Lattice Hub 文档
HTTP OpenAPI治理

路由

路由规则与 release。

路由规则与 release。

默认 Base URL:http://127.0.0.1:8090。管理面接口需 Authorization(登录返回的 token)。

路由

路由:查询、创建/更新、删除与 releases(发布 / 回滚 / 停灰度)。body 为规则数组;字段以 specification 为准。

GET/naming/v1/routings需要鉴权

查询路由

分页查询路由。

  • Authorizationheader · string必填

    登录返回的 token。

  • idquery · string可选

    按 ID。

  • namequery · string可选

    按名称。

  • namespacequery · string可选

    按命名空间。

  • servicequery · string可选

    按服务。

  • enablequery · bool可选

    是否启用。

  • offsetquery · integer可选

    偏移,默认 0。

  • limitquery · integer可选

    分页大小,常见上限 100。

请求示例
curl -sS 'http://127.0.0.1:8090/naming/v1/routings?limit=20' \
  -H "Authorization: $TOKEN"
响应示例
{
  "code": 200000,
  "info": "execute success",
  "data": [{ "id": "...", "name": "demo", "enable": true }]
}
GET/naming/v1/routings/detail需要鉴权

查询路由详情

按 id 等条件查单条详情。

  • Authorizationheader · string必填

    登录返回的 token。

  • idquery · string可选

    按 ID。

  • namequery · string可选

    按名称。

  • namespacequery · string可选

    按命名空间。

  • servicequery · string可选

    按服务。

  • enablequery · bool可选

    是否启用。

  • offsetquery · integer可选

    偏移,默认 0。

  • limitquery · integer可选

    分页大小,常见上限 100。

请求示例
curl -sS 'http://127.0.0.1:8090/naming/v1/routings/detail?id=<id>' \
  -H "Authorization: $TOKEN"
响应示例
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
POST/naming/v1/routings需要鉴权

创建路由

写接口 body 多为 protobuf 消息数组;下列为单条对象字段(见 specification)。

  • Authorizationheader · string必填

    登录返回的 token。

  • (body)body · RouteRule[]必填

    请求体为 RouteRule 的 JSON 数组:[{...}, ...]。下列字段为数组中单条对象的完整字段(含嵌套)。

  • idbody · string可选

    id

  • namebody · string必填

    route rule name

  • enablebody · bool可选

    Enable this router

  • route_policybody · enum(RoutePolicy)可选

    Router type 枚举:

  • routing_configbody · any可选

    Routing configuration for router(google.protobuf.Any,按策略 unpack)。

    • route_policy=RulePolicybody · CustomRoute可选

      RulePolicy 时 unpack 为 CustomRoute。

      • callerbody · ServiceKey可选

        source source info deprecated_filed only for compatible to the old version server

        • servicebody · string可选

          service service name

        • namespacebody · string可选

          namespace namespace of service

      • calleebody · ServiceKey可选

        destination destinations info deprecated_filed only for compatible to the old version server

        • servicebody · string可选

          service service name

        • namespacebody · string可选

          namespace namespace of service

      • rulesbody · CustomRouteRule[]可选

        rules

        • namebody · string可选

          sub routing rule name

        • argumentsbody · TrafficMatchRule可选

          Master Control Service Example Tag or Request Label Value supports regular matching

          • argumentsbody · SourceMatch[]可选

            arguments

            • typebody · enum(Type)可选

              type 枚举:CUSTOM | METHOD | HEADER | QUERY | CALLER_IP | PATH | COOKIE | CALLER_METADATA | CALLER_SERVICE

            • keybody · string可选

              header key or query key

            • valuebody · MatchString可选

              header value or query value

              • typebody · enum(MatchStringType)可选

                type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

              • valuebody · string可选

                value

              • value_typebody · enum(ValueType)可选

                value_type 枚举:TEXT | PARAMETER

          • random_percentbody · uint32可选

            随机百分比流量匹配, 1-100, 表示百分之几的流量会被匹配到, 默认值为 100

          • matchModebody · enum(TrafficMatchMode)可选

            matchMode 枚举:AND | OR

        • destinationsbody · DestinationGroup[]可选

          destinations

          • servicebody · string可选

            Templated service and namespace

          • namespacebody · string可选

            namespace

          • labelsbody · map<string,MatchString>可选

            labels

            • typebody · enum(MatchStringType)可选

              type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

            • valuebody · string可选

              value

            • value_typebody · enum(ValueType)可选

              value_type 枚举:TEXT | PARAMETER

          • prioritybody · uint32可选

            According to the service name and service instance Metadata Filter the qualified service instance subset Service instance subset can set priority and weight Priority: integer, range [0, 9], the highest priority is 0 Weight: Integer Press priority routing, if there is high priority, low priority will not use If there is a subset of the same priority, then assign by weight Priority and weight can be not set / set up one / set two If the section is set priority, some are not set, it is considered that the priority is not set. If the part is set, some is not set, it is considered that the weight is not set to 0 If you have no weight, you think the weight is the same

          • weightbody · uint32可选

            weight

          • transferbody · string可选

            Forward requests to proxy service

          • isolatebody · bool可选

            Whether to isolate the SET, after isolation, no traffic will be allocated

          • namebody · string可选

            name desition name

    • route_policy=MetadataPolicybody · MetadataRoutingConfig可选

      MetadataPolicy 时 unpack 为 MetadataRoutingConfig。

      • servicebody · string可选

        service

      • namespacebody · string可选

        namespace

      • labelsbody · map<string,string>可选

        labels

      • failoverbody · MetadataFailover可选

        When metadata not found, it will fall back to the

        • failover_rangebody · enum(FailoverRange)可选

          failover_range metadata route bottom type 枚举:ALL | OTHERS | OTHER_KEYS

        • labelsbody · map<string,string>可选

          labels

    • route_policy=NearbyPolicybody · NearbyRoutingConfig可选

      NearbyPolicy 时 unpack 为 NearbyRoutingConfig。

      • servicebody · string可选

        被调服务名,支持*,代表全部服务

      • namespacebody · string可选

        被调命名空间

      • match_levelbody · enum(LocationLevel)可选

        默认就近级别 枚举:UNKNOWN | CAMPUS | ZONE | REGION | ALL

      • max_match_levelbody · enum(LocationLevel)可选

        最大就近级别 枚举:UNKNOWN | CAMPUS | ZONE | REGION | ALL

      • strict_nearbybody · bool可选

        是否强制就近

  • prioritybody · uint32可选

    priority rules priority

  • descriptionbody · string可选

    description simple description rules

  • metadatabody · map<string,string>可选

    metadata

  • namespacebody · string必填

    namespace identifies the environment that owns this rule.

  • codebody · uint32必填

    业务码,成功多为 200000。

  • infobody · string可选

    提示信息。

  • routeRulebody · RouteRule可选

    返回中的 RouteRule 实体字段(批量接口在 responses[] 内)。

    • idbody · string可选

      id

    • namebody · string可选

      route rule name

    • enablebody · bool可选

      Enable this router

    • route_policybody · enum(RoutePolicy)可选

      Router type 枚举:

    • routing_configbody · any可选

      Routing configuration for router(google.protobuf.Any,按策略 unpack)。

      • route_policy=RulePolicybody · CustomRoute可选

        RulePolicy 时 unpack 为 CustomRoute。

        • callerbody · ServiceKey可选

          source source info deprecated_filed only for compatible to the old version server

          • servicebody · string可选

            service service name

          • namespacebody · string可选

            namespace namespace of service

        • calleebody · ServiceKey可选

          destination destinations info deprecated_filed only for compatible to the old version server

          • servicebody · string可选

            service service name

          • namespacebody · string可选

            namespace namespace of service

        • rulesbody · CustomRouteRule[]可选

          rules

          • namebody · string可选

            sub routing rule name

          • argumentsbody · TrafficMatchRule可选

            Master Control Service Example Tag or Request Label Value supports regular matching

            • argumentsbody · SourceMatch[]可选

              arguments

              • typebody · enum(Type)可选

                type 枚举:CUSTOM | METHOD | HEADER | QUERY | CALLER_IP | PATH | COOKIE | CALLER_METADATA | CALLER_SERVICE

              • keybody · string可选

                header key or query key

              • valuebody · MatchString可选

                header value or query value

                • typebody · enum(MatchStringType)可选

                  type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

                • valuebody · string可选

                  value

                • value_typebody · enum(ValueType)可选

                  value_type 枚举:TEXT | PARAMETER

            • random_percentbody · uint32可选

              随机百分比流量匹配, 1-100, 表示百分之几的流量会被匹配到, 默认值为 100

            • matchModebody · enum(TrafficMatchMode)可选

              matchMode 枚举:AND | OR

          • destinationsbody · DestinationGroup[]可选

            destinations

            • servicebody · string可选

              Templated service and namespace

            • namespacebody · string可选

              namespace

            • labelsbody · map<string,MatchString>可选

              labels

              • typebody · enum(MatchStringType)可选

                type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

              • valuebody · string可选

                value

              • value_typebody · enum(ValueType)可选

                value_type 枚举:TEXT | PARAMETER

            • prioritybody · uint32可选

              According to the service name and service instance Metadata Filter the qualified service instance subset Service instance subset can set priority and weight Priority: integer, range [0, 9], the highest priority is 0 Weight: Integer Press priority routing, if there is high priority, low priority will not use If there is a subset of the same priority, then assign by weight Priority and weight can be not set / set up one / set two If the section is set priority, some are not set, it is considered that the priority is not set. If the part is set, some is not set, it is considered that the weight is not set to 0 If you have no weight, you think the weight is the same

            • weightbody · uint32可选

              weight

            • transferbody · string可选

              Forward requests to proxy service

            • isolatebody · bool可选

              Whether to isolate the SET, after isolation, no traffic will be allocated

            • namebody · string可选

              name desition name

      • route_policy=MetadataPolicybody · MetadataRoutingConfig可选

        MetadataPolicy 时 unpack 为 MetadataRoutingConfig。

        • servicebody · string可选

          service

        • namespacebody · string可选

          namespace

        • labelsbody · map<string,string>可选

          labels

        • failoverbody · MetadataFailover可选

          When metadata not found, it will fall back to the

          • failover_rangebody · enum(FailoverRange)可选

            failover_range metadata route bottom type 枚举:ALL | OTHERS | OTHER_KEYS

          • labelsbody · map<string,string>可选

            labels

      • route_policy=NearbyPolicybody · NearbyRoutingConfig可选

        NearbyPolicy 时 unpack 为 NearbyRoutingConfig。

        • servicebody · string可选

          被调服务名,支持*,代表全部服务

        • namespacebody · string可选

          被调命名空间

        • match_levelbody · enum(LocationLevel)可选

          默认就近级别 枚举:UNKNOWN | CAMPUS | ZONE | REGION | ALL

        • max_match_levelbody · enum(LocationLevel)可选

          最大就近级别 枚举:UNKNOWN | CAMPUS | ZONE | REGION | ALL

        • strict_nearbybody · bool可选

          是否强制就近

    • revisionbody · string可选

      revision routing version

    • ctimebody · string可选

      ctime create time of the rules

    • mtimebody · string可选

      mtime modify time of the rules

    • etimebody · string可选

      etime enable time of the rules

    • prioritybody · uint32可选

      priority rules priority

    • descriptionbody · string可选

      description simple description rules

    • metadatabody · map<string,string>可选

      metadata

    • editablebody · bool可选

      操作标志位

    • deleteablebody · bool可选

      deleteable

    • namespacebody · string可选

      namespace identifies the environment that owns this rule.

请求示例
curl -sS -X POST 'http://127.0.0.1:8090/naming/v1/routings' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[{"name":"demo-route","enable":true}]'
响应示例
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
PUT/naming/v1/routings需要鉴权

更新路由

更新规则;body 为数组。

  • Authorizationheader · string必填

    登录返回的 token。

  • (body)body · RouteRule[]必填

    请求体为 RouteRule 的 JSON 数组:[{...}, ...]。下列字段为数组中单条对象的完整字段(含嵌套)。

  • idbody · string可选

    id

  • namebody · string可选

    route rule name

  • enablebody · bool可选

    Enable this router

  • route_policybody · enum(RoutePolicy)可选

    Router type 枚举:

  • routing_configbody · any可选

    Routing configuration for router(google.protobuf.Any,按策略 unpack)。

    • route_policy=RulePolicybody · CustomRoute可选

      RulePolicy 时 unpack 为 CustomRoute。

      • callerbody · ServiceKey可选

        source source info deprecated_filed only for compatible to the old version server

        • servicebody · string可选

          service service name

        • namespacebody · string可选

          namespace namespace of service

      • calleebody · ServiceKey可选

        destination destinations info deprecated_filed only for compatible to the old version server

        • servicebody · string可选

          service service name

        • namespacebody · string可选

          namespace namespace of service

      • rulesbody · CustomRouteRule[]可选

        rules

        • namebody · string可选

          sub routing rule name

        • argumentsbody · TrafficMatchRule可选

          Master Control Service Example Tag or Request Label Value supports regular matching

          • argumentsbody · SourceMatch[]可选

            arguments

            • typebody · enum(Type)可选

              type 枚举:CUSTOM | METHOD | HEADER | QUERY | CALLER_IP | PATH | COOKIE | CALLER_METADATA | CALLER_SERVICE

            • keybody · string可选

              header key or query key

            • valuebody · MatchString可选

              header value or query value

              • typebody · enum(MatchStringType)可选

                type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

              • valuebody · string可选

                value

              • value_typebody · enum(ValueType)可选

                value_type 枚举:TEXT | PARAMETER

          • random_percentbody · uint32可选

            随机百分比流量匹配, 1-100, 表示百分之几的流量会被匹配到, 默认值为 100

          • matchModebody · enum(TrafficMatchMode)可选

            matchMode 枚举:AND | OR

        • destinationsbody · DestinationGroup[]可选

          destinations

          • servicebody · string可选

            Templated service and namespace

          • namespacebody · string可选

            namespace

          • labelsbody · map<string,MatchString>可选

            labels

            • typebody · enum(MatchStringType)可选

              type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

            • valuebody · string可选

              value

            • value_typebody · enum(ValueType)可选

              value_type 枚举:TEXT | PARAMETER

          • prioritybody · uint32可选

            According to the service name and service instance Metadata Filter the qualified service instance subset Service instance subset can set priority and weight Priority: integer, range [0, 9], the highest priority is 0 Weight: Integer Press priority routing, if there is high priority, low priority will not use If there is a subset of the same priority, then assign by weight Priority and weight can be not set / set up one / set two If the section is set priority, some are not set, it is considered that the priority is not set. If the part is set, some is not set, it is considered that the weight is not set to 0 If you have no weight, you think the weight is the same

          • weightbody · uint32可选

            weight

          • transferbody · string可选

            Forward requests to proxy service

          • isolatebody · bool可选

            Whether to isolate the SET, after isolation, no traffic will be allocated

          • namebody · string可选

            name desition name

    • route_policy=MetadataPolicybody · MetadataRoutingConfig可选

      MetadataPolicy 时 unpack 为 MetadataRoutingConfig。

      • servicebody · string可选

        service

      • namespacebody · string可选

        namespace

      • labelsbody · map<string,string>可选

        labels

      • failoverbody · MetadataFailover可选

        When metadata not found, it will fall back to the

        • failover_rangebody · enum(FailoverRange)可选

          failover_range metadata route bottom type 枚举:ALL | OTHERS | OTHER_KEYS

        • labelsbody · map<string,string>可选

          labels

    • route_policy=NearbyPolicybody · NearbyRoutingConfig可选

      NearbyPolicy 时 unpack 为 NearbyRoutingConfig。

      • servicebody · string可选

        被调服务名,支持*,代表全部服务

      • namespacebody · string可选

        被调命名空间

      • match_levelbody · enum(LocationLevel)可选

        默认就近级别 枚举:UNKNOWN | CAMPUS | ZONE | REGION | ALL

      • max_match_levelbody · enum(LocationLevel)可选

        最大就近级别 枚举:UNKNOWN | CAMPUS | ZONE | REGION | ALL

      • strict_nearbybody · bool可选

        是否强制就近

  • prioritybody · uint32可选

    priority rules priority

  • descriptionbody · string可选

    description simple description rules

  • metadatabody · map<string,string>可选

    metadata

  • namespacebody · string可选

    namespace identifies the environment that owns this rule.

  • codebody · uint32必填

    业务码,成功多为 200000。

  • infobody · string可选

    提示信息。

  • routeRulebody · RouteRule可选

    返回中的 RouteRule 实体字段(批量接口在 responses[] 内)。

    • idbody · string可选

      id

    • namebody · string可选

      route rule name

    • enablebody · bool可选

      Enable this router

    • route_policybody · enum(RoutePolicy)可选

      Router type 枚举:

    • routing_configbody · any可选

      Routing configuration for router(google.protobuf.Any,按策略 unpack)。

      • route_policy=RulePolicybody · CustomRoute可选

        RulePolicy 时 unpack 为 CustomRoute。

        • callerbody · ServiceKey可选

          source source info deprecated_filed only for compatible to the old version server

          • servicebody · string可选

            service service name

          • namespacebody · string可选

            namespace namespace of service

        • calleebody · ServiceKey可选

          destination destinations info deprecated_filed only for compatible to the old version server

          • servicebody · string可选

            service service name

          • namespacebody · string可选

            namespace namespace of service

        • rulesbody · CustomRouteRule[]可选

          rules

          • namebody · string可选

            sub routing rule name

          • argumentsbody · TrafficMatchRule可选

            Master Control Service Example Tag or Request Label Value supports regular matching

            • argumentsbody · SourceMatch[]可选

              arguments

              • typebody · enum(Type)可选

                type 枚举:CUSTOM | METHOD | HEADER | QUERY | CALLER_IP | PATH | COOKIE | CALLER_METADATA | CALLER_SERVICE

              • keybody · string可选

                header key or query key

              • valuebody · MatchString可选

                header value or query value

                • typebody · enum(MatchStringType)可选

                  type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

                • valuebody · string可选

                  value

                • value_typebody · enum(ValueType)可选

                  value_type 枚举:TEXT | PARAMETER

            • random_percentbody · uint32可选

              随机百分比流量匹配, 1-100, 表示百分之几的流量会被匹配到, 默认值为 100

            • matchModebody · enum(TrafficMatchMode)可选

              matchMode 枚举:AND | OR

          • destinationsbody · DestinationGroup[]可选

            destinations

            • servicebody · string可选

              Templated service and namespace

            • namespacebody · string可选

              namespace

            • labelsbody · map<string,MatchString>可选

              labels

              • typebody · enum(MatchStringType)可选

                type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

              • valuebody · string可选

                value

              • value_typebody · enum(ValueType)可选

                value_type 枚举:TEXT | PARAMETER

            • prioritybody · uint32可选

              According to the service name and service instance Metadata Filter the qualified service instance subset Service instance subset can set priority and weight Priority: integer, range [0, 9], the highest priority is 0 Weight: Integer Press priority routing, if there is high priority, low priority will not use If there is a subset of the same priority, then assign by weight Priority and weight can be not set / set up one / set two If the section is set priority, some are not set, it is considered that the priority is not set. If the part is set, some is not set, it is considered that the weight is not set to 0 If you have no weight, you think the weight is the same

            • weightbody · uint32可选

              weight

            • transferbody · string可选

              Forward requests to proxy service

            • isolatebody · bool可选

              Whether to isolate the SET, after isolation, no traffic will be allocated

            • namebody · string可选

              name desition name

      • route_policy=MetadataPolicybody · MetadataRoutingConfig可选

        MetadataPolicy 时 unpack 为 MetadataRoutingConfig。

        • servicebody · string可选

          service

        • namespacebody · string可选

          namespace

        • labelsbody · map<string,string>可选

          labels

        • failoverbody · MetadataFailover可选

          When metadata not found, it will fall back to the

          • failover_rangebody · enum(FailoverRange)可选

            failover_range metadata route bottom type 枚举:ALL | OTHERS | OTHER_KEYS

          • labelsbody · map<string,string>可选

            labels

      • route_policy=NearbyPolicybody · NearbyRoutingConfig可选

        NearbyPolicy 时 unpack 为 NearbyRoutingConfig。

        • servicebody · string可选

          被调服务名,支持*,代表全部服务

        • namespacebody · string可选

          被调命名空间

        • match_levelbody · enum(LocationLevel)可选

          默认就近级别 枚举:UNKNOWN | CAMPUS | ZONE | REGION | ALL

        • max_match_levelbody · enum(LocationLevel)可选

          最大就近级别 枚举:UNKNOWN | CAMPUS | ZONE | REGION | ALL

        • strict_nearbybody · bool可选

          是否强制就近

    • revisionbody · string可选

      revision routing version

    • ctimebody · string可选

      ctime create time of the rules

    • mtimebody · string可选

      mtime modify time of the rules

    • etimebody · string可选

      etime enable time of the rules

    • prioritybody · uint32可选

      priority rules priority

    • descriptionbody · string可选

      description simple description rules

    • metadatabody · map<string,string>可选

      metadata

    • editablebody · bool可选

      操作标志位

    • deleteablebody · bool可选

      deleteable

    • namespacebody · string可选

      namespace identifies the environment that owns this rule.

请求示例
curl -sS -X PUT 'http://127.0.0.1:8090/naming/v1/routings' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[{"name":"demo-route","enable":true}]'
响应示例
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
POST/naming/v1/routings/delete需要鉴权

删除路由

删除规则;body 为含 id 的数组。

  • Authorizationheader · string必填

    登录返回的 token。

  • (body)body · RouteRule[]必填

    请求体为 RouteRule 的 JSON 数组:[{...}, ...]。下列字段为数组中单条对象的完整字段(含嵌套)。

  • idbody · string可选

    id

  • namebody · string可选

    route rule name

  • enablebody · bool可选

    Enable this router

  • route_policybody · enum(RoutePolicy)可选

    Router type 枚举:

  • routing_configbody · any可选

    Routing configuration for router(google.protobuf.Any,按策略 unpack)。

    • route_policy=RulePolicybody · CustomRoute可选

      RulePolicy 时 unpack 为 CustomRoute。

      • callerbody · ServiceKey可选

        source source info deprecated_filed only for compatible to the old version server

        • servicebody · string可选

          service service name

        • namespacebody · string可选

          namespace namespace of service

      • calleebody · ServiceKey可选

        destination destinations info deprecated_filed only for compatible to the old version server

        • servicebody · string可选

          service service name

        • namespacebody · string可选

          namespace namespace of service

      • rulesbody · CustomRouteRule[]可选

        rules

        • namebody · string可选

          sub routing rule name

        • argumentsbody · TrafficMatchRule可选

          Master Control Service Example Tag or Request Label Value supports regular matching

          • argumentsbody · SourceMatch[]可选

            arguments

            • typebody · enum(Type)可选

              type 枚举:CUSTOM | METHOD | HEADER | QUERY | CALLER_IP | PATH | COOKIE | CALLER_METADATA | CALLER_SERVICE

            • keybody · string可选

              header key or query key

            • valuebody · MatchString可选

              header value or query value

              • typebody · enum(MatchStringType)可选

                type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

              • valuebody · string可选

                value

              • value_typebody · enum(ValueType)可选

                value_type 枚举:TEXT | PARAMETER

          • random_percentbody · uint32可选

            随机百分比流量匹配, 1-100, 表示百分之几的流量会被匹配到, 默认值为 100

          • matchModebody · enum(TrafficMatchMode)可选

            matchMode 枚举:AND | OR

        • destinationsbody · DestinationGroup[]可选

          destinations

          • servicebody · string可选

            Templated service and namespace

          • namespacebody · string可选

            namespace

          • labelsbody · map<string,MatchString>可选

            labels

            • typebody · enum(MatchStringType)可选

              type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

            • valuebody · string可选

              value

            • value_typebody · enum(ValueType)可选

              value_type 枚举:TEXT | PARAMETER

          • prioritybody · uint32可选

            According to the service name and service instance Metadata Filter the qualified service instance subset Service instance subset can set priority and weight Priority: integer, range [0, 9], the highest priority is 0 Weight: Integer Press priority routing, if there is high priority, low priority will not use If there is a subset of the same priority, then assign by weight Priority and weight can be not set / set up one / set two If the section is set priority, some are not set, it is considered that the priority is not set. If the part is set, some is not set, it is considered that the weight is not set to 0 If you have no weight, you think the weight is the same

          • weightbody · uint32可选

            weight

          • transferbody · string可选

            Forward requests to proxy service

          • isolatebody · bool可选

            Whether to isolate the SET, after isolation, no traffic will be allocated

          • namebody · string可选

            name desition name

    • route_policy=MetadataPolicybody · MetadataRoutingConfig可选

      MetadataPolicy 时 unpack 为 MetadataRoutingConfig。

      • servicebody · string可选

        service

      • namespacebody · string可选

        namespace

      • labelsbody · map<string,string>可选

        labels

      • failoverbody · MetadataFailover可选

        When metadata not found, it will fall back to the

        • failover_rangebody · enum(FailoverRange)可选

          failover_range metadata route bottom type 枚举:ALL | OTHERS | OTHER_KEYS

        • labelsbody · map<string,string>可选

          labels

    • route_policy=NearbyPolicybody · NearbyRoutingConfig可选

      NearbyPolicy 时 unpack 为 NearbyRoutingConfig。

      • servicebody · string可选

        被调服务名,支持*,代表全部服务

      • namespacebody · string可选

        被调命名空间

      • match_levelbody · enum(LocationLevel)可选

        默认就近级别 枚举:UNKNOWN | CAMPUS | ZONE | REGION | ALL

      • max_match_levelbody · enum(LocationLevel)可选

        最大就近级别 枚举:UNKNOWN | CAMPUS | ZONE | REGION | ALL

      • strict_nearbybody · bool可选

        是否强制就近

  • prioritybody · uint32可选

    priority rules priority

  • descriptionbody · string可选

    description simple description rules

  • metadatabody · map<string,string>可选

    metadata

  • namespacebody · string可选

    namespace identifies the environment that owns this rule.

  • codebody · uint32必填

    业务码,成功多为 200000。

  • infobody · string可选

    提示信息。

  • routeRulebody · RouteRule可选

    返回中的 RouteRule 实体字段(批量接口在 responses[] 内)。

    • idbody · string可选

      id

    • namebody · string可选

      route rule name

    • enablebody · bool可选

      Enable this router

    • route_policybody · enum(RoutePolicy)可选

      Router type 枚举:

    • routing_configbody · any可选

      Routing configuration for router(google.protobuf.Any,按策略 unpack)。

      • route_policy=RulePolicybody · CustomRoute可选

        RulePolicy 时 unpack 为 CustomRoute。

        • callerbody · ServiceKey可选

          source source info deprecated_filed only for compatible to the old version server

          • servicebody · string可选

            service service name

          • namespacebody · string可选

            namespace namespace of service

        • calleebody · ServiceKey可选

          destination destinations info deprecated_filed only for compatible to the old version server

          • servicebody · string可选

            service service name

          • namespacebody · string可选

            namespace namespace of service

        • rulesbody · CustomRouteRule[]可选

          rules

          • namebody · string可选

            sub routing rule name

          • argumentsbody · TrafficMatchRule可选

            Master Control Service Example Tag or Request Label Value supports regular matching

            • argumentsbody · SourceMatch[]可选

              arguments

              • typebody · enum(Type)可选

                type 枚举:CUSTOM | METHOD | HEADER | QUERY | CALLER_IP | PATH | COOKIE | CALLER_METADATA | CALLER_SERVICE

              • keybody · string可选

                header key or query key

              • valuebody · MatchString可选

                header value or query value

                • typebody · enum(MatchStringType)可选

                  type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

                • valuebody · string可选

                  value

                • value_typebody · enum(ValueType)可选

                  value_type 枚举:TEXT | PARAMETER

            • random_percentbody · uint32可选

              随机百分比流量匹配, 1-100, 表示百分之几的流量会被匹配到, 默认值为 100

            • matchModebody · enum(TrafficMatchMode)可选

              matchMode 枚举:AND | OR

          • destinationsbody · DestinationGroup[]可选

            destinations

            • servicebody · string可选

              Templated service and namespace

            • namespacebody · string可选

              namespace

            • labelsbody · map<string,MatchString>可选

              labels

              • typebody · enum(MatchStringType)可选

                type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

              • valuebody · string可选

                value

              • value_typebody · enum(ValueType)可选

                value_type 枚举:TEXT | PARAMETER

            • prioritybody · uint32可选

              According to the service name and service instance Metadata Filter the qualified service instance subset Service instance subset can set priority and weight Priority: integer, range [0, 9], the highest priority is 0 Weight: Integer Press priority routing, if there is high priority, low priority will not use If there is a subset of the same priority, then assign by weight Priority and weight can be not set / set up one / set two If the section is set priority, some are not set, it is considered that the priority is not set. If the part is set, some is not set, it is considered that the weight is not set to 0 If you have no weight, you think the weight is the same

            • weightbody · uint32可选

              weight

            • transferbody · string可选

              Forward requests to proxy service

            • isolatebody · bool可选

              Whether to isolate the SET, after isolation, no traffic will be allocated

            • namebody · string可选

              name desition name

      • route_policy=MetadataPolicybody · MetadataRoutingConfig可选

        MetadataPolicy 时 unpack 为 MetadataRoutingConfig。

        • servicebody · string可选

          service

        • namespacebody · string可选

          namespace

        • labelsbody · map<string,string>可选

          labels

        • failoverbody · MetadataFailover可选

          When metadata not found, it will fall back to the

          • failover_rangebody · enum(FailoverRange)可选

            failover_range metadata route bottom type 枚举:ALL | OTHERS | OTHER_KEYS

          • labelsbody · map<string,string>可选

            labels

      • route_policy=NearbyPolicybody · NearbyRoutingConfig可选

        NearbyPolicy 时 unpack 为 NearbyRoutingConfig。

        • servicebody · string可选

          被调服务名,支持*,代表全部服务

        • namespacebody · string可选

          被调命名空间

        • match_levelbody · enum(LocationLevel)可选

          默认就近级别 枚举:UNKNOWN | CAMPUS | ZONE | REGION | ALL

        • max_match_levelbody · enum(LocationLevel)可选

          最大就近级别 枚举:UNKNOWN | CAMPUS | ZONE | REGION | ALL

        • strict_nearbybody · bool可选

          是否强制就近

    • revisionbody · string可选

      revision routing version

    • ctimebody · string可选

      ctime create time of the rules

    • mtimebody · string可选

      mtime modify time of the rules

    • etimebody · string可选

      etime enable time of the rules

    • prioritybody · uint32可选

      priority rules priority

    • descriptionbody · string可选

      description simple description rules

    • metadatabody · map<string,string>可选

      metadata

    • editablebody · bool可选

      操作标志位

    • deleteablebody · bool可选

      deleteable

    • namespacebody · string可选

      namespace identifies the environment that owns this rule.

请求示例
curl -sS -X POST 'http://127.0.0.1:8090/naming/v1/routings/delete' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[{"id":"<rule-id>"}]'
响应示例
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
POST/naming/v1/routings/releases需要鉴权

发布路由

发布 release,使客户端读到 active 视图。

  • Authorizationheader · string必填

    登录返回的 token。

  • (body)body · RuleRelease[]必填

    请求体为 RuleRelease 的 JSON 数组:[{...}, ...]。下列字段为数组中单条对象的完整字段(含嵌套)。

  • idbody · string可选

    id

  • rule_idbody · string可选

    rule_id

  • rule_namebody · string可选

    rule_name

  • release_namebody · string可选

    release_name

  • descriptionbody · string可选

    description

  • release_typebody · string可选

    release_type

  • client_labelsbody · ClientLabel[]可选

    client_labels

    • keybody · string可选

      key

    • valuebody · MatchString可选

      value

      • typebody · enum(MatchStringType)可选

        type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

      • valuebody · string可选

        value

      • value_typebody · enum(ValueType)可选

        value_type 枚举:TEXT | PARAMETER

  • versionbody · uint64可选

    version

  • resourcebody · enum(RuleType)可选

    resource 枚举:

  • codebody · uint32必填

    业务码,成功多为 200000。

  • infobody · string可选

    提示信息。

  • ruleReleasebody · RuleRelease可选

    返回中的 RuleRelease 实体字段(批量接口在 responses[] 内)。

    • idbody · string可选

      id

    • rule_idbody · string可选

      rule_id

    • rule_namebody · string可选

      rule_name

    • release_namebody · string可选

      release_name

    • descriptionbody · string可选

      description

    • release_typebody · string可选

      release_type

    • client_labelsbody · ClientLabel[]可选

      client_labels

      • keybody · string可选

        key

      • valuebody · MatchString可选

        value

        • typebody · enum(MatchStringType)可选

          type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

        • valuebody · string可选

          value

        • value_typebody · enum(ValueType)可选

          value_type 枚举:TEXT | PARAMETER

    • versionbody · uint64可选

      version

    • resourcebody · enum(RuleType)可选

      resource 枚举:

    • activebody · bool可选

      active

    • ctimebody · string可选

      ctime

    • mtimebody · string可选

      mtime

请求示例
curl -sS -X POST 'http://127.0.0.1:8090/naming/v1/routings/releases' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[{"id":"<rule-id>","release_type":"normal"}]'
响应示例
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
GET/naming/v1/routings/releases需要鉴权

查询路由发布

查询已发布版本。

  • Authorizationheader · string必填

    登录返回的 token。

  • idquery · string可选

    规则 ID。

  • limitquery · integer可选

    分页大小。

请求示例
curl -sS 'http://127.0.0.1:8090/naming/v1/routings/releases?limit=20' \
  -H "Authorization: $TOKEN"
响应示例
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
PUT/naming/v1/routings/releases/rollback需要鉴权

回滚路由

回滚到指定 release。

  • Authorizationheader · string必填

    登录返回的 token。

  • (body)body · RuleRelease[]必填

    请求体为 RuleRelease 的 JSON 数组:[{...}, ...]。下列字段为数组中单条对象的完整字段(含嵌套)。

  • idbody · string可选

    id

  • rule_idbody · string可选

    rule_id

  • rule_namebody · string可选

    rule_name

  • release_namebody · string可选

    release_name

  • descriptionbody · string可选

    description

  • release_typebody · string可选

    release_type

  • client_labelsbody · ClientLabel[]可选

    client_labels

    • keybody · string可选

      key

    • valuebody · MatchString可选

      value

      • typebody · enum(MatchStringType)可选

        type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

      • valuebody · string可选

        value

      • value_typebody · enum(ValueType)可选

        value_type 枚举:TEXT | PARAMETER

  • versionbody · uint64可选

    version

  • resourcebody · enum(RuleType)可选

    resource 枚举:

  • codebody · uint32必填

    业务码,成功多为 200000。

  • infobody · string可选

    提示信息。

  • ruleReleasebody · RuleRelease可选

    返回中的 RuleRelease 实体字段(批量接口在 responses[] 内)。

    • idbody · string可选

      id

    • rule_idbody · string可选

      rule_id

    • rule_namebody · string可选

      rule_name

    • release_namebody · string可选

      release_name

    • descriptionbody · string可选

      description

    • release_typebody · string可选

      release_type

    • client_labelsbody · ClientLabel[]可选

      client_labels

      • keybody · string可选

        key

      • valuebody · MatchString可选

        value

        • typebody · enum(MatchStringType)可选

          type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

        • valuebody · string可选

          value

        • value_typebody · enum(ValueType)可选

          value_type 枚举:TEXT | PARAMETER

    • versionbody · uint64可选

      version

    • resourcebody · enum(RuleType)可选

      resource 枚举:

    • activebody · bool可选

      active

    • ctimebody · string可选

      ctime

    • mtimebody · string可选

      mtime

请求示例
curl -sS -X PUT 'http://127.0.0.1:8090/naming/v1/routings/releases/rollback' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[{"id":"<rule-id>"}]'
响应示例
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
PUT/naming/v1/routings/releases/stopbeta需要鉴权

停止路由灰度

停止灰度 release。

  • Authorizationheader · string必填

    登录返回的 token。

  • (body)body · RuleRelease[]必填

    请求体为 RuleRelease 的 JSON 数组:[{...}, ...]。下列字段为数组中单条对象的完整字段(含嵌套)。

  • idbody · string可选

    id

  • rule_idbody · string可选

    rule_id

  • rule_namebody · string可选

    rule_name

  • release_namebody · string可选

    release_name

  • descriptionbody · string可选

    description

  • release_typebody · string可选

    release_type

  • client_labelsbody · ClientLabel[]可选

    client_labels

    • keybody · string可选

      key

    • valuebody · MatchString可选

      value

      • typebody · enum(MatchStringType)可选

        type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

      • valuebody · string可选

        value

      • value_typebody · enum(ValueType)可选

        value_type 枚举:TEXT | PARAMETER

  • versionbody · uint64可选

    version

  • resourcebody · enum(RuleType)可选

    resource 枚举:

  • codebody · uint32必填

    业务码,成功多为 200000。

  • infobody · string可选

    提示信息。

  • ruleReleasebody · RuleRelease可选

    返回中的 RuleRelease 实体字段(批量接口在 responses[] 内)。

    • idbody · string可选

      id

    • rule_idbody · string可选

      rule_id

    • rule_namebody · string可选

      rule_name

    • release_namebody · string可选

      release_name

    • descriptionbody · string可选

      description

    • release_typebody · string可选

      release_type

    • client_labelsbody · ClientLabel[]可选

      client_labels

      • keybody · string可选

        key

      • valuebody · MatchString可选

        value

        • typebody · enum(MatchStringType)可选

          type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

        • valuebody · string可选

          value

        • value_typebody · enum(ValueType)可选

          value_type 枚举:TEXT | PARAMETER

    • versionbody · uint64可选

      version

    • resourcebody · enum(RuleType)可选

      resource 枚举:

    • activebody · bool可选

      active

    • ctimebody · string可选

      ctime

    • mtimebody · string可选

      mtime

请求示例
curl -sS -X PUT 'http://127.0.0.1:8090/naming/v1/routings/releases/stopbeta' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[{"id":"<rule-id>"}]'
响应示例
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
POST/naming/v1/routings/releases/delete需要鉴权

删除发布

删除发布。

  • Authorizationheader · string必填

    登录返回的 token。

  • (body)body · RuleRelease[]必填

    请求体为 RuleRelease 的 JSON 数组;下列为单条字段。

  • idbody · string可选

    id

  • rule_idbody · string可选

    rule_id

  • rule_namebody · string可选

    rule_name

  • release_namebody · string可选

    release_name

  • descriptionbody · string可选

    description

  • release_typebody · string可选

    release_type

  • client_labelsbody · ClientLabel[]可选

    client_labels

    • keybody · string可选

      key

    • valuebody · MatchString可选

      value

      • typebody · enum(MatchStringType)可选

        type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

      • valuebody · string可选

        value

      • value_typebody · enum(ValueType)可选

        value_type 枚举:TEXT | PARAMETER

  • versionbody · uint64可选

    version

  • resourcebody · enum(RuleType)可选

    resource 枚举:

  • codebody · uint32必填

    业务码。

  • infobody · string可选

    提示信息。

  • RuleReleasebody · RuleRelease可选

    实体字段。

    • idbody · string可选

      id

    • rule_idbody · string可选

      rule_id

    • rule_namebody · string可选

      rule_name

    • release_namebody · string可选

      release_name

    • descriptionbody · string可选

      description

    • release_typebody · string可选

      release_type

    • client_labelsbody · ClientLabel[]可选

      client_labels

      • keybody · string可选

        key

      • valuebody · MatchString可选

        value

        • typebody · enum(MatchStringType)可选

          type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

        • valuebody · string可选

          value

        • value_typebody · enum(ValueType)可选

          value_type 枚举:TEXT | PARAMETER

    • versionbody · uint64可选

      version

    • resourcebody · enum(RuleType)可选

      resource 枚举:

    • activebody · bool可选

      active

    • ctimebody · string可选

      ctime

    • mtimebody · string可选

      mtime

请求示例
curl -sS -X POST 'http://127.0.0.1:8090/naming/v1/routings/releases/delete' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[]'
响应示例
{
  "code": 200000,
  "info": "execute success"
}

On this page