Updated on 2024-06-27 GMT+08:00

Viewing Orchestration Rules

Function

This API is used to view orchestration rules.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/apigw/instances/{instance_id}/orchestrations

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain it, see Obtaining a Project ID.

instance_id

Yes

String

Gateway ID, which can be obtained from the gateway information on the APIG console.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Long

Offset from which the query starts. If the value is less than 0, it is automatically converted to 0.

Default: 0

limit

No

Integer

Number of items displayed on each page. A value less than or equal to 0 will be automatically converted to 20, and a value greater than 500 will be automatically converted to 500.

Minimum: 1

Maximum: 500

Default: 20

orchestration_name

No

String

Orchestration rule name.

precise_search

No

String

Parameter name for exact matching. Separate multiple parameter names with commas (,). Only orchestration_name is supported.

orchestration_id

No

String

Orchestration rule ID.

Separate multiple orchestration rule IDs with commas (,). The maximum number of IDs is the maximum number of rules that can be bound to an API. For details, see "Quotas" in APIG Service Overview.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

size

Integer

Length of the returned resource list.

total

Long

Number of resources that match the query conditions.

orchestrations

Array of OrchestrationBaseResp objects

Orchestration rules that are queried.

Table 5 OrchestrationBaseResp

Parameter

Type

Description

orchestration_name

String

Orchestration mapping rule name.

The name must be 3 to 64 characters long, start with a letter and use only letters, digits, and underscores (_). It must be unique in the same gateway.

Minimum: 3

Maximum: 64

orchestration_strategy

String

Orchestration policy. Options:

  • list

  • hash

  • range

  • hash_range

  • none_value

  • default

  • head_n

  • tail_n. If the orchestration policy is list, the number of objects in orchestration_map multiplied by that in map_param_list cannot exceed 3,000.

Enumeration values:

  • list

  • hash

  • range

  • hash_range

  • none_value

  • default

  • head_n

  • tail_n

orchestration_mapped_param

OrchestrationMappedParam object

Parameter configuration after orchestration. This parameter is mandatory when isPreprocessing is set to false.

is_preprocessing

Boolean

Indicates whether the policy is a preprocessing policy. A preprocessing policy generates only temporary parameters as the input of the subsequent parameter orchestration rule. And it cannot be used as the last orchestration rule except the default orchestration rule.

orchestration_id

String

Orchestration rule ID.

orchestration_create_time

String

Time when an orchestration rule was created.

orchestration_update_time

String

Time when an orchestration rule was updated.

Table 6 OrchestrationMappedParam

Parameter

Type

Description

mapped_param_name

String

Name of the request parameter after orchestration. The value can contain 1 to 128 characters, including letters, digits, and hyphens (-). It must start with a letter and cannot be the same as an existing parameter name. By default, the parameter name is transparently transmitted to the backend.

Minimum: 1

Maximum: 128

mapped_param_type

String

Type of the parameter after orchestration. The value can be string or number.

Enumeration values:

  • string

  • number

mapped_param_location

String

Position of the orchestrated parameter. The value can be query or header.

Enumeration values:

  • query

  • header

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

None

Example Responses

Status code: 200

OK

{
  "total" : 2,
  "size" : 2,
  "orchestrations" : [ {
    "orchestration_id" : "76545e81d9cb4424bf704ef2b0ac7600",
    "orchestration_name" : "orchestration_demo_1",
    "orchestration_create_time" : "2023-07-02T12:31:23.353Z",
    "orchestration_update_time" : "2023-07-02T13:31:23.353Z",
    "orchestration_strategy" : "list",
    "orchestration_mapped_param" : {
      "mapped_param_name" : "shared-tag",
      "mapped_param_type" : "number",
      "mapped_param_location" : "header"
    }
  }, {
    "orchestration_id" : "yt655e81d9cb4424bf704ef2b0ac7600",
    "orchestration_name" : "orchestration_demo_2",
    "orchestration_create_time" : "2023-07-02T12:31:23.353Z",
    "orchestration_update_time" : "2023-07-02T13:31:23.353Z",
    "orchestration_strategy" : "range",
    "orchestration_mapped_param" : {
      "mapped_param_name" : "shared-tag",
      "mapped_param_type" : "number",
      "mapped_param_location" : "header"
    }
  } ]
}

Status code: 400

Bad Request

{
  "error_code" : "APIG.2012",
  "error_msg" : "Invalid parameter value,parameterName:instance_id. Please refer to the support documentation"
}

Status code: 401

Unauthorized

{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 403

Forbidden

{
  "error_code" : "APIG.1005",
  "error_msg" : "No permissions to request this method"
}

Status code: 404

Not Found

{
  "error_code" : "APIG.3030",
  "error_msg" : "The instance does not exist;id:f0fa1789-3b76-433b-a787-9892951c620ec"
}

Status code: 500

Internal Server Error

{
  "error_code" : "APIG.9999",
  "error_msg" : "System error"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.