Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide...

21
Double-Take ® METERED USAGE Version 1.0.05.00 Double-Take Metered Usage REST APIs

Transcript of Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide...

Page 1: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Double-Take® METERED USAGE Version 1.0.05.00

Double-Take Metered Usage REST APIs

Page 2: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Notices

Metered Usage REST APIs - Double-Take October 2016 Version: 1.0.05.00

© Copyright 2016 Vision Solutions®, Inc. All rights reserved.

The information in this document is subject to change without notice and is furnished under a license agreement. This document is proprietary to Vision Solutions, Inc., and may be used only as authorized in our license agreement. No portion of this manual may be copied or otherwise reproduced without the express written consent of Vision Solutions, Inc.

Vision Solutions provides no expressed or implied warranty with this manual.

The following are trademarks or registered trademarks of their respective organizations or companies:

• Double-Take •Availability for Hyper-V, Double-Take for Windows, and Double-Take DR for Windows Repository—DoubleTake Inc.

Page 3: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

3

Contents

REST API - Double-Take 5Authentication.............................................................................................................. 7REST API considerations............................................................................................ 9Get metered usages.................................................................................................. 11Get metered usages without pagination.................................................................... 13Get metered usages for a specific product SKU ....................................................... 15Get metered usages for a specific affiliate ................................................................ 17Get metered usages for a specific customer (user) .................................................. 19Get metered usages by filtering on username/sku/affiliate ....................................... 21Get customer (users)................................................................................................. 23Add a new customer (user) ....................................................................................... 25Update a single customer (user) ............................................................................... 27Delete a given customer (user) ................................................................................. 29Get alerts................................................................................................................... 31Get monthly usages reports for the service provider................................................. 33Get configuration for the service provider ................................................................. 35Update Configuration for the service provider........................................................... 37

Page 4: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

5

REST API - Double-Take

The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths..

To use a REST API, your application will make an HTTPS request and parse the response. For VMU, the HTTPS methods are GET and POST. REST APIs operate over HTTPS making it easy to use with any programming language or framework.

Review the following sections before you use the REST API.

• “Authentication” on page 7

• “REST API considerations” on page 9

Page 5: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Authentication

7

AuthenticationAuthentication is verified using Basic access authentication on the client side. This is a standard approach of sending the username and password in an encoded header. VMU then reads this header and validates the credentials. The user specified in the authentication header must be a valid Support Central username and password. The specific user must be entitled to use the Double-Take Metered Usage (DTMU) product group for the APIs to be successful. The product group represents the set of products that you have the authority to use.

Page 6: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

REST API considerations

9

REST API considerationsThe following are required when working with the REST API:

• In order to provide the full location (URL) of a call, the prefix for all URIs is structured as:

https://<<hostname>>/restapi/api/<<product-group>>/For the Double-Take product group Metered Usage (DTMU) REST APIs, the following is an example of its prefix:

https://vmu.visionsolutions.com/restapi/api/dtmu/• To use a REST API, the requesting user must have authority to the product group

to which the API applies. If they do not, a 403 code will be returned with an error indicating they do not have authority to the product group.

• Error code 400 will be returned when the inputs are not valid for the specified request.

The table shown below describes the query string parameters that can be specified in the URI.

Query string parameters Description

Affiliate An optional association a user may have, such as a company name.

Customer (user) Customer of a service provider.

Events (Alerts) Message to the customer (user), indicating which items may require attention. Alerts also appear in the Metered Usage user interface as Events.

Metered Usage Data that represents usage activity for a product.

Page/Pagination Chunks of data that represent a portion of a larger set of data.

SKU (stock keeping unit) Product SKU representing a product for which a user has metered usage data.

Page 7: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Get metered usages

11

Get metered usagesReturns metered usage data that is paged in the specified time window for all customers (users) associated with the service provider. The maximum time window is 40 days.

URI:MeteredUsages?StartDate={startDate}&EndDate={endDate}&Page={pageNb}HTTP Method: GET

Requested inputs

Sample response body

Format: JSON[{'Affiliate':'String content','JobGuid':'45be059d-7473-4bb2-b07c-c3b229287f53','JobName':'String content','ProductCode':2147483647,''ServerGuid'':'aabe999d-7473-4bb2-b07c-c3b229287f53','ServerName':'String content','Sku':'String content','TargetServerGuid':'aabbccdd-7473-4bb2-b07c-c3b229287f53','TargetServerName':'String content','UsageHours':50,'UserId':1234,'UserName':'String content'}]

Parameter Format Description

startDate Date in UTC with the portable format (yyyy-MM-ddTHH:mm:ssZ)

The start date from which the metered usages are retrieved.

endDate Date in UTC with the portable format (yyyy-MM-ddTHH:mm:ssZ)

The end date through which the metered usages are retrieved

pageNb Integer The page of results you wish to get.

Page 8: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Get metered usages without pagination

13

Get metered usages without paginationAllows consumers to handle pagination from the client side.

Returns all metered usage data in the specified time window for all customers (users) associated with the service provider. The maximum time window is 40 days.

URI:MeteredUsagesWithoutPagination?StartDate={startDate}&EndDate={endDate}HTTP Method: GET

Requested inputs

Sample response body

Format: JSON[{ 'Affiliate':'String content', 'JobGuid':'45be059d-7473-4bb2-b07c-c3b229287f53', 'JobName':'String content', 'ProductCode':2147483647, 'ServerGuid':'aabe999d-7473-4bb2-b07c-c3b229287f53', 'ServerName':'String content', 'Sku':'String content', 'TargetServerGuid':'aabbccdd-7473-4bb2-b07c-c3b229287f53', 'TargetServerName':'String content', 'UsageHours':50, 'UserId':1234, 'UserName':'String content' }]

Parameter Format Description

startDate Date in UTC with the portable format(yyyy-MM-ddTHH:mm:ssZ)

The start date from which the metered usages are retrieved.

endDate Date in UTC with the portable format(yyyy-MM-ddTHH:mm:ssZ)

The end date through which the metered usages are retrieved.

Page 9: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Get metered usages for a specific product SKU

15

Get metered usages for a specific product SKUReturns paged metered usage data for the sent product SKU in the specified time window for all customers (users) associated with the service provider. The maximum time window is 40 days.

URI:MeteredUsagesForSku?Sku={sku}&StartDate={startDate}&EndDate={endDate}&Page={pageNb}HTTP Method: GET

Requested inputs

Sample response body

Format: JSON[{ 'Affiliate':'String content', 'JobGuid':'45be059d-7473-4bb2-b07c-c3b229287f53', 'JobName':'String content', 'ProductCode':2147483647, 'ServerGuid':'aabe999d-7473-4bb2-b07c-c3b229287f53', 'ServerName':'String content', 'Sku':'String content', 'TargetServerGuid':'aabbccdd-7473-4bb2-b07c-c3b229287f53', 'TargetServerName':'String content', 'UsageHours':50, 'UserId':1234, 'UserName':'String content' }]

Parameter Format Description

sku String Product SKU from which to retrieve metered usages.

startDate Date in UTC with the portable format(yyyy-MM-ddTHH:mm:ssZ)

The start date from which the metered usages are retrieved.

endDate Date in UTC with the portable format(yyyy-MM-ddTHH:mm:ssZ)

The end date through which the metered usages are retrieved.

pageNb Integer The page of results you wish to get.

Page 10: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Get metered usages for a specific affiliate

17

Get metered usages for a specific affiliateReturns paged metered usage data in the specified time window for all customers (users) associated with the service provider which contain the specified affiliate. The maximum time window is 40 days.

URI:MeteredUsagesForAffiliate?Affiliate={affiliate}&StartDate={startDate}&EndDate={endDate}&Page={pageNb}Method: GET

Requested inputs

Sample response body

Format: JSON[{'Affiliate':'String content', 'JobGuid':'45be059d-7473-4bb2-b07c-c3b229287f53', 'JobName':'String content', 'ProductCode':2147483647, 'ServerGuid':'aabe999d-7473-4bb2-b07c-c3b229287f53', 'ServerName':'String content', 'Sku':'String content', 'TargetServerGuid':'aabbccdd-7473-4bb2-b07c-c3b229287f53', 'TargetServerName':'String content', 'UsageHours':50, 'UserId':1234, 'UserName':'String content' }]

Parameter Format Description

affiliate String The affiliate from which to retrieve metered usages

startDate Date in UTC with the portable format(yyyy-MM-ddTHH:mm:ssZ)

The start date from which the metered usages are retrieved

endDate Date in UTC with the portable format(yyyy-MM-ddTHH:mm:ssZ)

The end date through which the metered usages are retrieved

pageNb Integer The page of results you wish to get.

Page 11: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Get metered usages for a specific customer (user)

19

Get metered usages for a specific customer (user)Returns paged metered usage data in the specified time window for the specified customer (user) associated with the service provider. The maximum time window is 40 days.

URI:MeteredUsages?StartDate={startDate}&EndDate={endDate}&Page={pageNb}Method: GET

Requested inputs

Sample response body

Format: JSON[{ 'Affiliate':'String content', 'JobGuid':'45be059d-7473-4bb2-b07c-c3b229287f53', 'JobName':'String content', 'ProductCode':2147483647, 'ServerGuid':'aabe999d-7473-4bb2-b07c-c3b229287f53', 'ServerName':'String content', 'Sku':'String content', 'TargetServerGuid':'aabbccdd-7473-4bb2-b07c-c3b229287f53', 'TargetServerName':'String content', 'UsageHours':50, 'UserId':1234, 'UserName':'String content' }]

Parameter Format Description

username String The customer (user) from which to retrieve metered usages.

startDate Date in UTC with the portable format(yyyy-MM-ddTHH:mm:ssZ)

The start date from which the metered usages are retrieved.

endDate Date in UTC with the portable format(yyyy-MM-ddTHH:mm:ssZ)

The end date through which the metered usages are retrieved.

pageNb Integer The page of results you wish to get.

Page 12: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Get metered usages by filtering on username/sku/affiliate

Get metered usages by filtering on username/sku/affili-ate

Returns paged metered usage data in the specified time window filtered by the sent customer (user), SKU, and affiliate and which are associated with the service provider. The maximum time window is 40 days.

URI:MeteredUsagesWithFilters?Username={username}&Sku={sku}&Affiliate={affiliate}&StartDate={startDate}&EndDate={endDate}&Page={pageNb}Method: GET

Requested inputs

Sample response body

Format: JSON[{'Affiliate':'String content', 'JobGuid':'45be059d-7473-4bb2-b07c-c3b229287f53', 'JobName':'String content', 'ProductCode':2147483647, 'ServerGuid':'aabe999d-7473-4bb2-b07c-c3b229287f53', 'ServerName':'String content', 'Sku':'String content', 'TargetServerGuid':'aabbccdd-7473-4bb2-b07c-c3b229287f53', 'TargetServerName':'String content', 'UsageHours':50, 'UserId':1234, 'UserName':'String content' }]

Parameter Format Description

username String The customer (user) from which to retrieve metered usages.

sku String Product SKU from which to retrieve metered usages.

affiliate String The affiliate from which to retrieve metered usages.

startDate Date in UTC with the portable format(yyyy-MM-ddTHH:mm:ssZ)

The start date from which the metered usages are retrieved.

endDate Date in UTC with the portable format(yyyy-MM-ddTHH:mm:ssZ)

The end date through which the metered usages are retrieved.

pageNb Integer The page of results you wish to get.

21

Page 13: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

22

Page 14: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Get customer (users)

23

Get customer (users)Returns all customers (users) associated with the service provider.

URI:UsersHTTP Method: GET

Requested inputs

Sample response body

Format: JSON[{'name':'String content', 'affiliate':'String content', 'access':0/1 }]

Parameter Format Description

NA NA NA

Page 15: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Add a new customer (user)

25

Add a new customer (user)Adds a single customer (user) with the service provider.

URI:UsersMethod: POST

Requested inputs

Sample response body

Format: JSONNo body. Just an HTTP status.

Parameter Format Syntax Description

Body application/json { 'name':'String content', 'affiliate':'String content', 'access':0/1 }

name—Specifies the customer (user) name.

affiliate—Specifies the company affiliated with the partner.

access—Specifies the possible values assigned to a user:

• Denied = 0

• Granted = 1

Page 16: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Update a single customer (user)

27

Update a single customer (user)Updates a single customer (user) with the service provider.

URI:UsersHTTP Method: PUT

Requested inputs

Sample response body

Format: JSONNo body. Just an HTTP status.

Parameter Format Syntax Description

Body application/json - syntax: { “name”:”user-name”, “affiliate”:”company-name”, “access”:0}

name—Specifies the customer (user) name.

affiliate—Specifies the company affiliated with the partner.

access—Specifies the possible values assigned to a user:

• Denied = 0

• Granted = 1

Page 17: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Delete a given customer (user)

29

Delete a given customer (user)Deletes a single customer (user) associated with the service provider.

URI: Users/<username>HTTP Method: DELETE

Requested inputs

Sample response body

Format: JSONNo body. Just an HTTP status.

Parameter Format Description

username String The customer (user) name to delete.

Page 18: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Get alerts

31

Get alertsReturns all events (alerts) in the specified time window associated with the service provider. The maximum time window is 40 days.

URI:Alerts?StartDate={startDate}&EndDate={endDate}HTTP Method: GET

Requested inputs

Sample response body

Format: JSON[{ 'Date':'Date in UTC format (yyyy-MM-ddTHH:mm:ssZ)', 'Message':'String content', 'Severity':'0:Info/1:Warning/2:Error/3:Critical' }]

Parameter Format Description

startDate Date in UTC with the portable format (yyyy-MM-ddTHH:mm:ssZ)

The start date from which the events (alerts) are retrieved.

endDate Date in UTC with the portable format (yyyy-MM-ddTHH:mm:ssZ)

The end date through which the events (alerts) are retrieved.

Page 19: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Get monthly usages reports for the service provider

33

Get monthly usages reports for the service providerGet monthly usages reports for the service provider.

URI:meteredusages/monthlyReportsHTTP Method: GET

Requested inputs

Sample response body

Format: JSON[{ "date": "2014-10-01T00:00:00", "name": "Double-Take usage report_2014_10_1.csv", "periodicReportUrl": "reporturl/serviceprovider/Double-Take usage report_2014_10_1.csv" }]

Parameter Format Description

NA NA NA

Page 20: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Get configuration for the service provider

35

Get configuration for the service providerGet configuration for the service provider.

URI:MeteredUsages?StartDate={startDate}&EndDate={endDate}&Page={pageNb}HTTP Method: GET

Requested inputs

Sample response body

Format: JSON{ "timeZoneId": "UTC", "email": "[email protected]", "alertNotificationLevel": "Info" / "Warning" / "Error" / "Critical" }

Parameter Format Description

NA NA NA

Page 21: Double-Take METERED USAGE - Vision Solutions · The REST APIs for Double-Take metered usage provide access to resources (data entities) via URI paths.. ... SKU (stock keeping unit)

Update Configuration for the service provider

37

Update Configuration for the service providerUpdate configuration for the service provider.

URI:configurationHTTP Method: PUT

Requested inputs

Sample response body

Format: JSONNo body. Just an HTTP status.

Parameter Format Syntax Description

body application/json { "timeZoneId": "UTC", "email": "[email protected]", "alertNotificationLevel": "Info" / "Warning" / "Error" / "Critical" }

time zone ID—Specifies the UTC time zone. The value of timeZoneID is: http://stackoverflow.com/questions/7908343/list-of-timezone-ids-for-use-with-findtimezonebyid-in-c

email address—Specifies the email address for sending the notification.

alert level—Specifies the alert level for the notification as:

• Informational

• Warning

• Error

• Critical