Skip to main content

connectors

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

Overview​

Nameconnectors
TypeResource
Idgoogle.managedkafka.connectors

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. The name of the connector. Structured like: projects/{project}/locations/{location}/connectClusters/{connect_cluster}/connectors/{connector}
configsobjectOptional. Connector config as keys/values. The keys of the map are connector property names, for example: connector.class, tasks.max, key.converter.
statestringOutput only. The current state of the connector. (STATE_UNSPECIFIED, UNASSIGNED, RUNNING, PAUSED, FAILED, RESTARTING, STOPPED)
taskRestartPolicyobjectOptional. Restarts the individual tasks of a Connector. (id: TaskRetryPolicy)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, connectClustersId, connectorsIdReturns the properties of a single connector.
listselectprojectsId, locationsId, connectClustersIdpageSize, pageTokenLists the connectors in a given Connect cluster.
createinsertprojectsId, locationsId, connectClustersIdconnectorIdCreates a new connector in a given Connect cluster.
patchupdateprojectsId, locationsId, connectClustersId, connectorsIdupdateMaskUpdates the properties of a connector.
deletedeleteprojectsId, locationsId, connectClustersId, connectorsIdDeletes a connector.
pauseexecprojectsId, locationsId, connectClustersId, connectorsIdPauses the connector and its tasks.
restartexecprojectsId, locationsId, connectClustersId, connectorsIdRestarts the connector.
resumeexecprojectsId, locationsId, connectClustersId, connectorsIdResumes the connector and its tasks.
stopexecprojectsId, locationsId, connectClustersId, connectorsIdStops the connector.

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
connectClustersIdstring
connectorsIdstring
locationsIdstring
projectsIdstring
connectorIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples​

Returns the properties of a single connector.

SELECT
name,
configs,
state,
taskRestartPolicy
FROM google.managedkafka.connectors
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND connectClustersId = '{{ connectClustersId }}' -- required
AND connectorsId = '{{ connectorsId }}' -- required
;

INSERT examples​

Creates a new connector in a given Connect cluster.

INSERT INTO google.managedkafka.connectors (
data__configs,
data__name,
data__taskRestartPolicy,
projectsId,
locationsId,
connectClustersId,
connectorId
)
SELECT
'{{ configs }}',
'{{ name }}',
'{{ taskRestartPolicy }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ connectClustersId }}',
'{{ connectorId }}'
RETURNING
name,
configs,
state,
taskRestartPolicy
;

UPDATE examples​

Updates the properties of a connector.

UPDATE google.managedkafka.connectors
SET
data__configs = '{{ configs }}',
data__name = '{{ name }}',
data__taskRestartPolicy = '{{ taskRestartPolicy }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND connectClustersId = '{{ connectClustersId }}' --required
AND connectorsId = '{{ connectorsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
configs,
state,
taskRestartPolicy;

DELETE examples​

Deletes a connector.

DELETE FROM google.managedkafka.connectors
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND connectClustersId = '{{ connectClustersId }}' --required
AND connectorsId = '{{ connectorsId }}' --required
;

Lifecycle Methods​

Pauses the connector and its tasks.

EXEC google.managedkafka.connectors.pause
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@connectClustersId='{{ connectClustersId }}' --required,
@connectorsId='{{ connectorsId }}' --required
;