Skip to main content

clusters

Creates, updates, deletes, gets or lists a clusters resource.

Overview

Nameclusters
TypeResource
Idgoogle.managedkafka.clusters

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. The name of the cluster. Structured like: projects/{project_number}/locations/{location}/clusters/{cluster_id}
brokerDetailsarrayOutput only. Only populated when FULL view is requested. Details of each broker in the cluster.
capacityConfigobjectRequired. Capacity configuration for the Kafka cluster. (id: CapacityConfig)
createTimestring (google-datetime)Output only. The time when the cluster was created.
gcpConfigobjectRequired. Configuration properties for a Kafka cluster deployed to Google Cloud Platform. (id: GcpConfig)
kafkaVersionstringOutput only. Only populated when FULL view is requested. The Kafka version of the cluster.
labelsobjectOptional. Labels as key value pairs.
rebalanceConfigobjectOptional. Rebalance configuration for the Kafka cluster. (id: RebalanceConfig)
satisfiesPzibooleanOutput only. Reserved for future use.
satisfiesPzsbooleanOutput only. Reserved for future use.
statestringOutput only. The current state of the cluster. (STATE_UNSPECIFIED, CREATING, ACTIVE, DELETING, UPDATING)
tlsConfigobjectOptional. TLS configuration for the Kafka cluster. (id: TlsConfig)
updateOptionsobjectOptional. UpdateOptions represents options that control how updates to the cluster are applied. (id: UpdateOptions)
updateTimestring (google-datetime)Output only. The time when the cluster was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, clustersIdviewReturns the properties of a single cluster.
listselectprojectsId, locationsIdorderBy, pageSize, pageToken, filterLists the clusters in a given project and location.
createinsertprojectsId, locationsIdclusterId, requestIdCreates a new cluster in a given project and location.
patchupdateprojectsId, locationsId, clustersIdrequestId, updateMaskUpdates the properties of a single cluster.
deletedeleteprojectsId, locationsId, clustersIdrequestIdDeletes a single cluster.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
clustersIdstring
locationsIdstring
projectsIdstring
clusterIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
updateMaskstring (google-fieldmask)
viewstring

SELECT examples

Returns the properties of a single cluster.

SELECT
name,
brokerDetails,
capacityConfig,
createTime,
gcpConfig,
kafkaVersion,
labels,
rebalanceConfig,
satisfiesPzi,
satisfiesPzs,
state,
tlsConfig,
updateOptions,
updateTime
FROM google.managedkafka.clusters
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND clustersId = '{{ clustersId }}' -- required
AND view = '{{ view }}'
;

INSERT examples

Creates a new cluster in a given project and location.

INSERT INTO google.managedkafka.clusters (
data__capacityConfig,
data__rebalanceConfig,
data__gcpConfig,
data__name,
data__updateOptions,
data__tlsConfig,
data__labels,
projectsId,
locationsId,
clusterId,
requestId
)
SELECT
'{{ capacityConfig }}',
'{{ rebalanceConfig }}',
'{{ gcpConfig }}',
'{{ name }}',
'{{ updateOptions }}',
'{{ tlsConfig }}',
'{{ labels }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ clusterId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the properties of a single cluster.

UPDATE google.managedkafka.clusters
SET
data__capacityConfig = '{{ capacityConfig }}',
data__rebalanceConfig = '{{ rebalanceConfig }}',
data__gcpConfig = '{{ gcpConfig }}',
data__name = '{{ name }}',
data__updateOptions = '{{ updateOptions }}',
data__tlsConfig = '{{ tlsConfig }}',
data__labels = '{{ labels }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND clustersId = '{{ clustersId }}' --required
AND requestId = '{{ requestId}}'
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single cluster.

DELETE FROM google.managedkafka.clusters
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND clustersId = '{{ clustersId }}' --required
AND requestId = '{{ requestId }}'
;