百度智能云

All Product Document

          Relational Database Service

          Instructions for Slow Log Download Task Related Interfaces

          Add a slow log download task

          Note

          Add a slow log download task. After adding the task, view the task execution status through the details interface or list interface.

          Request Structure

          POST /v{version}/instance/slowquery/task/{instanceId} HTTP/1.1
          HOST: rds.bj.baidubce.com
          Authorization authorization string
           
          {
              "startTime" : startTime,
              "endTime"   : endTime
          }

          Request Header Field

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

          Request Parameters

          Parameter Name Type Required Parameter Position Description
          version string Yes URL parameter API Version Number
          instanceId string Yes URL parameter Instance ID
          startTime string Yes RequestBody parameter UTC Time, sum up the start time for statistical query.
          endTime string Yes RequestBody parameter UTC Time, sum up the end time for the statistical query. There are some limits between end time and start time: the end time is later than the start time, and the interval is no less than 30 minutes but no greater than 3 hours.

          Return Header Field

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

          Return Parameter

          Parameter Name Type Description
          taskId int Task ID

          Request Example

          GET /v1/instance/slowquery/task/rds-xxx HTTP/1.1
          HOST: rds.bj.baidubce.com
          Authorization bce-auth-v1/rdsak/2016-07-03T06:13:13Z/1800/x-bce-date/{signature}
           
          {
              "startTime" : "2019-04-03T06:13:13Z",
              "endTime"   : "2019-04-03T08:13:13Z"
          }

          Return Example

          HTTP/1.1 200 OK
          x-bce-request-id 7869616F-7A68-6977-656E-406261696475
          Content-Type: application/json
          Content-Length: 49
          {
              "result" : {
                  "taskId" : 100001
              }
          }
           

          Get a slow log management task list

          Return slow log download task list under this instance.

          Request Structure

          GET /v{version}/instance/slowquery/task/{instanceId} HTTP/1.1
          HOST: rds.bj.baidubce.com
          Authorization authorization string

          Request Header Field

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

          Request Parameters

          Parameter Name Type Required Parameter Position Description
          version string Yes URL parameter API Version Number.
          instanceId string Yes URL parameter Instance ID.
          marker string No Query parameters The start position of a query to obtain the list by batch, which is a character string generated by the system.
          maxKeys string No Query parameters The maximum number contained in each page, which is usually no more than 1,000 pages per page, and 1,000 by default.
          filterStartTime string No Query parameters UTC Time, slow log task filtering start time.
          filterEndTime string No Query parameters UTC Time, slow log task filtering end time.

          Return Header Field

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

          Return Parameter

          Parameter Name Type Description
          marker string The start position of a query to obtain the list by batch, which is a character string generated by the system.
          maxKeys int Maximum number of master instances per page, which usually does not exceed 1,000, and the default value is 1,000.
          isTruncated boolean True means there is still data behind, and false means it is already the last page.
          nextMarker string Get the marker value to pass on the next page. This field does not appear when isTruncated is false.
          result List Instance The array composed of instance objects.

          Request Example

          GET /v1/instance/slowquery/task/123 HTTP/1.1
          HOST: rds.bj.baidubce.com
          Authorization bce-auth-v1/rdsak/2016-07-03T06:13:13Z/1800/x-bce-date/{signature}

          Return Example

          {
              "nextMarker": "rds-xktdeMSf",
              "marker": "rds-IyWRtII7",
              "maxKeys": 1,
              "isTruncated": true,
              "result":[{
                  "taskId"                : "100001",
                  "instanceId"            : "rds-fkii3341x",
                  "createTime"            : "2019-06-01T12:00:00Z",
                  "status"                : "running"
              }]
          }

          Get slow log download task details

          Note

          View Slow log download task details.

          Request Structure

          GET /v{version}/instance/slowquery/task/{instanceId}/{taskId} HTTP/1.1
          HOST: rds.bj.baidubce.com
          Authorization authorization string

          Request Parameters

          Parameter Name Type Required Parameter position Description
          version string Yes URL parameter API Version Number
          instanceId string Yes URL parameter Instance ID
          taskId string Yes URL parameter Slow Log Download Task ID

          Return Header Field

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

          Return Parameter

          Parameter Name Type Description
          result Task Object The array composed of instance objects

          Task Object Structure

          Parameter Name Type Description
          taskId int Slow Log Download Task ID
          status string Status
          downloadUrl string Download link
          expireDate string UTC Time, download link expiry time

          Request Example

          GET /v1/instance/slowquery/task/rds-fkxiuhbs/100001 HTTP/1.1
          HOST: rds.bj.baidubce.com
          Authorization bce-auth-v1/rdsak/2019-04-03T06:13:13Z/1800/x-bce-date/{signature}

          Return Example

          HTTP/1.1 200 OK
          x-bce-request-id 7869616F-7A68-6977-656E-406261696475
          Content-Type: application/json
          Content-Length: 226
           
          {
              "result" : {
                 "taskId"         : 100001,
                 "instanceId"     : "rds-fkxiuhbs",
                 "status"         : "success",
                 "downloadUrl"    : "http://downloadxx.bce.baidu.com/xxxxx",
                 "expireDate"     :  "2019-04-04T06:13:13Z"
              }
          }
          Previous
          Contents
          Next
          Sample-Code