Lattice Hub Docs
HTTP OpenAPIGovernance

Routing

Route rules and releases.

Route rules and releases.

Default Base URL: http://127.0.0.1:8090. Management APIs require Authorization (token from login).

Routing

Routing: list, create/update, delete, and releases (publish / rollback / stopbeta). Bodies are rule arrays; fields follow specification.

GET/naming/v1/routingsAuth required

List routing

Paginated routing list.

  • Authorizationheader · stringrequired

    Token from login.

  • idquery · stringoptional

    Filter by ID.

  • namequery · stringoptional

    Filter by name.

  • namespacequery · stringoptional

    Filter by namespace.

  • servicequery · stringoptional

    Filter by service.

  • enablequery · booloptional

    Enabled filter.

  • offsetquery · integeroptional

    Offset, default 0.

  • limitquery · integeroptional

    Page size, often max 100.

Request
curl -sS 'http://127.0.0.1:8090/naming/v1/routings?limit=20' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success",
  "data": [{ "id": "...", "name": "demo", "enable": true }]
}
GET/naming/v1/routings/detailAuth required

Get routing detail

Fetch one rule by id / filters.

  • Authorizationheader · stringrequired

    Token from login.

  • idquery · stringoptional

    Filter by ID.

  • namequery · stringoptional

    Filter by name.

  • namespacequery · stringoptional

    Filter by namespace.

  • servicequery · stringoptional

    Filter by service.

  • enablequery · booloptional

    Enabled filter.

  • offsetquery · integeroptional

    Offset, default 0.

  • limitquery · integeroptional

    Page size, often max 100.

Request
curl -sS 'http://127.0.0.1:8090/naming/v1/routings/detail?id=<id>' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
POST/naming/v1/routingsAuth required

Create routing

Write bodies are usually protobuf message arrays; fields below are per-object (see specification).

  • Authorizationheader · stringrequired

    Token from login.

  • (body)body · RouteRule[]required

    Request body is a JSON array of RouteRule: [{...}, ...]. Fields below are the full per-item schema (including nested).

  • idbody · stringoptional

    id

  • namebody · stringrequired

    route rule name

  • enablebody · booloptional

    Enable this router

  • route_policybody · enum(RoutePolicy)optional

    Router type enum:

  • routing_configbody · anyoptional

    Routing configuration for router (google.protobuf.Any; unpack by policy).

    • route_policy=RulePolicybody · CustomRouteoptional

      When route_policy=RulePolicy, unpack as CustomRoute.

      • callerbody · ServiceKeyoptional

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

        • servicebody · stringoptional

          service service name

        • namespacebody · stringoptional

          namespace namespace of service

      • calleebody · ServiceKeyoptional

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

        • servicebody · stringoptional

          service service name

        • namespacebody · stringoptional

          namespace namespace of service

      • rulesbody · CustomRouteRule[]optional

        rules

        • namebody · stringoptional

          sub routing rule name

        • argumentsbody · TrafficMatchRuleoptional

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

          • argumentsbody · SourceMatch[]optional

            arguments

            • typebody · enum(Type)optional

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

            • keybody · stringoptional

              header key or query key

            • valuebody · MatchStringoptional

              header value or query value

              • typebody · enum(MatchStringType)optional

                type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

              • valuebody · stringoptional

                value

              • value_typebody · enum(ValueType)optional

                value_type enum: TEXT | PARAMETER

          • random_percentbody · uint32optional

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

          • matchModebody · enum(TrafficMatchMode)optional

            matchMode enum: AND | OR

        • destinationsbody · DestinationGroup[]optional

          destinations

          • servicebody · stringoptional

            Templated service and namespace

          • namespacebody · stringoptional

            namespace

          • labelsbody · map<string,MatchString>optional

            labels

            • typebody · enum(MatchStringType)optional

              type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

            • valuebody · stringoptional

              value

            • value_typebody · enum(ValueType)optional

              value_type enum: TEXT | PARAMETER

          • prioritybody · uint32optional

            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 · uint32optional

            weight

          • transferbody · stringoptional

            Forward requests to proxy service

          • isolatebody · booloptional

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

          • namebody · stringoptional

            name desition name

    • route_policy=MetadataPolicybody · MetadataRoutingConfigoptional

      When route_policy=MetadataPolicy, unpack as MetadataRoutingConfig.

      • servicebody · stringoptional

        service

      • namespacebody · stringoptional

        namespace

      • labelsbody · map<string,string>optional

        labels

      • failoverbody · MetadataFailoveroptional

        When metadata not found, it will fall back to the

        • failover_rangebody · enum(FailoverRange)optional

          failover_range metadata route bottom type enum: ALL | OTHERS | OTHER_KEYS

        • labelsbody · map<string,string>optional

          labels

    • route_policy=NearbyPolicybody · NearbyRoutingConfigoptional

      When route_policy=NearbyPolicy, unpack as NearbyRoutingConfig.

      • servicebody · stringoptional

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

      • namespacebody · stringoptional

        被调命名空间

      • match_levelbody · enum(LocationLevel)optional

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

      • max_match_levelbody · enum(LocationLevel)optional

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

      • strict_nearbybody · booloptional

        是否强制就近

  • prioritybody · uint32optional

    priority rules priority

  • descriptionbody · stringoptional

    description simple description rules

  • metadatabody · map<string,string>optional

    metadata

  • namespacebody · stringrequired

    namespace identifies the environment that owns this rule.

  • codebody · uint32required

    Business code; success is usually 200000.

  • infobody · stringoptional

    Info message.

  • routeRulebody · RouteRuleoptional

    RouteRule entity fields (batch APIs nest under responses[]).

    • idbody · stringoptional

      id

    • namebody · stringoptional

      route rule name

    • enablebody · booloptional

      Enable this router

    • route_policybody · enum(RoutePolicy)optional

      Router type enum:

    • routing_configbody · anyoptional

      Routing configuration for router (google.protobuf.Any; unpack by policy).

      • route_policy=RulePolicybody · CustomRouteoptional

        When route_policy=RulePolicy, unpack as CustomRoute.

        • callerbody · ServiceKeyoptional

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

          • servicebody · stringoptional

            service service name

          • namespacebody · stringoptional

            namespace namespace of service

        • calleebody · ServiceKeyoptional

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

          • servicebody · stringoptional

            service service name

          • namespacebody · stringoptional

            namespace namespace of service

        • rulesbody · CustomRouteRule[]optional

          rules

          • namebody · stringoptional

            sub routing rule name

          • argumentsbody · TrafficMatchRuleoptional

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

            • argumentsbody · SourceMatch[]optional

              arguments

              • typebody · enum(Type)optional

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

              • keybody · stringoptional

                header key or query key

              • valuebody · MatchStringoptional

                header value or query value

                • typebody · enum(MatchStringType)optional

                  type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

                • valuebody · stringoptional

                  value

                • value_typebody · enum(ValueType)optional

                  value_type enum: TEXT | PARAMETER

            • random_percentbody · uint32optional

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

            • matchModebody · enum(TrafficMatchMode)optional

              matchMode enum: AND | OR

          • destinationsbody · DestinationGroup[]optional

            destinations

            • servicebody · stringoptional

              Templated service and namespace

            • namespacebody · stringoptional

              namespace

            • labelsbody · map<string,MatchString>optional

              labels

              • typebody · enum(MatchStringType)optional

                type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

              • valuebody · stringoptional

                value

              • value_typebody · enum(ValueType)optional

                value_type enum: TEXT | PARAMETER

            • prioritybody · uint32optional

              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 · uint32optional

              weight

            • transferbody · stringoptional

              Forward requests to proxy service

            • isolatebody · booloptional

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

            • namebody · stringoptional

              name desition name

      • route_policy=MetadataPolicybody · MetadataRoutingConfigoptional

        When route_policy=MetadataPolicy, unpack as MetadataRoutingConfig.

        • servicebody · stringoptional

          service

        • namespacebody · stringoptional

          namespace

        • labelsbody · map<string,string>optional

          labels

        • failoverbody · MetadataFailoveroptional

          When metadata not found, it will fall back to the

          • failover_rangebody · enum(FailoverRange)optional

            failover_range metadata route bottom type enum: ALL | OTHERS | OTHER_KEYS

          • labelsbody · map<string,string>optional

            labels

      • route_policy=NearbyPolicybody · NearbyRoutingConfigoptional

        When route_policy=NearbyPolicy, unpack as NearbyRoutingConfig.

        • servicebody · stringoptional

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

        • namespacebody · stringoptional

          被调命名空间

        • match_levelbody · enum(LocationLevel)optional

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

        • max_match_levelbody · enum(LocationLevel)optional

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

        • strict_nearbybody · booloptional

          是否强制就近

    • revisionbody · stringoptional

      revision routing version

    • ctimebody · stringoptional

      ctime create time of the rules

    • mtimebody · stringoptional

      mtime modify time of the rules

    • etimebody · stringoptional

      etime enable time of the rules

    • prioritybody · uint32optional

      priority rules priority

    • descriptionbody · stringoptional

      description simple description rules

    • metadatabody · map<string,string>optional

      metadata

    • editablebody · booloptional

      操作标志位

    • deleteablebody · booloptional

      deleteable

    • namespacebody · stringoptional

      namespace identifies the environment that owns this rule.

Request
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}]'
Response example
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
PUT/naming/v1/routingsAuth required

Update routing

Update rules; body is an array.

  • Authorizationheader · stringrequired

    Token from login.

  • (body)body · RouteRule[]required

    Request body is a JSON array of RouteRule: [{...}, ...]. Fields below are the full per-item schema (including nested).

  • idbody · stringoptional

    id

  • namebody · stringoptional

    route rule name

  • enablebody · booloptional

    Enable this router

  • route_policybody · enum(RoutePolicy)optional

    Router type enum:

  • routing_configbody · anyoptional

    Routing configuration for router (google.protobuf.Any; unpack by policy).

    • route_policy=RulePolicybody · CustomRouteoptional

      When route_policy=RulePolicy, unpack as CustomRoute.

      • callerbody · ServiceKeyoptional

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

        • servicebody · stringoptional

          service service name

        • namespacebody · stringoptional

          namespace namespace of service

      • calleebody · ServiceKeyoptional

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

        • servicebody · stringoptional

          service service name

        • namespacebody · stringoptional

          namespace namespace of service

      • rulesbody · CustomRouteRule[]optional

        rules

        • namebody · stringoptional

          sub routing rule name

        • argumentsbody · TrafficMatchRuleoptional

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

          • argumentsbody · SourceMatch[]optional

            arguments

            • typebody · enum(Type)optional

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

            • keybody · stringoptional

              header key or query key

            • valuebody · MatchStringoptional

              header value or query value

              • typebody · enum(MatchStringType)optional

                type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

              • valuebody · stringoptional

                value

              • value_typebody · enum(ValueType)optional

                value_type enum: TEXT | PARAMETER

          • random_percentbody · uint32optional

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

          • matchModebody · enum(TrafficMatchMode)optional

            matchMode enum: AND | OR

        • destinationsbody · DestinationGroup[]optional

          destinations

          • servicebody · stringoptional

            Templated service and namespace

          • namespacebody · stringoptional

            namespace

          • labelsbody · map<string,MatchString>optional

            labels

            • typebody · enum(MatchStringType)optional

              type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

            • valuebody · stringoptional

              value

            • value_typebody · enum(ValueType)optional

              value_type enum: TEXT | PARAMETER

          • prioritybody · uint32optional

            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 · uint32optional

            weight

          • transferbody · stringoptional

            Forward requests to proxy service

          • isolatebody · booloptional

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

          • namebody · stringoptional

            name desition name

    • route_policy=MetadataPolicybody · MetadataRoutingConfigoptional

      When route_policy=MetadataPolicy, unpack as MetadataRoutingConfig.

      • servicebody · stringoptional

        service

      • namespacebody · stringoptional

        namespace

      • labelsbody · map<string,string>optional

        labels

      • failoverbody · MetadataFailoveroptional

        When metadata not found, it will fall back to the

        • failover_rangebody · enum(FailoverRange)optional

          failover_range metadata route bottom type enum: ALL | OTHERS | OTHER_KEYS

        • labelsbody · map<string,string>optional

          labels

    • route_policy=NearbyPolicybody · NearbyRoutingConfigoptional

      When route_policy=NearbyPolicy, unpack as NearbyRoutingConfig.

      • servicebody · stringoptional

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

      • namespacebody · stringoptional

        被调命名空间

      • match_levelbody · enum(LocationLevel)optional

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

      • max_match_levelbody · enum(LocationLevel)optional

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

      • strict_nearbybody · booloptional

        是否强制就近

  • prioritybody · uint32optional

    priority rules priority

  • descriptionbody · stringoptional

    description simple description rules

  • metadatabody · map<string,string>optional

    metadata

  • namespacebody · stringoptional

    namespace identifies the environment that owns this rule.

  • codebody · uint32required

    Business code; success is usually 200000.

  • infobody · stringoptional

    Info message.

  • routeRulebody · RouteRuleoptional

    RouteRule entity fields (batch APIs nest under responses[]).

    • idbody · stringoptional

      id

    • namebody · stringoptional

      route rule name

    • enablebody · booloptional

      Enable this router

    • route_policybody · enum(RoutePolicy)optional

      Router type enum:

    • routing_configbody · anyoptional

      Routing configuration for router (google.protobuf.Any; unpack by policy).

      • route_policy=RulePolicybody · CustomRouteoptional

        When route_policy=RulePolicy, unpack as CustomRoute.

        • callerbody · ServiceKeyoptional

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

          • servicebody · stringoptional

            service service name

          • namespacebody · stringoptional

            namespace namespace of service

        • calleebody · ServiceKeyoptional

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

          • servicebody · stringoptional

            service service name

          • namespacebody · stringoptional

            namespace namespace of service

        • rulesbody · CustomRouteRule[]optional

          rules

          • namebody · stringoptional

            sub routing rule name

          • argumentsbody · TrafficMatchRuleoptional

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

            • argumentsbody · SourceMatch[]optional

              arguments

              • typebody · enum(Type)optional

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

              • keybody · stringoptional

                header key or query key

              • valuebody · MatchStringoptional

                header value or query value

                • typebody · enum(MatchStringType)optional

                  type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

                • valuebody · stringoptional

                  value

                • value_typebody · enum(ValueType)optional

                  value_type enum: TEXT | PARAMETER

            • random_percentbody · uint32optional

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

            • matchModebody · enum(TrafficMatchMode)optional

              matchMode enum: AND | OR

          • destinationsbody · DestinationGroup[]optional

            destinations

            • servicebody · stringoptional

              Templated service and namespace

            • namespacebody · stringoptional

              namespace

            • labelsbody · map<string,MatchString>optional

              labels

              • typebody · enum(MatchStringType)optional

                type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

              • valuebody · stringoptional

                value

              • value_typebody · enum(ValueType)optional

                value_type enum: TEXT | PARAMETER

            • prioritybody · uint32optional

              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 · uint32optional

              weight

            • transferbody · stringoptional

              Forward requests to proxy service

            • isolatebody · booloptional

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

            • namebody · stringoptional

              name desition name

      • route_policy=MetadataPolicybody · MetadataRoutingConfigoptional

        When route_policy=MetadataPolicy, unpack as MetadataRoutingConfig.

        • servicebody · stringoptional

          service

        • namespacebody · stringoptional

          namespace

        • labelsbody · map<string,string>optional

          labels

        • failoverbody · MetadataFailoveroptional

          When metadata not found, it will fall back to the

          • failover_rangebody · enum(FailoverRange)optional

            failover_range metadata route bottom type enum: ALL | OTHERS | OTHER_KEYS

          • labelsbody · map<string,string>optional

            labels

      • route_policy=NearbyPolicybody · NearbyRoutingConfigoptional

        When route_policy=NearbyPolicy, unpack as NearbyRoutingConfig.

        • servicebody · stringoptional

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

        • namespacebody · stringoptional

          被调命名空间

        • match_levelbody · enum(LocationLevel)optional

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

        • max_match_levelbody · enum(LocationLevel)optional

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

        • strict_nearbybody · booloptional

          是否强制就近

    • revisionbody · stringoptional

      revision routing version

    • ctimebody · stringoptional

      ctime create time of the rules

    • mtimebody · stringoptional

      mtime modify time of the rules

    • etimebody · stringoptional

      etime enable time of the rules

    • prioritybody · uint32optional

      priority rules priority

    • descriptionbody · stringoptional

      description simple description rules

    • metadatabody · map<string,string>optional

      metadata

    • editablebody · booloptional

      操作标志位

    • deleteablebody · booloptional

      deleteable

    • namespacebody · stringoptional

      namespace identifies the environment that owns this rule.

Request
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}]'
Response example
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
POST/naming/v1/routings/deleteAuth required

Delete routing

Delete rules; body is an array with ids.

  • Authorizationheader · stringrequired

    Token from login.

  • (body)body · RouteRule[]required

    Request body is a JSON array of RouteRule: [{...}, ...]. Fields below are the full per-item schema (including nested).

  • idbody · stringoptional

    id

  • namebody · stringoptional

    route rule name

  • enablebody · booloptional

    Enable this router

  • route_policybody · enum(RoutePolicy)optional

    Router type enum:

  • routing_configbody · anyoptional

    Routing configuration for router (google.protobuf.Any; unpack by policy).

    • route_policy=RulePolicybody · CustomRouteoptional

      When route_policy=RulePolicy, unpack as CustomRoute.

      • callerbody · ServiceKeyoptional

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

        • servicebody · stringoptional

          service service name

        • namespacebody · stringoptional

          namespace namespace of service

      • calleebody · ServiceKeyoptional

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

        • servicebody · stringoptional

          service service name

        • namespacebody · stringoptional

          namespace namespace of service

      • rulesbody · CustomRouteRule[]optional

        rules

        • namebody · stringoptional

          sub routing rule name

        • argumentsbody · TrafficMatchRuleoptional

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

          • argumentsbody · SourceMatch[]optional

            arguments

            • typebody · enum(Type)optional

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

            • keybody · stringoptional

              header key or query key

            • valuebody · MatchStringoptional

              header value or query value

              • typebody · enum(MatchStringType)optional

                type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

              • valuebody · stringoptional

                value

              • value_typebody · enum(ValueType)optional

                value_type enum: TEXT | PARAMETER

          • random_percentbody · uint32optional

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

          • matchModebody · enum(TrafficMatchMode)optional

            matchMode enum: AND | OR

        • destinationsbody · DestinationGroup[]optional

          destinations

          • servicebody · stringoptional

            Templated service and namespace

          • namespacebody · stringoptional

            namespace

          • labelsbody · map<string,MatchString>optional

            labels

            • typebody · enum(MatchStringType)optional

              type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

            • valuebody · stringoptional

              value

            • value_typebody · enum(ValueType)optional

              value_type enum: TEXT | PARAMETER

          • prioritybody · uint32optional

            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 · uint32optional

            weight

          • transferbody · stringoptional

            Forward requests to proxy service

          • isolatebody · booloptional

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

          • namebody · stringoptional

            name desition name

    • route_policy=MetadataPolicybody · MetadataRoutingConfigoptional

      When route_policy=MetadataPolicy, unpack as MetadataRoutingConfig.

      • servicebody · stringoptional

        service

      • namespacebody · stringoptional

        namespace

      • labelsbody · map<string,string>optional

        labels

      • failoverbody · MetadataFailoveroptional

        When metadata not found, it will fall back to the

        • failover_rangebody · enum(FailoverRange)optional

          failover_range metadata route bottom type enum: ALL | OTHERS | OTHER_KEYS

        • labelsbody · map<string,string>optional

          labels

    • route_policy=NearbyPolicybody · NearbyRoutingConfigoptional

      When route_policy=NearbyPolicy, unpack as NearbyRoutingConfig.

      • servicebody · stringoptional

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

      • namespacebody · stringoptional

        被调命名空间

      • match_levelbody · enum(LocationLevel)optional

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

      • max_match_levelbody · enum(LocationLevel)optional

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

      • strict_nearbybody · booloptional

        是否强制就近

  • prioritybody · uint32optional

    priority rules priority

  • descriptionbody · stringoptional

    description simple description rules

  • metadatabody · map<string,string>optional

    metadata

  • namespacebody · stringoptional

    namespace identifies the environment that owns this rule.

  • codebody · uint32required

    Business code; success is usually 200000.

  • infobody · stringoptional

    Info message.

  • routeRulebody · RouteRuleoptional

    RouteRule entity fields (batch APIs nest under responses[]).

    • idbody · stringoptional

      id

    • namebody · stringoptional

      route rule name

    • enablebody · booloptional

      Enable this router

    • route_policybody · enum(RoutePolicy)optional

      Router type enum:

    • routing_configbody · anyoptional

      Routing configuration for router (google.protobuf.Any; unpack by policy).

      • route_policy=RulePolicybody · CustomRouteoptional

        When route_policy=RulePolicy, unpack as CustomRoute.

        • callerbody · ServiceKeyoptional

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

          • servicebody · stringoptional

            service service name

          • namespacebody · stringoptional

            namespace namespace of service

        • calleebody · ServiceKeyoptional

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

          • servicebody · stringoptional

            service service name

          • namespacebody · stringoptional

            namespace namespace of service

        • rulesbody · CustomRouteRule[]optional

          rules

          • namebody · stringoptional

            sub routing rule name

          • argumentsbody · TrafficMatchRuleoptional

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

            • argumentsbody · SourceMatch[]optional

              arguments

              • typebody · enum(Type)optional

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

              • keybody · stringoptional

                header key or query key

              • valuebody · MatchStringoptional

                header value or query value

                • typebody · enum(MatchStringType)optional

                  type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

                • valuebody · stringoptional

                  value

                • value_typebody · enum(ValueType)optional

                  value_type enum: TEXT | PARAMETER

            • random_percentbody · uint32optional

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

            • matchModebody · enum(TrafficMatchMode)optional

              matchMode enum: AND | OR

          • destinationsbody · DestinationGroup[]optional

            destinations

            • servicebody · stringoptional

              Templated service and namespace

            • namespacebody · stringoptional

              namespace

            • labelsbody · map<string,MatchString>optional

              labels

              • typebody · enum(MatchStringType)optional

                type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

              • valuebody · stringoptional

                value

              • value_typebody · enum(ValueType)optional

                value_type enum: TEXT | PARAMETER

            • prioritybody · uint32optional

              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 · uint32optional

              weight

            • transferbody · stringoptional

              Forward requests to proxy service

            • isolatebody · booloptional

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

            • namebody · stringoptional

              name desition name

      • route_policy=MetadataPolicybody · MetadataRoutingConfigoptional

        When route_policy=MetadataPolicy, unpack as MetadataRoutingConfig.

        • servicebody · stringoptional

          service

        • namespacebody · stringoptional

          namespace

        • labelsbody · map<string,string>optional

          labels

        • failoverbody · MetadataFailoveroptional

          When metadata not found, it will fall back to the

          • failover_rangebody · enum(FailoverRange)optional

            failover_range metadata route bottom type enum: ALL | OTHERS | OTHER_KEYS

          • labelsbody · map<string,string>optional

            labels

      • route_policy=NearbyPolicybody · NearbyRoutingConfigoptional

        When route_policy=NearbyPolicy, unpack as NearbyRoutingConfig.

        • servicebody · stringoptional

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

        • namespacebody · stringoptional

          被调命名空间

        • match_levelbody · enum(LocationLevel)optional

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

        • max_match_levelbody · enum(LocationLevel)optional

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

        • strict_nearbybody · booloptional

          是否强制就近

    • revisionbody · stringoptional

      revision routing version

    • ctimebody · stringoptional

      ctime create time of the rules

    • mtimebody · stringoptional

      mtime modify time of the rules

    • etimebody · stringoptional

      etime enable time of the rules

    • prioritybody · uint32optional

      priority rules priority

    • descriptionbody · stringoptional

      description simple description rules

    • metadatabody · map<string,string>optional

      metadata

    • editablebody · booloptional

      操作标志位

    • deleteablebody · booloptional

      deleteable

    • namespacebody · stringoptional

      namespace identifies the environment that owns this rule.

Request
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>"}]'
Response example
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
POST/naming/v1/routings/releasesAuth required

Publish routing

Publish a release so clients observe the active view.

  • Authorizationheader · stringrequired

    Token from login.

  • (body)body · RuleRelease[]required

    Request body is a JSON array of RuleRelease: [{...}, ...]. Fields below are the full per-item schema (including nested).

  • idbody · stringoptional

    id

  • rule_idbody · stringoptional

    rule_id

  • rule_namebody · stringoptional

    rule_name

  • release_namebody · stringoptional

    release_name

  • descriptionbody · stringoptional

    description

  • release_typebody · stringoptional

    release_type

  • client_labelsbody · ClientLabel[]optional

    client_labels

    • keybody · stringoptional

      key

    • valuebody · MatchStringoptional

      value

      • typebody · enum(MatchStringType)optional

        type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

      • valuebody · stringoptional

        value

      • value_typebody · enum(ValueType)optional

        value_type enum: TEXT | PARAMETER

  • versionbody · uint64optional

    version

  • resourcebody · enum(RuleType)optional

    resource enum:

  • codebody · uint32required

    Business code; success is usually 200000.

  • infobody · stringoptional

    Info message.

  • ruleReleasebody · RuleReleaseoptional

    RuleRelease entity fields (batch APIs nest under responses[]).

    • idbody · stringoptional

      id

    • rule_idbody · stringoptional

      rule_id

    • rule_namebody · stringoptional

      rule_name

    • release_namebody · stringoptional

      release_name

    • descriptionbody · stringoptional

      description

    • release_typebody · stringoptional

      release_type

    • client_labelsbody · ClientLabel[]optional

      client_labels

      • keybody · stringoptional

        key

      • valuebody · MatchStringoptional

        value

        • typebody · enum(MatchStringType)optional

          type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

        • valuebody · stringoptional

          value

        • value_typebody · enum(ValueType)optional

          value_type enum: TEXT | PARAMETER

    • versionbody · uint64optional

      version

    • resourcebody · enum(RuleType)optional

      resource enum:

    • activebody · booloptional

      active

    • ctimebody · stringoptional

      ctime

    • mtimebody · stringoptional

      mtime

Request
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"}]'
Response example
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
GET/naming/v1/routings/releasesAuth required

List routing releases

List published releases.

  • Authorizationheader · stringrequired

    Token from login.

  • idquery · stringoptional

    Rule ID.

  • limitquery · integeroptional

    Page size.

Request
curl -sS 'http://127.0.0.1:8090/naming/v1/routings/releases?limit=20' \
  -H "Authorization: $TOKEN"
Response example
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
PUT/naming/v1/routings/releases/rollbackAuth required

Rollback routing

Roll back to a release.

  • Authorizationheader · stringrequired

    Token from login.

  • (body)body · RuleRelease[]required

    Request body is a JSON array of RuleRelease: [{...}, ...]. Fields below are the full per-item schema (including nested).

  • idbody · stringoptional

    id

  • rule_idbody · stringoptional

    rule_id

  • rule_namebody · stringoptional

    rule_name

  • release_namebody · stringoptional

    release_name

  • descriptionbody · stringoptional

    description

  • release_typebody · stringoptional

    release_type

  • client_labelsbody · ClientLabel[]optional

    client_labels

    • keybody · stringoptional

      key

    • valuebody · MatchStringoptional

      value

      • typebody · enum(MatchStringType)optional

        type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

      • valuebody · stringoptional

        value

      • value_typebody · enum(ValueType)optional

        value_type enum: TEXT | PARAMETER

  • versionbody · uint64optional

    version

  • resourcebody · enum(RuleType)optional

    resource enum:

  • codebody · uint32required

    Business code; success is usually 200000.

  • infobody · stringoptional

    Info message.

  • ruleReleasebody · RuleReleaseoptional

    RuleRelease entity fields (batch APIs nest under responses[]).

    • idbody · stringoptional

      id

    • rule_idbody · stringoptional

      rule_id

    • rule_namebody · stringoptional

      rule_name

    • release_namebody · stringoptional

      release_name

    • descriptionbody · stringoptional

      description

    • release_typebody · stringoptional

      release_type

    • client_labelsbody · ClientLabel[]optional

      client_labels

      • keybody · stringoptional

        key

      • valuebody · MatchStringoptional

        value

        • typebody · enum(MatchStringType)optional

          type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

        • valuebody · stringoptional

          value

        • value_typebody · enum(ValueType)optional

          value_type enum: TEXT | PARAMETER

    • versionbody · uint64optional

      version

    • resourcebody · enum(RuleType)optional

      resource enum:

    • activebody · booloptional

      active

    • ctimebody · stringoptional

      ctime

    • mtimebody · stringoptional

      mtime

Request
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>"}]'
Response example
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
PUT/naming/v1/routings/releases/stopbetaAuth required

Stop routing gray

Stop a gray release.

  • Authorizationheader · stringrequired

    Token from login.

  • (body)body · RuleRelease[]required

    Request body is a JSON array of RuleRelease: [{...}, ...]. Fields below are the full per-item schema (including nested).

  • idbody · stringoptional

    id

  • rule_idbody · stringoptional

    rule_id

  • rule_namebody · stringoptional

    rule_name

  • release_namebody · stringoptional

    release_name

  • descriptionbody · stringoptional

    description

  • release_typebody · stringoptional

    release_type

  • client_labelsbody · ClientLabel[]optional

    client_labels

    • keybody · stringoptional

      key

    • valuebody · MatchStringoptional

      value

      • typebody · enum(MatchStringType)optional

        type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

      • valuebody · stringoptional

        value

      • value_typebody · enum(ValueType)optional

        value_type enum: TEXT | PARAMETER

  • versionbody · uint64optional

    version

  • resourcebody · enum(RuleType)optional

    resource enum:

  • codebody · uint32required

    Business code; success is usually 200000.

  • infobody · stringoptional

    Info message.

  • ruleReleasebody · RuleReleaseoptional

    RuleRelease entity fields (batch APIs nest under responses[]).

    • idbody · stringoptional

      id

    • rule_idbody · stringoptional

      rule_id

    • rule_namebody · stringoptional

      rule_name

    • release_namebody · stringoptional

      release_name

    • descriptionbody · stringoptional

      description

    • release_typebody · stringoptional

      release_type

    • client_labelsbody · ClientLabel[]optional

      client_labels

      • keybody · stringoptional

        key

      • valuebody · MatchStringoptional

        value

        • typebody · enum(MatchStringType)optional

          type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

        • valuebody · stringoptional

          value

        • value_typebody · enum(ValueType)optional

          value_type enum: TEXT | PARAMETER

    • versionbody · uint64optional

      version

    • resourcebody · enum(RuleType)optional

      resource enum:

    • activebody · booloptional

      active

    • ctimebody · stringoptional

      ctime

    • mtimebody · stringoptional

      mtime

Request
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>"}]'
Response example
{
  "code": 200000,
  "info": "execute success",
  "amount": 1
}
POST/naming/v1/routings/releases/deleteAuth required

Delete releases

Delete releases.

  • Authorizationheader · stringrequired

    Token from login.

  • (body)body · RuleRelease[]required

    JSON array of RuleRelease; fields below are per-item.

  • idbody · stringoptional

    id

  • rule_idbody · stringoptional

    rule_id

  • rule_namebody · stringoptional

    rule_name

  • release_namebody · stringoptional

    release_name

  • descriptionbody · stringoptional

    description

  • release_typebody · stringoptional

    release_type

  • client_labelsbody · ClientLabel[]optional

    client_labels

    • keybody · stringoptional

      key

    • valuebody · MatchStringoptional

      value

      • typebody · enum(MatchStringType)optional

        type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

      • valuebody · stringoptional

        value

      • value_typebody · enum(ValueType)optional

        value_type enum: TEXT | PARAMETER

  • versionbody · uint64optional

    version

  • resourcebody · enum(RuleType)optional

    resource enum:

  • codebody · uint32required

    Business code.

  • infobody · stringoptional

    Info.

  • RuleReleasebody · RuleReleaseoptional

    Entity fields.

    • idbody · stringoptional

      id

    • rule_idbody · stringoptional

      rule_id

    • rule_namebody · stringoptional

      rule_name

    • release_namebody · stringoptional

      release_name

    • descriptionbody · stringoptional

      description

    • release_typebody · stringoptional

      release_type

    • client_labelsbody · ClientLabel[]optional

      client_labels

      • keybody · stringoptional

        key

      • valuebody · MatchStringoptional

        value

        • typebody · enum(MatchStringType)optional

          type enum: EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE

        • valuebody · stringoptional

          value

        • value_typebody · enum(ValueType)optional

          value_type enum: TEXT | PARAMETER

    • versionbody · uint64optional

      version

    • resourcebody · enum(RuleType)optional

      resource enum:

    • activebody · booloptional

      active

    • ctimebody · stringoptional

      ctime

    • mtimebody · stringoptional

      mtime

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

On this page