Help Center> ServiceStage> API Reference> Application Management APIs> Instances> Modifying an Application Component Instance

Modifying an Application Component Instance

Function

This API is used to modify an application component instance.

URI

PUT /v2/{project_id}/cas/applications/{application_id}/components/{component_id}/instances/{instance_id}

Table 1 Path parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Tenant's project ID.

application_id

String

Yes

Application ID.

component_id

String

Yes

Component ID.

instance_id

String

Yes

Component instance ID.

Request Parameters

Request parameters

Table 2 Request parameters

Parameter

Type

Mandatory

Description

version

String

Yes

Application component version that meets version semantics. Example: 1.0.1.

flavor_id

String

No

Resource flavor.

artifacts

Map<String, Object>

No

Artifact. key indicates the component name. In the Docker container scenario, key indicates the container name. See Table 3.

configuration

Map<String, Object>

No

Application configurations, such as environment variables.

description

String

No

Description.

external_accesses

Array of objects

No

Access mode. See Table 4.

refer_resources

Array of objects

No

Deployed resources. See Table 5.

Table 3 artifact parameters

Parameter

Type

Mandatory

Description

storage

String

Yes

Storage mode. Value: swr or obs.

type

String

Yes

Type. Value: package (VM deployment) or image (container deployment).

url

String

Yes

Software package or image address.

auth

String

Yes

Authentication mode. Value: iam or none. Default value: iam.

version

String

No

Version number.

properties

Map<String,String>

No

Property information.

Table 4 external_accesses parameters

Parameter

Type

Mandatory

Description

id

String

No

ID

protocol

String

Yes

Protocol. Value: http or https.

address

String

Yes

Access address. Example: www.example.com.

forward_port

Integer

Yes

Port for listening to an application component process.

type

String

No

Value: AUTO_GENERATED, SPECIFIED, or IP_ADDR. Default value: AUTO_GENERATED.

status

String

No

Value: NORMAL or EXPIRED. Default value: NORMAL.

create_time

Integer

No

Creation time.

update_time

Integer

No

Update time.

Table 5 refer_resources parameters

Parameter

Type

Mandatory

Description

id

String

Yes

Resource ID.

type

String

Yes

Basic resources: Cloud Container Engine (CCE), Cloud Container Instance (CCI), Elastic Cloud Server (ECS), and Auto Scaling (AS).

Optional resources: Relational Database Service (RDS), Distributed Cache Service (DCS), Elastic Load Balance (ELB), and other services.

refer_alias

String

No

Application alias, which is provided only in DCS scenario. Value: "distributed_session", "distributed_cache", "distributed_session, distributed_cache".

Default value: "distributed_session, distributed_cache".

parameters

Map<String,String>

No

Reference resource parameter.

Response Parameters

Response parameters

Table 6 Response parameters

Parameter

Type

Description

job_id

String

Job ID, which is used to query information about the created job.

Example

Example request

{
  "version": "string",
  "flavor_id": "MICRO-5G:0.5C:1G",
  "artifacts": {
    "container-name": {
      "storage": "swr",
      "type": "image",
      "url": "100.125.0.198:20202/adminuser/junit-platformstest:1.0",
      "auth": "iam"
    }
  },
  "configuration": {},
  "description": "string",
  "external_accesses": [
    {
      "id": "xxx",
      "protocol": "HTTP",
      "address": "string",
      "forward_port": 80,
      "type": "AUTO_GENERATED",
      "status": "NORMAL",
      "create_time": 1571626146765,
      "update_time": 1571626146765
    }
  ],
  "refer_resources": [
    {
      "id": "string",
      "type": "vpc",
      "refer_alias": "string",
      "parameters": {}
    }
  ]
}

Example response

{
    "job_id": "JOB66761060-f209-407c-a093-4df6f531b9dc"
}

Status Code

Table 7 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.