百度智能云

All Product Document

          Distributed Relational Database Service DRDS

          Instructions for Whitelist Management Interfaces

          Obtain a Whitelist

          Interface description

          This interface is used to obtain the IP whitelist of the DRDS instance.

          Request structure

          GET /v{version}/instance/{instanceId}/securityIp HTTP/1.1
          HOST: drds.bj.baidubce.com
          Authorization: authorization string

          Request header field

          There are no other special header fields except for the common header field.

          Request parameters

          Parameter Name Type Required Parameter Position Description
          version String Yes URI parameter API version number
          instanceId String Yes URI parameter Instance ID

          Response header field

          Parameter Name Type Description
          ETag string For the current version number, the current ETag needs to be passed back via header when modifying.

          Response parameter

          Parameter Name Type Description
          securityIps List<String> Array composed of IP

          Request example

          GET https://drds.bj.baidubce.com/v1/instance/drds265l1gltivi/securityIp
          Host: drds.bj.baidubce.com
          Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de

          Response example

          HTTP/1.1 200 OK
          x-bce-request-id: 7869616F-7A68-6977-656E-406261696475
          ETag:v10
          Content-Type: application/json
          {
              "securityIps": [
                  "192.168.0.1"
              ]
          }

          Modify the IP whitelist

          Interface description

          This interface is used to modify the IP whitelist of the DRDS instance.

          Request structure

          PUT /v{version}/instance/{instanceId}/securityIp HTTP/1.1
          HOST: drds.bj.baidubce.com
          x-bce-if-match: {Etag}
          Authorization: authorization string

          Request header field

          Parameter Name Type Description
          x-bce-if-match string ETag value obtained through query interface

          Request parameters

          Parameter Name Type Required Parameter Position Description
          version String Yes URI parameter API version number
          instanceId String Yes URI parameter Instance ID
          securityIps List<String> Yes RequestBody parameter For the full array composed of IPs, you can access to the IP whitelist. The whitelist format must meet the CIDR mode.

          Response header field

          There are no other special header fields except for the common header field.

          Response parameter

          No special response parameter

          Request example

          PUT https://drds.bj.baidubce.com/v1/instance/drds265l1gltivi/securityIp
          Host: drds.bj.baidubce.com
          x-bce-if-match: v10
          Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
          {
              "securityIps": [
                  "192.0.0.1"
              ]
          }

          Response example

          HTTP/1.1 200 OK
          x-bce-request-id: 7869616F-7A68-6977-656E-406261696475
          Content-Type: application/json
          Previous
          Instructions for Account Management Interfaces
          Next
          Other Interfaces