You can call this operation to create a custom domain name.
Request headers
This operation uses only common request headers. For more information, see Common parameters.
Request syntax
POST /custom-domains
Request parameters
Parameter | Type | Position | Required | Example | Description |
---|---|---|---|---|---|
Object | Body | Yes |
The definition of the domain name. |
||
certConfig | CertConfig | Body | Yes |
The configurations of the HTTPS certificate. |
|
domainName | String | Body | Yes | example.com |
The domain name. |
protocol | String | Body | Yes | HTTP |
The protocol types supported by the domain name. Valid values:
|
routeConfig | RouteConfig | Body | Yes |
The route table that maps paths to functions when the functions are invoked by using the custom domain name. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
accountId | String | 19861144305**** |
The account ID. |
apiVersion | String | 2016-08-15 |
The version of the API. |
certConfig | CertConfig |
The configurations of the HTTPS certificate. |
|
createdTime | String | 2020-07-27T08:02:19Z |
The time when the domain name was created. |
domainName | String | example.com |
The domain name. |
lastModifiedTime | String | 2020-07-27T08:02:19Z |
The last time when the domain name was updated. |
protocol | String | HTTP |
The protocol types supported by the domain name. Valid values:
|
routeConfig | RouteConfig |
The route table that maps paths to functions when the functions are invoked by using the custom domain name. |
Examples
Sample requests
POST /2016-08-15/custom-domains HTTP/1.1
Common request headers
{
"domainName":"example.com",
"routeConfig":{
"routes":[
{
"path":"/login/*",
"serviceName":"service_name",
"functionName":"function_name"
}
]
}
}
Sample success responses
JSON
format
HTTP/1.1 200 OK
Common response headers
{
"domainName": "example.com",
"accountId": "19861144305****",
"protocol": "HTTP",
"certConfig": {
"certName":/login/,
"privateKey":-----BEGIN RSA PRIVATE KEY-----xxxxx-----END RSA PRIVATE KEY-----,
"certificate":-----BEGIN CERTIFICATE-----xxxxx-----END CERTIFICATE-----
},
"apiVersion": "2016-08-15",
"routeConfig": {
"routes": [
{
"path": "/login",
"serviceName": "service_name",
"functionName": "function_name",
"qualifier":test,
"methods":GET
}
]
},
"createdTime": "2020-07-27T08:02:19Z",
"lastModifiedTime": "2020-07-27T08:02:19Z"
}