Enable Apache Kafka® REST Proxy API

DoubleCloud Managed Service for Apache Kafka® features a built-in REST Proxy API.

To enable the REST Proxy API, use the rest_api_config object within the ClusterService Update method.

The following example uses DoubleCloud Python SDK :

import json

# >= 0.8.0
import doublecloud

from doublecloud.kafka.v1.config_pb2 import RestAPIConfig
from doublecloud.kafka.v1.cluster_service_pb2 import UpdateClusterRequest
from doublecloud.kafka.v1.cluster_service_pb2_grpc import ClusterServiceStub

with open('service_account_key.json') as f: # import your Service account key
  key_data = json.load(f)

sdk = doublecloud.SDK(service_account_key=key_data)
cluster_service = sdk.client(ClusterServiceStub)
update_operation = cluster_service.Update(UpdateClusterRequest(
  cluster_id="<your_clusterID>", 
  rest_api_config=RestAPIConfig(enabled=True)) # enable REST Proxy API for the above cluster
)

print(update_operation)

See also