我想你使用python,看看這個腳本getAttachedVolumes看着經理:
"""
This script retrieve the network storage volumes this group is attached to
Important manual pages:
https://sldn.softlayer.com/reference/services/SoftLayer_Network_Storage_Group/getAttachedVolumes
https://sldn.softlayer.com/reference/datatypes/SoftLayer_Network_Storage
License: http://sldn.softlayer.com/article/License
Author: SoftLayer Technologies, Inc. <[email protected]>
"""
import SoftLayer
import pprint
# Your SoftLayer API username and key.
USERNAME = 'set me'
API_KEY = 'set me'
storageGroupId = 448757
# declaring the API client
client = SoftLayer.Client(username=USERNAME, api_key=API_KEY)
try:
result = client['SoftLayer_Network_Storage_Group'].getAttachedVolumes(id=storageGroupId)
pprint.pprint(result)
except SoftLayer.SoftLayerAPIError as e:
print(('Error faultCode=%s, faultString=%s'
% (e.faultCode, e.faultString)))
我希望它能夠提供一種思路如何發送輸入的方法,你應該送的此lineL
客戶[ 'SoftLayer_Network_Storage_Group']。getAttachedVolumes(ID = storageGroupId)
看看下面的鏈接獲得更多信息:
另一個重要的環節:
對於其他編程語言:
請讓我知道如果你需要與其他方法,編程語言進一步的援助或懷疑它。
更新
要檢索帳戶的網絡存儲組(與它們的標識符),您可以使用此方法:在Python SoftLayer_Account::getNetworkStorageGroups,下面的例子:
"""
This script retrieves an account's Network Storage Groups
Important manual pages:
http://sldn.softlayer.com/reference/services/SoftLayer_Account/getNetworkStorageGroups
http://sldn.softlayer.com/reference/datatypes/SoftLayer_Network_Storage_Group
License: http://sldn.softlayer.com/article/License
Author: SoftLayer Technologies, Inc. <[email protected]>
"""
import SoftLayer
import pprint
# Your SoftLayer API username and key.
USERNAME = 'set me'
API_KEY = 'set me'
# declaring the API client
client = SoftLayer.Client(username=USERNAME, api_key=API_KEY)
try:
result = client['SoftLayer_Account'].getNetworkStorageGroups()
pprint.pprint(result)
except SoftLayer.SoftLayerAPIError as e:
print(('Error faultCode=%s, faultString=%s'
% (e.faultCode, e.faultString)))
你將在響應中檢索標識符(groupId)
在這種情況下,您需要查看所需的頭文件,在這種情況下,文檔中提到:initParameter和autenticación。初始參數基本上是您想要獲取,編輯或刪除的對象的ID。使用python你pasa這樣的id:clent.getAttachedVolumes(id = 111)問候。 –