public final class RestClient extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RestClient.Response |
static class |
RestClient.WatchResponse |
Modifier and Type | Field and Description |
---|---|
static int |
HTTP_NOT_FOUND
HTTP status code 404 NOT FOUND
|
static int |
HTTP_OK
HTTP status code 200 OK
|
Modifier | Constructor and Description |
---|---|
protected |
RestClient(String url) |
Modifier and Type | Method and Description |
---|---|
static RestClient |
create(String url) |
RestClient |
expectResponseCodes(Integer... codes) |
RestClient.Response |
get() |
RestClient.Response |
post() |
RestClient.Response |
put() |
RestClient.WatchResponse |
watch(String resourceVersion)
Issues a watch request to a Kubernetes resource, starting with the given
resourceVersion . |
RestClient |
withBody(String body) |
RestClient |
withCaCertificates(String caCertificate) |
RestClient |
withConnectTimeoutSeconds(int connectTimeoutSeconds) |
RestClient |
withHeader(String name,
String value) |
RestClient |
withHeaders(Map<String,String> headers) |
RestClient |
withReadTimeoutSeconds(int readTimeoutSeconds) |
RestClient |
withRetries(int retries) |
public static final int HTTP_OK
public static final int HTTP_NOT_FOUND
protected RestClient(String url)
public static RestClient create(String url)
public RestClient withHeaders(Map<String,String> headers)
public RestClient withHeader(String name, String value)
public RestClient withBody(String body)
public RestClient withReadTimeoutSeconds(int readTimeoutSeconds)
public RestClient withConnectTimeoutSeconds(int connectTimeoutSeconds)
public RestClient withRetries(int retries)
public RestClient withCaCertificates(String caCertificate)
public RestClient expectResponseCodes(Integer... codes)
public RestClient.Response get()
public RestClient.Response post()
public RestClient.Response put()
public RestClient.WatchResponse watch(String resourceVersion)
resourceVersion
.
Since a watch implies a stream of updates from the server will be consumed, unlike other methods
in this class, it is the responsibility of the consumer to disconnect the connection
(by invoking RestClient.WatchResponse.disconnect()
) once the watch is no longer required.Copyright © 2023 Hazelcast, Inc.. All rights reserved.