Method: Google::Cloud::Monitoring::V3::GroupService::Client#create_group
- Defined in:
- lib/google/cloud/monitoring/v3/group_service/client.rb
permalink #create_group(request, options = nil) ⇒ ::Google::Cloud::Monitoring::V3::Group #create_group(name: nil, group: nil, validate_only: nil) ⇒ ::Google::Cloud::Monitoring::V3::Group
Creates a new group.
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 |
# File 'lib/google/cloud/monitoring/v3/group_service/client.rb', line 449 def create_group request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::CreateGroupRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_group..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Monitoring::V3::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_group.timeout, metadata: , retry_policy: @config.rpcs.create_group.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @group_service_stub.call_rpc :create_group, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |