Obtaining All Components of an Application
Function
This API is used to obtain all components of an application.
URI
GET /v2/{project_id}/cas/applications/{application_id}/components
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| project_id | String | Yes | Tenant's project ID. |
| application_id | String | Yes | Application ID. |
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| limit | String | No | Number of records to be queried. Value range: 0–100. Default value: 1000, indicating that a maximum of 1000 records can be queried and all records are displayed on the same page. |
| offset | String | No | Offset. |
| order_by | String | No | Sorting field. By default, query results are sorted by creation time. The following enumerated values are supported: create_time, name, and update_time. |
| order | String | No | Descending or ascending order. Default value: desc. |
Request Parameters
Request parameters
None
Response Parameters
Response parameters
| Parameter | Type | Description |
|---|---|---|
| count | Integer | Total number of components. |
| components | Array of objects | Component parameters. See Table 4. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Application component ID. |
| name | String | Application component name. |
| status | Integer | Value: 0 or 1. 0: Normal. 1: Being deleted. |
| runtime | String | Runtime. |
| category | String | Application component type. Example: Webapp, Microservice, or Common. |
| sub_category | String | Application component sub-type. Webapp sub-types include Web, Magento, and Wordpress. Microservice sub-types include Java Chassis, Go Chassis, and Mesher. Common sub-type can be empty. |
| application_id | String | Application ID. |
| source | Object | Source of the code or software package. See Table 5. |
| description | String | Description. |
| creator | String | Creator. |
| create_time | Integer | Creation time. |
| update_time | Integer | Update time. |
| Parameter | Type | Description |
|---|---|---|
| kind | String | Type |
| spec | Object | For details about the source code, see Table 6. For details about the artifact software package, see Table 7. |
| Parameter | Type | Description |
|---|---|---|
| repo_type | String | Code repository. Value: GitHub, GitLab, Gitee, or Bitbucket. |
| repo_url | String | Code repository URL. Example: https://github.com/example/demo.git. |
| repo_ref | String | Code branch or tag. Default value: master. |
| repo_auth | String | Authorization name, which can be obtained from the authorization list. |
Example
Example request
None
Example response
{
"components": [
{
"id": "6f8a56d1-59dc-4783-8676-81e44486eeab",
"name": "app-bypspe",
"status": 0,
"runtime": "Docker",
"category": "Webapp",
"sub_category": "Web",
"application_id": "14356608-381b-4700-9b2b-0a2f115fd5b7",
"source": {
"kind": "artifact",
"spec": {
"storage": "swr",
"type": "package",
"url": "https://{IP}:20202/xxx/xxx.jar",
"auth": "iam"
}
},
"description": "desc",
"creator": "string",
"create_time": 1572263247157,
"update_time": 1572263247157
}
],
"count": 10
} Status Code
| HTTP Status Code | Description |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
| 500 | Internal Server Error |
Error code must be in the format of SVCSTG.00100.[Error_ID]. Example: SVCSTG.00100400. See Error Codes of Application Management APIs.
Last Article: Creating an Application Component
Next Article: Modifying Component Information Based on the Component ID
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.