您可以使用SoftLayer_Network_Storage::getReplicationPartners
方法獲取副本ID。一旦你有,你可以使用SoftLayer_Network_Storage/<replica_id>/getServiceResourceBackendIpAddress
獲得目標IP地址。
[email protected] ~ » curl -s --user "$SOFTLAYER_USERNAME:$SOFTLAYER_API_KEY" "https://api.softlayer.com/rest/v3/SoftLayer_Network_Storage/8744521/getReplicationPartners" | pmj
[
{
"accountId": 78003,
"capacityGb": 20,
"createDate": "2016-12-30T10:57:50-06:00",
"guestId": null,
"hardwareId": null,
"hostId": null,
"id": 18032161,
"nasType": "ISCSI_REPLICANT",
"serviceProviderId": 1,
"serviceResourceName": "PerfStor Aggr aggr_staasdal0101_pc01",
"storageTypeId": "8",
"upgradableFlag": true,
"username": "SL01SEL78003_3_REP_1"
}
]
[email protected] ~ » curl -s --user "$SOFTLAYER_USERNAME:$SOFTLAYER_API_KEY" \
"https://api.softlayer.com/rest/v3/SoftLayer_Network_Storage/18032161/getServiceResourceBackendIpAddress"
"10.0.90.87"%