Obtaining Component Information Based on the Component ID
Function
This API is used to obtain component information based on the component ID.
URI
GET /v3/{project_id}/cas/applications/{application_id}/components/{component_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Tenant's project ID. See Obtaining a Project ID. |
application_id |
Yes |
String |
Application ID. See Obtaining All Applications. |
component_id |
Yes |
String |
Component ID. See Obtaining All Components of an Application. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
version |
No |
String |
Component version. See Obtaining All Components of an Application. |
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
Message body type (format). Default value: application/json;charset=utf8. |
X-Auth-Token |
Yes |
String |
API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token. For details about how to obtain a token, see Obtaining a User Token. |
Response
Parameter |
Type |
Description |
---|---|---|
name |
String |
Application component name. The value contains 2 to 64 characters consisting of letters, digits, hyphens (-), and underscores (_). It starts with a letter and ends with a letter or digit. Letters are case insensitive. |
labels |
Array of objects |
Label. For container-deployed components, you can query a workload by label. For VM-deployed components, you can configure a label of the corresponding microservice name to use graceful startup and shutdown. See Table 5. |
runtime_stack |
Object |
Runtime. See Table 30. The value can be obtained from the response of the API for Querying a Runtime System Stack. |
environment_id |
String |
Environment ID. |
application_id |
String |
Application ID. |
description |
String |
Description. The value can contain up to 128 characters. |
source |
Object |
Source of the code or software package. See Table 31. |
build |
Object |
Component build. See Table 32. |
limit_cpu |
Number |
Maximum CPU limit. Unit: core. |
limit_memory |
Number |
Maximum memory size. Unit: GiB. |
request_cpu |
Number |
Requested CPU resources. Unit: core. |
request_memory |
Number |
Requested memory. Unit: GiB. |
version |
String |
Component version number. The value can contain up to 32 characters. It needs to meet the following rule: ^([0-9]+)(.[0-9]+){2,3}$ |
envs |
Array of objects |
Environment variable list. See Table 28. |
replica |
Integer |
Number of instances. |
storages |
Array of objects |
Storage. See Table 6. |
deploy_strategy |
Object |
Component deployment. See Table 9. |
command |
Object |
Startup command. See Table 12. |
post_start |
Object |
Post-start processing. See Table 13. |
pre_stop |
Object |
Pre-stop processing. See Table 13. |
mesher |
Object |
Multi-language access service mesh. This parameter is mandatory when Node.js is selected for the technology stack and the CSE engine is bound. See Table 14. |
timezone |
String |
Time zone where the component runs. Example: Asia/Shanghai. |
jvm_opts |
String |
JVM parameter. Example: -Xms256m -Xmx1024m. If there are multiple parameters, separate them by spaces. If the parameter is left blank, the default value is used. |
tomcat_opts |
Object |
Tomcat parameter. This parameter is valid when you use the Tomcat technology stack. See Table 15. |
logs |
Array of objects |
Log collection. See Table 21. |
custom_metric |
Object |
Custom metrics. See Table 22. |
affinity |
Array of objects |
Affinity. See Table 23. |
anti_affinity |
Array of objects |
Anti-affinity. See Table 23. |
liveness_probe |
Array of objects |
Component liveness probe. See Table 25. |
readiness_probe |
Object |
Component service probe. See Table 25. |
refer_resources |
Array of objects |
Associated resource. See Table 26. |
status |
Object |
Component status. See Table 34. |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Data storage type.
|
name |
String |
Name of the storage disk. |
parameters |
Object |
For details about the parameters of each data storage type, see Table 7. |
mounts |
Array of objects |
Mount path of data storage. See Table 8. |
Parameter |
Type |
Description |
---|---|---|
path |
String |
Host path. This parameter is applicable to the HostPath storage type. |
name |
String |
Name of a configuration item, secret, or PVC, which is applicable to ConfigMap, Secret, or PersistentVolumeClaim storage, respectively. |
default_mode |
Integer |
Mounting permission. The value is in decimal format. Example: 384. This parameter is applicable to ConfigMap and secret storage. |
medium |
String |
This parameter is applicable to the EmptyDir storage type. Example: memory. |
Parameter |
Type |
Description |
---|---|---|
path |
String |
Mount path. |
sub_path |
String |
Subpath of the mount path. |
read_only |
Boolean |
Read-only or not. |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Deployment type.
|
rolling_release |
Object |
Rolling deployment parameter. See Table 10. |
gray_release |
Object |
Dark launch upgrade. See Table 11. |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Dark launch policy. weight: The upgrade is performed based on dark launch traffic. |
first_batch_weight |
Integer |
Proportion of first-batch dark launch traffic. |
first_batch_replica |
Integer |
Number of first-batch dark launch instances. |
remaining_batch |
Integer |
Number of batches for remaining instance deployment. After the first batch is completed, the remaining instances will be deployed in specified batches. Example: If there are 5 instances remaining to be deployed in 3 batches, these 5 instances will be upgraded based on 2:2:1. |
Parameter |
Type |
Description |
---|---|---|
command |
Array of String |
Command for controlling container running. |
args |
Array of String |
Parameter for controlling container running. Example: -port=8080. If there are multiple parameters, separate them by line breaks. |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Processing method.
|
scheme |
String |
HTTP request type, which can be HTTP or HTTPS. This parameter is valid only when type is set to http. |
host |
String |
Custom IP address. If this parameter is left blank, the pod IP address is used. This parameter is valid only when type is set to http. |
port |
Integer |
Port number. This parameter is valid only when type is set to http. |
path |
String |
Request path. This parameter is valid only when type is set to http. |
command |
Array of String |
Command list. This parameter is valid only when type is set to command. |
Parameter |
Type |
Description |
---|---|---|
server_xml |
String |
|
Parameter |
Type |
Description |
---|---|---|
ip |
String |
IP address. |
hostname |
Array of String |
Host alias. |
Parameter |
Type |
Description |
---|---|---|
nameservers |
Array of String |
IP address list of the DNS server of the pod. |
searches |
Array of String |
List of DNS search domains used to search for host names in the pod. |
options |
Array of objects |
An optional list of objects where each object may have a name property (required) and a value property (optional). This property is merged into the options generated from the specified DNS policy. Duplicate entries will be deleted. See Table 18. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Operation name. |
value |
String |
Operation value. |
Parameter |
Type |
Description |
---|---|---|
run_as_user |
Integer |
User for running containers. Example: To run containers as user root, set the user ID to 0. |
run_as_group |
Integer |
Owner group specified for running container processes. |
capabilities |
Object |
Capability set. See Table 20. |
Parameter |
Type |
Description |
---|---|---|
add |
Array of String |
Grant the Linux permission to the running user. |
drop |
Array of String |
Remove the Linux permission of the running user. |
Parameter |
Type |
Description |
---|---|---|
log_path |
String |
Container log path. |
rotate |
String |
Interval for dumping logs. |
host_path |
String |
Mounted host path. |
host_extend_path |
String |
Host extension path. By extending the host path, you can distinguish mounting from different containers in the same host path.
|
Parameter |
Type |
Description |
---|---|---|
path |
String |
Collection path. Example: /metrics. |
port |
Integer |
Collection port. Example: 9090. |
dimensions |
String |
Monitoring dimension. Example: cpu_usage,mem_usage. |
Parameter |
Type |
Description |
---|---|---|
condition |
String |
Whether the condition must be met.
|
kind |
String |
Affinity type.
|
weight |
Integer |
Affinity weight. Value range: 0–100. |
match_expressions |
String |
Match condition. See Table 24. |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Key of the match tag. |
operation |
String |
Match condition. |
value |
String |
Value of the match tag. |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Type. Value: http, tcp, or command. |
delay |
Integer |
Interval between the startup and detection. |
timeout |
Integer |
Detection timeout interval. |
scheme |
String |
Request type. Value: HTTP or HTTPS. This parameter is valid only when type is set to http. |
host |
String |
Custom IP address. If this parameter is left blank, the pod IP address is used. This parameter is valid only when type is set to http. |
port |
Integer |
Port number. This parameter is valid only when type is set to http or tcp. |
path |
String |
Request path. This parameter is valid only when type is set to http. |
command |
Array of String |
Command list. This parameter is valid only when type is set to command. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Resource ID. |
type |
String |
Resource type.
|
parameters |
Object |
Resource parameters. See Table 27. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Variable name. |
value |
String |
Variable value. |
value_from |
Object |
Variable reference. See Table 29. |
Parameter |
Type |
Description |
---|---|---|
reference_type |
String |
Reference type.
|
name |
String |
Name of the configuration item or secret. |
key |
String |
Key of the configuration item or secret. |
optional |
Boolean |
Whether the key of the configuration item or secret is mandatory. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Technology stack name. |
type |
String |
Technology stack type. Value: Java, Tomcat, Nodejs, Php, Docker, or Python. When deploy_mode is set to virtualmachine, only Java, Tomcat, and Node.js are supported. When deploy_mode is set to container, all of the preceding types are supported. |
version |
String |
Technology stack version. |
deploy_mode |
String |
Deployment mode.
|
Parameter |
Type |
Description |
---|---|---|
kind |
String |
Component source kind.
|
version |
String |
Version number. |
url |
String |
Package address. This parameter is mandatory when kind is set to package or image. |
storage |
String |
Storage mode. Value: swr (image), swr (software repository), codearts, or obs. This parameter is mandatory when kind is set to package or image. |
auth |
String |
Authentication mode. Value: iam or none. Default value: iam. |
repo_auth |
String |
Authorization name, which can be obtained from the authorization list. |
repo_namespace |
String |
Namespace of the code repository. |
repo_ref |
String |
Code branch or tag. Default value: master. |
repo_type |
String |
Code repository type. Value: GitHub, BitBucket, or GitLab. |
web_url |
String |
Code redirection URL. Example: https://github.com/example/demo.git. |
repo_url |
String |
Code repository URL. Example: https://github.com/example/demo.git. |
commit_id |
String |
In the code repository, commit ID is the unique identifier of each commit and is used to identify and reference a commit. The value contains 8 to 40 characters and starts with a lowercase letter or digit. This parameter is returned only when Request contains Table 2. |
Parameter |
Type |
Description |
---|---|---|
parameters |
Map<String, Object> |
This parameter is provided only when no ID is available during build creation. See Table 33. |
Parameter |
Type |
Description |
---|---|---|
build_cmd |
String |
Compilation command. By default:
|
dockerfile_path |
String |
Address of the Docker file. By default, the Docker file is in the root directory (./). |
artifact_namespace |
String |
Build archive organization. Default value: cas_{project_id}. |
cluster_id |
String |
ID of the cluster to be built. |
node_label_selector |
Map<String, String> |
key: label key. value: label value. |
environment_id |
String |
Environment ID. |
Parameter |
Type |
Description |
---|---|---|
component_status |
String |
Component status.
|
available_replica |
Integer |
Available instances. |
replica |
Integer |
Total instances. |
fail_detail |
String |
Failure cause.
|
last_job_id |
String |
ID of the last executed task. |
create_time |
Integer |
Creation time. |
update_time |
Integer |
Update time. |
creator |
String |
Creator. |
artifact |
Object |
Artifact information. See Table 35. |
Example Request
None
Example Response
{ "name": "test-component", "description": "", "labels": [], "runtime_stack": { "type": "Java", "name": "OpenJDK8", "deploy_mode": "virtualmachine", "version": "1.1.1" }, "id": "b8702b0f-94d3-4822-98a1-56815632a0a0", "source": { "kind": "package", "url": "obs://bucket0001/weather-1.0.0.jar", "storage": "obs" }, "environment_id": "4d084044-0b80-4641-963c-b9c9f4092a4f", "application_id": "fc092465-a5fb-4a52-bc65-b735f18366d8", "replica": 1, "version": "2023.0323.15181", "envs": [], "tomcat_opts": { "server_xml": "", "http_port": 0, "context_path": null }, "refer_resources": [ { "id": "Default", "type": "ecs", "parameters": { "hosts": [ "67835bb3-1235-4cc9-be71-becbb2b4ca0d" ] } } ], "status": { "component_status": "RUNNING", "available_replica": 1, "replica": 1, "fail_detail": null, "last_job_id": "JOB1c8e20ec-1b30-4ee4-9a36-35a18b5e8b7e", "creator": null, "create_time": 1679556221933, "update_time": 1679579448500, }, "workload_kind": "deployment" }
Status Code
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
404 |
Not Found |
500 |
Internal Server Error |
Error Code
The error code format is SVCSTG.00100.[Error_ID], for example, SVCSTG.00100400. For details, see ServiceStage Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank 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