Binding an Access Control Policy to an API

Function

This API is used to bind an access control policy to a specified API.

You can bind different access control policies to an API in different environments, but you can bind only one type of access control policy to the API in each environment.

URI

The following table lists the HTTPS request method and URI of the API.

Table 1 HTTPS request method and URI

Request Method

URI

POST

/v1/{project_id}/apigw/instances/{instance_id}/acl-bindings

The following table lists the parameters in the URI.

Table 2 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID, which can be obtained by the administrator on the My Credentials page.

instance_id

Yes

String

Instance ID, which can be obtained from the dedicated gateway information on the API Gateway console.

Request

Table 3 Parameter description

Parameter

Type

Description

acl_id

String

Access control policy ID

publish_ids

[]String

API publication record ID

Example request:

{
  "acl_id": "206bb985d8a04ec09f13c3e51ef77095",
  "publish_ids": [
    "1bc8b2b741a04bd4af3ef9d7cd003104"
  ]
}

Response

Table 4 Parameter description

Parameter

Type

Description

id

String

Binding ID

api_id

String

API ID

env_id

String

Environment ID

acl_id

String

Access control policy ID

create_time

Timestamp

Time when the access control policy is bound to the API

Example response:

[
  {
    "id": "4ffc0da71ddd4c22add8ff801e19846c",
    "api_id": "aebacac6095942b4b2dd2b209bb7b9bc",
    "env_id": "DEFAULT_ENVIRONMENT_RELEASE_ID",
    "acl_id": "206bb985d8a04ec09f13c3e51ef77095",
    "create_time": "2018-07-27T11:27:10.7470224Z"
  }
]

Status Codes

Table 5 Status codes

Status Code

Description

201

Created

400

Bad Request

403

Forbidden

404

Not Found

500

Server Internal Error