Help Center> ServiceStage> API Reference> Application Management APIs> Components> Obtaining All Components of an Application

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

Table 1 Path parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Tenant's project ID.

application_id

String

Yes

Application ID.

Table 2 Query parameters

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

Table 3 Response parameters

Parameter

Type

Description

count

Integer

Total number of components.

components

Array of objects

Component parameters. See Table 4.

Table 4 components parameters

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.

Table 5 source parameters

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.

Table 6 code spec parameters

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.

Table 7 artifact spec parameters

Parameter

Type

Description

storage

String

Storage mode.

type

String

Type.

url

String

Source code address of the software package.

auth

String

Authentication mode.

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

Table 8 Status codes

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.