Obtaining Virtual Resource Flavors
Function
This API is used to obtain virtual resource flavors.
URI
GET /v1/{project_id}/virtualresourceflavors
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID and Name. |
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
apiVersion |
String |
API version. The options are as follows:
|
|
kind |
String |
Resource type. The options are as follows:
|
|
metadata |
ResourceFlavorListMetadata object |
Metadata of resource flavors. |
|
items |
Array of ResourceFlavor objects |
Resource flavors. |
|
Parameter |
Type |
Description |
|---|---|---|
|
continue |
String |
Next query position in pagination query. |
|
remainingItemCount |
Integer |
Remaining resources. |
|
Parameter |
Type |
Description |
|---|---|---|
|
apiVersion |
String |
API version. The options are as follows:
|
|
kind |
String |
Resource type. The options are as follows:
|
|
metadata |
ResourceFlavorMetadata object |
Metadata of a resource flavor. |
|
spec |
ResourceFlavorSpec object |
Description of a resource flavor. |
|
Parameter |
Type |
Description |
|---|---|---|
|
type |
String |
Virtual resource flavor type. The options are as follows:
|
|
cpuArch |
String |
Computer architecture. The options are as follows:
|
|
cpu |
String |
Number of CPU cores. |
|
memory |
String |
Memory size in GiB. |
|
npu |
ResourceFlavorXpu object |
Virtual NPU information. |
|
virtualResourceTemplateName |
String |
Template name of the virtual NPU resource corresponding to the resource flavor. |
|
Parameter |
Type |
Description |
|---|---|---|
|
type |
String |
Virtual NPU allocation type, which corresponds to the queried virtual resource template. |
|
size |
String |
Size. The value is 1. |
|
resourceKey |
String |
Resource key for virtual NPU allocation |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
Example Requests
Obtain virtual NPU allocation resource flavors.
GET https://{endpoint}/v1/{project_id}/virtualresourceflavors
Example Responses
Status code: 200
OK.
{
"kind" : "ResourceFlavorList",
"apiVersion" : "v1",
"metadata" : { },
"items" : [ {
"kind" : "ResourceFlavor",
"apiVersion" : "v1",
"metadata" : {
"name" : "snt9-280t-vir10-3c-16g",
"labels" : { }
},
"spec" : {
"cpuArch" : "arm64",
"cpu" : "8",
"memory" : "32Gi",
"type" : "Logical",
"virtualResourceTemplateName" : "snt9-280t",
"visibility" : "invisible"
}
} ]
}
Status code: 404
Not found.
{
"error_code" : "ModelArts.50005101",
"error_msg" : "VirtualResourceTemplate {name} not found."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK. |
|
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.