Usage
- Last UpdatedJul 18, 2024
- 5 minute read
APIs related to querying usage data.
List Tenant Usage 1
Returns tenant usage data, based on groupBy value, start and end dates. It computes the active/completed billing cycles based on whether start and end parameters are provided or omitted. When start is provided and end is omitted, a single day of usage data is returned. When both start and end are provided, daily usage data is returned for the range provided. Default results are grouped with groupBy value as "None".
Request
GET /api/v1/tenants/{tenantId}/usage
?start={start}&end={end}&groupBy={groupBy}&groupByNamespace={groupByNamespace}
Parameters
string tenantId
Tenant identifier.
[optional] string start
Start date of the range for daily usage data.[optional] string end
End date of the range for daily usage data; if no end date is provided, only one summary is returned.[optional] any groupBy
Selector UsageGroupBy to group usage records on namespace, community, all(both namespace and community), or none.[optional] boolean groupByNamespace
Selection to order usage data by namespace. This parameter is deprecated, use groupBy to group the records.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | UsageDataRecord[] | Usage data for the requested tenant. |
| 400 | ErrorResponse | Missing or invalid inputs. |
| 401 | None | Unauthorized. |
| 403 | ErrorResponse | Forbidden. |
| 500 | ErrorResponse | Internal server error. |
Example response body
200 Response (UsageDataRecord[])
[
{
"Date": "2019-08-24T14:15:22Z",
"TenantId": "string",
"CalleeTenantId": "string",
"CallerTenantId": "string",
"CommunityId": "string",
"NamespaceId": "string",
"ClusterRegion": "string",
"IngressEvents": 0,
"IngressStreamsAccessed": 0,
"EgressEvents": 0,
"EgressStreamsAccessed": 0
}
]
List Tenant Usage (communities path)
Returns community usage data for a specified tenant. It computes the active/completed billing cycles based on whether start and end parameters are provided or omitted. When start is provided and end is omitted, a single day of usage data is returned. When both start and end are provided, daily usage data is returned for the range provided. Default results are grouped with groupBy value as "None".
Request
GET /api/v1/communities/{communityId}/tenants/{tenantId}/usage
?start={start}&end={end}&groupBy={groupBy}&source={source}
Parameters
string communityId
Community identifier.string tenantId
Tenant identifier.
[optional] string start
Start date of the range for daily usage data.[optional] string end
End date of the range for daily usage data; if no end date is provided, only one summary is returned.[optional] any groupBy
Selector UsageGroupBy to group usage records on namespace, community, all(both namespace and community), or none.[optional] any source
Source of usage records.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | UsageDataRecord[] | Usage data for the requested tenant. |
| 400 | ErrorResponse | Missing or invalid inputs. |
| 401 | None | Unauthorized. |
| 403 | ErrorResponse | Forbidden. |
| 500 | ErrorResponse | Internal server error. |
Example response body
200 Response
[
{
"Date": "2019-08-24T14:15:22Z",
"TenantId": "string",
"CalleeTenantId": "string",
"CallerTenantId": "string",
"CommunityId": "string",
"NamespaceId": "string",
"ClusterRegion": "string",
"IngressEvents": 0,
"IngressStreamsAccessed": 0,
"EgressEvents": 0,
"EgressStreamsAccessed": 0
}
]
Get Tenant Resource Usage
Returns the current rather than the entitled resource usage.
Request
GET /api/v1/tenants/{tenantId}/resources/usage
Parameters
string tenantId
Tenant identifier.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | ResourceUsage | Current rather than entitled resource usage. |
| 400 | ErrorResponse | Missing or invalid inputs. |
| 401 | None | Unauthorized. |
| 403 | ErrorResponse | Forbidden. |
| 500 | ErrorResponse | Internal server error. |
Example response body
200 Response
{
"StreamCount": 0,
"EntitledStreamCount": 0,
"NamespaceCount": 0,
"EntitledNamespaceCount": 0,
"EntitledStreamAccessCount": 0
}
List Tenant Billing Cycles
Returns the billing cycles for an account. The billing cycles returned is from Tenant's creation date until now, or last 12 months, whichever is less.
Request
GET /api/v1/tenants/{tenantId}/subscriptionterm/billingcycles
Parameters
string tenantId
Tenant identifier.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | BillingCycle[] | List of elapsed billing cycles for an account subscription. |
| 400 | ErrorResponse | Missing or invalid inputs. |
| 401 | None | Unauthorized. |
| 403 | ErrorResponse | Forbidden. |
| 500 | ErrorResponse | Internal server error. |
Example response body
200 Response
[
{
"StartDate": "2019-08-24T14:15:22Z",
"EndDate": "2019-08-24T14:15:22Z"
}
]
List Tenant Usage
Returns tenant usage data, based on active/completed billing cycles, and whether start and end parameters are provided or omitted. When start is provided and end is omitted, a single day of usage data is returned. When both start and end are provided, daily usage data is returned for the range provided.
Request
GET /api/v1/tenants/{tenantId}/usage
?start={start}&end={end}&groupByNamespace={groupByNamespace}
Parameters
string tenantId
Tenant identifier
[optional] string start
Start date of the range for daily usage data[optional] string end
End date of the range for daily usage data; if no end date is provided, only one summary is returned.[optional] boolean groupByNamespace
Selection to order usage data by namespace
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | UsageDataRecord[] | Usage data for the requested tenant |
| 400 | ErrorResponse | Missing or invalid inputs |
| 401 | None | Unauthorized |
| 403 | ErrorResponse | Forbidden |
| 500 | ErrorResponse | Internal server error |
Example response body
200 Response
[
{
"Date": "2019-08-24T14:15:22Z",
"TenantId": "string",
"NamespaceId": "string",
"ClusterRegion": "string",
"IngressEvents": 0,
"IngressStreamsAccessed": 0,
"EgressEvents": 0,
"EgressStreamsAccessed": 0
}
]
Definitions
UsageDataRecord
Usage within CONNECT data services
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| Date | date-time | true | false | The date property of a usage record |
| TenantId | guid | false | true | Tenant identifier. |
| CalleeTenantId | guid | true | false | The callee tenant identifier of a usage record |
| CallerTenantId | guid | true | false | The caller tenant identifier of a usage record |
| CommunityId | guid | false | true | The community identifier of a usage record |
| NamespaceId | string | false | true | The namespace identifier of a usage record |
| ClusterRegion | string | false | true | The cluster region for the record |
| IngressEvents | int64 | true | false | The count of events ingressed for a usage record |
| IngressStreamsAccessed | int64 | true | false | The count of ingress streams accessed for a usage record |
| EgressEvents | int64 | true | false | The count of events egressed for a usage record |
| EgressStreamsAccessed | int64 | true | false | The count of egress streams accessed for a usage record |
{
"Date": "2019-08-24T14:15:22Z",
"TenantId": "string",
"CalleeTenantId": "string",
"CallerTenantId": "string",
"CommunityId": "string",
"NamespaceId": "string",
"ClusterRegion": "string",
"IngressEvents": 0,
"IngressStreamsAccessed": 0,
"EgressEvents": 0,
"EgressStreamsAccessed": 0
}
ErrorResponse
Object used to represent error information.
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| OperationId | string | false | true | OperationId of action that caused the error |
| Error | string | false | true | Error description |
| Reason | string | false | true | Reason for the error |
| Resolution | string | false | true | The resolution of the error |
{
"OperationId": "string",
"Error": "string",
"Reason": "string",
"Resolution": "string"
}
UsageGroupBy
Specifies the grouping mechanism for tenant usage records.
Enumerated Values
| Property | Value | Description |
|---|---|---|
| Namespace | 0 | Group by namespace identifier. |
| Community | 1 | Group by community identifier. |
| All | 2 | The union of records grouped by namespace and grouped by community. |
| None | 3 | No grouping. |
CommunityUsageGroupBy
Specifies the property to group Community-related Usage data on.
Enumerated Values
| Property | Value | Description |
|---|---|---|
| None | 0 | No grouping. |
| Tenant | 1 | Group usage data by caller or callee Tenant, depending on whether the usage source is External or Internal, respectively. |
CommunityUsageSource
Specifies the source of Community usage data.
Enumerated Values
| Property | Value | Description |
|---|---|---|
| Invalid | 0 | Default enumeration value. Not supported. |
| Internal | 1 | The caller's own tenant. |
| External | 2 | Other tenants accessing the caller's own data. |
ResourceUsage
Resources currently allocated by an account and their entitled amounts
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| StreamCount | int64 | true | false | Streams allocated by the account across all namespaces |
| EntitledStreamCount | int64 | true | false | Number of streams entitled to be allocated |
| NamespaceCount | int64 | true | false | Number of namespaces allocated by the account |
| EntitledNamespaceCount | int64 | true | false | Number of namespaces entitled to be allocated |
| EntitledStreamAccessCount | int64 | true | false | Average number of streams entitled to be accessed per day |
{
"StreamCount": 0,
"EntitledStreamCount": 0,
"NamespaceCount": 0,
"EntitledNamespaceCount": 0,
"EntitledStreamAccessCount": 0
}
BillingCycle
Represents a completed billing cycle for an account.
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| StartDate | date-time | true | false | Start of the billing cycle. |
| EndDate | date-time | true | false | End of the billing cycle |
{
"StartDate": "2019-08-24T14:15:22Z",
"EndDate": "2019-08-24T14:15:22Z"
}