For a given virtual guest, how should i get the attached additional storage details using api. Information like storage name, storage ID etc for softlayer only. Please provide the api if possible.
Thanks
You could use an objectMask to retrieve additional information related to the object you are using. The next are some examples that might help you:
Method: GET
https://$username:[email protected]/rest/v3/SoftLayer_Virtual_Guest/$virtualGuestId/getObject?objectMask=mask[datacenter,blockDevices[diskImage[capacity,type[name],units]],networkStorage,allowedHost,allowedNetworkStorage[serviceResource[networkDevice[datacenter]],serviceResourceBackendIpAddress,storageType],allowedNetworkStorageReplicas,evaultNetworkStorage[serviceResource[networkDevice[datacenter]]]]
Method: POST
https://$username:[email protected]/rest/v3/SoftLayer_Virtual_Guest/$virtualGuestId/getAttachedNetworkStorages?objectMask=mask[id,username,capacityGb,nasType,notes,serviceResource[id,networkDevice[id,datacenter],type],storageType,storageTierLevel,replicationPartners[id,username,capacityGb,nasType,notes,serviceResource[id,networkDevice[id,datacenter],type],storageType,storageTierLevel,serviceResourceBackendIpAddress],serviceResourceBackendIpAddress]
Payload:
{
"parameters": ["*"]
}
Regarding to the Portable storages the only way to distinguish them is by calling the method SoftLayer_Account::getPortableStorageVolumes and apply a filter to the Virtual Guest id.
e.g.
Method: GET
https://$username:[email protected]/rest/v3/SoftLayer_Account/getPortableStorageVolumes?objectFilter={"portableStorageVolumes":{"blockDevices":{"guest":{"id":{"operation":$virtualGuestId}}}}}
Note: Replace $username, $apiKey and $virtualGuestId with your information.
Additional information about object-masks can be found in the next link: https://sldn.softlayer.com/article/object-masks
There’s also valuable information about Storage services in the next link: https://knowledgelayer.softlayer.com/