Package org.apache.pulsar.client.admin
Interface Tenants
public interface Tenants
Admin interface for tenants management.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createTenant
(String tenant, TenantInfo config) Create a new tenant.createTenantAsync
(String tenant, TenantInfo config) Create a new tenant asynchronously.void
deleteTenant
(String tenant) Delete an existing tenant.void
deleteTenant
(String tenant, boolean force) Delete an existing tenant.deleteTenantAsync
(String tenant) Delete an existing tenant asynchronously.deleteTenantAsync
(String tenant, boolean force) Delete an existing tenant asynchronously.getTenantInfo
(String tenant) Get the config of the tenant.getTenantInfoAsync
(String tenant) Get the config of the tenant asynchronously.Get the list of tenants.Get the list of tenants asynchronously.void
updateTenant
(String tenant, TenantInfo config) Update the admins for a tenant.updateTenantAsync
(String tenant, TenantInfo config) Update the admins for a tenant asynchronously.
-
Method Details
-
getTenants
Get the list of tenants. Response Example:["my-tenant", "other-tenant", "third-tenant"]
- Returns:
- the list of Pulsar tenants
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException
- Unexpected error
-
getTenantsAsync
CompletableFuture<List<String>> getTenantsAsync()Get the list of tenants asynchronously. Response Example:["my-tenant", "other-tenant", "third-tenant"]
- Returns:
- the list of Pulsar tenants
-
getTenantInfo
Get the config of the tenant. Get the admin configuration for a given tenant.- Parameters:
tenant
- Tenant name- Returns:
- the tenant configuration
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Tenant does not existPulsarAdminException
- Unexpected error
-
getTenantInfoAsync
Get the config of the tenant asynchronously. Get the admin configuration for a given tenant.- Parameters:
tenant
- Tenant name- Returns:
- the tenant configuration
-
createTenant
Create a new tenant. Provisions a new tenant. This operation requires Pulsar super-user privileges.- Parameters:
tenant
- Tenant nameconfig
- Config data- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.ConflictException
- Tenant already existsPulsarAdminException.PreconditionFailedException
- Tenant name is not validPulsarAdminException
- Unexpected error
-
createTenantAsync
Create a new tenant asynchronously. Provisions a new tenant. This operation requires Pulsar super-user privileges.- Parameters:
tenant
- Tenant nameconfig
- Config data
-
updateTenant
Update the admins for a tenant. This operation requires Pulsar super-user privileges.- Parameters:
tenant
- Tenant nameconfig
- Config data- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Tenant does not existPulsarAdminException
- Unexpected error
-
updateTenantAsync
Update the admins for a tenant asynchronously. This operation requires Pulsar super-user privileges.- Parameters:
tenant
- Tenant nameconfig
- Config data
-
deleteTenant
Delete an existing tenant. Delete a tenant and all namespaces and topics under it.- Parameters:
tenant
- Tenant name- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- The tenant does not existPulsarAdminException.ConflictException
- The tenant still has active namespacesPulsarAdminException
- Unexpected error
-
deleteTenant
Delete an existing tenant. Force flag delete a tenant forcefully and all namespaces and topics under it.- Parameters:
tenant
- Tenant nameforce
- Delete tenant forcefully- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- The tenant does not existPulsarAdminException.ConflictException
- The tenant still has active namespacesPulsarAdminException
- Unexpected error
-
deleteTenantAsync
Delete an existing tenant asynchronously. Delete a tenant and all namespaces and topics under it.- Parameters:
tenant
- Tenant name
-
deleteTenantAsync
Delete an existing tenant asynchronously. Force flag delete a tenant forcefully and all namespaces and topics under it.- Parameters:
tenant
- Tenant nameforce
- Delete tenant forcefully
-