Creates an external store.

Request syntax

POST /externalstores HTTP/1.1
'x-log-bodyrawsize': '0',
'Content-Type': 'application/json', 
'Content-Length': <ContentLength>, 
'Content-MD5': <Md5>, 
'x-log-apiversion': '0.6.0', 
'x-log-signaturemethod': 'hmac-sha1', 
'Host': <Project Endpoint> 
'Date': <GMT Date>, 
'Authorization': <AuthorizationString> 
'{"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>"
               }
}'

Request parameters

  • Request headers

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

  • Parameters
    Parameter Type Required Example Description
    ExternalStoreName string Yes rds_store The name of the external store. The name must be unique in a project.
    vpc-id string No vpc-bp1aevy8sofi8mh1q**** The ID of the VPC to which the RDS instance belongs.
    instance-id string No i-bp1b6c719dfa08exf**** The ID of the RDS instance. Both vpc-id and instance-id can be empty. If you do not specify the parameters, it means that the external store is not in VPC and is accessible from the Internet.
    host string No 192.***. ***. *** The host on which the RDS instance resides. This parameter is required if both vpc-id and instance-id are empty.
    port string Yes 3306 The port number of the RDS instance.
    username string Yes root The username that is used to log on to the RDS instance.
    password string Yes sfdsfldsfksfls**** The password that is used to log on to the RDS instance.
    db string Yes meta The name of the RDS database.
    table string Yes join_meta The name of the table.
    region string Yes cn-qingdao The region the RDS instance belongs to. Only three regions are available: China (Qingdao), China (Beijing), and China (Hangzhou).

Response parameters

  • Response headers

    The CreateExternalStore 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

    The HTTP status code 200 is returned.

Examples

  • Sample requests
    POST /externalstores HTTP/1.1
    '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-yunlei-chengdu.cn-chengdu.log.aliyuncs.com', 
    'Date': 'Thu, 19 Apr 2018 02:15:41 GMT', 
    'Authorization': 'LOG <yourAccessKeyId>:<yourSignature>'}
    '{"externalStoreName": "rds_store", 
      "storeType": "rds-vpc", 
      "parameter": {
                   "vpc-id": "vpc-bp1aevy8sofi8mh1q****", 
                   "instance-id": "i-bp1b6c719dfa08exf****", 
                   "host": "192. ***. ***.***", 
                   "port": "3306", 
                   "username": "root", 
                   "password": "sfdsfldsfksfls****", 
                   "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 code Error code Error message Description
400 ProjectAlreadyExist Project {project} already exists. The error message returned because the specified project already exists.
400 ParameterInvalid The body is not valid json string. The error message returned because a parameter value is invalid.
500 InternalServerError Specified Server Error Message. The error message returned because an internal server error has occurred.

For more information about the error codes, see Common error codes.