Modifies the parameters of an external store.

Description

The available external stores include Object Storage Service (OSS) objects and ApsaraDB RDS for MySQL databases over a virtual private cloud (VPC). This topic uses an ApsaraDB RDS for MySQL database as an example. For information about how to use an OSS object as a data source, see Associate Log Service with an OSS bucket.

Request syntax

PUT /externalstores/externalStoreName HTTP/1.1
x-log-bodyrawsize: 0
Content-Type: application/json
x-log-apiversion: 0.6.0
x-log-signaturemethod: hmac-sha1
Host: ProjectName.Endpoint
Date: GMT Date 
Authorization: LOG yourAccessKeyId:yourSignature 
{"externalStoreName": "externalStoreName",
  "storeType": "rds-vpc", 
  "parameter": {
               "vpc-id": "vpc-id", 
               "instance-id": "instance-id", 
               "host": "host", 
               "port": "port", 
               "username": "username", 
               "password": "password", 
               "db": "db", 
               "table": "table", 
               "region": "region"
               }
}

The value of the Host parameter consists of a project name and an endpoint. You must specify a project name for the Host parameter.

Request parameters

  • Request headers

    The UpdateExternalStore operation does not have operation-specific request headers. For information about the common request headers of Log Service API operations, see Common request headers.

  • Request parameters
    ParameterTypeRequiredExampleDescription
    projectNameStringYesali-test-projectThe name of the project.
    externalStoreNameStringYesrds_storeThe name of the external store.
    storeTypeStringYesrds-vpcThe type of the store. Valid value: rds-vpc. This value indicates an ApsaraDB RDS for MySQL database over a virtual private cloud (VPC).
    vpc-idStringNovpc-bp1aevy8sofi8mh1q****The ID of the VPC to which the ApsaraDB RDS for MySQL instance belongs.
    intance-idStringNoi-bp1b6c719dfa08exf****The ID of the ApsaraDB RDS for MySQL instance.
    hostStringNo192.168.XX.XXThe internal or public endpoint of the ApsaraDB RDS for MySQL instance.
    portStringYes3306The internal or public port of the ApsaraDB RDS for MySQL instance.
    usernameStringYesuserThe username that is used to log on to the ApsaraDB RDS for MySQL instance.
    passwordStringYessfdsfldsfksfl****The password that is used to log on to the ApsaraDB RDS for MySQL instance.
    dbStringYesmetaThe name of the database in the ApsaraDB RDS for MySQL instance.
    tableStringYesjoin_metaThe name of the database table in the ApsaraDB RDS for MySQL instance.
    regionStringYescn-qingdaoThe region to which the ApsaraDB RDS for MySQL instance belongs. Valid values: cn-qingdao, cn-beijing, and cn-hangzhou.

Response parameters

  • Response headers

    The UpdateExternalStore operation does not have operation-specific response headers. For information about the common response headers of Log Service API operations, see Common response headers.

  • Response elements

    If the HTTP status code 200 is returned, the request is successful. If the request is successful, no other elements are returned.

Examples

  • Sample requests
    PUT /externalstores/rds_store  HTTP/1.1
    Header :
    {
    x-log-bodyrawsize: 0
    Content-Type: application/json 
    Content-Length: 307 
    Content-MD5: 7C1D14659C0BBBA7C7BFF9E5A1A46705 
    x-log-apiversion: 0.6.0
    x-log-signaturemethod: hmac-sha1 
    Host: ali-test-project.cn-chengdu.log.aliyuncs.com 
    Date: Thu, 19 Apr 2018 02:15:41 GMT
    Authorization: LOG yourAccessKeyId:yourSignature
    }
    Body :
    {"externalStoreName": "rds_store", 
      "storeType": "rds-vpc", 
      "parameter": {
                   "vpc-id": "vpc-p1aevy8sofi8mh1q****", 
                   "instance-id": "i-bp1b6c719dfa08exf****", 
                   "host": "192.168.XX.XX", 
                   "port": "3306", 
                   "username": "user", 
                   "password": "sfdsfldsfksfl****", 
                   "db": "meta", 
                   "table": "join_meta", 
                   "region": "cn-qingdao"
                   }
    }
  • Sample success responses
    HTTP/1.1 200 OK
    Header
    {
    date: Mon, 09 Nov 2015 07:45:30 GMT
    connection: close
    x-log-requestid: 56404F1A99248CA26C002180
    content-length: 0
    server: nginx/1.6.1
    }

Error codes

HTTP status codeError codeError messageDescription
404ProjectNotExistThe Project does not exist : projectNameThe error message returned because the specified project does not exist.
400ParameterInvalidThe body is not valid json string.The error message returned because a parameter value is invalid in the configurations of the external store.
500InternalServerErrorSpecified Server Error Message.The error message returned because an internal server error has occurred.

For a list of error codes, see Error codes.