|
| 1 | +=begin |
| 2 | +#Datadog API V2 Collection |
| 3 | +
|
| 4 | +#Collection of all Datadog Public endpoints. |
| 5 | +
|
| 6 | +The version of the OpenAPI document: 1.0 |
| 7 | +Contact: support@datadoghq.com |
| 8 | +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator |
| 9 | +
|
| 10 | + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. |
| 11 | + This product includes software developed at Datadog (https://www.datadoghq.com/). |
| 12 | + Copyright 2020-Present Datadog, Inc. |
| 13 | +
|
| 14 | +=end |
| 15 | + |
| 16 | +require 'cgi' |
| 17 | + |
| 18 | +module DatadogAPIClient::V2 |
| 19 | + class APMAPI |
| 20 | + attr_accessor :api_client |
| 21 | + |
| 22 | + def initialize(api_client = DatadogAPIClient::APIClient.default) |
| 23 | + @api_client = api_client |
| 24 | + end |
| 25 | + |
| 26 | + # Get service list. |
| 27 | + # |
| 28 | + # @see #get_service_list_with_http_info |
| 29 | + def get_service_list(opts = {}) |
| 30 | + data, _status_code, _headers = get_service_list_with_http_info(opts) |
| 31 | + data |
| 32 | + end |
| 33 | + |
| 34 | + # Get service list. |
| 35 | + # @param opts [Hash] the optional parameters |
| 36 | + # @return [Array<(ServiceList, Integer, Hash)>] ServiceList data, response status code and response headers |
| 37 | + def get_service_list_with_http_info(opts = {}) |
| 38 | + |
| 39 | + if @api_client.config.debugging |
| 40 | + @api_client.config.logger.debug 'Calling API: APMAPI.get_service_list ...' |
| 41 | + end |
| 42 | + # resource path |
| 43 | + local_var_path = '/api/v2/apm/services' |
| 44 | + |
| 45 | + # query parameters |
| 46 | + query_params = opts[:query_params] || {} |
| 47 | + |
| 48 | + # header parameters |
| 49 | + header_params = opts[:header_params] || {} |
| 50 | + # HTTP header 'Accept' (if needed) |
| 51 | + header_params['Accept'] = @api_client.select_header_accept(['application/json']) |
| 52 | + |
| 53 | + # form parameters |
| 54 | + form_params = opts[:form_params] || {} |
| 55 | + |
| 56 | + # http body (model) |
| 57 | + post_body = opts[:debug_body] |
| 58 | + |
| 59 | + # return_type |
| 60 | + return_type = opts[:debug_return_type] || 'ServiceList' |
| 61 | + |
| 62 | + # auth_names |
| 63 | + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] |
| 64 | + |
| 65 | + new_options = opts.merge( |
| 66 | + :operation => :get_service_list, |
| 67 | + :header_params => header_params, |
| 68 | + :query_params => query_params, |
| 69 | + :form_params => form_params, |
| 70 | + :body => post_body, |
| 71 | + :auth_names => auth_names, |
| 72 | + :return_type => return_type, |
| 73 | + :api_version => "V2" |
| 74 | + ) |
| 75 | + |
| 76 | + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) |
| 77 | + if @api_client.config.debugging |
| 78 | + @api_client.config.logger.debug "API called: APMAPI#get_service_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" |
| 79 | + end |
| 80 | + return data, status_code, headers |
| 81 | + end |
| 82 | + end |
| 83 | +end |
0 commit comments