Get Services Usage
You can get a collection resource representation of services consumed by companies.
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 collection resource representation of consumed services, send the GET HTTP request to the URL of the /organizations/companies/usage collection. Additionally you can 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/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 |
---|---|---|---|---|---|
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
The following request returns a representation of services consumed by companies.
Request: GET https://localhost:1280/api/v3/organizations/companies/usage
Request Header: Authorization: Bearer <Access-Token>
Response Code: 200 OK
Response Body: { "meta": { "pagingInfo": { "total": 26, "count": 26, "offset": 0 } }, "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" } ] }, { "companyUid": "2c6af0ef-fdc6-4304-8724-eaa83b6832c4", "locationUid": "dc50bdab-657b-499d-881d-d615d7107dcd", "date": "2020-03-28T03:00:00+03:00", "counters": [ { "value": 20, "type": "vmCloudBackups" }, { "value": 0, "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": 10457389, "type": "cloudRepositoryUsageByVm" }, { "value": 0, "type": "cloudRepositoryUsageByServerAgent" }, { "value": 0, "type": "cloudRepositoryUsageByWorkstationAgent" }, { "value": 0, "type": "managedServerAgents" }, { "value": 0, "type": "managedWorkstationAgents" }, { "value": 20, "type": "managedVms" }, { "value": 0, "type": "fileShareArchiveSize" }, { "value": 0, "type": "fileShareBackupSize" }, { "value": 0, "type": "fileShareSourceSize" } ] } ] } |