class ClusterManager (View source)

Provides management capabilities for a Couchbase Server Cluster

Constants

RBAC_DOMAIN_LOCAL

The user account managed by Couchbase Cluster.

RBAC_DOMAIN_EXTERNAL

The user account managed by external system (e.g. LDAP).

Methods

array
listBuckets()

Lists all buckets on this cluster.

createBucket(string $name, array $options = [])

Creates new bucket

removeBucket(string $name)

Removes a bucket identified by its name.

array
info()

Provides information about the cluster.

array
listUsers(int $domain = RBAC_DOMAIN_LOCAL)

Lists all users on this cluster.

array
getUser(string $username, int $domain = RBAC_DOMAIN_LOCAL)

Fetch single user by its name

upsertUser(string $name, UserSettings $settings, int $domain = RBAC_DOMAIN_LOCAL)

Creates new user

removeUser(string $name, int $domain = RBAC_DOMAIN_LOCAL)

Removes a user identified by its name.

Details

array listBuckets()

Lists all buckets on this cluster.

Return Value

array

createBucket(string $name, array $options = [])

Creates new bucket

Parameters

string $name

Name of the bucket

array $options

Bucket options

  • "authType" (default: "sasl") type of the bucket authentication
  • "bucketType" (default: "couchbase") type of the bucket
  • "ramQuotaMB" (default: 100) memory quota of the bucket
  • "replicaNumber" (default: 1) number of replicas.

See also

https://developer.couchbase.com/documentation/server/current/rest-api/rest-bucket-create.html More options and details

removeBucket(string $name)

Removes a bucket identified by its name.

Parameters

string $name

name of the bucket

See also

https://developer.couchbase.com/documentation/server/current/rest-api/rest-bucket-delete.html More details

array info()

Provides information about the cluster.

Returns an associative array of status information as seen on the cluster. The exact structure of the returned data can be seen in the Couchbase Manual by looking at the cluster /info endpoint.

Return Value

array

See also

https://developer.couchbase.com/documentation/server/current/rest-api/rest-cluster-get.html Retrieving Cluster Information

array listUsers(int $domain = RBAC_DOMAIN_LOCAL)

Lists all users on this cluster.

Parameters

int $domain

RBAC domain

Return Value

array

See also

ClusterManager::RBAC_DOMAIN_LOCAL
ClusterManager::RBAC_DOMAIN_EXTERNAL

array getUser(string $username, int $domain = RBAC_DOMAIN_LOCAL)

Fetch single user by its name

Parameters

string $username

The user's identifier

int $domain

RBAC domain

Return Value

array

See also

ClusterManager::RBAC_DOMAIN_LOCAL
ClusterManager::RBAC_DOMAIN_EXTERNAL

upsertUser(string $name, UserSettings $settings, int $domain = RBAC_DOMAIN_LOCAL)

Creates new user

Parameters

string $name

Name of the user

UserSettings $settings

settings (credentials and roles)

int $domain

RBAC domain

See also

https://developer.couchbase.com/documentation/server/5.0/rest-api/rbac.html More options and details
ClusterManager::RBAC_DOMAIN_LOCAL
ClusterManager::RBAC_DOMAIN_EXTERNAL

removeUser(string $name, int $domain = RBAC_DOMAIN_LOCAL)

Removes a user identified by its name.

Parameters

string $name

name of the bucket

int $domain

RBAC domain

See also

https://developer.couchbase.com/documentation/server/5.0/rest-api/rbac.html More details
ClusterManager::RBAC_DOMAIN_LOCAL
ClusterManager::RBAC_DOMAIN_EXTERNAL