Get Service Details
This API is used to get a website acceleration service details.
Request
Request-Line
GET /cdn/v1.0/service/{serviceId} HTTP/1.1
Request Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| serviceId | Integer | Mandatory | Service ID. |
Response
Response Body
| 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 | InvalidService.IdIncorrect | Service id is incorrect. |
Examples
GET Service Detail
Request
GET /cdn/v1.0/services/228622 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"
}