Edit Domain
This API is used to edit website acceleration domain.
1. Request Definition
- API URL
https://cdn-api.swiftfederation.com/v2.0/domains/{serviceId}
- Request Method
PUT
- Request Header
Refer to HTTP Request Headers
- Request Body
Request Body Data Format: JSON
Field | Required | Type | Description |
---|---|---|---|
origins | Optional | Origin[] | List of Origin, need at least one Origin. and for multi Origin, the priority as the List sequence, there will be fallback is the front origin is fail.(Please remember fill all the origins in a list but not only one when need to append a origin into existing origins list.) |
streamingService | Optional | boolean | To indicate if need to combine multiple requests as one request to origin server. true: Enabled, false: Disabled. Default is false. |
http2 | Optional | boolean | Enable HTTP/2 will allow client connect CDN by HTTP/2. Note: Please configure SSL certificate before you use HTTP/2. true: Enabled, false: Disabled. Default is false.If the value is not set, the default value will be used. |
redirectHttpToHttps | Optional | boolean | Whether redirect all plain HTTP requests to HTTPS. true: Enabled, false: Disabled. Default is false. If the value is not set, the default value will be used. |
active | Optional | boolean | To indicate if service is enabled or disabled. true: Enabled, false: Disabled. Default is true. |
Origin Definition | |||
urlPrefix | Optional | string | The origin address. Has the following format: [http[s]://]hostname[:port][/path/prefix]. The bits in [] are optional. If the scheme (http/https) is explicitly specified then it is forced for all origin requests, otherwise (scheme is omitted) the protocol used by client is used to contact the origin. |
sni | Optional | string | The server name to send to the origin during SSL handshake, when missing the host name used in Origin URL is used. |
headers | Optional | Dictionary | The Origin Headers containing extra headers to send to the origin. format: Dictionary {"HeaderName": "HeaderValue", ...}. E.g: {"Host": "origin.domain.com"} |
- Request Body Example
{
"origins":[
{
"urlPrefix":"https://origin.domain.com:8888/foo/bar",
"sni":"origin-a.domain.com",
"headers":{"Host":"origin-b.domain.com","X-From":"Conversant"}
}
],
"streamingService": true,
"http2":true,
"redirectHttpToHttps":true,
"active": true
}
2. Response Definition
- Response Header
Refer to HTTP Response Headers
- Response Body
Field | Type | Description |
---|---|---|
id | int | Service ID number. |
name | string | Domain name. |
customerId | int | Customer ID of this domain. |
origins | Origin[] | List of Origin. |
deliveryDomain | string | Delivery domain which will be CName to. |
streamingService | boolean | true: Enabled, false: Disabled. |
http2 | boolean | true: Enabled, false: Disabled. If the value is not set, the default value will be used. |
redirectHttpToHttps | boolean | Whether redirect all plain http requests to https. true: Enabled, false: Disabled. Default is false. If the value is not set, the default value will be used. |
active | boolean | true: Enabled, false: Disabled. |
- Response Body Example
{
"id": 101,
"name": "www.website1.com",
"customerId": 11,
"origins":[
{
"urlPrefix":"https://origin.domain.com:8888/foo/bar",
"sni":"origin-a.domain.com",
"headers":{"Host":"origin-b.domain.com","X-Foo":"bar"}
}
],
"redirectHttpToHttps": true,
"deliveryDomain": "edge.swiftserve.com",
"streamingService": true,
"http2":true,
"active": true
}