Class HttpCloudClient
java.lang.Object
com.cockroachlabs.data.continuum.cloud.HttpCloudClient
- All Implemented Interfaces:
CloudClient
HTTP-backed
CloudClient that talks to the real CockroachDB Cloud API
using a service-account Bearer token.
To stay independent of the host application's HTTP message converters and
Jackson version, responses are retrieved as text and parsed with Spring Boot's
JsonParser, and request bodies are written as compact JSON strings.
Fields are mapped by their documented (snake_case) names. Construct with
create(String, String) in production, or pass a pre-built
RestClient (e.g. bound to a MockRestServiceServer) in tests.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.cockroachlabs.data.continuum.cloud.CloudClient
CloudClient.Cluster, CloudClient.MetricExportConfig, CloudClient.MetricExportTarget, CloudClient.VirtualCluster -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureMetricExport(String clusterId, CloudClient.MetricExportConfig config) Enables a metric-export sink for a cluster.static HttpCloudClientBuilds anHttpCloudClientfor the given base URL and API key.getCluster(String clusterId) Returns a single cluster by its control-plane ID.Returns the clusters visible to the configured service account.
-
Field Details
-
DEFAULT_BASE_URL
Default CockroachDB Cloud API base URL.- See Also:
-
-
Constructor Details
-
HttpCloudClient
public HttpCloudClient(org.springframework.web.client.RestClient rest)
-
-
Method Details
-
create
Builds anHttpCloudClientfor the given base URL and API key. -
listClusters
Description copied from interface:CloudClientReturns the clusters visible to the configured service account.- Specified by:
listClustersin interfaceCloudClient
-
getCluster
Description copied from interface:CloudClientReturns a single cluster by its control-plane ID.- Specified by:
getClusterin interfaceCloudClient
-
configureMetricExport
Description copied from interface:CloudClientEnables a metric-export sink for a cluster.- Specified by:
configureMetricExportin interfaceCloudClient
-