Obtaining Virtual Resource Flavor Templates
Function
This API is used to obtain details about a specified virtual resource allocation template.
URI
GET /v1/{project_id}/virtualresourcetemplates/{virtualresourcetemplate_name}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID and Name. |
|
virtualresourcetemplate_name |
Yes |
String |
Name of the virtual resource allocation template, which corresponds to the virtualResourceTemplateName field in the spec of the resource flavor obtained using ListVirtualresourceFlavors. |
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 |
Metadata of the virtual resource allocation template. |
|
|
spec |
VirtualResourceTemplateSpec object |
Specifications of the virtual resource allocation template. |
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
String |
Name of the virtual NPU resource allocation template. |
|
Parameter |
Type |
Description |
|---|---|---|
|
resources |
String |
Physical resource information of the flavor. |
|
resourceKey |
String |
Resource key of the NPU. |
|
virtualResources |
Array of VitrualResource objects |
Virtual resource list. |
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
String |
Name of the virtual resource template. |
|
resources |
Map<String,String> |
Resources used by the virtualization template. |
|
resourceKey |
String |
Resource key of the virtualization template. |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
Example Requests
Obtain details about a virtual resource template.
GET https://{endpoint}/v1/{project_id}/virtualresourcetemplates/{virtualresourcetemplate_name}
Example Responses
Status code: 200
OK.
{
"apiVersion" : "v1",
"kind" : "VirtualResourceTemplate",
"metadata" : {
"name" : "snt9-280t"
},
"spec" : {
"resources" : {
"AICORE" : 10,
"AICPU" : 5,
"memory" : "32G"
}
},
"virtualResources" : [ {
"name" : "vir5_1c_8g",
"resources" : {
"AICORE" : 5,
"AICPU" : 1,
"memory" : "8G"
},
"resourceKey" : "npu.accelerator/snt9-5c.1cpu.8g"
} ]
}
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.