百度智能云

All Product Document

          Relational Database Service

          Forced Switch of Hot Iinstance Group

          Request header field

          No other special header fields are available, except for common header fields.

          Request Structure

          PUT /v{version}/instance/{groupId}/forceChange HTTP/1.1
          HOST: rds.bj.baidubce.com
          Authorization: authorization string
          {
              "leaderId"         : "leaderId",
              "force"            : force,
              "maxBehind"        : maxBehind
          }

          Request header field

          No other special header fields are available, except for common header fields.

          Request Parameter

          Parameter name Type Required? Parameter Position Description
          version string Yes URL Parameter API version number
          groupId string Yes URL Parameter Instance group id
          leaderId string Yes RequestBody parameter The instance id to be switched as the main role in the instance group
          force int No RequestBody parameter 0-Non-fault (used in the non-fault state) 1-Fault
          maxBehind int No RequestBody parameter The maximum allowable Behind_Master value of the secondary database (0 means that the data in the secondary database and the faulty primary database should be fully identical. It is recommended that the business gradually increases from 0 to the maximum tolerance value. In the case of force=0, this parameter is null and void)

          Return Parameter

          Parameter name Type Description
          behindMaster int Secondary database latency during switch-over

          Request Example

          GET /v1/instance/rdcj5d7hs0c/forceChange HTTP/1.1
          HOST: rds.bj.baidubce.com
          Authorization: bce-auth-v1/rdsak/2016-07-03T06:13:13Z/1800/x-bce-date/{signature}
          {
              "leaderId"         : "rds-y9dJu77d",
              "force"            : 1,
              "maxBehind"        : 10
          }

          Return Example

          HTTP/1.1 200 OK
          x-bce-request-id: 7869616F-7A68-6977-656E-406261696475
          ETag:xxx-xxx-xxx
          Content-Type: application/json
          Content-Length 567
          
          {
              "behindMaster": 0
          }
          Previous
          Obtain the Availability Zone Llist.
          Next
          SDK