查询资源规格列表
功能介绍
列举资源规格列表。用户可通过该接口列举资源规格列表,用户可以通过编码、类型、使用场景等参数过滤查询,支持分页。此接口为同步接口,无配套使用接口和特殊场景。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
GET https://localhost.com/v1/specs
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
spec_code |
否 |
String |
规格编码。 |
spec_types |
否 |
Array of strings |
|
offset |
否 |
Integer |
|
limit |
否 |
Integer |
|
scenario |
否 |
Object |
|
请求参数
无
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
total |
Integer |
|
spec_codes |
Array of Spec objects |
|
参数 |
参数类型 |
描述 |
---|---|---|
spec_code |
String |
|
spec_type |
String |
|
resource_type |
String |
|
stride |
Integer |
|
unit |
String |
|
min_stride_num |
Integer |
|
max_stride_num |
Integer |
|
usage_measure_id |
Integer |
|
usage_factor |
String |
|
stride_num_whitelist |
Array of integers |
|
extra_info |
SpecExtraInfo object |
|
参数 |
参数类型 |
描述 |
---|---|---|
mu_multiple |
Double |
|
mu_code |
String |
|
状态码:400
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
状态码:401
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
状态码:404
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
状态码:408
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
状态码:500
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
请求示例
GET https://{endpoint}/v1/specs
响应示例
状态码:200
查询规格列表响应。
{ "total" : 1, "spec_codes" : [ { "spec_code" : "string", "spec_type" : "APU", "resource_type" : "hws.resource.type.fabric.ray.dpu", "stride" : 1, "unit" : "string", "min_stride_num" : 0, "max_stride_num" : 1, "usage_measure_id" : 6, "usage_factor" : "string", "stride_num_whitelist" : [ 12, 13 ], "extra_info" : { "mu_multiple" : 0, "mu_code" : "string" } } ] }
状态码:400
BadRequest
{ "error_code" : "common.01000001", "error_msg" : "failed to read http request, please check your input, code: 400, reason: Type mismatch., cause: TypeMismatchException" }
状态码:401
Unauthorized
{ "error_code" : "APIG.1002", "error_msg" : "Incorrect token or token resolution failed" }
状态码:403
Forbidden
{ "error" : { "code" : "403", "message" : "X-Auth-Token is invalid in the request", "title" : "Forbidden" }, "error_code" : 403, "error_msg" : "X-Auth-Token is invalid in the request", "title" : "Forbidden" }
状态码:404
NotFound
{ "error_code" : "common.01000001", "error_msg" : "response status exception, code: 404" }
状态码:408
Request Time-out
{ "error_code" : "common.00000408", "error_msg" : "timeout exception occurred" }
状态码:500
InternalServerError
{ "error_code" : "common.00000500", "error_msg" : "internal error" }
状态码
状态码 |
描述 |
---|---|
200 |
查询规格列表响应。 |
400 |
BadRequest |
401 |
Unauthorized |
403 |
Forbidden |
404 |
NotFound |
408 |
Request Time-out |
500 |
InternalServerError |
错误码
请参见错误码。