Method: Google::Cloud::Monitoring::V3::GroupService::Client#list_groups
- Defined in:
- lib/google/cloud/monitoring/v3/group_service/client.rb
permalink #list_groups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::Group> #list_groups(name: nil, children_of_group: nil, ancestors_of_group: nil, descendants_of_group: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::Group>
Lists the existing groups.
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
# File 'lib/google/cloud/monitoring/v3/group_service/client.rb', line 268 def list_groups request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::ListGroupsRequest # 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.list_groups..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.list_groups.timeout, metadata: , retry_policy: @config.rpcs.list_groups.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @group_service_stub.call_rpc :list_groups, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @group_service_stub, :list_groups, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |