Deze pagina is nog niet beschikbaar in uw eigen taal. We werken er hard aan om meer taalversies toe te voegen. Bedankt voor uw steun.
Listing Resources in an Enterprise Project
Function
This API is used to query resources added to an enterprise project.
Calling Method
For details, see Calling APIs.
URI
POST /v1.0/enterprise-projects/{enterprise_project_id}/resources/filter
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enterprise_project_id |
Yes |
String |
Enterprise project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Specifies the user token. EPS is a global service. Therefore, when calling the IAM API to obtain a user token, set the scope field to domain. The value of X-Subject-Token in the response header is the user token. |
X-Security-Token |
No |
String |
Security token (session token) of your temporary security credentials. If a temporary security credential is used, this header is required. Minimum: 0 Maximum: 2048 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
projects |
No |
Array of strings |
Project IDs. This parameter is mandatory when resource_types contains a region-level service. |
resource_types |
Yes |
Array of strings |
Specifies the resource type list. The value of this parameter is case sensitive. For example, ecs,scaling_group, images, disk, vpcs,security-groups, shared_bandwidth,eip and cdn. For details, see the section "Appendix - Resource Types Supported by EPS". |
offset |
No |
Integer |
Index position. The query starts from the next data record specified by offset. The value must be a number and cannot be a negative number. The default value is 0. |
limit |
No |
Integer |
Number of records to be queried. If this parameter is not passed, the default value 1000 is used. The maximum value is 1000 and the minimum value is 1. |
matches |
No |
Array of Match objects |
Search field. key indicates the field to be matched and is fixed at resource_name. value indicates the value to be matched. If this field is not passed, no matching condition will be used. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Key. If the matches parameter is passed, this parameter is mandatory and is fixed at resource_name. |
value |
Yes |
String |
Value, which is the resource name. If the matches parameter is passed, this parameter is mandatory and fuzzy search is used by default, for example, message.com. A value can contain a maximum of 255 characters. Maximum: 255 |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
resources |
Array of Resources objects |
Resource list. |
errors |
Array of Errors objects |
Resources bound to enterprise projects that failed to be queried. |
total_count |
Integer |
Total number of resources in enterprise projects. |
Parameter |
Type |
Description |
---|---|---|
enterprise_project_id |
String |
Enterprise project ID. |
project_id |
String |
ProjectID |
project_name |
String |
Project name. |
resource_detail |
Object |
Resource details. |
resource_id |
String |
Resource ID. |
resource_name |
String |
Resource name. |
resource_type |
String |
Resource type. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
project_id |
String |
ProjectID |
resource_type |
String |
Resource type. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error |
RespErrorMessage object |
Error request information. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error |
RespErrorMessage object |
Error request information. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 402
Parameter |
Type |
Description |
---|---|---|
error |
RespErrorMessage object |
Error request information. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
error |
RespErrorMessage object |
Error request information. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error |
RespErrorMessage object |
Error request information. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 405
Parameter |
Type |
Description |
---|---|---|
error |
RespErrorMessage object |
Error request information. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 406
Parameter |
Type |
Description |
---|---|---|
error |
RespErrorMessage object |
Error request information. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 407
Parameter |
Type |
Description |
---|---|---|
error |
RespErrorMessage object |
Error request information. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 408
Parameter |
Type |
Description |
---|---|---|
error |
RespErrorMessage object |
Error request information. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 409
Parameter |
Type |
Description |
---|---|---|
error |
RespErrorMessage object |
Error request information. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error |
RespErrorMessage object |
Error request information. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 501
Parameter |
Type |
Description |
---|---|---|
error |
RespErrorMessage object |
Error request information. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 502
Parameter |
Type |
Description |
---|---|---|
error |
RespErrorMessage object |
Error request information. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 503
Parameter |
Type |
Description |
---|---|---|
error |
RespErrorMessage object |
Error request information. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 504
Parameter |
Type |
Description |
---|---|---|
error |
RespErrorMessage object |
Error request information. |
Example Requests
Listing Resources in an Enterprise Project
POST https://{Endpoint}/v1.0/enterprise-projects/{enterprise_project_id}/resources/filter { "projects" : [ "e1eb7c40cbea4c8389cde527594a306d", "2345d321da864d6faf2e762647e19f96" ], "resource_types" : [ "disk" ], "offset" : 0, "limit" : 10, "matches" : [ { "key" : "resource_name", "value" : "lhj" } ] }
Example Responses
Status code: 200
OK
{ "resources" : [ { "project_id" : "e1eb7c40cbea4c8389cde527594a306d", "project_name" : "XXXX", "resource_type" : "disk", "resource_id" : "b621f5ae-b5c1-49d7-a660-752c445434b4", "resource_name" : "lhj1-volume-0001", "resource_detail" : null, "enterprise_project_id" : "0" }, { "project_id" : "e1eb7c40cbea4c8389cde527594a306d", "project_name" : "XXXX", "resource_type" : "disk", "resource_id" : "87c9edc9-f66c-48b8-a22f-372b2e22d579", "resource_name" : "lhj2-volume-0002", "resource_detail" : null, "enterprise_project_id" : "0" } ], "errors" : [ ], "total_count" : 2 }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
401 |
Unauthorized |
402 |
Payment Required |
403 |
Forbidden |
404 |
Not Found |
405 |
Method Not Allowed |
406 |
Not Acceptable |
407 |
Proxy Authentication Required |
408 |
Request Timeout |
409 |
Conflict |
500 |
Internal Server Error |
501 |
Not Implemented |
502 |
Bad Gateway |
503 |
Service Unavailable |
504 |
Gateway Timeout |
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.