Updated on 2025-12-19 GMT+08:00

Obtaining the Component List

Function

Obtain the component list.

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 /v1/{project_id}/cae/applications/{application_id}/components

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. See Obtaining a Project ID.

application_id

Yes

String

Application ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

String

Maximum number of returned results.

offset

No

String

Pagination offset, that is, the start position for query.

status

No

String

Definition

Component status.

Range

  • created: not deployed.

  • running

  • paused

  • notReady

Default Value

This field is optional. If this field is not transferred, the API can be properly called and components in all states are returned.

sort_key

No

String

Definition

Sorting field.

Range

  • created_at

  • updated_at

Default Value

This field is optional. If this field is not transferred, the API can be properly called and the default value created_at is used.

sort

No

String

Definition

Ascending and ascending order rule.

Range

  • asc

  • desc

Default Value

This field is optional. If this field is not transferred, the API can be properly called and the default value desc is used.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

X-Enterprise-Project-ID

No

String

Enterprise project ID.

  • When an environment is created, it will be bound with an enterprise project ID.

  • Enter 0 or up to 36 characters in UUID format with hyphens (-).

  • If this parameter is not specified or is set to 0, resources in the default enterprise project are queried.

NOTE:
For details about how to obtain enterprise project IDs and enterprise project features, see Enterprise Management User Guide.

X-Environment-ID

Yes

String

Environment ID.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

api_version

String

API version. Fixed value: v1.

kind

String

API type. Fixed value: Component.

items

Array of ComponentItem objects

Component list.

total_count

Integer

Total number of pages.

Table 5 ComponentItem

Parameter

Type

Description

id

String

Component ID.

name

String

Component name.

annotations

Map<String,String>

Resource information.

created_at

String

Creation time.

updated_at

String

Update time.

spec

ComponentSpec object

Component specifications.

Table 6 ComponentSpec

Parameter

Type

Description

runtime

String

Language or runtime.

env_id

String

Environment ID.

replica

Integer

Number of instances.

source

Source object

Source information.

build

Build object

Build information.

resource_limit

ResourceLimit object

Instance specifications

access_info

Array of Access objects

Access mode list.

image_url

String

Image address.

available_replica

Integer

Number of available instances.

job_id

String

Job ID.

build_id

String

Build job ID.

status

String

Component status.

  • created: not deployed.

  • running

  • paused

  • notReady

job_status

String

Last operation result of the component.

  • deploying

  • retrying

  • restarting

  • scaling

  • stopping

  • starting

  • rollingBack

  • upgrading

  • configuring

  • deleting

  • deploy_failed

  • retry_failed

  • restart_failed

  • scale_failed

  • stop_failed

  • start_failed

  • rollback_failed

  • upgrade_failed

  • configure_failed

  • delete_failed

  • create_succeeded

  • deploy_succeeded

  • retry_succeeded

  • restart_succeeded

  • scale_succeeded

  • stop_succeeded

  • start_succeeded

  • rollback_succeeded

  • upgrade_succeeded

  • configure_succeeded

build_log_id

String

Build log ID.

configuration_operation_id

String

Latest operation ID.

terminated

String

Whether the task executed on the component is forcibly terminated.

Table 7 Source

Parameter

Type

Description

code

Repo object

Source code repository information.

type

String

Definition

Source type.

Constraints

When updating a component, the source type must match the type used during its initial creation.

Range

  • image: image.

  • code: source code.

  • softwarePackage: software package.

Default Value

N/A

sub_type

String

Source subtype.

  • If type is code, sub_type indicates a code repository, such as DevCloud (CodeArts), GitLab, GitHub, Gitee, or Bitbucket.

  • If type is softwarePackage, sub_type indicates a software package repository, such as BinObs or BinDevCloud (CodeArts Release Repo).

url

String

URL.

  • If type is image, url indicates an image address.

  • If type is code, url indicates a Git address.

  • If type is softwarePackage, url indicates a software package address.

Table 8 Repo

Parameter

Type

Description

auth_name

String

Authorization name.

branch

String

Branch.

namespace

String

Namespace, which must be Base64-encoded.

Table 9 Build

Parameter

Type

Description

archive

Archive object

Place where build products are archived for management.

parameters

Map<String,String>

Additional parameters. Options:

  • base_image: base image address.

  • build_cmd: custom build command.

  • dockerfile_path: custom dockerfile path.

  • dockerfile_content: custom dockerfile content.

  • artifact_name: product to be run after the Java multi-module build. The value ends with .jar.

Table 10 Archive

Parameter

Type

Description

artifact_namespace

String

SWR organization for product management.

Table 11 ResourceLimit

Parameter

Type

Description

cpu_limit

String

CPU limit.

memory_limit

String

Memory limit.

Table 12 Access

Parameter

Type

Description

address

String

Access address.

type

String

Definition

Access mode type.

Range

  • ClusterIP: intra-cluster IP address access.

  • LoadBalancer: load balancing acces.

  • Ingress: route access.

Default Value

N/A

Example Requests

Obtain the component list.

GET https://{endpoint}/v1/{project_id}/cae/applications/{application_id}/components

Example Responses

Status code: 200

OK

{
  "api_version" : "v1",
  "kind" : "Component",
  "items" : [ {
    "id" : "610fb1de-5ac6-424e-b910-d7be902575d0",
    "name" : "demo-xxx",
    "annotations" : {
      "version" : "1.0.0",
      "enterprise_project_id" : ""
    },
    "created_at" : "2022-06-09T07:01:05.323979Z",
    "updated_at" : "2022-06-09T07:01:05.323979Z",
    "spec" : {
      "runtime" : "Docker",
      "env_id" : "50d18173-5df0-4db4-a2b6-8a428d42146b",
      "replica" : 1,
      "source" : {
        "type" : "image",
        "url" : "xxx/demo-jar:v2"
      },
      "build" : {
        "archive" : {
          "artifact_namespace" : "xxx"
        },
        "parameters" : {
          "base_image" : ""
        }
      },
      "resource_limit" : {
        "cpu_limit" : "500m",
        "memory_limit" : "1Gi"
      },
      "image_url" : "xxx/demo-jar:v2",
      "available_replica" : 1,
      "job_id" : "251b7d84-c353-416a-864f-5878a94c3d28",
      "status" : "running",
      "configuration_operation_id" : "xxx"
    }
  } ],
  "total_count" : 1
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.