Help Center/ ServiceStage/ API Reference/ Application Management V3 APIs/ Lane/ Associating a Component Based on the Lane ID
Updated on 2024-10-16 GMT+08:00

Associating a Component Based on the Lane ID

Function

This API is used to associate a lane with a component based on the lane ID.

URI

PUT /v3/{project_id}/cas/swimlane-group/{lane_group_id}/swimlane/{lane_id}/instances

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant's project ID. See Obtaining a Project ID.

lane_group_id

Yes

String

Lane group ID. See Obtaining All Lane Groups.

lane_id

Yes

String

Lane ID. See Obtaining All Lanes in a Lane Group.

Request

Table 2 Request header parameters

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.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

action

Yes

String

Removes or associates a component.

  • ADD
  • REMOVE

instance_ids

Yes

Array of String

Component instance list.

Response

Table 4 Response parameters

Parameter

Type

Description

id

String

Lane ID.

name

String

Lane name.

swimlane_group_id

String

Lane group ID.

type

String

Lane type.

  • BASE: baseline lane.
  • GRAY: dark launch lane.

tag

String

Lane tag, which is used to control traffic routing.

route_status

String

Route status.

  • ENABLE
  • DISABLED

rule_match_mode

String

Mode of matching routing rules.

This parameter is valid when gray_release_type is set to CONTENT.

  • ALL: matches all rules.
  • ANY: matches any rule.

rules

Array of objects

Routing rules. This parameter is valid when gray_release_type is set to CONTENT. See Table 5.

weight

Integer

Lane traffic weight. Value range: 0–100. This parameter is valid when gray_release_type is set to WEIGHT.

instances

Array of objects

List of components managed in the lane. See Table 6.

instance_count

Integer

Number of components managed in the lane.

latest_opt

String

Previous operation of the lane.

  • CLONE
  • UPGRADE
  • ROLLBACK
  • CREATE

release_plan_id

String

ID of the release task associated with the previous operation of the lane.

project_id

String

Project ID.

create_time

Integer

Creation time.

update_time

Integer

Update time.

creator

String

Creator.

Table 5 rules

Parameter

Type

Description

type

String

Type of dark launch matching rule. Currently, only HEADER is supported, that is, matching by header.

key

String

Key.

value

String

Value.

condition

String

Match condition.

  • EXACT
  • PREFIX
  • REGEX
Table 6 instances

Parameter

Type

Description

id

String

Component instance ID.

name

String

Component instance name.

version

String

Component version.

application_id

String

Application ID.

component_id

String

Component ID.

application_name

String

Application name.

replica

Integer

Number of instance replicas.

Example Request

Associate the lane whose ID is 8f8a5b33-ee1f-4a70-b3a9-c1b179a69fd2 with the component instance whose ID is 887f99d7-4ce5-431d-924f-6a328cb05572.

{
    "instance_ids": [
        "887f99d7-4ce5-431d-924f-6a328cb05572"
    ],
    "action": "ADD"
}

Example Response

{
    "id": "8f8a5b33-ee1f-4a70-b3a9-c1b179a69fd2",
    "name": "base",
    "swimlane_group_id": "5447f910-ab74-4d15-b2ab-dd0945900ce9",
    "type": "BASE",
    "tag": "base",
    "route_status": "ENABLE",
    "rule_match_mode": null,
    "project_id": "86a1f7b663b349e89071a3090d9d81f3",
    "rules": null,
    "creator": "test_user",
    "create_time": 1722848532908,
    "update_time": 1722848532908,
    "instances": [
        {
            "componentId": "0b582884-1ad0-4183-8d6d-16998f54818f",
            "id": "887f99d7-4ce5-431d-924f-6a328cb05572",
            "name": "comp-uh59l7s2",
            "version": "1.0.0",
            "application_id": "70502782-4f93-4eda-af19-415bac2d12ae",
            "application_name": "app-apitest-1o6l",
            "replica": 0
        }
    ],
    "instance_count": 1,
    "weight": 100,
    "batch_status": null,
    "latest_opt": null,
    "release_plan_id": null
}