List
Retrieves the list of Apache Kafka® connectors in a cluster.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListConnectorsRequest =
cloudApi.mdb.kafka_connector_service.ListConnectorsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ConnectorServiceClient);
const result = await client.list(
ListConnectorsRequest.fromPartial({
clusterId: "clusterId",
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.mdb.kafka.v1.connector_service_pb2_grpc import ConnectorServiceStub
from yandex.cloud.mdb.kafka.v1.connector_service_pb2 import ListConnectorsRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ConnectorServiceStub)
response = service.List(
ListConnectorsRequest(
cluster_id="clusterId",
# page_size = 0,
# page_token = "pageToken"
)
)
print(response)
ListConnectorsRequest
clusterId
: string
ID of the Apache Kafka® cluster to list connectors in.
To get this ID, make a ClusterService.List request.
pageSize
: int64
The maximum number of results per page to return.
If the number of available results is larger than page_size, the API returns a ListConnectorsResponse.next_page_token that can be used to get the next page of results in the subsequent ConnectorService.List requests.
pageToken
: string
Page token that can be used to iterate through multiple pages of results.
To get the next page of results, set page_token to the ListConnectorsResponse.next_page_token returned by the previous ConnectorService.List request.
ListConnectorsResponse
connectors
: Connector
List of Apache Kafka® Connectors.
nextPageToken
: string
The token that can be used to get the next page of results.
If the number of results is larger than ListConnectorsRequest.page_size, use the next_page_token as the value for the ListConnectorsRequest.page_token in the subsequent ConnectorService.List request to iterate through multiple pages of results.
Connector
Health
HEALTH_UNKNOWN
Health of the connector is unknown.
ALIVE
Connector is running.
DEAD
Connector has failed to start.
Status
STATUS_UNKNOWN
Connector state is unknown.
RUNNING
Connector is running normally.
ERROR
Connector has encountered a problem and cannot operate.
PAUSED
Connector is paused.
name
: string
Name of the connector.
tasksMax
: google.protobuf.Int64Value
Maximum number of connector tasks. Default value is the number of brokers.
properties
: string
A set of properties passed to Managed Service for Apache Kafka® with the connector configuration.
Example: sync.topics.config.enabled: true
.
health
: Health
Connector health.
status
: Status
Current status of the connector.
clusterId
: string
ID of the Apache Kafka® cluster that the connector belongs to.
One of connectorConfig
Additional settings for the connector.
connectorConfigMirrormaker
: ConnectorConfigMirrorMakerConfiguration of the MirrorMaker connector.
connectorConfigS3Sink
: ConnectorConfigS3SinkConfiguration of S3-Sink connector.
ConnectorConfigMirrorMaker
sourceCluster
: ClusterConnection
Source cluster connection configuration.
targetCluster
: ClusterConnection
Target cluster connection configuration.
topics
: string
List of Kafka topics, separated by ,
.
replicationFactor
: google.protobuf.Int64Value
Replication factor for automatically created topics.
ConnectorConfigS3Sink
An Apache Kafka® S3-Sink connector resource.
topics
: string
List of Kafka topics, separated by ','.
fileCompressionType
: string
The compression type used for files put on GCS.
The supported values are: gzip
, snappy
, zstd
, none
.
Optional, the default is none
.
fileMaxRecords
: google.protobuf.Int64Value
Max records per file.
s3Connection
: S3Connection
Credentials for connecting to S3 storage.
ClusterConnection
alias
: string
Alias of cluster connection configuration.
Examples: source
, target
.
One of clusterConnection
Type of connection to Apache Kafka® cluster.
thisCluster
: ThisClusterConnection configuration of the cluster the connector belongs to. As all credentials are already known, leave this parameter empty.
externalCluster
: ExternalClusterConnectionConfiguration of connection to an external cluster with all the necessary credentials.
S3Connection
Resource for S3Connection - settings of connection to AWS-compatible S3 storage, that are source or target of Kafka S3-connectors. YC Object Storage is AWS-compatible.
bucketName
: string
One of storage
externalS3
: ExternalS3Storage
ThisCluster
ExternalClusterConnection
bootstrapServers
: string
List of bootstrap servers of the cluster, separated by ,
.
saslUsername
: string
SASL username to use for connection to the cluster.
saslMechanism
: string
SASL mechanism to use for connection to the cluster.
securityProtocol
: string
Security protocol to use for connection to the cluster.
ExternalS3Storage
accessKeyId
: string
endpoint
: string
region
: string
Default is 'us-east-1'