List Services
Retrieves the services records for the specified customer.
Request
Request-Line
GET /cdn/v1.0/services HTTP/1.1
Response
Response Body
| Parameter | Type | Description |
|---|---|---|
| Array | Array of Service. |
Object: Service
| Property name | Type | Description |
|---|---|---|
| id | Integer | Service ID number. |
| domainName | String | Domain name. |
| origins | Array | 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. See Origin for details. |
| defaultHostHeader | String | Applies when no host header or SNI is configured. Both host header and SNI can be configured in the origin control. preserve:Maintains the host header and SNI from the original request. originHost:Maintains the host header and SNI from the host in the origin URL. |
| alternateDomainNames | String[] | Array of alternate domain names. |
| streaming | Boolean | To indicate if need to combine multiple requests as one request to origin server. true: Enabled, false: Disabled. Default is false. |
| http2 | Boolean | true: Enabled, false: Disabled. Default is true. |
| http3 | Boolean | true: Enabled, false: Disabled. Default is false. |
| redirectHttpToHttps | Boolean | Whether redirect all plain HTTP requests to HTTPS. true: Enabled, false: Disabled. Default is false. |
| tlsProfile | String | Effective TLS delivery profile for HTTP protocol. |
| enabled | Boolean | To indicate if service is enabled or disabled. true: Enabled, false: Disabled. Default is true. |
Object: Origin
| Property name | Type | Description |
|---|---|---|
| originUrl | 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 | String | The server name to send to the origin during SSL handshake. |
| headers | Object | The Origin Headers containing extra headers to send to the origin. |
| s3Credential | Object | Configure the S3 credential. See S3Credential for details. |
Object: S3 Credential
| Property name | Type | Description |
|---|---|---|
| accessKey | String | Configure the AWS access key ID to generate the signature to access S3. |
| accessSecret | String | Configure the AWS access secret to generate the signature to access S3. |
| region | String | Configure the AWS region. Example: ap-southeast-1. |
| dropQueryString | Boolean | Drop the query string from the origin generating the signature to it.default is false. |
Status Codes, Error Codes and Error Messages
| Status Code | Error Code | Error Message |
|---|---|---|
| 400 | InvalidCustomer.IdEmpty | Customer id can not be empty. |
Examples
List Services
Request
GET /cdn/v1.0/services HTTP/1.1
Successful Response Body
[
{
"id": 228622,
"domainName": "test.example.com",
"streaming": true,
"http2": true,
"http3": false,
"redirectHttpToHttps": true,
"enabled": true,
"tlsProfile": "modern",
"origins": [
{
"originUrl": "https://origin1.example.com",
"sni": "origin-sni.example.com",
"headers": {
"X-Custom-Header": "test-value",
"X-Forwarded-For": "client-ip"
},
"s3Credential": {
"accessKey": "AKIAEXAMPLE123456",
"accessSecret": "secret1234567890abcdefghijklmnopqrstuvwxyz",
"region": "us-east-1",
"dropQueryString": false
}
}
],
"defaultHostHeader": "originHost",
"alternateDomainNames": [
"cdn.example.com",
"www.test.example.com"
],
"cName": "edge2x.testing.swiftserve.com"
},
{
"id": 228624,
"domainName": "test2.example.com",
"streaming": true,
"http2": true,
"http3": false,
"redirectHttpToHttps": true,
"enabled": true,
"tlsProfile": "modern",
"origins": [
{
"originUrl": "https://origin1.example.com",
"sni": "origin-sni.example.com",
"headers": {
"Host": "origin-host.example.com",
"X-Custom-Header": "test-value",
"X-Forwarded-For": "client-ip"
},
"s3Credential": {
"accessKey": "AKIAEXAMPLE123456",
"accessSecret": "secret1234567890abcdefghijklmnopqrstuvwxyz",
"region": "us-east-1",
"dropQueryString": false
}
}
],
"defaultHostHeader": "originHost",
"alternateDomainNames": [
"www2.test.example.com",
"cdn2.example.com"
],
"cName": "edge2x.testing.swiftserve.com"
}
]