Upsert a Target associated with an Upstream

Create or Update a Target associated with an Upstream using ID or target.

put

Path Parameters

UpstreamIdForTargetstringrequired

ID or target of the Target to lookup

Example:5a078780-5d4c-4aae-984a-bdc6f52113d8

TargetIdstringrequired

ID of the Target to lookup

Example:5a078780-5d4c-4aae-984a-bdc6f52113d8

controlPlaneIdstring(uuid)required

The UUID of your control plane. This variable is available in the Konnect manager.

Example:9524ec7d-36d9-465d-a8c5-83a3c9390458

Body

application/json

Description of the Target

TargetWithoutParents

A target is an ip address/hostname with a port that identifies an instance of a backend service. Every upstream can have many targets, and the targets can be dynamically added, modified, or deleted. Changes take effect on the fly. To disable a target, post a new one with weight=0; alternatively, use the DELETE convenience method to accomplish the same. The current target object definition is the one with the latest created_at.

* Additional properties are NOT allowed.
created_atnumber

Unix epoch when the resource was created.

descriptionstring

User-defined entity description. Konnect only field, not synced to the Gateway.

failoverboolean

Whether to use this target only as backup or not.

Default:false

idstring

A string representing a UUID (universally unique identifier).

managed_byobject

Arbitrary JSON data for client responsible for managing the entity. Konnect only field, not synced to the Gateway.

* Additional properties are allowed.
tagsarray[string]

A string representing a tag.

targetstringrequired

The target address (ip or hostname) and port. If the hostname resolves to an SRV record, the port value will be overridden by the value from the DNS record.

updated_atnumber

Unix epoch when the resource was last updated.

upstreamobject

The unique identifier or the name of the upstream for which to update the target.

Show Child Parameters
weightinteger

The weight this target gets within the upstream loadbalancer (0-65535). If the hostname resolves to an SRV record, the weight value will be overridden by the value from the DNS record.

Default:100

>= 0<= 65535

Response

200 application/json

Successfully upserted Target

Target

A target is an ip address/hostname with a port that identifies an instance of a backend service. Every upstream can have many targets, and the targets can be dynamically added, modified, or deleted. Changes take effect on the fly. To disable a target, post a new one with weight=0; alternatively, use the DELETE convenience method to accomplish the same. The current target object definition is the one with the latest created_at.

* Additional properties are NOT allowed.
created_atnumber

Unix epoch when the resource was created.

descriptionstring

User-defined entity description. Konnect only field, not synced to the Gateway.

failoverboolean

Whether to use this target only as backup or not.

Default:false

idstring

A string representing a UUID (universally unique identifier).

managed_byobject

Arbitrary JSON data for client responsible for managing the entity. Konnect only field, not synced to the Gateway.

* Additional properties are allowed.
tagsarray[string]

A string representing a tag.

targetstringrequired

The target address (ip or hostname) and port. If the hostname resolves to an SRV record, the port value will be overridden by the value from the DNS record.

updated_atnumber

Unix epoch when the resource was last updated.

upstreamobject

The unique identifier or the name of the upstream for which to update the target.

Show Child Parameters
weightinteger

The weight this target gets within the upstream loadbalancer (0-65535). If the hostname resolves to an SRV record, the weight value will be overridden by the value from the DNS record.

Default:100

>= 0<= 65535

put/control-planes/{controlPlaneId}/core-entities/upstreams/{UpstreamIdForTarget}/targets/{TargetId}

Body

{ "id": "089292a7-ba3d-4d88-acf0-97b4b2e2621a", "target": "203.0.113.42", "weight": 100 }
 
200 application/json

Upstreams

The upstream object represents a virtual hostname and can be used to load balance incoming requests over multiple services (targets).



An upstream also includes a health checker, which can enable and disable targets based on their ability or inability to serve requests.
The configuration for the health checker is stored in the upstream object, and applies to all of its targets.

List all Upstreams in a workspace

List all Upstreams in a workspace

get

Query Parameters

sizeinteger

Number of resources to be returned.

Default:100

>= 1<= 1000

offsetstring

Offset from which to return the next set of resources. Use the value of the ‘offset’ field from the response of a list operation as input here to paginate through all the resources

tagsstring

A list of tags to filter the list of resources on. Multiple tags can be concatenated using ‘,’ to mean AND or using ‘/’ to mean OR.

Example:tag1,tag2

Path Parameters

workspacestring(string)required

The name of the workspace

Example:team-payments

controlPlaneIdstring(uuid)required

The UUID of your control plane. This variable is available in the Konnect manager.

Example:9524ec7d-36d9-465d-a8c5-83a3c9390458

Response

application/json

A successful response listing Upstreams

dataarray[object]

The upstream object represents a virtual hostname and can be used to loadbalance incoming requests over multiple services (targets). So for example an upstream named service.v1.xyz for a Service object whose host is service.v1.xyz. Requests for this Service would be proxied to the targets defined within the upstream. An upstream also includes a [health checker][healthchecks], which is able to enable and disable targets based on their ability or inability to serve requests. The configuration for the health checker is stored in the upstream object, and applies to all of its targets.

Example:{"algorithm":"round-robin","hash_fallback":"none","hash_on":"none","hash_on_cookie_path":"/","healthchecks":{"active":{"concurrency":10,"healthy":{"http_statuses":[200,302],"interval":0,"successes":0},"http_path":"/","https_verify_certificate":true,"timeout":1,"type":"http","unhealthy":{"http_failures":0,"http_statuses":[429,404,500,501,502,503,504,505],"interval":0,"tcp_failures":0,"timeouts":0}},"passive":{"healthy":{"http_statuses":[200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308],"successes":0},"type":"http","unhealthy":{"http_failures":0,"http_statuses":[429,500,503],"tcp_failures":0,"timeouts":0}},"threshold":0},"id":"6eed5e9c-5398-4026-9a4c-d48f18a2431e","name":"api.example.internal","slots":10000}

* Additional properties are NOT allowed.
Show Child Parameters
nextstring

URI to the next page (may be null)

offsetstring

Offset is used to paginate through the API. Provide this value to the next list operation to fetch the next page

get/control-planes/{controlPlaneId}/core-entities/{workspace}/upstreams
 
application/json

Create a new Upstream in a workspace

Create a new Upstream in a workspace

post

Path Parameters

workspacestring(string)required

The name of the workspace

Example:team-payments

controlPlaneIdstring(uuid)required

The UUID of your control plane. This variable is available in the Konnect manager.

Example:9524ec7d-36d9-465d-a8c5-83a3c9390458

Body

application/json

Description of the new Upstream for creation

Upstream

The upstream object represents a virtual hostname and can be used to loadbalance incoming requests over multiple services (targets). So for example an upstream named service.v1.xyz for a Service object whose host is service.v1.xyz. Requests for this Service would be proxied to the targets defined within the upstream. An upstream also includes a [health checker][healthchecks], which is able to enable and disable targets based on their ability or inability to serve requests. The configuration for the health checker is stored in the upstream object, and applies to all of its targets.

* Additional properties are NOT allowed.
algorithmstring

Which load balancing algorithm to use.

Allowed values:consistent-hashinglatencyleast-connectionsround-robinsticky-sessions

Default:round-robin

client_certificateobject

If set, the certificate to be used as client certificate while TLS handshaking to the upstream server.

Show Child Parameters
created_atinteger

Unix epoch when the resource was created.

descriptionstring

User-defined entity description. Konnect only field, not synced to the Gateway.

hash_fallbackstring

What to use as hashing input if the primary hash_on does not return a hash (eg. header is missing, or no Consumer identified). Not available if hash_on is set to cookie.

Allowed values:consumercookieheaderipnonepathquery_arguri_capture

Default:none

hash_fallback_headerstring

The header name to take the value from as hash input. Only required when hash_fallback is set to header.

hash_fallback_query_argstring

The name of the query string argument to take the value from as hash input. Only required when hash_fallback is set to query_arg.

>= 1 characters

hash_fallback_uri_capturestring

The name of the route URI capture to take the value from as hash input. Only required when hash_fallback is set to uri_capture.

>= 1 characters

hash_onstring

What to use as hashing input. Using none results in a weighted-round-robin scheme with no hashing.

Allowed values:consumercookieheaderipnonepathquery_arguri_capture

Default:none

hash_on_cookiestring

The cookie name to take the value from as hash input. Only required when hash_on or hash_fallback is set to cookie. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response.

hash_on_cookie_pathstring

The cookie path to set in the response headers. Only required when hash_on or hash_fallback is set to cookie.

Default:/

hash_on_headerstring

The header name to take the value from as hash input. Only required when hash_on is set to header.

hash_on_query_argstring

The name of the query string argument to take the value from as hash input. Only required when hash_on is set to query_arg.

>= 1 characters

hash_on_uri_capturestring

The name of the route URI capture to take the value from as hash input. Only required when hash_on is set to uri_capture.

>= 1 characters

healthchecksobject

The array of healthchecks.

Default:{"active":{"concurrency":10,"healthy":{"http_statuses":[200,302],"interval":0,"successes":0},"http_path":"/","https_verify_certificate":true,"timeout":1,"type":"http","unhealthy":{"http_failures":0,"http_statuses":[429,404,500,501,502,503,504,505],"interval":0,"tcp_failures":0,"timeouts":0}},"passive":{"healthy":{"http_statuses":[200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308],"successes":0},"type":"http","unhealthy":{"http_failures":0,"http_statuses":[429,500,503],"tcp_failures":0,"timeouts":0}}}

Show Child Parameters
host_headerstring

The hostname to be used as Host header when proxying requests through Kong.

idstring

A string representing a UUID (universally unique identifier).

managed_byobject

Arbitrary JSON data for client responsible for managing the entity. Konnect only field, not synced to the Gateway.

* Additional properties are allowed.
namestringrequired

This is a hostname, which must be equal to the host of a Service.

slotsinteger

The number of slots in the load balancer algorithm. If algorithm is set to round-robin, this setting determines the maximum number of slots. If algorithm is set to consistent-hashing, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range 10-65536.

Default:10000

>= 10<= 65536

sticky_sessions_cookiestring

The cookie name to keep sticky sessions.

sticky_sessions_cookie_pathstring

A string representing a URL path, such as /path/to/resource. Must start with a forward slash (/) and must not contain empty segments (i.e., two consecutive forward slashes).

Default:/

tagsarray[string]

A string representing a tag.

updated_atinteger

Unix epoch when the resource was last updated.

use_srv_nameboolean

If set, the balancer will use SRV hostname(if DNS Answer has SRV record) as the proxy upstream Host.

Default:false

Response

application/json

Successfully created Upstream

Upstream

The upstream object represents a virtual hostname and can be used to loadbalance incoming requests over multiple services (targets). So for example an upstream named service.v1.xyz for a Service object whose host is service.v1.xyz. Requests for this Service would be proxied to the targets defined within the upstream. An upstream also includes a [health checker][healthchecks], which is able to enable and disable targets based on their ability or inability to serve requests. The configuration for the health checker is stored in the upstream object, and applies to all of its targets.

* Additional properties are NOT allowed.
algorithmstring

Which load balancing algorithm to use.

Allowed values:consistent-hashinglatencyleast-connectionsround-robinsticky-sessions

Default:round-robin

client_certificateobject

If set, the certificate to be used as client certificate while TLS handshaking to the upstream server.

Show Child Parameters
created_atinteger

Unix epoch when the resource was created.

descriptionstring

User-defined entity description. Konnect only field, not synced to the Gateway.

hash_fallbackstring

What to use as hashing input if the primary hash_on does not return a hash (eg. header is missing, or no Consumer identified). Not available if hash_on is set to cookie.

Allowed values:consumercookieheaderipnonepathquery_arguri_capture

Default:none

hash_fallback_headerstring

The header name to take the value from as hash input. Only required when hash_fallback is set to header.

hash_fallback_query_argstring

The name of the query string argument to take the value from as hash input. Only required when hash_fallback is set to query_arg.

>= 1 characters

hash_fallback_uri_capturestring

The name of the route URI capture to take the value from as hash input. Only required when hash_fallback is set to uri_capture.

>= 1 characters

hash_onstring

What to use as hashing input. Using none results in a weighted-round-robin scheme with no hashing.

Allowed values:consumercookieheaderipnonepathquery_arguri_capture

Default:none

hash_on_cookiestring

The cookie name to take the value from as hash input. Only required when hash_on or hash_fallback is set to cookie. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response.

hash_on_cookie_pathstring

The cookie path to set in the response headers. Only required when hash_on or hash_fallback is set to cookie.

Default:/

hash_on_headerstring

The header name to take the value from as hash input. Only required when hash_on is set to header.

hash_on_query_argstring

The name of the query string argument to take the value from as hash input. Only required when hash_on is set to query_arg.

>= 1 characters

hash_on_uri_capturestring

The name of the route URI capture to take the value from as hash input. Only required when hash_on is set to uri_capture.

>= 1 characters

healthchecksobject

The array of healthchecks.

Default:{"active":{"concurrency":10,"healthy":{"http_statuses":[200,302],"interval":0,"successes":0},"http_path":"/","https_verify_certificate":true,"timeout":1,"type":"http","unhealthy":{"http_failures":0,"http_statuses":[429,404,500,501,502,503,504,505],"interval":0,"tcp_failures":0,"timeouts":0}},"passive":{"healthy":{"http_statuses":[200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308],"successes":0},"type":"http","unhealthy":{"http_failures":0,"http_statuses":[429,500,503],"tcp_failures":0,"timeouts":0}}}

Show Child Parameters
host_headerstring

The hostname to be used as Host header when proxying requests through Kong.

idstring

A string representing a UUID (universally unique identifier).

managed_byobject

Arbitrary JSON data for client responsible for managing the entity. Konnect only field, not synced to the Gateway.

* Additional properties are allowed.
namestringrequired

This is a hostname, which must be equal to the host of a Service.

slotsinteger

The number of slots in the load balancer algorithm. If algorithm is set to round-robin, this setting determines the maximum number of slots. If algorithm is set to consistent-hashing, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range 10-65536.

Default:10000

>= 10<= 65536

sticky_sessions_cookiestring

The cookie name to keep sticky sessions.

sticky_sessions_cookie_pathstring

A string representing a URL path, such as /path/to/resource. Must start with a forward slash (/) and must not contain empty segments (i.e., two consecutive forward slashes).

Default:/

tagsarray[string]

A string representing a tag.

updated_atinteger

Unix epoch when the resource was last updated.

use_srv_nameboolean

If set, the balancer will use SRV hostname(if DNS Answer has SRV record) as the proxy upstream Host.

Default:false

post/control-planes/{controlPlaneId}/core-entities/{workspace}/upstreams

Body

{ "algorithm": "round-robin", "hash_fallback": "none", "hash_on": "none", "hash_on_cookie_path": "/", "healthchecks": { "active": { "concurrency": 10, "healthy": { "http_statuses": [ 200, 302 ], "interval": 0, "successes": 0 }, "http_path": "/", "https_verify_certificate": true, "timeout": 1, "type": "http", "unhealthy": { "http_failures": 0, "http_statuses": [ 429, 404, 500, 501, 502, 503, 504, 505 ], "interval": 0, "tcp_failures": 0, "timeouts": 0 } }, "passive": { "healthy": { "http_statuses": [ 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308 ], "successes": 0 }, "type": "http", "unhealthy": { "http_failures": 0, "http_statuses": [ 429, 500, 503 ], "tcp_failures": 0, "timeouts": 0 } }, "threshold": 0 }, "id": "6eed5e9c-5398-4026-9a4c-d48f18a2431e", "name": "api.example.internal", "slots": 10000 }
 
application/json

Delete an Upstream in a workspace

Delete an Upstream in a workspace

delete

Path Parameters

UpstreamIdstringrequired

ID of the Upstream to lookup

Example:426d620c-7058-4ae6-aacc-f85a3204a2c5

workspacestring(string)required

The name of the workspace

Example:team-payments

controlPlaneIdstring(uuid)required

The UUID of your control plane. This variable is available in the Konnect manager.

Example:9524ec7d-36d9-465d-a8c5-83a3c9390458

Response

Successfully deleted Upstream or the resource didn’t exist

delete/control-planes/{controlPlaneId}/core-entities/{workspace}/upstreams/{UpstreamId}