URL Structure Request Examples

Accessing Multiple Resources in the Server Group

http://[REST server]/RestService/rest.svc/1.0/resources

For example, to get all server data in a server group: http://localhost/RestService/rest.svc/1.0/servers

Accessing a Specific Resource in the Server Group

http://[REST server]/RestService/rest.svc/1.0/resources/{instanceID}

For example, to get data for a specific server: http://localhost/RestService/rest.svc/1.0/servers/23861AF4-D9C7-41E8-B520-B5876B9D85CB

Accessing Resources Group with Parameters

http://[REST server]/RestService/rest.svc/1.0/resources?parameter1=value1&parameter2=value2&...

For example, to get all logical disks for a specified server: http://localhost/RestService/rest.svc/logicaldisks?server=23861AF4-D9C7-41E8-B520-B5876B9D85CB

Some functions require parameters to be included in a JSON body format.

Notation:

  • REST server is the computer where DataCore REST Support is installed. The REST server can be identified by full computer name (recommended) or IP address.
  • /RestService/rest.svc is the path to the REST service on the REST server.
  • /2.07 is the current API version number.
  • /resources is the managed resource in the server group that is being queried.
  • /{instanceID} is the ID of a specific resource in the server group.
  • parameters are supported with some operations as documented in the DataCore REST API Reference Guide. Parameters are case-sensitive.

Request Guidelines

Enumerated Values

Some parameters require enumerated values which are documented in the Table of Enums in the DataCore REST API Reference Guide. Always use the associated number for the value. Example enumeration for virtual disk types as defined in the VirtualDiskType in the Table of Enums

NonMirrored

0

Single (non-mirrored) virtual disk created from a single storage source.

MultiPathMirrored

2

Mirrored virtual disk created from two server storage sources.

Dual

3

Dual virtual disk created from a single storage source shared by two servers.

<body>

{

   “Type”: 0

   …

}

Error Information

Error information is returned in the JSON object that contains a "Message" with the appropriate error. For example, a response when trying to access an invalid URI:

{"Message": "Resource /restservice/rest.svc/1.0/virtuallogicalunit not found. Check the address of the resource you want to access and the method that you are using on the resource (GET, PUT, POST, DELETE etc.)."}

ASCII Characters

Some REST clients require that "unsafe" ASCII characters in the request be replaced with a "%" followed by the two hexadecimal digits that represent the character. This is dependent on the particular client. For example, some clients consider a colon (:) and brackets ({ })as unsafe characters. In this case, these characters could be replaced by %3A, %7B, and %7D respectively.