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
    ParameterTypeRequiredExampleDescription
    ExternalStoreNamestringYesrds_storeThe name of the external store. The name must be unique in a project.
    vpc-idstringNovpc-bp1aevy8sofi8mh1q****The ID of the VPC to which the RDS instance belongs.
    instance-idstringNoi-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.
    hoststringNo192.***. ***. ***The host on which the RDS instance resides. This parameter is required if both vpc-id and instance-id are empty.
    portstringYes3306The port number of the RDS instance.
    usernamestringYesuserThe username that is used to log on to the RDS instance.
    passwordstringYessfdsfldsfksfls****The password that is used to log on to the RDS instance.
    dbstringYesmetaThe name of the RDS database.
    tablestringYesjoin_metaThe name of the table.
    regionstringYescn-qingdaoThe 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": "user", 
                   "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 codeError codeError messageDescription
400ProjectAlreadyExistProject {project} already exists.The error message returned because the specified project already exists.
400ParameterInvalidThe body is not valid json string.The error message returned because a parameter value is invalid.
500InternalServerErrorSpecified Server Error Message.The error message returned because an internal server error has occurred.

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