GetCapacityReservationUsage
Returns the number of instances in use from a SageMaker Capacity Reservation, for each account that uses them.
SageMaker AI refreshes the usage counts periodically. The
LastRefreshTime value shows when the counts were last refreshed.
Request Syntax
{
"MaxResults": number,
"NextToken": "string",
"SMCapacityReservationArn": "string"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- MaxResults
-
The maximum number of results to return in the response. If more results are available, the response includes a
NextTokenvalue.Type: Integer
Valid Range: Minimum value of 1. Maximum value of 100.
Required: No
- NextToken
-
If the previous response was truncated, the response includes a
NextTokenvalue. To retrieve the next set of results, use that token in your next request.Type: String
Length Constraints: Minimum length of 0. Maximum length of 8192.
Pattern:
.*Required: No
- SMCapacityReservationArn
-
The Amazon Resource Name (ARN) of the SageMaker Capacity Reservation. The ARN has the format
arn:aws:sagemaker:region:account-id:sm-capacity-reservation/smcr-id.Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Pattern:
arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]+:[0-9]{12}:sm-capacity-reservation/smcr-[0-9a-z]{12}Required: Yes
Response Syntax
{
"AvailableInstanceCount": number,
"InstanceUsageSet": [
{
"AccountId": "string",
"InUseInstanceCount": number,
"ResourcesUsage": [
{
"InUseInstanceCount": number,
"ResourceType": "string"
}
]
}
],
"LastRefreshTime": number,
"NextToken": "string",
"SMCapacityReservationId": "string",
"TotalInstanceCount": number
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- AvailableInstanceCount
-
The number of instances in the SageMaker Capacity Reservation that are not in use.
Type: Integer
Valid Range: Minimum value of 0.
- InstanceUsageSet
-
The instance usage for each account that uses instances from the SageMaker Capacity Reservation, sorted by account ID. Each account appears at most once across all pages. The list is empty when no instances are in use.
Type: Array of CapacityReservationInstanceUsage objects
- LastRefreshTime
-
The time when SageMaker AI last refreshed the usage counts in this response.
Type: Timestamp
- NextToken
-
If the response is truncated, SageMaker AI returns this token. To retrieve the next set of results, use this token in your next request.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 8192.
Pattern:
.* - SMCapacityReservationId
-
The ID of the SageMaker Capacity Reservation. The ID is the last part of the ARN and starts with
smcr-.Type: String
Pattern:
smcr-[0-9a-z]{12} - TotalInstanceCount
-
The number of instances in the SageMaker Capacity Reservation.
Type: Integer
Valid Range: Minimum value of 0.
Errors
For information about the errors that are common to all actions, see Common Error Types.
- ResourceNotFound
-
Resource being access is not found.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: