Managed Service for Apache Kafka V1 API - Class Google::Cloud::ManagedKafka::V1::ManagedKafka::Client (v1.3.0)

Reference documentation and code samples for the Managed Service for Apache Kafka V1 API class Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.

Client for the ManagedKafka service.

The service that a client application uses to manage Apache Kafka clusters, topics and consumer groups.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the ManagedKafka Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all ManagedKafka clients
::Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.configure do |config|
  config.timeout = 10.0
end

#add_acl_entry

def add_acl_entry(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::AddAclEntryResponse
def add_acl_entry(acl: nil, acl_entry: nil) -> ::Google::Cloud::ManagedKafka::V1::AddAclEntryResponse

Incremental update: Adds an acl entry to an acl. Creates the acl if it does not exist yet.

Overloads
def add_acl_entry(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::AddAclEntryResponse
Pass arguments to add_acl_entry via a request object, either of type AddAclEntryRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::AddAclEntryRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def add_acl_entry(acl: nil, acl_entry: nil) -> ::Google::Cloud::ManagedKafka::V1::AddAclEntryResponse
Pass arguments to add_acl_entry via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • acl (::String) — Required. The name of the acl to add the acl entry to. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}.

    The structure of acl_id defines the Resource Pattern (resource_type, resource_name, pattern_type) of the acl. See Acl.name for details.

  • acl_entry (::Google::Cloud::ManagedKafka::V1::AclEntry, ::Hash) — Required. The acl entry to add.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::AddAclEntryRequest.new

# Call the add_acl_entry method.
result = client.add_acl_entry request

# The returned object is of type Google::Cloud::ManagedKafka::V1::AddAclEntryResponse.
p result

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the ManagedKafka Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_acl

def create_acl(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::Acl
def create_acl(parent: nil, acl_id: nil, acl: nil) -> ::Google::Cloud::ManagedKafka::V1::Acl

Creates a new acl in the given project, location, and cluster.

Overloads
def create_acl(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::Acl
Pass arguments to create_acl via a request object, either of type CreateAclRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::CreateAclRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_acl(parent: nil, acl_id: nil, acl: nil) -> ::Google::Cloud::ManagedKafka::V1::Acl
Pass arguments to create_acl via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent cluster in which to create the acl. Structured like projects/{project}/locations/{location}/clusters/{cluster}.
  • acl_id (::String) — Required. The ID to use for the acl, which will become the final component of the acl's name. The structure of acl_id defines the Resource Pattern (resource_type, resource_name, pattern_type) of the acl. acl_id is structured like one of the following:

    For acls on the cluster: cluster

    For acls on a single resource within the cluster: topic/{resource_name} consumerGroup/{resource_name} transactionalId/{resource_name}

    For acls on all resources that match a prefix: topicPrefixed/{resource_name} consumerGroupPrefixed/{resource_name} transactionalIdPrefixed/{resource_name}

    For acls on all resources of a given type (i.e. the wildcard literal ""): allTopics (represents `topic/) allConsumerGroups(representsconsumerGroup/) allTransactionalIds(representstransactionalId/`)

  • acl (::Google::Cloud::ManagedKafka::V1::Acl, ::Hash) — Required. Configuration of the acl to create. Its name field is ignored.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::CreateAclRequest.new

# Call the create_acl method.
result = client.create_acl request

# The returned object is of type Google::Cloud::ManagedKafka::V1::Acl.
p result

#create_cluster

def create_cluster(request, options = nil) -> ::Gapic::Operation
def create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) -> ::Gapic::Operation

Creates a new cluster in a given project and location.

Overloads
def create_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_cluster via a request object, either of type CreateClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::CreateClusterRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to create_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent region in which to create the cluster. Structured like projects/{project}/locations/{location}.
  • cluster_id (::String) — Required. The ID to use for the cluster, which will become the final component of the cluster's name. The ID must be 1-63 characters long, and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? to comply with RFC 1035.

    This value is structured like: my-cluster-id.

  • cluster (::Google::Cloud::ManagedKafka::V1::Cluster, ::Hash) — Required. Configuration of the cluster to create. Its name field is ignored.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID to avoid duplication of requests. If a request times out or fails, retrying with the same ID allows the server to recognize the previous attempt. For at least 60 minutes, the server ignores duplicate requests bearing the same ID.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID within 60 minutes of the last request, the server checks if an original operation with the same request ID was received. If so, the server ignores the second request.

    The request ID must be a valid UUID. A zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::CreateClusterRequest.new

# Call the create_cluster method.
result = client.create_cluster request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_topic

def create_topic(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::Topic
def create_topic(parent: nil, topic_id: nil, topic: nil) -> ::Google::Cloud::ManagedKafka::V1::Topic

Creates a new topic in a given project and location.

Overloads
def create_topic(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::Topic
Pass arguments to create_topic via a request object, either of type CreateTopicRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::CreateTopicRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_topic(parent: nil, topic_id: nil, topic: nil) -> ::Google::Cloud::ManagedKafka::V1::Topic
Pass arguments to create_topic via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent cluster in which to create the topic. Structured like projects/{project}/locations/{location}/clusters/{cluster}.
  • topic_id (::String) — Required. The ID to use for the topic, which will become the final component of the topic's name.

    This value is structured like: my-topic-name.

  • topic (::Google::Cloud::ManagedKafka::V1::Topic, ::Hash) — Required. Configuration of the topic to create. Its name field is ignored.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::CreateTopicRequest.new

# Call the create_topic method.
result = client.create_topic request

# The returned object is of type Google::Cloud::ManagedKafka::V1::Topic.
p result

#delete_acl

def delete_acl(request, options = nil) -> ::Google::Protobuf::Empty
def delete_acl(name: nil) -> ::Google::Protobuf::Empty

Deletes an acl.

Overloads
def delete_acl(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_acl via a request object, either of type DeleteAclRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::DeleteAclRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_acl(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_acl via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the acl to delete. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}.

    The structure of acl_id defines the Resource Pattern (resource_type, resource_name, pattern_type) of the acl. See Acl.name for details.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::DeleteAclRequest.new

# Call the delete_acl method.
result = client.delete_acl request

# The returned object is of type Google::Protobuf::Empty.
p result

#delete_cluster

def delete_cluster(request, options = nil) -> ::Gapic::Operation
def delete_cluster(name: nil, request_id: nil) -> ::Gapic::Operation

Deletes a single cluster.

Overloads
def delete_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_cluster via a request object, either of type DeleteClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::DeleteClusterRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_cluster(name: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to delete_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The name of the cluster to delete.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID to avoid duplication of requests. If a request times out or fails, retrying with the same ID allows the server to recognize the previous attempt. For at least 60 minutes, the server ignores duplicate requests bearing the same ID.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID within 60 minutes of the last request, the server checks if an original operation with the same request ID was received. If so, the server ignores the second request.

    The request ID must be a valid UUID. A zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::DeleteClusterRequest.new

# Call the delete_cluster method.
result = client.delete_cluster request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_consumer_group

def delete_consumer_group(request, options = nil) -> ::Google::Protobuf::Empty
def delete_consumer_group(name: nil) -> ::Google::Protobuf::Empty

Deletes a single consumer group.

Overloads
def delete_consumer_group(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_consumer_group via a request object, either of type DeleteConsumerGroupRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::DeleteConsumerGroupRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_consumer_group(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_consumer_group via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the consumer group to delete. projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::DeleteConsumerGroupRequest.new

# Call the delete_consumer_group method.
result = client.delete_consumer_group request

# The returned object is of type Google::Protobuf::Empty.
p result

#delete_topic

def delete_topic(request, options = nil) -> ::Google::Protobuf::Empty
def delete_topic(name: nil) -> ::Google::Protobuf::Empty

Deletes a single topic.

Overloads
def delete_topic(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_topic via a request object, either of type DeleteTopicRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::DeleteTopicRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_topic(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_topic via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the topic to delete. projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::DeleteTopicRequest.new

# Call the delete_topic method.
result = client.delete_topic request

# The returned object is of type Google::Protobuf::Empty.
p result

#get_acl

def get_acl(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::Acl
def get_acl(name: nil) -> ::Google::Cloud::ManagedKafka::V1::Acl

Returns the properties of a single acl.

Overloads
def get_acl(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::Acl
Pass arguments to get_acl via a request object, either of type GetAclRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::GetAclRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_acl(name: nil) -> ::Google::Cloud::ManagedKafka::V1::Acl
Pass arguments to get_acl via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the acl to return. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}.

    The structure of acl_id defines the Resource Pattern (resource_type, resource_name, pattern_type) of the acl. See Acl.name for details.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::GetAclRequest.new

# Call the get_acl method.
result = client.get_acl request

# The returned object is of type Google::Cloud::ManagedKafka::V1::Acl.
p result

#get_cluster

def get_cluster(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::Cluster
def get_cluster(name: nil) -> ::Google::Cloud::ManagedKafka::V1::Cluster

Returns the properties of a single cluster.

Overloads
def get_cluster(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::Cluster
Pass arguments to get_cluster via a request object, either of type GetClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::GetClusterRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_cluster(name: nil) -> ::Google::Cloud::ManagedKafka::V1::Cluster
Pass arguments to get_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the cluster whose configuration to return.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::GetClusterRequest.new

# Call the get_cluster method.
result = client.get_cluster request

# The returned object is of type Google::Cloud::ManagedKafka::V1::Cluster.
p result

#get_consumer_group

def get_consumer_group(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::ConsumerGroup
def get_consumer_group(name: nil) -> ::Google::Cloud::ManagedKafka::V1::ConsumerGroup

Returns the properties of a single consumer group.

Overloads
def get_consumer_group(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::ConsumerGroup
Pass arguments to get_consumer_group via a request object, either of type GetConsumerGroupRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::GetConsumerGroupRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_consumer_group(name: nil) -> ::Google::Cloud::ManagedKafka::V1::ConsumerGroup
Pass arguments to get_consumer_group via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the consumer group whose configuration to return. projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::GetConsumerGroupRequest.new

# Call the get_consumer_group method.
result = client.get_consumer_group request

# The returned object is of type Google::Cloud::ManagedKafka::V1::ConsumerGroup.
p result

#get_topic

def get_topic(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::Topic
def get_topic(name: nil) -> ::Google::Cloud::ManagedKafka::V1::Topic

Returns the properties of a single topic.

Overloads
def get_topic(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::Topic
Pass arguments to get_topic via a request object, either of type GetTopicRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::GetTopicRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_topic(name: nil) -> ::Google::Cloud::ManagedKafka::V1::Topic
Pass arguments to get_topic via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the topic whose configuration to return. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::GetTopicRequest.new

# Call the get_topic method.
result = client.get_topic request

# The returned object is of type Google::Cloud::ManagedKafka::V1::Topic.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new ManagedKafka client object.

Yields
  • (config) — Configure the ManagedKafka client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new do |config|
  config.timeout = 10.0
end

#list_acls

def list_acls(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Acl>
def list_acls(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Acl>

Lists the acls in a given cluster.

Overloads
def list_acls(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Acl>
Pass arguments to list_acls via a request object, either of type ListAclsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::ListAclsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_acls(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Acl>
Pass arguments to list_acls via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent cluster whose acls are to be listed. Structured like projects/{project}/locations/{location}/clusters/{cluster}.
  • page_size (::Integer) — Optional. The maximum number of acls to return. The service may return fewer than this value. If unset or zero, all acls for the parent is returned.
  • page_token (::String) — Optional. A page token, received from a previous ListAcls call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to ListAcls must match the call that provided the page token.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::ListAclsRequest.new

# Call the list_acls method.
result = client.list_acls request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ManagedKafka::V1::Acl.
  p item
end

#list_clusters

def list_clusters(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Cluster>
def list_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Cluster>

Lists the clusters in a given project and location.

Overloads
def list_clusters(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Cluster>
Pass arguments to list_clusters via a request object, either of type ListClustersRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::ListClustersRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Cluster>
Pass arguments to list_clusters via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent location whose clusters are to be listed. Structured like projects/{project}/locations/{location}.
  • page_size (::Integer) — Optional. The maximum number of clusters to return. The service may return fewer than this value. If unspecified, server will pick an appropriate default.
  • page_token (::String) — Optional. A page token, received from a previous ListClusters call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to ListClusters must match the call that provided the page token.

  • filter (::String) — Optional. Filter expression for the result.
  • order_by (::String) — Optional. Order by fields for the result.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::ListClustersRequest.new

# Call the list_clusters method.
result = client.list_clusters request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ManagedKafka::V1::Cluster.
  p item
end

#list_consumer_groups

def list_consumer_groups(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::ConsumerGroup>
def list_consumer_groups(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::ConsumerGroup>

Lists the consumer groups in a given cluster.

Overloads
def list_consumer_groups(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::ConsumerGroup>
Pass arguments to list_consumer_groups via a request object, either of type ListConsumerGroupsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::ListConsumerGroupsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_consumer_groups(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::ConsumerGroup>
Pass arguments to list_consumer_groups via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent cluster whose consumer groups are to be listed. Structured like projects/{project}/locations/{location}/clusters/{cluster}.
  • page_size (::Integer) — Optional. The maximum number of consumer groups to return. The service may return fewer than this value. If unset or zero, all consumer groups for the parent is returned.
  • page_token (::String) — Optional. A page token, received from a previous ListConsumerGroups call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to ListConsumerGroups must match the call that provided the page token.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::ListConsumerGroupsRequest.new

# Call the list_consumer_groups method.
result = client.list_consumer_groups request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ManagedKafka::V1::ConsumerGroup.
  p item
end

#list_topics

def list_topics(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Topic>
def list_topics(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Topic>

Lists the topics in a given cluster.

Overloads
def list_topics(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Topic>
Pass arguments to list_topics via a request object, either of type ListTopicsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::ListTopicsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_topics(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ManagedKafka::V1::Topic>
Pass arguments to list_topics via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent cluster whose topics are to be listed. Structured like projects/{project}/locations/{location}/clusters/{cluster}.
  • page_size (::Integer) — Optional. The maximum number of topics to return. The service may return fewer than this value. If unset or zero, all topics for the parent is returned.
  • page_token (::String) — Optional. A page token, received from a previous ListTopics call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to ListTopics must match the call that provided the page token.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::ListTopicsRequest.new

# Call the list_topics method.
result = client.list_topics request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ManagedKafka::V1::Topic.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#operations_client

def operations_client() -> ::Google::Cloud::ManagedKafka::V1::ManagedKafka::Operations

Get the associated client for long-running operations.

#remove_acl_entry

def remove_acl_entry(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::RemoveAclEntryResponse
def remove_acl_entry(acl: nil, acl_entry: nil) -> ::Google::Cloud::ManagedKafka::V1::RemoveAclEntryResponse

Incremental update: Removes an acl entry from an acl. Deletes the acl if its acl entries become empty (i.e. if the removed entry was the last one in the acl).

Overloads
def remove_acl_entry(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::RemoveAclEntryResponse
Pass arguments to remove_acl_entry via a request object, either of type RemoveAclEntryRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::RemoveAclEntryRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def remove_acl_entry(acl: nil, acl_entry: nil) -> ::Google::Cloud::ManagedKafka::V1::RemoveAclEntryResponse
Pass arguments to remove_acl_entry via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • acl (::String) — Required. The name of the acl to remove the acl entry from. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}.

    The structure of acl_id defines the Resource Pattern (resource_type, resource_name, pattern_type) of the acl. See Acl.name for details.

  • acl_entry (::Google::Cloud::ManagedKafka::V1::AclEntry, ::Hash) — Required. The acl entry to remove.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::RemoveAclEntryRequest.new

# Call the remove_acl_entry method.
result = client.remove_acl_entry request

# The returned object is of type Google::Cloud::ManagedKafka::V1::RemoveAclEntryResponse.
p result

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_acl

def update_acl(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::Acl
def update_acl(acl: nil, update_mask: nil) -> ::Google::Cloud::ManagedKafka::V1::Acl

Updates the properties of a single acl.

Overloads
def update_acl(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::Acl
Pass arguments to update_acl via a request object, either of type UpdateAclRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::UpdateAclRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_acl(acl: nil, update_mask: nil) -> ::Google::Cloud::ManagedKafka::V1::Acl
Pass arguments to update_acl via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • acl (::Google::Cloud::ManagedKafka::V1::Acl, ::Hash) — Required. The updated acl. Its name and etag fields must be populated. acl_entries must not be empty in the updated acl; to remove all acl entries for an acl, use DeleteAcl.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. Field mask is used to specify the fields to be overwritten in the Acl resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::UpdateAclRequest.new

# Call the update_acl method.
result = client.update_acl request

# The returned object is of type Google::Cloud::ManagedKafka::V1::Acl.
p result

#update_cluster

def update_cluster(request, options = nil) -> ::Gapic::Operation
def update_cluster(update_mask: nil, cluster: nil, request_id: nil) -> ::Gapic::Operation

Updates the properties of a single cluster.

Overloads
def update_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_cluster via a request object, either of type UpdateClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::UpdateClusterRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_cluster(update_mask: nil, cluster: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to update_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Field mask is used to specify the fields to be overwritten in the cluster resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. The mask is required and a value of * will update all fields.
  • cluster (::Google::Cloud::ManagedKafka::V1::Cluster, ::Hash) — Required. The cluster to update. Its name field must be populated.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID to avoid duplication of requests. If a request times out or fails, retrying with the same ID allows the server to recognize the previous attempt. For at least 60 minutes, the server ignores duplicate requests bearing the same ID.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID within 60 minutes of the last request, the server checks if an original operation with the same request ID was received. If so, the server ignores the second request.

    The request ID must be a valid UUID. A zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::UpdateClusterRequest.new

# Call the update_cluster method.
result = client.update_cluster request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#update_consumer_group

def update_consumer_group(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::ConsumerGroup
def update_consumer_group(update_mask: nil, consumer_group: nil) -> ::Google::Cloud::ManagedKafka::V1::ConsumerGroup

Updates the properties of a single consumer group.

Overloads
def update_consumer_group(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::ConsumerGroup
Pass arguments to update_consumer_group via a request object, either of type UpdateConsumerGroupRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::UpdateConsumerGroupRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_consumer_group(update_mask: nil, consumer_group: nil) -> ::Google::Cloud::ManagedKafka::V1::ConsumerGroup
Pass arguments to update_consumer_group via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Field mask is used to specify the fields to be overwritten in the ConsumerGroup resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. The mask is required and a value of * will update all fields.
  • consumer_group (::Google::Cloud::ManagedKafka::V1::ConsumerGroup, ::Hash) — Required. The consumer group to update. Its name field must be populated.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::UpdateConsumerGroupRequest.new

# Call the update_consumer_group method.
result = client.update_consumer_group request

# The returned object is of type Google::Cloud::ManagedKafka::V1::ConsumerGroup.
p result

#update_topic

def update_topic(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::Topic
def update_topic(update_mask: nil, topic: nil) -> ::Google::Cloud::ManagedKafka::V1::Topic

Updates the properties of a single topic.

Overloads
def update_topic(request, options = nil) -> ::Google::Cloud::ManagedKafka::V1::Topic
Pass arguments to update_topic via a request object, either of type UpdateTopicRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ManagedKafka::V1::UpdateTopicRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_topic(update_mask: nil, topic: nil) -> ::Google::Cloud::ManagedKafka::V1::Topic
Pass arguments to update_topic via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Field mask is used to specify the fields to be overwritten in the Topic resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. The mask is required and a value of * will update all fields.
  • topic (::Google::Cloud::ManagedKafka::V1::Topic, ::Hash) — Required. The topic to update. Its name field must be populated.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/managed_kafka/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::V1::ManagedKafka::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::V1::UpdateTopicRequest.new

# Call the update_topic method.
result = client.update_topic request

# The returned object is of type Google::Cloud::ManagedKafka::V1::Topic.
p result