2017-12-27 14 views
-1

ソフトレイヤーREST APIを使用してVMクレデンシャルを取得する方法は?ソフトレイヤーREST APIを使用して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" 

答えて

0

まず、仮想ゲストの特定のコンポーネント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": "" 
    } 
] 

あなたはその後、

$ 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" 
    } 
] 
SoftLayer_Software_Component :: getPasswordsを呼び出すことができます
関連する問題