Skip to main content

List Services

Retrieves the services records for the specified customer.

Request

Request-Line

GET /cdn/v1.0/services HTTP/1.1

Response

Response Body

ParameterTypeDescription
ArrayArray of Service.

Object: Service

Property nameTypeDescription
idIntegerService ID number.
domainNameStringDomain name.
originsArrayList 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.
defaultHostHeaderStringApplies 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.
alternateDomainNamesString[]Array of alternate domain names.
streamingBooleanTo indicate if need to combine multiple requests as one request to origin server. true: Enabled, false: Disabled. Default is false.
http2Booleantrue: Enabled, false: Disabled. Default is true.
http3Booleantrue: Enabled, false: Disabled. Default is false.
redirectHttpToHttpsBooleanWhether redirect all plain HTTP requests to HTTPS. true: Enabled, false: Disabled. Default is false.
tlsProfileStringEffective TLS delivery profile for HTTP protocol.
enabledBooleanTo indicate if service is enabled or disabled. true: Enabled, false: Disabled. Default is true.

Object: Origin

Property nameTypeDescription
originUrlStringThe 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.
sniStringThe server name to send to the origin during SSL handshake.
headersObjectThe Origin Headers containing extra headers to send to the origin.
s3CredentialObjectConfigure the S3 credential. See S3Credential for details.

Object: S3 Credential

Property nameTypeDescription
accessKeyStringConfigure the AWS access key ID to generate the signature to access S3.
accessSecretStringConfigure the AWS access secret to generate the signature to access S3.
regionStringConfigure the AWS region. Example: ap-southeast-1.
dropQueryStringBooleanDrop the query string from the origin generating the signature to it.default is false.

Status Codes, Error Codes and Error Messages

Status CodeError CodeError Message
400InvalidCustomer.IdEmptyCustomer 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"
}
]