Class: Aws::Kafka::Client

Inherits:
Seahorse::Client::Base
  • Object
show all
Includes:
ClientStubs
Defined in:
lib/aws-sdk-kafka/client.rb

Class Attribute Summary collapse

API Operations collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

Parameters:

  • options (Hash)

Options Hash (options):

  • :credentials (required, Aws::CredentialProvider)

    Your AWS credentials. This can be an instance of any one of the following classes:

    • ‘Aws::Credentials` - Used for configuring static, non-refreshing credentials.

    • ‘Aws::InstanceProfileCredentials` - Used for loading credentials from an EC2 IMDS on an EC2 instance.

    • ‘Aws::SharedCredentials` - Used for loading credentials from a shared file, such as `~/.aws/config`.

    • ‘Aws::AssumeRoleCredentials` - Used when you need to assume a role.

    When ‘:credentials` are not configured directly, the following locations will be searched for credentials:

    • Aws.config`

    • The ‘:access_key_id`, `:secret_access_key`, and `:session_token` options.

    • ENV, ENV

    • ‘~/.aws/credentials`

    • ‘~/.aws/config`

    • EC2 IMDS instance profile - When used by default, the timeouts are very aggressive. Construct and pass an instance of ‘Aws::InstanceProfileCredentails` to enable retries and extended timeouts.

  • :region (required, String)

    The AWS region to connect to. The configured ‘:region` is used to determine the service `:endpoint`. When not passed, a default `:region` is search for in the following locations:

  • :access_key_id (String)
  • :active_endpoint_cache (Boolean) — default: false

    When set to ‘true`, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to `false`.

  • :client_side_monitoring (Boolean) — default: false

    When ‘true`, client-side metrics will be collected for all API requests from this client.

  • :client_side_monitoring_client_id (String) — default: ""

    Allows you to provide an identifier for this client which will be attached to all generated client side metrics. Defaults to an empty string.

  • :client_side_monitoring_port (Integer) — default: 31000

    Required for publishing client metrics. The port that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher) — default: Aws::ClientSideMonitoring::Publisher

    Allows you to provide a custom client-side monitoring publisher class. By default, will use the Client Side Monitoring Agent Publisher.

  • :convert_params (Boolean) — default: true

    When ‘true`, an attempt is made to coerce request parameters into the required types.

  • :disable_host_prefix_injection (Boolean) — default: false

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available.

  • :endpoint (String)

    The client endpoint is normally constructed from the ‘:region` option. You should only configure an `:endpoint` when connecting to test endpoints. This should be avalid HTTP(S) URI.

  • :endpoint_cache_max_entries (Integer) — default: 1000

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000.

  • :endpoint_cache_max_threads (Integer) — default: 10

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.

  • :endpoint_cache_poll_interval (Integer) — default: 60

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec.

  • :endpoint_discovery (Boolean) — default: false

    When set to ‘true`, endpoint discovery will be enabled for operations when available. Defaults to `false`.

  • :log_formatter (Aws::Log::Formatter) — default: Aws::Log::Formatter.default

    The log formatter.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the ‘:logger` at.

  • :logger (Logger)

    The Logger instance to send log messages to. If this option is not set, logging will be disabled.

  • :profile (String) — default: "default"

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, ‘default’ is used.

  • :retry_base_delay (Float) — default: 0.3

    The base delay in seconds used by the default backoff function.

  • :retry_jitter (Symbol) — default: :none

    A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number.

    @see www.awsarchitectureblog.com/2015/03/backoff.html

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials.

  • :retry_max_delay (Integer) — default: 0

    The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function.

  • :secret_access_key (String)
  • :session_token (String)
  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    ** Please note ** When response stubbing is enabled, no HTTP requests are made, and retries are disabled.

  • :validate_params (Boolean) — default: true

    When ‘true`, request parameters are validated before sending the request.



202
203
204
# File 'lib/aws-sdk-kafka/client.rb', line 202

def initialize(*args)
  super
end

Class Attribute Details

.identifierObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



511
512
513
# File 'lib/aws-sdk-kafka/client.rb', line 511

def identifier
  @identifier
end

Class Method Details

.errors_moduleObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



514
515
516
# File 'lib/aws-sdk-kafka/client.rb', line 514

def errors_module
  Errors
end

Instance Method Details

#build_request(operation_name, params = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • params ({}) (defaults to: {})


489
490
491
492
493
494
495
496
497
498
499
500
# File 'lib/aws-sdk-kafka/client.rb', line 489

def build_request(operation_name, params = {})
  handlers = @handlers.for(operation_name)
  context = Seahorse::Client::RequestContext.new(
    operation_name: operation_name,
    operation: config.api.operation(operation_name),
    client: self,
    params: params,
    config: config)
  context[:gem_name] = 'aws-sdk-kafka'
  context[:gem_version] = '1.0.0'
  Seahorse::Client::Request.new(handlers, context)
end

#create_cluster(params = {}) ⇒ Types::CreateClusterResponse

Creates a new MSK cluster.

Examples:

Request syntax with placeholder values


resp = client.create_cluster({
  broker_node_group_info: { # required
    broker_az_distribution: "DEFAULT", # accepts DEFAULT
    client_subnets: ["__string"], # required
    instance_type: "__stringMin5Max32", # required
    security_groups: ["__string"],
    storage_info: {
      ebs_storage_info: {
        volume_size: 1,
      },
    },
  },
  cluster_name: "__stringMin1Max64", # required
  encryption_info: {
    encryption_at_rest: {
      data_volume_kms_key_id: "__string", # required
    },
  },
  enhanced_monitoring: "DEFAULT", # accepts DEFAULT, PER_BROKER, PER_TOPIC_PER_BROKER
  kafka_version: "__stringMin1Max128", # required
  number_of_broker_nodes: 1, # required
})

Response structure


resp.cluster_arn #=> String
resp.cluster_name #=> String
resp.state #=> String, one of "ACTIVE", "CREATING", "DELETING", "FAILED"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :broker_node_group_info (required, Types::BrokerNodeGroupInfo)

    Information about the broker nodes in the cluster.

  • :cluster_name (required, String)

    The name of the cluster.

  • :encryption_info (Types::EncryptionInfo)

    Includes all encryption-related information.

  • :enhanced_monitoring (String)

    Specifies the level of monitoring for the MSK cluster. The possible values are DEFAULT, PER_BROKER, and PER_TOPIC_PER_BROKER.

  • :kafka_version (required, String)

    The version of Apache Kafka.

  • :number_of_broker_nodes (required, Integer)

    The number of Kafka broker nodes in the Amazon MSK cluster.

Returns:

See Also:



270
271
272
273
# File 'lib/aws-sdk-kafka/client.rb', line 270

def create_cluster(params = {}, options = {})
  req = build_request(:create_cluster, params)
  req.send_request(options)
end

#delete_cluster(params = {}) ⇒ Types::DeleteClusterResponse

Deletes the MSK cluster specified by the Amazon Resource Name (ARN) in the request.

Examples:

Request syntax with placeholder values


resp = client.delete_cluster({
  cluster_arn: "__string", # required
  current_version: "__string",
})

Response structure


resp.cluster_arn #=> String
resp.state #=> String, one of "ACTIVE", "CREATING", "DELETING", "FAILED"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :cluster_arn (required, String)
  • :current_version (String)

Returns:

See Also:



303
304
305
306
# File 'lib/aws-sdk-kafka/client.rb', line 303

def delete_cluster(params = {}, options = {})
  req = build_request(:delete_cluster, params)
  req.send_request(options)
end

#describe_cluster(params = {}) ⇒ Types::DescribeClusterResponse

Returns a description of the MSK cluster whose Amazon Resource Name (ARN) is specified in the request.

Examples:

Request syntax with placeholder values


resp = client.describe_cluster({
  cluster_arn: "__string", # required
})

Response structure


resp.cluster_info.broker_node_group_info.broker_az_distribution #=> String, one of "DEFAULT"
resp.cluster_info.broker_node_group_info.client_subnets #=> Array
resp.cluster_info.broker_node_group_info.client_subnets[0] #=> String
resp.cluster_info.broker_node_group_info.instance_type #=> String
resp.cluster_info.broker_node_group_info.security_groups #=> Array
resp.cluster_info.broker_node_group_info.security_groups[0] #=> String
resp.cluster_info.broker_node_group_info.storage_info.ebs_storage_info.volume_size #=> Integer
resp.cluster_info.cluster_arn #=> String
resp.cluster_info.cluster_name #=> String
resp.cluster_info.creation_time #=> Time
resp.cluster_info.current_broker_software_info.configuration_arn #=> String
resp.cluster_info.current_broker_software_info.configuration_revision #=> String
resp.cluster_info.current_broker_software_info.kafka_version #=> String
resp.cluster_info.current_version #=> String
resp.cluster_info.encryption_info.encryption_at_rest.data_volume_kms_key_id #=> String
resp.cluster_info.enhanced_monitoring #=> String, one of "DEFAULT", "PER_BROKER", "PER_TOPIC_PER_BROKER"
resp.cluster_info.number_of_broker_nodes #=> Integer
resp.cluster_info.state #=> String, one of "ACTIVE", "CREATING", "DELETING", "FAILED"
resp.cluster_info.zookeeper_connect_string #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :cluster_arn (required, String)

Returns:

See Also:



349
350
351
352
# File 'lib/aws-sdk-kafka/client.rb', line 349

def describe_cluster(params = {}, options = {})
  req = build_request(:describe_cluster, params)
  req.send_request(options)
end

#get_bootstrap_brokers(params = {}) ⇒ Types::GetBootstrapBrokersResponse

A list of brokers that a client application can use to bootstrap.

Examples:

Request syntax with placeholder values


resp = client.get_bootstrap_brokers({
  cluster_arn: "__string", # required
})

Response structure


resp.bootstrap_broker_string #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :cluster_arn (required, String)

Returns:

See Also:



376
377
378
379
# File 'lib/aws-sdk-kafka/client.rb', line 376

def get_bootstrap_brokers(params = {}, options = {})
  req = build_request(:get_bootstrap_brokers, params)
  req.send_request(options)
end

#list_clusters(params = {}) ⇒ Types::ListClustersResponse

Returns a list of clusters in an account.

Examples:

Request syntax with placeholder values


resp = client.list_clusters({
  cluster_name_filter: "__string",
  max_results: 1,
  next_token: "__string",
})

Response structure


resp.cluster_info_list #=> Array
resp.cluster_info_list[0].broker_node_group_info.broker_az_distribution #=> String, one of "DEFAULT"
resp.cluster_info_list[0].broker_node_group_info.client_subnets #=> Array
resp.cluster_info_list[0].broker_node_group_info.client_subnets[0] #=> String
resp.cluster_info_list[0].broker_node_group_info.instance_type #=> String
resp.cluster_info_list[0].broker_node_group_info.security_groups #=> Array
resp.cluster_info_list[0].broker_node_group_info.security_groups[0] #=> String
resp.cluster_info_list[0].broker_node_group_info.storage_info.ebs_storage_info.volume_size #=> Integer
resp.cluster_info_list[0].cluster_arn #=> String
resp.cluster_info_list[0].cluster_name #=> String
resp.cluster_info_list[0].creation_time #=> Time
resp.cluster_info_list[0].current_broker_software_info.configuration_arn #=> String
resp.cluster_info_list[0].current_broker_software_info.configuration_revision #=> String
resp.cluster_info_list[0].current_broker_software_info.kafka_version #=> String
resp.cluster_info_list[0].current_version #=> String
resp.cluster_info_list[0].encryption_info.encryption_at_rest.data_volume_kms_key_id #=> String
resp.cluster_info_list[0].enhanced_monitoring #=> String, one of "DEFAULT", "PER_BROKER", "PER_TOPIC_PER_BROKER"
resp.cluster_info_list[0].number_of_broker_nodes #=> Integer
resp.cluster_info_list[0].state #=> String, one of "ACTIVE", "CREATING", "DELETING", "FAILED"
resp.cluster_info_list[0].zookeeper_connect_string #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :cluster_name_filter (String)
  • :max_results (Integer)
  • :next_token (String)

Returns:

See Also:



430
431
432
433
# File 'lib/aws-sdk-kafka/client.rb', line 430

def list_clusters(params = {}, options = {})
  req = build_request(:list_clusters, params)
  req.send_request(options)
end

#list_nodes(params = {}) ⇒ Types::ListNodesResponse

Returns a list of the broker nodes in the cluster.

Examples:

Request syntax with placeholder values


resp = client.list_nodes({
  cluster_arn: "__string", # required
  max_results: 1,
  next_token: "__string",
})

Response structure


resp.next_token #=> String
resp.node_info_list #=> Array
resp.node_info_list[0].added_to_cluster_time #=> String
resp.node_info_list[0].broker_node_info.attached_eni_id #=> String
resp.node_info_list[0].broker_node_info.broker_id #=> Float
resp.node_info_list[0].broker_node_info.client_subnet #=> String
resp.node_info_list[0].broker_node_info.client_vpc_ip_address #=> String
resp.node_info_list[0].broker_node_info.current_broker_software_info.configuration_arn #=> String
resp.node_info_list[0].broker_node_info.current_broker_software_info.configuration_revision #=> String
resp.node_info_list[0].broker_node_info.current_broker_software_info.kafka_version #=> String
resp.node_info_list[0].instance_type #=> String
resp.node_info_list[0].node_arn #=> String
resp.node_info_list[0].node_type #=> String, one of "BROKER"
resp.node_info_list[0].zookeeper_node_info.attached_eni_id #=> String
resp.node_info_list[0].zookeeper_node_info.client_vpc_ip_address #=> String
resp.node_info_list[0].zookeeper_node_info.zookeeper_id #=> Float
resp.node_info_list[0].zookeeper_node_info.zookeeper_version #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :cluster_arn (required, String)
  • :max_results (Integer)
  • :next_token (String)

Returns:

See Also:



480
481
482
483
# File 'lib/aws-sdk-kafka/client.rb', line 480

def list_nodes(params = {}, options = {})
  req = build_request(:list_nodes, params)
  req.send_request(options)
end

#waiter_namesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deprecated.


504
505
506
# File 'lib/aws-sdk-kafka/client.rb', line 504

def waiter_names
  []
end