Package org.apache.pulsar.client.admin
Interface Clusters
public interface Clusters
Admin interface for clusters management.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createCluster
(String cluster, ClusterData clusterData) Create a new cluster.createClusterAsync
(String cluster, ClusterData clusterData) Create a new cluster asynchronously.void
createFailureDomain
(String cluster, String domainName, FailureDomain domain) Create a domain into cluster.createFailureDomainAsync
(String cluster, String domainName, FailureDomain domain) Create a domain into cluster asynchronously.void
createNamespaceIsolationPolicy
(String cluster, String policyName, NamespaceIsolationData namespaceIsolationData) Create a namespace isolation policy for a cluster.createNamespaceIsolationPolicyAsync
(String cluster, String policyName, NamespaceIsolationData namespaceIsolationData) Create a namespace isolation policy for a cluster asynchronously.void
deleteCluster
(String cluster) Delete an existing cluster.deleteClusterAsync
(String cluster) Delete an existing cluster asynchronously.void
deleteFailureDomain
(String cluster, String domainName) Delete a domain in cluster.deleteFailureDomainAsync
(String cluster, String domainName) Delete a domain in cluster asynchronously.void
deleteNamespaceIsolationPolicy
(String cluster, String policyName) Delete a namespace isolation policy for a cluster.deleteNamespaceIsolationPolicyAsync
(String cluster, String policyName) Delete a namespace isolation policy for a cluster asynchronously.Returns list of active brokers with namespace-isolation policies attached to it.Returns list of active brokers with namespace-isolation policies attached to it asynchronously.getBrokerWithNamespaceIsolationPolicy
(String cluster, String broker) Returns active broker with namespace-isolation policies attached to it.getBrokerWithNamespaceIsolationPolicyAsync
(String cluster, String broker) Returns active broker with namespace-isolation policies attached to it asynchronously.getCluster
(String cluster) Get the configuration data for the specified cluster.getClusterAsync
(String cluster) Get the configuration data for the specified cluster asynchronously.Get the list of clusters.Get the list of clusters asynchronously.getFailureDomain
(String cluster, String domainName) Get the domain registered into a cluster.getFailureDomainAsync
(String cluster, String domainName) Get the domain registered into a cluster asynchronously.getFailureDomains
(String cluster) Get all registered domains in cluster.getFailureDomainsAsync
(String cluster) Get all registered domains in cluster asynchronously.getNamespaceIsolationPolicies
(String cluster) Get the namespace isolation policies of a cluster.getNamespaceIsolationPoliciesAsync
(String cluster) Get the namespace isolation policies of a cluster asynchronously.getNamespaceIsolationPolicy
(String cluster, String policyName) Get a single namespace isolation policy for a cluster.getNamespaceIsolationPolicyAsync
(String cluster, String policyName) Get a single namespace isolation policy for a cluster asynchronously.getPeerClusterNames
(String cluster) Get peer-cluster names.getPeerClusterNamesAsync
(String cluster) Get peer-cluster names asynchronously.void
updateCluster
(String cluster, ClusterData clusterData) Update the configuration for a cluster.updateClusterAsync
(String cluster, ClusterData clusterData) Update the configuration for a cluster asynchronously.void
updateFailureDomain
(String cluster, String domainName, FailureDomain domain) Update a domain into cluster.updateFailureDomainAsync
(String cluster, String domainName, FailureDomain domain) Update a domain into cluster asynchronously.void
updateNamespaceIsolationPolicy
(String cluster, String policyName, NamespaceIsolationData namespaceIsolationData) Update a namespace isolation policy for a cluster.updateNamespaceIsolationPolicyAsync
(String cluster, String policyName, NamespaceIsolationData namespaceIsolationData) Update a namespace isolation policy for a cluster asynchronously.void
updatePeerClusterNames
(String cluster, LinkedHashSet<String> peerClusterNames) Update peer cluster names.updatePeerClusterNamesAsync
(String cluster, LinkedHashSet<String> peerClusterNames) Update peer cluster names asynchronously.
-
Method Details
-
getClusters
Get the list of clusters. Get the list of all the Pulsar clusters. Response Example:["c1", "c2", "c3"]
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException
- Unexpected error
-
getClustersAsync
CompletableFuture<List<String>> getClustersAsync()Get the list of clusters asynchronously. Get the list of all the Pulsar clusters. Response Example:["c1", "c2", "c3"]
-
getCluster
Get the configuration data for the specified cluster. Response Example:{ serviceUrl : "http://my-broker.example.com:8080/" }
- Parameters:
cluster
- Cluster name- Returns:
- the cluster configuration
- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to get the configuration of the clusterPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
getClusterAsync
Get the configuration data for the specified cluster asynchronously. Response Example:{ serviceUrl : "http://my-broker.example.com:8080/" }
- Parameters:
cluster
- Cluster name- Returns:
- the cluster configuration
-
createCluster
Create a new cluster. Provisions a new cluster. This operation requires Pulsar super-user privileges. The name cannot contain '/' characters.- Parameters:
cluster
- Cluster nameclusterData
- the cluster configuration object- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.ConflictException
- Cluster already existsPulsarAdminException
- Unexpected error
-
createClusterAsync
Create a new cluster asynchronously. Provisions a new cluster. This operation requires Pulsar super-user privileges. The name cannot contain '/' characters.- Parameters:
cluster
- Cluster nameclusterData
- the cluster configuration object
-
updateCluster
Update the configuration for a cluster. This operation requires Pulsar super-user privileges.- Parameters:
cluster
- Cluster nameclusterData
- the cluster configuration object- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
updateClusterAsync
Update the configuration for a cluster asynchronously. This operation requires Pulsar super-user privileges.- Parameters:
cluster
- Cluster nameclusterData
- the cluster configuration object
-
updatePeerClusterNames
void updatePeerClusterNames(String cluster, LinkedHashSet<String> peerClusterNames) throws PulsarAdminException Update peer cluster names. This operation requires Pulsar super-user privileges.- Parameters:
cluster
- Cluster namepeerClusterNames
- list of peer cluster names- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
updatePeerClusterNamesAsync
CompletableFuture<Void> updatePeerClusterNamesAsync(String cluster, LinkedHashSet<String> peerClusterNames) Update peer cluster names asynchronously. This operation requires Pulsar super-user privileges.- Parameters:
cluster
- Cluster namepeerClusterNames
- list of peer cluster names
-
getPeerClusterNames
Get peer-cluster names.- Parameters:
cluster
- Cluster name- Returns:
- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Domain doesn't existPulsarAdminException.PreconditionFailedException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
getPeerClusterNamesAsync
Get peer-cluster names asynchronously.- Parameters:
cluster
- Cluster name- Returns:
-
deleteCluster
Delete an existing cluster. Delete a cluster- Parameters:
cluster
- Cluster name- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permissionPulsarAdminException.NotFoundException
- Cluster does not existPulsarAdminException.PreconditionFailedException
- Cluster is not emptyPulsarAdminException
- Unexpected error
-
deleteClusterAsync
Delete an existing cluster asynchronously. Delete a cluster- Parameters:
cluster
- Cluster name
-
getNamespaceIsolationPolicies
Map<String,NamespaceIsolationData> getNamespaceIsolationPolicies(String cluster) throws PulsarAdminException Get the namespace isolation policies of a cluster.- Parameters:
cluster
- Cluster name- Returns:
- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Policies don't existPulsarAdminException.PreconditionFailedException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
getNamespaceIsolationPoliciesAsync
CompletableFuture<Map<String,NamespaceIsolationData>> getNamespaceIsolationPoliciesAsync(String cluster) Get the namespace isolation policies of a cluster asynchronously.- Parameters:
cluster
- Cluster name- Returns:
- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Policies don't existPulsarAdminException.PreconditionFailedException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
createNamespaceIsolationPolicy
void createNamespaceIsolationPolicy(String cluster, String policyName, NamespaceIsolationData namespaceIsolationData) throws PulsarAdminException Create a namespace isolation policy for a cluster.- Parameters:
cluster
- Cluster namepolicyName
- Policy namenamespaceIsolationData
- Namespace isolation policy configuration- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException.PreconditionFailedException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
createNamespaceIsolationPolicyAsync
CompletableFuture<Void> createNamespaceIsolationPolicyAsync(String cluster, String policyName, NamespaceIsolationData namespaceIsolationData) Create a namespace isolation policy for a cluster asynchronously.- Parameters:
cluster
- Cluster namepolicyName
- Policy namenamespaceIsolationData
- Namespace isolation policy configuration- Returns:
-
getBrokersWithNamespaceIsolationPolicy
List<BrokerNamespaceIsolationData> getBrokersWithNamespaceIsolationPolicy(String cluster) throws PulsarAdminException Returns list of active brokers with namespace-isolation policies attached to it.- Parameters:
cluster
-- Returns:
- Throws:
PulsarAdminException
-
getBrokersWithNamespaceIsolationPolicyAsync
CompletableFuture<List<BrokerNamespaceIsolationData>> getBrokersWithNamespaceIsolationPolicyAsync(String cluster) Returns list of active brokers with namespace-isolation policies attached to it asynchronously.- Parameters:
cluster
-- Returns:
-
getBrokerWithNamespaceIsolationPolicy
BrokerNamespaceIsolationData getBrokerWithNamespaceIsolationPolicy(String cluster, String broker) throws PulsarAdminException Returns active broker with namespace-isolation policies attached to it.- Parameters:
cluster
-broker
- the broker name in the form host:port.- Returns:
- Throws:
PulsarAdminException
-
getBrokerWithNamespaceIsolationPolicyAsync
CompletableFuture<BrokerNamespaceIsolationData> getBrokerWithNamespaceIsolationPolicyAsync(String cluster, String broker) Returns active broker with namespace-isolation policies attached to it asynchronously.- Parameters:
cluster
-broker
-- Returns:
-
updateNamespaceIsolationPolicy
void updateNamespaceIsolationPolicy(String cluster, String policyName, NamespaceIsolationData namespaceIsolationData) throws PulsarAdminException Update a namespace isolation policy for a cluster.- Parameters:
cluster
- Cluster namepolicyName
- Policy namenamespaceIsolationData
- Namespace isolation policy configuration- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException.PreconditionFailedException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
updateNamespaceIsolationPolicyAsync
CompletableFuture<Void> updateNamespaceIsolationPolicyAsync(String cluster, String policyName, NamespaceIsolationData namespaceIsolationData) Update a namespace isolation policy for a cluster asynchronously.- Parameters:
cluster
- Cluster namepolicyName
- Policy namenamespaceIsolationData
- Namespace isolation policy configuration- Returns:
-
deleteNamespaceIsolationPolicy
Delete a namespace isolation policy for a cluster.- Parameters:
cluster
- Cluster namepolicyName
- Policy name- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException.PreconditionFailedException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
deleteNamespaceIsolationPolicyAsync
Delete a namespace isolation policy for a cluster asynchronously.- Parameters:
cluster
- Cluster namepolicyName
- Policy name- Returns:
-
getNamespaceIsolationPolicy
NamespaceIsolationData getNamespaceIsolationPolicy(String cluster, String policyName) throws PulsarAdminException Get a single namespace isolation policy for a cluster.- Parameters:
cluster
- Cluster namepolicyName
- Policy name- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Policy doesn't existPulsarAdminException.PreconditionFailedException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
getNamespaceIsolationPolicyAsync
CompletableFuture<NamespaceIsolationData> getNamespaceIsolationPolicyAsync(String cluster, String policyName) Get a single namespace isolation policy for a cluster asynchronously.- Parameters:
cluster
- Cluster namepolicyName
- Policy name
-
createFailureDomain
void createFailureDomain(String cluster, String domainName, FailureDomain domain) throws PulsarAdminException Create a domain into cluster.- Parameters:
cluster
- Cluster namedomainName
- domain namedomain
- Domain configurations- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.ConflictException
- Broker already exist into other domainPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException.PreconditionFailedException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
createFailureDomainAsync
CompletableFuture<Void> createFailureDomainAsync(String cluster, String domainName, FailureDomain domain) Create a domain into cluster asynchronously.- Parameters:
cluster
- Cluster namedomainName
- domain namedomain
- Domain configurations- Returns:
-
updateFailureDomain
void updateFailureDomain(String cluster, String domainName, FailureDomain domain) throws PulsarAdminException Update a domain into cluster.- Parameters:
cluster
- Cluster namedomainName
- domain namedomain
- Domain configurations- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.ConflictException
- Broker already exist into other domainPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException.PreconditionFailedException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
updateFailureDomainAsync
CompletableFuture<Void> updateFailureDomainAsync(String cluster, String domainName, FailureDomain domain) Update a domain into cluster asynchronously.- Parameters:
cluster
- Cluster namedomainName
- domain namedomain
- Domain configurations- Returns:
-
deleteFailureDomain
Delete a domain in cluster.- Parameters:
cluster
- Cluster namedomainName
- Domain name- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException.PreconditionFailedException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
deleteFailureDomainAsync
Delete a domain in cluster asynchronously.- Parameters:
cluster
- Cluster namedomainName
- Domain name- Returns:
-
getFailureDomains
Get all registered domains in cluster.- Parameters:
cluster
- Cluster name- Returns:
- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Cluster don't existPulsarAdminException
- Unexpected error
-
getFailureDomainsAsync
Get all registered domains in cluster asynchronously.- Parameters:
cluster
- Cluster name- Returns:
-
getFailureDomain
Get the domain registered into a cluster.- Parameters:
cluster
- Cluster name- Returns:
- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Domain doesn't existPulsarAdminException.PreconditionFailedException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
getFailureDomainAsync
Get the domain registered into a cluster asynchronously.- Parameters:
cluster
- Cluster name- Returns:
-