我知道我可以使用softlayer_software_component_password在Softlayer的数据库中检索/更新OS密码值,是否有API可以获取计算机的密码?哪个是机器登录密码?
谢谢,
Q.Z。
您可以尝试以下请求:
对于虚拟服务器:
https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/111111/getObject?objectMask=mask[operatingSystem[passwords]]
对于裸金属服务器:
https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/111111/getObject?objectMask=mask[operatingSystem[passwords]]
替换: $ user , $ apikey 和 111111 带有您自己的信息。
它将显示机器的用户名和密码
使用Python API,您可以使用以下功能检索密码
def get_instance在以下位置找到:softlayer.managers.vs
示例:
vs_unit_info = SoftLayer.VSManager(sl_client).get_instance(vs_unit_id, mask="fullyQualifiedDomainName, primaryIpAddress, operatingSystem.passwords.username, operatingSystem.passwords.password")