更新时间:2024-09-30 GMT+08:00
分享

根据泳道组ID获取泳道组信息

功能介绍

此API用于根据泳道组ID获取泳道组信息。

调试

您可以在API Explorer中调试该接口。

URI

GET /v3/{project_id}/cas/swimlane-group/{lane_group_id}

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

租户项目ID。获取方法,请参考获取项目ID

lane_group_id

String

泳道组ID。获取方法,请参考6.4.2-获取所有泳道组

请求消息

表2 请求Header参数

参数

是否必选

参数类型

描述

Content-Type

String

消息体的类型(格式),默认取值为“application/json”。

X-Auth-Token

String

调用接口的认证方式分为Token和AK/SK两种,如果您使用的Token方式,此参数为必填,请填写Token的值。Token获取方式,请参考获取用户Token

响应消息

表3 响应参数

参数

参数类型

描述

description

String

泳道组的描述。

gateways

Array of objects

流量网关入口,请参考表4

gray_release_type

String

灰度发布类型。

  • WEIGHT:基于流量比例进行全链路灰度。
  • CONTENT:基于内容进行全链路灰度。

id

String

泳道组的ID。

name

String

泳道组的名称。

swimlane_count

Integer

泳道组下的泳道数量。

swimlanes

Array of objects

泳道组下的泳道列表,请参考表6

creator

String

创建者。

create_time

String

创建时间。

update_time

String

更新时间

project_id

String

租户项目ID。获取方法,请参考获取项目ID

target_services

Array of objects

目标服务列表。请参考表5

表4 gateways

参数

参数类型

描述

engine_id

String

网关引擎ID。

id

String

网关ID。

name

String

网关名称。

target_services

Array of objects

目标服务列表。请参考表5

表5 target_services

参数

是否必选

参数类型

描述

host

String

目标服务host信息。

host信息由目标服务的接入引擎后的微服务名、微服务所在环境名、微服务所属应用名称已经微服务接入的引擎类型组成,以点号(.)分隔。

例如,unit-controller.testing.test-application.servicecomb。unit-controller为接入引擎的微服务名称,testing为unit-controller微服务所在环境名,test-application为unit-controller微服务所属应用名称,servicecomb表示unit-controller微服务接入的是ServiceComb引擎。

name

String

目标服务名称。

id

String

目标服务ID。

engine_id

String

引擎ID。

engine_type

String

引擎类型。

  • servicecomb:ServiceComb引擎。
  • nacos:注册配置中心。
表6 swimlanes

参数

参数类型

描述

id

String

泳道ID。

name

String

泳道名称。

swimlane_group_id

String

所属的泳道组ID。

type

String

泳道类型。

  • BASE:基线泳道。
  • GRAY:灰度泳道。

tag

String

泳道标签,用于根据标签来控制流量的走向。

route_status

String

泳道路由状态。

  • ENABLE:开启路由。
  • DISABLED:关闭路由。

rule_match_mode

String

路由规则匹配模式,当泳道组灰度类型为基于内容即gray_release_type为CONTENT时生效。

  • ALL:匹配所有的规则。
  • ANY:匹配任一规则。

rules

Array of objects

路由规则,当泳道组灰度类型为基于内容即gray_release_type为CONTENT时生效。请参考表7

weight

Integer

泳道流量权重,范围在0-100之间。

当泳道组灰度类型为基于流量即gray_release_type为WEIGHT时生效。

instances

Array of objects

泳道中纳管的组件列表,请参考表8

instance_count

Integer

泳道中纳管的组件个数。

latest_opt

String

泳道上一步的操作。

  • CLONE:克隆。
  • UPGRADE:升级。
  • ROLLBACK:回滚。
  • CREATE:创建。

release_plan_id

String

泳道上一步操作关联的发布单ID。

project_id

String

项目ID。

create_time

Integer

创建时间。

update_time

Integer

更新时间。

creator

String

创建人。

表7 rules

参数

参数类型

描述

type

String

灰度匹配规则类型。当前只支持HEADER,即基于Header头进行匹配。

key

String

键。

value

String

值。

condition

String

匹配条件。

  • EXACT:精确匹配。
  • PREFIX:前缀匹配。
  • REGEX:正则匹配。
表8 instances

参数

参数类型

描述

id

String

应用组件实例ID。

name

String

应用组件实例名称。

version

String

应用组件版本号。

application_id

String

应用ID。

component_id

String

组件ID。

application_name

String

应用名称。

status

String

实例状态

engine_id

String

组件关联引擎ID。

runtime_stack

Object

运行时,请参考表9

replica

Integer

实例副本数。

表9 runtime_stack

参数

参数类型

描述

name

String

技术栈名称。

type

String

技术栈类型,支持Java、Tomcat、Nodejs、Php、Docker、Python。

当部署模式为虚机部署时,仅支持Java、Tomcat、Nodejs;容器部署上述类型都支持。

version

String

技术栈版本。

deploy_mode

String

部署模式。

  • container,容器部署。
  • virtualmachine,虚机部署。

请求示例

响应示例

{
    "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,
    "swimlanes": [
        {
            "id": "1cd0cb71-5d5d-41a0-8b05-f7ed53400cf7",
            "name": "base",
            "swimlane_group_id": "ba1ca687-1895-4fc3-88ca-9db02ce2a14e",
            "type": "BASE",
            "tag": "base",
            "route_status": "ENABLE",
            "rule_match_mode": null,
            "project_id": "578ac30b81034b89a7255b3af26db9c9",
            "rules": null,
            "creator": "test_user",
            "create_time": 1726626094346,
            "update_time": 1726626094346,
            "instances": [
                {
                    "componentId": "c14f17b7-ac44-4738-8b57-4be7eff7a956",
                    "environmentId": "d1b623d9-3350-4777-8979-5b4b571ca518",
                    "id": "5fd78836-301e-4750-bdc9-be8a9e43b19a",
                    "name": "weater-beta",
                    "version": "2024.0914.17114",
                    "application_id": "69993ce9-e468-3349-acb8-a30b85b17de5",
                    "application_name": "weathermap",
                    "status": "RUNNING",
                    "engine_id": "d68a5ca7-b5b6-4917-a464-0adef94b8067",
                    "runtime_stack": {
                        "id": "656d9392-658f-4c2c-bb4f-3702a1169267",
                        "url": "openjdk-{arch}:8-1.3.8",
                        "type": "Java",
                        "name": "OpenJDK8",
                        "deploy_mode": "container",
                        "app_spec_name": "",
                        "version": "1.3.8",
                        "status": "Supported",
                        "release_note": "Fixed some security issues and bugs.",
                        "spec": {
                            "os": "EulerOS 2.9.8",
                            "sdk": "OpenJDK-8u411",
                            "digest": null
                        },
                        "parameters": null,
                        "system": null
                    },
                    "replica": 1
                }
            ],
            "instance_count": 1,
            "weight": 100,
            "batch_status": null,
            "latest_opt": null,
            "release_plan_id": null
        }
    ],
    "swimlane_count": 1,
    "engine_ids": [
        "d68a5ca7-b5b6-4917-a464-0adef94b8067"
    ]
}

状态码

状态码

描述

200

操作成功

400

错误的请求

404

请求对象不存在

500

内部错误

错误码

错误码格式为:SVCSTG.00100.[Error_ID],例如:SVCSTG.00100400。错误码说明请参考ServiceStage错误码

相关文档