Querying Resource Associations
Function
This API is used to query resource associations, including the types, IDs, and project IDs of resources and instances. Resources such as network interfaces can be associated with instances of advanced services, such as ELB.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.
URI
GET /v3/{project_id}/vpc/resource-associations
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition ID of the project that the network ACL belongs to. For details about how to obtain a project ID, see Obtaining a Project ID. Range N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| resource_id | No | Array of strings | Definition Resource ID. If this parameter is specified, resources are filtered by ID. Multiple IDs can be specified for filtering. Range The value can be the ID of an elastic network interface or supplementary network interface. |
| resource_type | No | Array of strings | Definition Resource type. If this parameter is specified, resources are filtered by resource type. Multiple resource types can be specified. Range |
| resource_project_id | No | String | Definition The ID of the project to which the resource belongs. If this parameter is specified, resources are filtered by project ID. Range N/A |
| instance_id | No | Array of strings | Definition Instance ID, which is used for filtering. Multiple IDs can be specified for filtering. Range Load balancer ID. |
| instance_type | No | Array of strings | Definition Instance type. If this parameter is specified, the query is performed based on the instance type. Multiple instance types can be specified for filtering. Range |
| instance_project_id | No | String | Definition Project ID of the instance. If this parameter is specified, the query is performed based on the project ID. Range N/A |
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| request_id | String | Definition Request ID. Range N/A |
| resource_associations | Array of ResourceAssociation objects | Definition List of associated instances. Range N/A |
| page_info | PageInfo object | Definition Pagination information. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition ID of the association between a resource and an instance. Range N/A |
| resource_id | String | Definition Resource ID. Range N/A |
| resource_type | String | Definition Resource type. Range |
| resource_project_id | String | Definition ID of the project to which the resource belongs. Range N/A |
| instance_id | String | Definition Instance ID. Range N/A |
| instance_type | String | Definition Instance type. Range |
| instance_project_id | String | Definition Project ID. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| previous_marker | String | Definition: The first record on the current page. Range: N/A |
| current_count | Integer | Definition: Total number of resources on the current page. Range: N/A |
| next_marker | String | Definition: The last record on the current page. The next_marker field does not exist if the page is the last one. Range: N/A |
Example Requests
Query resource associations.
GET https://{Endpoint}/v3/{project_id}/vpc/resource-associations Example Responses
Status code: 200
{
"request_id" : "7bf6704ac786da56fc1c517b5abd19b2",
"resource_associations" : [ {
"id" : "4aa73aa9-9402-461a-8cf0-31c8e6b612d1",
"resource_type" : "subeni",
"resource_id" : "c5fcc0cd-d025-41d6-8021-43d155e01031",
"resource_project_id" : "5e122060ce2840e39c765feb7e6d5b6b",
"instance_type" : "ELB",
"instance_id" : "80489e14-30c2-4c60-a486-bdc1809740e5",
"instance_project_id" : "5e122060ce2840e39c765feb7e6d5b6b"
}, {
"id" : "23775f49-927b-44b9-acba-5ddd1a53c187",
"resource_type" : "subeni",
"resource_id" : "c5fcc0cd-d025-41d6-8021-43d155e01031",
"resource_project_id" : "5e122060ce2840e39c765feb7e6d5b6b",
"instance_type" : "ELB",
"instance_id" : "73980090-c383-4510-bfa2-433149a5b298",
"instance_project_id" : "5e122060ce2840e39c765feb7e6d5b6b"
} ],
"page_info" : {
"previous_marker" : "4aa73aa9-9402-461a-8cf0-31c8e6b612d1",
"current_count" : 2
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | The GET operation is successful. For more status codes, see Status Codes. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank 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