Updated on 2024-10-16 GMT+08:00

Creating a Lane Group

Function

This API is used to create a lane group.

A lane group is a set of lanes used to distinguish organizations or scenarios. A maximum of 300 lane groups can be created in a project.

URI

POST /v3/{project_id}/cas/swimlane-group

Table 1 Path parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

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

name

Yes

String

Lane group 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.

gateways

No

Array of objects

List of gateways associated with a lane group, indicating the ingress of full-link traffic. See Table 4.

description

No

String

Lane group description.

The value can contain up to 128 characters.

Table 4 gateways

Parameter

Mandatory

Type

Description

engine_id

Yes

String

ID of the engine used by the target service source.

id

Yes

String

Gateway ID.

name

No

String

Gateway name.

target_services

Yes

Array of objects

List of target services in the gateway service management. See Table 5.

Table 5 target_services

Parameter

Mandatory

Type

Description

host

Yes

String

Host information of the target service.

The host information consists of the microservice name after the target service is connected to the engine, the microservice environment name, the microservice application name, and the type of the engine to which the microservice is connected. They are separated by periods (.).

For example, unit-controller.testing.test-application.servicecomb. unit-controller indicates the name of the microservice connected to the engine. testing indicates the name of the environment where the unit-controller microservice is located. test-application indicates the name of the application to which the unit-controller microservice belongs. servicecomb indicates that the unit-controller microservice is connected to the ServiceComb engine.

name

No

String

Target service name.

id

Yes

String

Target service ID.

engine_id

Yes

String

Engine ID.

engine_type

Yes

String

Engine type.

  • servicecomb
  • nacos: registry/configuration center

Response

Table 6 Response parameters

Parameter

Type

Description

name

String

Lane group name.

gateways

Array of objects

Traffic gateway entry. See Table 7.

description

String

Lane group description.

gray_release_type

String

Dark launch type.

  • WEIGHT: full-link dark launch based on the traffic ratio.
  • CONTENT: full-link dark launch based on content.

id

String

Lane group ID.

gateway_engine_ids

Array of String

Gateway ID list.

creator

String

Creator.

create_time

String

Creation time.

update_time

String

Update time.

project_id

String

Tenant's project ID.

Table 7 gateways

Parameter

Type

Description

engine_id

String

ID of the engine used by the target service source.

id

String

Gateway ID.

name

String

Gateway name.

target_services

Array of objects

List of target services in the gateway service management. See Table 8.

Table 8 target_services

Parameter

Type

Description

host

String

Host information of the target service.

The host information consists of the microservice name after the target service is connected to the engine, the microservice environment name, the microservice application name, and the type of the engine to which the microservice is connected. They are separated by periods (.).

For example, unit-controller.testing.test-application.servicecomb. unit-controller indicates the name of the microservice connected to the engine. testing indicates the name of the environment where the unit-controller microservice is located. test-application indicates the name of the application to which the unit-controller microservice belongs. servicecomb indicates that the unit-controller microservice is connected to the ServiceComb engine.

name

String

Target service name.

id

String

Target service ID.

engine_id

String

Engine ID.

engine_type

String

Engine type.

  • servicecomb
  • nacos: registry/configuration center

Example Request

Create a lane group named test with description test. The lane group is bound to an application gateway named microGateway-cy8bhr as the traffic ingress gateway. The target service that forwards traffic through the application gateway is the provider microservice that is connected to the ServiceComb engine and whose environment is empty and application name is demo-java-chassis-cse-v2.

{
    "name": "test",
    "description": "test",
    "gateways": [
        {
            "id": "71949725-9c8f-483a-a05f-74d33ff1613e",
            "name": "microGateway-cy8bhr",
            "engine_id": "d68a5ca7-b5b6-4917-a464-0adef94b8067",
            "target_services": [
                {
                    "id": "8177d237-b912-4167-a90d-33c603610d0b",
                    "host": "provider..demo-java-chassis-cse-v2.servicecomb",
                    "name": "provider",
                    "engine_type": "servicecomb",
                    "engine_id": "d68a5ca7-b5b6-4917-a464-0adef94b8067"
                }
            ]
        }
    ]
}

Example Response

{
    "gateways": [
        {
            "id": "71949725-9c8f-483a-a05f-74d33ff1613e",
            "name": "microGateway-cy8bhr",
            "target_services": [
                {
                    "id": "8177d237-b912-4167-a90d-33c603610d0b",
                    "host": "provider..demo-java-chassis-cse-v2.servicecomb",
                    "name": "provider",
                    "engine_id": "d68a5ca7-b5b6-4917-a464-0adef94b8067",
                    "engine_type": "servicecomb"
                }
            ],
            "engine_id": "d68a5ca7-b5b6-4917-a464-0adef94b8067"
        }
    ],
    "id": "ba1ca687-1895-4fc3-88ca-9db02ce2a14e",
    "name": "test",
    "gray_release_type": "WEIGHT",
    "description": "test",
    "project_id": "578ac30b81034b89a7255b3af26db9c9",
    "creator": "test_user",
    "create_time": 1726623793113,
    "update_time": 1726623793113,
    "gateway_engine_ids": [
        "d68a5ca7-b5b6-4917-a464-0adef94b8067"
    ]
}

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.