Domain Resource

Domains are used to map a request to a service inside your applications environment.

List Domains

Returns a list of domain resources associated with the current application.

GET /rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/domains

Response

[
   {
       "domain": "demo.d9tready.com",
       "port": "8080",
       "certificate": "New Cert (PK: My Key)",
       "force_ssl": false,
       "links":
       {
           "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/domains/demo.d9tready.com",
           "rel": "self"
       }
   },
   ...
]

Attributes

  • domain - Domain of resource.
  • port - Internal port of service. See Rule Resource
  • certificate - Verbose name of assigned Certificate.
  • force_ssl - Force HTTPS connection via 302 redirect.
  • _links - Link relations.

HTTP Status Codes

Status Code Description
200 OK No error, operation successful
403 FORBIDDEN Authentication failure
503 SERVICE UNAVAILABLE Service not/partially reachable

Retrieve Domain

Retrieve a single domain resources.

GET /rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/domains/demo.d9tready.com

Response

{
    "domain": "demo.d9tready.com",
    "port": "8080",
    "certificate": "New Cert (PK: My Key)",
    "force_ssl": false
}

Attributes

  • domain - Domain of resource.
  • port - Internal port of service. See Rule Resource
  • certificate - Verbose name of assigned Certificate.
  • force_ssl - Force HTTPS connection via 302 redirect.

HTTP Status Codes

Status Code Description
200 OK No error, operation successful
403 FORBIDDEN Authentication failure
404 NOT FOUND Resource not found
503 SERVICE UNAVAILABLE Service not/partially reachable

Create Domain

Add a domain to the application.

POST /rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/domains

Payload

{
   "domain": "<DOMAIN>",
   "port": "<PORT>",
   "tlsCertificate": "<CERTIFICATE_ID>",
   "forceSsl": true|false
}
  • domain - TLD or subdomain. See Rule Resource for host suffix.
  • port - Internal port of service. See Rule Resource
  • tlsCertificate - TLS certificate. Only available on HTTP ports.
  • forceSsl - Force redirection to SSL. Optional, defaults to false.

Response

On successful creation the URL to the new domain resource is set in the Location-Header.

HTTP/1.0 201 CREATED
Location: https://d9tready.com/rest/applications/<CONTAINER_ID>/domains/<DOMAIN>

HTTP Status Codes

Status Code Description
201 CREATED Successful creation of resource
400 BAD REQUEST Malformed syntax or bad query
403 FORBIDDEN Authentication failure

Delete Domain

Permanently delete a domain resource.

DELETE /rest/applications/<CONTAINER_ID>/domains/<DOMAIN>

HTTP Status Codes

Status Code Description
204 NO CONTENT Successful deletion of resource
400 BAD REQUEST Malformed syntax or bad query
403 FORBIDDEN Authentication failure