io.enterpriseai.manager.ManagerClient
Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/manager/ManagerClient.java. Back to the Java SDK reference index.
This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.
Class ManagerClient
Client of the Platform Manager API (navin-manager): hosts, clusters, services, HA, backups, restores and DR.
ManagerGroups
Attributes:
| Name | Type | Required | Description |
|---|---|---|---|
ON_BEHALF_HEADER | String | yes | Delegation header: the user a service token acts for. |
Constructor ManagerClient
ManagerClient(Builder settings, Sender sender)
Private constructor: the client is created with ManagerClient.builder(), fromEnv() or onBehalfOf.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
settings | Builder | yes | Validated builder settings, kept for onBehalfOf. | |
sender | Sender | yes | Internal HTTP sender that carries the token, the headers and the connection pool. |
ManagerClient.baseUrl
URI baseUrl()
Manager URL without trailing slash.
This element takes no parameter.
Returns: URI. the base URL
ManagerClient.call
JsonNode call(String operationIdOrAlias, Object body, Map<String, ?> query, String... pathParams)
Calls an operation by operationId (or alias), path parameters in template order.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
operationIdOrAlias | String | yes | operationId or group.method alias | |
body | Object | yes | JSON body for operations that take one (null sends {}), null otherwise | |
query | Map<String, ?> | yes | query parameters, null values skipped; may be null | |
pathParams | String... | yes | path parameters in template order |
Returns: JsonNode. the parsed response, a NullNode for an empty body
ManagerClient.locale
Locale locale()
Language of the error messages.
This element takes no parameter.
Returns: Locale. the locale
ManagerClient.onBehalfOf
ManagerClient onBehalfOf(String user)
A client with the same settings and connection pool acting on behalf of user.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
user | String | yes | user name the service token acts for (the token needs the auth:delegate permission) |
Returns: ManagerClient. the delegated client
ManagerClient.page
Page<JsonNode> page(String operationIdOrAlias, Map<String, ?> query, String... pathParams)
Calls a cursor paginated operation; the returned page fetches the next ones.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
operationIdOrAlias | String | yes | operationId or group.method alias of a paged operation | |
query | Map<String, ?> | yes | query parameters (limit, filters), null values skipped; may be null | |
pathParams | String... | yes | path parameters in template order |
Returns: Page<JsonNode>. the first page
Raises: IllegalArgumentException.
ManagerClient.toString
String toString()
Never prints the token.
This element takes no parameter.
Returns: String. The base URL, the masked token and the delegated user.
Class ManagerClient.Builder
Client configuration builder.
Builder.baseUrl
Builder baseUrl(String v)
Platform Manager URL, for example <manager-url> (https, or http on localhost).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | String | yes | the URL |
Returns: Builder. this builder
Builder.build
ManagerClient build()
Validates the settings and builds the client.
This element takes no parameter.
Returns: ManagerClient. the client
Raises: IllegalArgumentException.
Builder.caBundle
Builder caBundle(Path pem)
PEM file of extra trusted CA certificates (the manager PKI); certificate verification stays on.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
pem | Path | yes | the bundle |
Returns: Builder. this builder
Builder.connectTimeout
Builder connectTimeout(Duration v)
Connection timeout (default 10 s).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | Duration | yes | the timeout |
Returns: Builder. this builder
Builder.fromEnv
Builder fromEnv(Map<String, String> env)
Reads NM_MANAGER_URL, NM_MANAGER_TOKEN, NM_MANAGER_TOKEN_FILE, NM_MANAGER_CA_BUNDLE, NM_MANAGER_ON_BEHALF_OF and NM_MANAGER_LOCALE; blank values are ignored. Control Plane variables (EAI_*) are never read.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
env | Map<String, String> | yes | environment, usually System.getenv() |
Returns: Builder. this builder
Builder.header
Builder header(String name, String value)
Extra header sent on every request; it cannot replace Authorization or the delegation header.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
name | String | yes | header name | |
value | String | yes | header value |
Returns: Builder. this builder
Builder.httpClient
Builder httpClient(HttpClient v)
Custom java.net.http.HttpClient (proxy, executor); it must not follow redirects.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | HttpClient | yes | the client |
Returns: Builder. this builder
Builder.locale
Builder locale(Locale v)
Message language: Locale.ENGLISH (default) or Locale.FRENCH, sent as Accept-Language.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | Locale | yes | the locale |
Returns: Builder. this builder
Builder.onBehalfOf
Builder onBehalfOf(String user)
User the service token acts for, sent as X-NM-On-Behalf-Of.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
user | String | yes | the user name |
Returns: Builder. this builder
Builder.retries
Builder retries(int v)
Retries of GET, PUT and DELETE on network errors and HTTP 408/429/502/503/504 (default 2).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | int | yes | the number of retries |
Returns: Builder. this builder
Builder.retryBaseDelay
Builder retryBaseDelay(Duration v)
First backoff delay, doubled at each attempt; Retry-After wins when present.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | Duration | yes | the delay |
Returns: Builder. this builder
Builder.timeout
Builder timeout(Duration v)
Per request timeout (default 30 s).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | Duration | yes | the timeout |
Returns: Builder. this builder
Builder.toString
String toString()
Never prints the token.
This element takes no parameter.
Returns: String. A summary of the settings with the token masked.
Builder.token
Builder token(String v)
Manager API token nmt_<12 hex>_<secret>, sent as Authorization: Bearer.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | String | yes | the token |
Returns: Builder. this builder
Builder.tokenFile
Builder tokenFile(Path v)
File holding the token (mode 0600), read by #build() when no token is set.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | Path | yes | the token file |
Returns: Builder. this builder
Builder.traceparent
Builder traceparent(Supplier<String> v)
Supplies the W3C traceparent of the current span; a random one is generated otherwise.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | Supplier<String> | yes | the supplier |
Returns: Builder. this builder