ソフトレイヤーRESTAPIを使用してVMクレデンシャルを取得するにはどうすればよいですか?
残りのAPIを呼び出す際のエラーに続いて。
ser%!(EXTRA services.Software_Component_Password={0xc420184000 {<nil> <nil> <nil>}})
2017/12/27 00:02:48 [DEBUG] Request URL: GET https://api.softlayer.com/rest/v3/SoftLayer_Software_Component_Password.json
2017/12/27 00:02:48 [DEBUG] Parameters:
2017/12/27 00:02:48 [DEBUG] Response: {"error":"Object does not exist to execute method on. (SoftLayer_Software_Component_Password::getObject)","code":"SoftLayer_Exception"
まず、仮想ゲストの特定のコンポーネントIDを見つける必要があります。これは、SoftLayer_Virtual_Guest :: getSoftwareComponentsを介して行うことができます。
$ curl -s "https://$SOFTLAYER_USERNAME:[email protected]/rest/v3/SoftLayer_Virtual_Guest/VSI_ID/getSoftwareComponents" | pmj
[
{
"hardwareId": null,
"id": 22088293,
"manufacturerLicenseInstance": ""
}
]
その後、SoftLayer_Software_Component :: getPasswordsを呼び出すことができます。
$ curl -s "https://$SOFTLAYER_USERNAME:[email protected]/rest/v3/SoftLayer_Software_Component/22088293/getPasswords" | pmj
[
{
"createDate": "2017-12-26T10:52:12-06:00",
"id": 24126369,
"modifyDate": "2017-12-26T10:52:12-06:00",
"password": "xxxxx",
"port": null,
"software": {
"hardwareId": null,
"id": 22088293,
"manufacturerLicenseInstance": "",
"passwords": [
null
]
},
"softwareId": 22088293,
"username": "root"
}
]
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加