=begin #Datadog API V2 Collection #Collection of all Datadog Public endpoints. The version of the OpenAPI document: 1.0 Contact: support@datadoghq.com Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2020-Present Datadog, Inc. =end require 'cgi' module DatadogAPIClient::V2 class CSMAgentsAPI attr_accessor :api_client def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end # Get all CSM Agents. # # @see #list_all_csm_agents_with_http_info def list_all_csm_agents(opts = {}) data, _status_code, _headers = list_all_csm_agents_with_http_info(opts) data end # Get all CSM Agents. # # Get the list of all CSM Agents running on your hosts and containers. # # @param opts [Hash] the optional parameters # @option opts [Integer] :page The page index for pagination (zero-based). # @option opts [Integer] :size The number of items to include in a single page. # @option opts [String] :query A search query string to filter results (for example, `hostname:COMP-T2H4J27423`). # @option opts [OrderDirection] :order_direction The sort direction for results. Use `asc` for ascending or `desc` for descending. # @return [Array<(CsmAgentsResponse, Integer, Hash)>] CsmAgentsResponse data, response status code and response headers def list_all_csm_agents_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CSMAgentsAPI.list_all_csm_agents ...' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 1000000 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling CSMAgentsAPI.list_all_csm_agents, must be smaller than or equal to 1000000.' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling CSMAgentsAPI.list_all_csm_agents, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100 fail ArgumentError, 'invalid value for "opts[:"size"]" when calling CSMAgentsAPI.list_all_csm_agents, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] < 0 fail ArgumentError, 'invalid value for "opts[:"size"]" when calling CSMAgentsAPI.list_all_csm_agents, must be greater than or equal to 0.' end allowable_values = ['asc', 'desc'] if @api_client.config.client_side_validation && opts[:'order_direction'] && !allowable_values.include?(opts[:'order_direction']) fail ArgumentError, "invalid value for \"order_direction\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/v2/csm/onboarding/agents' # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? query_params[:'order_direction'] = opts[:'order_direction'] if !opts[:'order_direction'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CsmAgentsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :list_all_csm_agents, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CSMAgentsAPI#list_all_csm_agents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all CSM Serverless Agents. # # @see #list_all_csm_serverless_agents_with_http_info def list_all_csm_serverless_agents(opts = {}) data, _status_code, _headers = list_all_csm_serverless_agents_with_http_info(opts) data end # Get all CSM Serverless Agents. # # Get the list of all CSM Serverless Agents running on your hosts and containers. # # @param opts [Hash] the optional parameters # @option opts [Integer] :page The page index for pagination (zero-based). # @option opts [Integer] :size The number of items to include in a single page. # @option opts [String] :query A search query string to filter results (for example, `hostname:COMP-T2H4J27423`). # @option opts [OrderDirection] :order_direction The sort direction for results. Use `asc` for ascending or `desc` for descending. # @return [Array<(CsmAgentsResponse, Integer, Hash)>] CsmAgentsResponse data, response status code and response headers def list_all_csm_serverless_agents_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CSMAgentsAPI.list_all_csm_serverless_agents ...' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 1000000 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling CSMAgentsAPI.list_all_csm_serverless_agents, must be smaller than or equal to 1000000.' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling CSMAgentsAPI.list_all_csm_serverless_agents, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100 fail ArgumentError, 'invalid value for "opts[:"size"]" when calling CSMAgentsAPI.list_all_csm_serverless_agents, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] < 0 fail ArgumentError, 'invalid value for "opts[:"size"]" when calling CSMAgentsAPI.list_all_csm_serverless_agents, must be greater than or equal to 0.' end allowable_values = ['asc', 'desc'] if @api_client.config.client_side_validation && opts[:'order_direction'] && !allowable_values.include?(opts[:'order_direction']) fail ArgumentError, "invalid value for \"order_direction\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/v2/csm/onboarding/serverless/agents' # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? query_params[:'order_direction'] = opts[:'order_direction'] if !opts[:'order_direction'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CsmAgentsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :list_all_csm_serverless_agents, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CSMAgentsAPI#list_all_csm_serverless_agents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end