Check Network Reachability Between Multiple Hosts

GET/zstack/v1/zops/check/network

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zops/check/network?sourceHostnames=172.0.0.1&targetHostnames=test1.com&targetHostnames=test2.com

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
sourceHostnames (Optional)ListqueryCollection of source IP addresses or domain names 4.7.21
targetHostnamesListqueryCollection of target IP addresses or domain names 4.7.21
systemTags (Optional)ListquerySystem tags 4.7.21
userTags (Optional)ListqueryUser tags 4.7.21

API Response

Response Example

{
  "results": [
    {
      "sourceHostname": "172.0.0.1",
      "targetHostname": "test2.com",
      "status": "Disconnected"
    },
    {}
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.7.21
resultsListSee results for details4.7.21
errorErrorCodeThe error code. If not null, the operation failed. This field is null when the operation succeeds. See error for details4.7.21

results

NameTypeDescriptionStarting Version
sourceHostnameStringSource address4.7.21
targetHostnameStringTarget address4.7.21
statusHostConnectedStatusSee status for details4.7.21

status

NameTypeDescriptionStarting Version
ConnectedHostConnectedStatusNetwork reachable4.7.21
DisconnectedHostConnectedStatusNetwork unreachable4.7.21
UnknownHostConnectedStatusNetwork connection status unknown4.7.21

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.10010.6
descriptionStringA brief description of the error0.6
detailsStringThe detailed error information0.6
elaborationStringReserved field. Default is null0.6
opaqueLinkedHashMapReserved field. Default is null0.6
causeErrorCodeThe root error that caused the current error. If no root error exists, this field is null0.6

SDK Examples

Java SDK

CheckNetworkReachableAction action = new CheckNetworkReachableAction();
action.sourceHostnames = asList("172.0.0.1");
action.targetHostnames = asList("test1.com","test2.com");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CheckNetworkReachableAction.Result res = action.call();

Python SDK

CheckNetworkReachableAction action = CheckNetworkReachableAction()
action.sourceHostnames = [172.0.0.1]
action.targetHostnames = [test1.com, test2.com]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CheckNetworkReachableAction.Result res = action.call()