Obtaining Resource Specifications
Function
Obtain resource specifications.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
GET /v1/{project_id}/resourceflavors
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition: Project ID. For details, see Obtaining a Project ID and Name. Constraints: N/A Range: N/A Default Value: N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
continue |
No |
String |
Definition: Offset parameter of the pagination query Constraints: N/A Range: The value is obtained from the metadata.continue field in the response to the last pagination query. An empty value indicates no offset. Default Value: N/A |
limit |
No |
Integer |
Definition: Number of resources returned in a single pagination query Constraints: N/A Range: 0 to 500 Default Value: 500 |
labelSelector |
No |
String |
Definition: Tag filtering query Constraints: N/A Range: N/A Default Value: N/A |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
apiVersion |
String |
Definition: API version of a resource. Range: |
kind |
String |
Definition: Resource type. Range: |
metadata |
metadata object |
Definition: Metadata of a resource flavor list. Range: N/A |
items |
Array of ResourceFlavor objects |
Definition: Resource flavor list. Range: N/A |
Parameter |
Type |
Description |
---|---|---|
continue |
String |
Definition: Offset parameter of the pagination query. Constraints: This parameter is optional. Range: The value is obtained from the metadata.continue field in the response to the last pagination query. An empty value indicates no offset. Default Value: N/A |
remainingItemCount |
Integer |
Definition: Number of remaining resources in a pagination query. Default Value: N/A |
Parameter |
Type |
Description |
---|---|---|
apiVersion |
String |
Definition: API version of a resource. Range: |
kind |
String |
Definition: Resource type. Range: |
metadata |
metadata object |
Definition: Metadata of a resource flavor. Range: N/A |
spec |
ResourceFlavorSpec object |
Definition: Specifications of a resource flavor. Range: N/A |
status |
ResourceFlavorStatus object |
Definition: Status of a resource flavor. Range: N/A |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Definition: Resource flavor ID. Constraints: N/A Range: N/A Default Value: N/A |
labels |
ResourceFlavorLabel object |
Definition: Tags of a resource flavor. Constraints: N/A Range: N/A Default Value: N/A |
annotations |
ResourceFlavorAnnotation object |
Definition: Comments of a resource flavor. Constraints: N/A Range: N/A Default Value: N/A |
Parameter |
Type |
Description |
---|---|---|
os.modelarts/scope |
String |
Definition: Job types supported by the resource flavor. Use periods (.) to separate multiple job types. Constraints: N/A Range: N/A Default Value: N/A |
Parameter |
Type |
Description |
---|---|---|
os.modelarts.flavor/image.filter |
String |
Definition: Filter criteria of private images supported by the resource flavor. Constraints: N/A Range: N/A Default Value: N/A |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Definition: Resource flavor type. Constraints: N/A Range: Default Value: N/A |
cpuArch |
String |
Definition: Compute architecture of a resource flavor. Constraints: N/A Range: Default Value: N/A |
cpu |
String |
Definition: Number of CPU cores of a resource flavor. Constraints: N/A Range: N/A Default Value: N/A |
memory |
String |
Definition: Memory size of a resource flavor, in GiB. Constraints: N/A Range: N/A Default Value: N/A |
gpu |
gpu object |
Definition: GPU resource information of a resource flavor. Constraints: N/A Range: N/A Default Value: N/A |
npu |
npu object |
Definition: GPU resource information of a resource flavor. Constraints: N/A Range: N/A Default Value: N/A |
dataVolume |
Array of dataVolume objects |
Definition: Storage resource information of a resource flavor. Constraints: N/A Range: N/A Default Value: N/A |
billingModes |
Array of integers |
Definition: Billing mode supported by a resource flavor. Constraints: N/A Range: Default Value: N/A |
billingCode |
String |
Definition: Billing code of a resource flavor. Constraints: N/A Range: N/A Default Value: N/A |
jobFlavors |
Array of strings |
Definition: List of job types supported by a resource flavor. Constraints: N/A Range: N/A Default Value: N/A |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Definition: Type of GPUs of a resource flavor. Constraints: N/A Range: N/A Default Value: N/A |
size |
String |
Definition: Number of GPUs of a resource flavor. Constraints: N/A Range: N/A Default Value: N/A |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Definition: Type of NPUs of a resource flavor. Constraints: N/A Range: N/A Default Value: N/A |
size |
String |
Definition: Number of NPUs of a resource flavor. Constraints: N/A Range: N/A Default Value: N/A |
Parameter |
Type |
Description |
---|---|---|
volumeType |
String |
Definition: Disk type. Constraints: N/A Range: Default Value: N/A |
size |
String |
Definition: Disk size, in GiB. Constraints: N/A Range: N/A Default Value: N/A |
Parameter |
Type |
Description |
---|---|---|
phase |
Map<String,String> |
Definition: Capacity status of a resource flavor. The value is in the key-value pair format. The key is the AZ code, and the value is the resource status of the AZ. The options are as follows: Constraints: N/A Range: N/A Default Value: N/A |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Range: N/A |
error_msg |
String |
Definition: Error message. Range: N/A |
Status code: 404
Example Requests
This API is used to obtain resource specifications.
GET https://{endpoint}/v1/{project_id}/resourceflavors { }
Example Responses
Status code: 200
OK
{ "kind" : "ResourceFlavorList", "apiVersion" : "v1", "metadata" : { }, "items" : [ { "kind" : "ResourceFlavor", "apiVersion" : "v1", "metadata" : { "name" : "modelarts.vm.cpu8u32g", "labels" : { } }, "spec" : { "cpuArch" : "x86", "cpu" : "8", "memory" : "32Gi", "type" : "Dedicate", "billingCode" : "modelarts.vm.cpu.8ud", "billingModes" : [ 0 ] }, "status" : { "phase" : { "cn-north-7a" : "soldout", "cn-north-7b" : "soldout", "cn-north-7c" : "normal" } } } ] }
Status code: 401
Authorization failed.
{ "error_code" : "ModelArts.50001000", "error_msg" : "token is invalid" }
Status code: 404
Not found.
{ "error_code" : "ModelArts.50005101", "error_msg" : "Resourceflavor not found." }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
401 |
Authorization failed. |
404 |
Not found. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot