Get Services Usage by Company

You can get a collection resource representation of services consumed by a company with the specified UID.

Required Privileges

To perform this task, a user must have one of the following roles assigned: Portal Administrator, Service Provider Global Administrator, Service Provider Administrator, Company Owner, Company Administrator.

Request

To get a representation of services consumed by a company with the specified UID, send the GET HTTP request to the URL of the /organizations/companies/{companyUid}/usage collection. Additionally you must create a query string that contains start date and end date timestamps in the YYYY-MM-DD format to limit searched items.

HTTP Request

GET https://<hostname>:1280/api/v3/organizations/companies/{companyUid}/usage?fromDate={Date}&toDate={Date}

Request Headers

The request contains the following headers.

Header

Required/Optional

Value

Description

Authorization

Required

Bearer <Access-Token>

Authenticates a client who sends the request to the server. Must contain the access token for the current logon session in the Bearer <Access-Token> format.

Accept

Optional

application/json

Specifies a media type of representation that is required in the response message. If the requested type is not supported, the server will return the response in the application/json media type.

Request parameters

A list of parameters that are applicable for this operation:

Name

In

Type

Required

Default

Description

companyUid

Path

String (uuid)

Yes

Company UID

fromDate

Query

String/date

Date string is formatted as full-date according to RFC 3339.

No

Start timestamp of a searched time range

toDate

Query

String/date

Date string is formatted as full-date according to RFC 3339.

No

End timestamp of a searched time range. Total time range must be less than 31 day.

limit

Query

Integer (int32)

No

100

Specifies the first N resources that must be returned in the output

offset

Query

Integer (int32)

No

0

Excludes the first N resources from the query output

Response

The server returns the following response to the client.

Response Code

A successfully completed operation returns response code 200 OK.

Response Headers

The response to this request contains the following headers. The response may also include additional standard HTTP headers.

Header

Description

Content-length

The length of the response body.

Content-type

The media type and syntax of the request body message: application/json; charset=utf-8

Response Body

In the response body, Veeam Service Provider Console returns a collection resource representation based on the LocationAggregateUsage schema.

Example Get Services Usage by Company

The following request returns a representation of services consumed by a company with UID c5f2d5ab-6243-4430-b070-f753c70d98fb.

Request:

GET https://localhost:1280/api/v3/organizations/companies/c5f2d5ab-6243-4430-b070-f753c70d98fb/usage

 

Request Header:

Authorization: Bearer <Access-Token>

 

Response Code:

200 OK

 

Response Body:

{

 "data": {

   "companyUid": "c5f2d5ab-6243-4430-b070-f753c70d98fb",

   "locationUid": "59e078bf-cb44-4050-8101-0958094ac255",

   "date": "2020-03-28T03:00:00+03:00",

   "counters": [

     {

       "value": 50,

       "type": "vmCloudBackups"

     },

     {

       "value": 10,

       "type": "serverCloudBackups"

     },

     {

       "value": 0,

       "type": "workstationCloudBackups"

     },

     {

       "value": 0,

       "type": "agentCloudBackupDataTransferOut"

     },

     {

       "value": 0,

       "type": "agentCloudBackupDataTransferIn"

     },

     {

       "value": 0,

       "type": "vmCloudBackupsDataTransferOut"

     },

     {

       "value": 0,

       "type": "vmCloudBackupsDataTransferIn"

     },

     {

       "value": 0,

       "type": "vmCloudReplicas"

     },

     {

       "value": 0,

       "type": "vmCloudReplicaComputeTime"

     },

     {

       "value": 0,

       "type": "vmCloudReplicaDataTransferOut"

     },

     {

       "value": 0,

       "type": "vmCloudReplicaDataTransferIn"

     },

     {

       "value": 0,

       "type": "vmCloudReplicaStorageUsage"

     },

     {

       "value": 478934504,

       "type": "cloudRepositoryUsageByVm"

     },

     {

       "value": 257394754,

       "type": "cloudRepositoryUsageByServerAgent"

     },

     {

       "value": 0,

       "type": "cloudRepositoryUsageByWorkstationAgent"

     },

     {

       "value": 10,

       "type": "managedServerAgents"

     },

     {

       "value": 0,

       "type": "managedWorkstationAgents"

     },

     {

       "value": 50,

       "type": "managedVms"

     },

     {

       "value": 0,

       "type": "fileShareArchiveSize"

     },

     {

       "value": 0,

       "type": "fileShareBackupSize"

     },

     {

       "value": 0,

       "type": "fileShareSourceSize"

     }

   ]

 }

}

I want to report a typo

There is a misspelling right here:

 

I want to let the Veeam Documentation Team know about that.