Send an HTTP request to a GKE cluster's control plane.
Arguments
Arguments | |
---|---|
cluster_id |
The ID of the cluster.
|
path |
Path to the API endpoint (for example,
|
method |
The HTTP request method. One of:
|
project |
The project that the cluster is hosted in. Default value is this workflow's project.
|
location |
The location that the cluster is hosted in. Default value is this workflow's location.
|
timeout |
The request timeout, in seconds (default:
|
body |
The request body. If a Content-Type header is not specified and if the body value is bytes, the header is set to Content-Type: application/octet-stream ; otherwise, the body is JSON-encoded and the header is set to Content-type: application/json; charset=utf-8 . |
headers |
The HTTP request headers. If present, must be a map of simple types. If a Content-Type header is specified, the request body is encoded as prescribed. For example, it might be JSON or URL-encoded. |
query |
Optional query parameters. If present, must be a map of simple types that will be URL-encoded and appended to the URL. |
Returns
The HTTP response as a map with body
, code
(status code), and headers
attributes.
Raised exceptions
Exceptions | |
---|---|
ConnectionError |
In case of a network problem (DNS failure, refused connection, etc.). |
TimeoutError |
When the specified timeout is reached before the response is received. |
HttpError |
If the response status is >= 400. |
ValueError |
If timeout is > 1800, or if the cluster does not have status RUNNING . |