Package org.apache.pulsar.client.admin
Interface Tenants
-
public interface TenantsAdmin interface for tenants management.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcreateTenant(java.lang.String tenant, TenantInfo config)Create a new tenant.java.util.concurrent.CompletableFuture<java.lang.Void>createTenantAsync(java.lang.String tenant, TenantInfo config)Create a new tenant asynchronously.voiddeleteTenant(java.lang.String tenant)Delete an existing tenant.voiddeleteTenant(java.lang.String tenant, boolean force)Delete an existing tenant.java.util.concurrent.CompletableFuture<java.lang.Void>deleteTenantAsync(java.lang.String tenant)Delete an existing tenant asynchronously.java.util.concurrent.CompletableFuture<java.lang.Void>deleteTenantAsync(java.lang.String tenant, boolean force)Delete an existing tenant asynchronously.TenantInfogetTenantInfo(java.lang.String tenant)Get the config of the tenant.java.util.concurrent.CompletableFuture<TenantInfo>getTenantInfoAsync(java.lang.String tenant)Get the config of the tenant asynchronously.java.util.List<java.lang.String>getTenants()Get the list of tenants.java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>>getTenantsAsync()Get the list of tenants asynchronously.voidupdateTenant(java.lang.String tenant, TenantInfo config)Update the admins for a tenant.java.util.concurrent.CompletableFuture<java.lang.Void>updateTenantAsync(java.lang.String tenant, TenantInfo config)Update the admins for a tenant asynchronously.
-
-
-
Method Detail
-
getTenants
java.util.List<java.lang.String> getTenants() throws PulsarAdminExceptionGet 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
java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>> getTenantsAsync()
Get the list of tenants asynchronously. Response Example:["my-tenant", "other-tenant", "third-tenant"]- Returns:
- the list of Pulsar tenants
-
getTenantInfo
TenantInfo getTenantInfo(java.lang.String tenant) throws PulsarAdminException
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
java.util.concurrent.CompletableFuture<TenantInfo> getTenantInfoAsync(java.lang.String tenant)
Get the config of the tenant asynchronously. Get the admin configuration for a given tenant.- Parameters:
tenant- Tenant name- Returns:
- the tenant configuration
-
createTenant
void createTenant(java.lang.String tenant, TenantInfo config) throws PulsarAdminExceptionCreate 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
java.util.concurrent.CompletableFuture<java.lang.Void> createTenantAsync(java.lang.String tenant, TenantInfo config)Create a new tenant asynchronously. Provisions a new tenant. This operation requires Pulsar super-user privileges.- Parameters:
tenant- Tenant nameconfig- Config data
-
updateTenant
void updateTenant(java.lang.String tenant, TenantInfo config) throws PulsarAdminExceptionUpdate 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
java.util.concurrent.CompletableFuture<java.lang.Void> updateTenantAsync(java.lang.String tenant, TenantInfo config)Update the admins for a tenant asynchronously. This operation requires Pulsar super-user privileges.- Parameters:
tenant- Tenant nameconfig- Config data
-
deleteTenant
void deleteTenant(java.lang.String tenant) throws PulsarAdminExceptionDelete 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
void deleteTenant(java.lang.String tenant, boolean force) throws PulsarAdminExceptionDelete 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
java.util.concurrent.CompletableFuture<java.lang.Void> deleteTenantAsync(java.lang.String tenant)
Delete an existing tenant asynchronously. Delete a tenant and all namespaces and topics under it.- Parameters:
tenant- Tenant name
-
deleteTenantAsync
java.util.concurrent.CompletableFuture<java.lang.Void> deleteTenantAsync(java.lang.String tenant, boolean force)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
-
-