Create Service Associated to a Specific Certificate

POST {{gateway}}/certificates/:certificateIdorName/services

Create Service Associated to a Specific Certificate konghq

AttributesMandatoryTypeDescription
certificate name or idrequiredpathThe unique identifier or the name attribute of the Certificate that should be associated to the newly-created Service.

Request Body

AttributesMandatoryDescription
nameoptionalThe Service name
retriesoptionalThe number of retries to execute upon failure to proxy. Defaults to 5
protocolrequiredThe protocol used to communicate with the upstream. Accepted values are: "grpc", "grpcs", "http", "https", "tcp", "tls". Defaults to "http"
hostrequiredThe host of the upstream server
portrequiredThe upstream server port. Defaults to 80
pathoptionalThe path to be used in requests to the upstream server.
connect_timeoutoptionalThe timeout in milliseconds for establishing a connection to the upstream server. Defaults to 60000.
write_timeoutoptionalThe timeout in milliseconds between two successive write operations for transmitting a request to the upstream server. Defaults to 60000.
read_timeoutoptionalThe timeout in milliseconds between two successive read operations for transmitting a request to the upstream server. Defaults to 60000.
tagsoptionalAn optional set of strings associated with the Service, for grouping and filtering.
client_certificateoptionalCertificate to be used as client certificate while TLS handshaking to the upstream server. With form-encoded, the notation is client_certificate.id=. With JSON, use “"client_certificate":{"id":""}.
urlrequiredShorthand attribute to set protocol, host, port and path at once. This attribute is write-only (the Admin API never “returns” the url).

Request Body

{"name"=>"httpbin-api", "url"=>"https://httpbin.org/"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: Created

{"host":"httpbin.org","created_at":1583524667,"connect_timeout":60000,"id":"ebcbaad6-797f-435c-be22-63051db717c3","protocol":"https","name":"httpbin-api","read_timeout":60000,"port":443,"path":"/","updated_at":1583524667,"retries":5,"write_timeout":60000,"tags":null,"client_certificate":null}