Package io.stargate.sdk.data
Class DataApiClient
java.lang.Object
io.stargate.sdk.data.DataApiClient
Client core for Data API (crud for namespaces).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringdefault endpoint.static final Stringdefault service id.static final Stringpath for json api.static final Stringdefault endpoint.final Function<ServiceHttp, String> Function to compute the root.protected final LoadBalancedHttpClientGet Topology of the nodes.protected final StringVersion of the API. -
Constructor Summary
ConstructorsConstructorDescriptionDefault ConstructorDataApiClient(ServiceDeployment<ServiceHttp> serviceDeployment) Initialized document API with a URL and a token.DataApiClient(ServiceDeployment<ServiceHttp> serviceDeployment, String version) Initialized document API with a URL and a token.DataApiClient(String endpoint) Single instance of Stargate, could be used for tests.DataApiClient(String endpoint, String version) Single instance of Stargate, could be used for tests. -
Method Summary
Modifier and TypeMethodDescriptionvoidCreate a Namespace providing a name.createNamespace(String namespace) Create a Namespace providing a name.voiddropNamespace(String namespace) Drop a namespace, no error if it does not exist.Find Namespaces.booleanisNamespaceExists(String namespace) Evaluate if a namespace exists.Move the document API (namespace client)
-
Field Details
-
DEFAULT_ENDPOINT
default endpoint.- See Also:
-
PATH_HEALTH_CHECK
default endpoint.- See Also:
-
DEFAULT_SERVICE_ID
default service id.- See Also:
-
DEFAULT_VERSION
path for json api.- See Also:
-
rootResource
Function to compute the root. -
stargateHttpClient
Get Topology of the nodes. -
version
Version of the API.
-
-
Constructor Details
-
DataApiClient
public DataApiClient()Default Constructor -
DataApiClient
Single instance of Stargate, could be used for tests.- Parameters:
endpoint- service endpoint
-
DataApiClient
Single instance of Stargate, could be used for tests.- Parameters:
endpoint- service endpointversion- provide version number
-
DataApiClient
Initialized document API with a URL and a token.- Parameters:
serviceDeployment- http client topology aware
-
DataApiClient
Initialized document API with a URL and a token.- Parameters:
serviceDeployment- http client topology awareversion- customized version
-
-
Method Details
-
isNamespaceExists
Evaluate if a namespace exists.- Parameters:
namespace- namespace name.- Returns:
- if namespace exists
-
findAllNamespaces
Find Namespaces.- Returns:
- a list of namespaces
-
createNamespace
Create a Namespace providing a name.- Parameters:
namespace- current namespace.- Returns:
- client for namespace
-
createNamespace
Create a Namespace providing a name.- Parameters:
req- current namespace.
-
dropNamespace
Drop a namespace, no error if it does not exist.- Parameters:
namespace- current namespace
-
namespace
Move the document API (namespace client)- Parameters:
namespace- String- Returns:
- NamespaceClient
-