From 368a1f69954fda28c1f400c061852e68a7214349 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 1 Apr 2025 20:56:24 +0000 Subject: [PATCH] Regenerate client from commit f629f10b of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 185 +++++++++++++++ ...ted-connections-returns-OK-response.frozen | 1 + ...egated-connections-returns-OK-response.yml | 20 ++ ...ctions-returns-Bad-Request-response.frozen | 1 + ...nnections-returns-Bad-Request-response.yml | 20 ++ .../GetAggregatedConnections.rb | 8 + features/scenarios_model_mapping.rb | 7 + features/v2/cloud_network_monitoring.feature | 29 +++ features/v2/undo.json | 6 + lib/datadog_api_client/configuration.rb | 1 + lib/datadog_api_client/inflector.rb | 5 + .../v2/api/cloud_network_monitoring_api.rb | 108 +++++++++ ...le_aggregated_connection_response_array.rb | 107 +++++++++ ...gle_aggregated_connection_response_data.rb | 126 ++++++++++ ...ted_connection_response_data_attributes.rb | 215 ++++++++++++++++++ ...ggregated_connection_response_data_type.rb | 27 +++ 17 files changed, 870 insertions(+), 4 deletions(-) create mode 100644 cassettes/features/v2/cloud_network_monitoring/Get-aggregated-connections-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cloud_network_monitoring/Get-aggregated-connections-returns-OK-response.yml create mode 100644 cassettes/features/v2/cloud_network_monitoring/Get-all-aggregated-connections-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/cloud_network_monitoring/Get-all-aggregated-connections-returns-Bad-Request-response.yml create mode 100644 examples/v2/cloud-network-monitoring/GetAggregatedConnections.rb create mode 100644 features/v2/cloud_network_monitoring.feature create mode 100644 lib/datadog_api_client/v2/api/cloud_network_monitoring_api.rb create mode 100644 lib/datadog_api_client/v2/models/single_aggregated_connection_response_array.rb create mode 100644 lib/datadog_api_client/v2/models/single_aggregated_connection_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/single_aggregated_connection_response_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/single_aggregated_connection_response_data_type.rb diff --git a/.apigentools-info b/.apigentools-info index 53711ff9c033..ddcc17bb1fd6 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-03-31 17:39:58.222884", - "spec_repo_commit": "3826157e" + "regenerated": "2025-04-01 20:55:53.888631", + "spec_repo_commit": "f629f10b" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-03-31 17:39:58.238226", - "spec_repo_commit": "3826157e" + "regenerated": "2025-04-01 20:55:53.904596", + "spec_repo_commit": "f629f10b" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4aacf7eab58b..d99088e0a321 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -30188,6 +30188,125 @@ components: description: Link to the Incident created on ServiceNow type: string type: object + SingleAggregatedConnectionResponseArray: + description: The definition of `SingleAggregatedConnectionResponseArray` object. + example: + data: + - attributes: + bytes_sent_by_client: 100 + bytes_sent_by_server: 200 + group_bys: + client_team: + - networks + server_service: + - hucklebuck + packets_sent_by_client: 10 + packets_sent_by_server: 20 + rtt_micro_seconds: 800 + tcp_closed_connections: 30 + tcp_established_connections: 40 + tcp_refusals: 7 + tcp_resets: 5 + tcp_retransmits: 30 + tcp_timeouts: 6 + id: client_team:networks, server_service:hucklebuck + type: aggregated_connection + properties: + data: + description: The `SingleAggregatedConnectionResponseArray` `data`. + items: + $ref: '#/components/schemas/SingleAggregatedConnectionResponseData' + type: array + type: object + SingleAggregatedConnectionResponseData: + description: The definition of `SingleAggregatedConnectionResponseData` object. + properties: + attributes: + $ref: '#/components/schemas/SingleAggregatedConnectionResponseDataAttributes' + id: + description: The `SingleAggregatedConnectionResponseData` `id`. + type: string + type: + $ref: '#/components/schemas/SingleAggregatedConnectionResponseDataType' + type: object + SingleAggregatedConnectionResponseDataAttributes: + description: The definition of `SingleAggregatedConnectionResponseDataAttributes` + object. + properties: + bytes_sent_by_client: + description: The total number of bytes sent by the client over the given + period. + format: int64 + type: integer + bytes_sent_by_server: + description: The total number of bytes sent by the server over the given + period. + format: int64 + type: integer + group_bys: + additionalProperties: + items: + type: string + type: array + description: The `attributes` `group_bys`. + type: object + packets_sent_by_client: + description: The total number of packets sent by the client over the given + period. + format: int64 + type: integer + packets_sent_by_server: + description: The total number of packets sent by the server over the given + period. + format: int64 + type: integer + rtt_micro_seconds: + description: Measured as TCP smoothed roundtrip time in microseconds (the + time between a TCP frame being sent and acknowledged). + format: int64 + type: integer + tcp_closed_connections: + description: The number of TCP connections in a closed state. Measured in + connections per second from the client. + format: int64 + type: integer + tcp_established_connections: + description: The number of TCP connections in an established state. Measured + in connections per second from the client. + format: int64 + type: integer + tcp_refusals: + description: The number of TCP connections that were refused by the server. + Typically this indicates an attempt to connect to an IP/port that is not + receiving connections, or a firewall/security misconfiguration. + format: int64 + type: integer + tcp_resets: + description: The number of TCP connections that were reset by the server. + format: int64 + type: integer + tcp_retransmits: + description: TCP Retransmits represent detected failures that are retransmitted + to ensure delivery. Measured in count of retransmits from the client. + format: int64 + type: integer + tcp_timeouts: + description: The number of TCP connections that timed out from the perspective + of the operating system. This can indicate general connectivity and latency + issues. + format: int64 + type: integer + type: object + SingleAggregatedConnectionResponseDataType: + default: aggregated_connection + description: 'Aggregated connection resource type. Allowed enum values: `aggregated_connection`. + + default: `aggregated_connection`' + enum: + - aggregated_connection + type: string + x-enum-varnames: + - AGGREGATED_CONNECTION SlackIntegrationMetadata: description: Incident integration metadata for the Slack integration. properties: @@ -44282,6 +44401,68 @@ paths: summary: Update the tags for a device tags: - Network Device Monitoring + /api/v2/network/connections/aggregate: + get: + description: Get aggregated connections + operationId: GetAggregatedConnections + parameters: + - description: Unix timestamp (number of seconds since epoch) of the start of + the query window. If not provided, the start of the query window is 15 minutes + before the "to" timestamp. If neither "from" nor "to" are provided, the + query window is [now - 15m, now]. + in: query + name: from + schema: + format: int64 + type: integer + - description: Unix timestamp (number of seconds since epoch) of the end of + the query window. If not provided, the end of the query window is the current + time. If neither "from" nor "to" are provided, the query window is [now + - 15m, now]. + in: query + name: to + schema: + format: int64 + type: integer + - description: Comma-separated list of fields to group connections by. + in: query + name: group_by + schema: + type: string + - description: Comma-separated list of tags to filter connections by. + in: query + name: tags + schema: + type: string + - description: The number of connections to be returned. The maximum value is + 5000. + in: query + name: limit + schema: + default: 100 + format: int32 + maximum: 5000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SingleAggregatedConnectionResponseArray' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get aggregated connections + tags: + - Cloud Network Monitoring + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/). + + type: safe' /api/v2/org_configs: get: description: Returns all Org Configs (name, description, and value). @@ -53624,6 +53805,10 @@ tags: and the `cloud_cost` data source. For more information, see the [Cloud Cost Management documentation](https://docs.datadoghq.com/cloud_cost_management/). name: Cloud Cost Management +- description: The Cloud Network Monitoring API allows you to fetch aggregated connections + and their attributes. See the [Cloud Network Monitoring page](https://docs.datadoghq.com/network_monitoring/cloud_network_monitoring/) + for more information. + name: Cloud Network Monitoring - description: Manage your Datadog Cloudflare integration directly through the Datadog API. See the [Cloudflare integration page](https://docs.datadoghq.com/integrations/cloudflare/) for more information. diff --git a/cassettes/features/v2/cloud_network_monitoring/Get-aggregated-connections-returns-OK-response.frozen b/cassettes/features/v2/cloud_network_monitoring/Get-aggregated-connections-returns-OK-response.frozen new file mode 100644 index 000000000000..ec3ccb6dc70b --- /dev/null +++ b/cassettes/features/v2/cloud_network_monitoring/Get-aggregated-connections-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-03-31T18:18:50.338Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_network_monitoring/Get-aggregated-connections-returns-OK-response.yml b/cassettes/features/v2/cloud_network_monitoring/Get-aggregated-connections-returns-OK-response.yml new file mode 100644 index 000000000000..c9c4d65b8706 --- /dev/null +++ b/cassettes/features/v2/cloud_network_monitoring/Get-aggregated-connections-returns-OK-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Mon, 31 Mar 2025 18:18:50 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/network/connections/aggregate + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cloud_network_monitoring/Get-all-aggregated-connections-returns-Bad-Request-response.frozen b/cassettes/features/v2/cloud_network_monitoring/Get-all-aggregated-connections-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..ca4c2f607f79 --- /dev/null +++ b/cassettes/features/v2/cloud_network_monitoring/Get-all-aggregated-connections-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-03-31T18:18:50.770Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_network_monitoring/Get-all-aggregated-connections-returns-Bad-Request-response.yml b/cassettes/features/v2/cloud_network_monitoring/Get-all-aggregated-connections-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..364bf8be3635 --- /dev/null +++ b/cassettes/features/v2/cloud_network_monitoring/Get-all-aggregated-connections-returns-Bad-Request-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Mon, 31 Mar 2025 18:18:50 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/network/connections/aggregate?limit=6000 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Invalid limit"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/examples/v2/cloud-network-monitoring/GetAggregatedConnections.rb b/examples/v2/cloud-network-monitoring/GetAggregatedConnections.rb new file mode 100644 index 000000000000..3157360f131c --- /dev/null +++ b/examples/v2/cloud-network-monitoring/GetAggregatedConnections.rb @@ -0,0 +1,8 @@ +# Get aggregated connections returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_aggregated_connections".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudNetworkMonitoringAPI.new +p api_instance.get_aggregated_connections() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 42ce22763415..d275591633b7 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1765,6 +1765,13 @@ "device_id" => "String", "body" => "ListTagsResponse", }, + "v2.GetAggregatedConnections" => { + "from" => "Integer", + "to" => "Integer", + "group_by" => "String", + "tags" => "String", + "limit" => "Integer", + }, "v2.GetOrgConfig" => { "org_config_name" => "String", }, diff --git a/features/v2/cloud_network_monitoring.feature b/features/v2/cloud_network_monitoring.feature new file mode 100644 index 000000000000..2ae8e7cf2d07 --- /dev/null +++ b/features/v2/cloud_network_monitoring.feature @@ -0,0 +1,29 @@ +@endpoint(cloud-network-monitoring) @endpoint(cloud-network-monitoring-v2) +Feature: Cloud Network Monitoring + The Cloud Network Monitoring API allows you to fetch aggregated + connections and their attributes. See the [Cloud Network Monitoring page]( + https://docs.datadoghq.com/network_monitoring/cloud_network_monitoring/) + for more information. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "CloudNetworkMonitoring" API + And operation "GetAggregatedConnections" enabled + And new "GetAggregatedConnections" request + + @generated @skip @team:Datadog/networks + Scenario: Get aggregated connections returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @team:Datadog/networks + Scenario: Get aggregated connections returns "OK" response + When the request is sent + Then the response status is 200 OK + + @skip-python @skip-ruby @team:Datadog/networks + Scenario: Get all aggregated connections returns "Bad Request" response + Given request contains "limit" parameter with value 6000 + When the request is sent + Then the response status is 400 Bad Request diff --git a/features/v2/undo.json b/features/v2/undo.json index 13df29980191..f8e2c4ef1bdf 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1744,6 +1744,12 @@ "type": "idempotent" } }, + "GetAggregatedConnections": { + "tag": "Cloud Network Monitoring", + "undo": { + "type": "safe" + } + }, "ListOrgConfigs": { "tag": "Organizations", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 921de0897ddc..b2f1493cb289 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -230,6 +230,7 @@ def initialize "v2.list_aws_namespaces": false, "v2.update_aws_account": false, "v2.list_aws_logs_services": false, + "v2.get_aggregated_connections": false, "v2.cancel_historical_job": false, "v2.convert_job_result_to_signal": false, "v2.delete_historical_job": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 7d3c4ff9d7d0..08246f627063 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2793,6 +2793,10 @@ def overrides "v2.service_definition_v2_version" => "ServiceDefinitionV2Version", "v2.service_now_ticket" => "ServiceNowTicket", "v2.service_now_ticket_result" => "ServiceNowTicketResult", + "v2.single_aggregated_connection_response_array" => "SingleAggregatedConnectionResponseArray", + "v2.single_aggregated_connection_response_data" => "SingleAggregatedConnectionResponseData", + "v2.single_aggregated_connection_response_data_attributes" => "SingleAggregatedConnectionResponseDataAttributes", + "v2.single_aggregated_connection_response_data_type" => "SingleAggregatedConnectionResponseDataType", "v2.slack_integration_metadata" => "SlackIntegrationMetadata", "v2.slack_integration_metadata_channel_item" => "SlackIntegrationMetadataChannelItem", "v2.slack_trigger_wrapper" => "SlackTriggerWrapper", @@ -3087,6 +3091,7 @@ def overrides "v2.ci_visibility_pipelines_api" => "CIVisibilityPipelinesAPI", "v2.ci_visibility_tests_api" => "CIVisibilityTestsAPI", "v2.cloud_cost_management_api" => "CloudCostManagementAPI", + "v2.cloud_network_monitoring_api" => "CloudNetworkMonitoringAPI", "v2.cloudflare_integration_api" => "CloudflareIntegrationAPI", "v2.confluent_cloud_api" => "ConfluentCloudAPI", "v2.container_images_api" => "ContainerImagesAPI", diff --git a/lib/datadog_api_client/v2/api/cloud_network_monitoring_api.rb b/lib/datadog_api_client/v2/api/cloud_network_monitoring_api.rb new file mode 100644 index 000000000000..e7daf39cfc86 --- /dev/null +++ b/lib/datadog_api_client/v2/api/cloud_network_monitoring_api.rb @@ -0,0 +1,108 @@ +=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 CloudNetworkMonitoringAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Get aggregated connections. + # + # @see #get_aggregated_connections_with_http_info + def get_aggregated_connections(opts = {}) + data, _status_code, _headers = get_aggregated_connections_with_http_info(opts) + data + end + + # Get aggregated connections. + # + # Get aggregated connections + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :from Unix timestamp (number of seconds since epoch) of the start of the query window. If not provided, the start of the query window is 15 minutes before the "to" timestamp. If neither "from" nor "to" are provided, the query window is [now - 15m, now]. + # @option opts [Integer] :to Unix timestamp (number of seconds since epoch) of the end of the query window. If not provided, the end of the query window is the current time. If neither "from" nor "to" are provided, the query window is [now - 15m, now]. + # @option opts [String] :group_by Comma-separated list of fields to group connections by. + # @option opts [String] :tags Comma-separated list of tags to filter connections by. + # @option opts [Integer] :limit The number of connections to be returned. The maximum value is 5000. + # @return [Array<(SingleAggregatedConnectionResponseArray, Integer, Hash)>] SingleAggregatedConnectionResponseArray data, response status code and response headers + def get_aggregated_connections_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_aggregated_connections".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_aggregated_connections") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_aggregated_connections")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudNetworkMonitoringAPI.get_aggregated_connections ...' + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 5000 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CloudNetworkMonitoringAPI.get_aggregated_connections, must be smaller than or equal to 5000.' + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CloudNetworkMonitoringAPI.get_aggregated_connections, must be greater than or equal to 1.' + end + # resource path + local_var_path = '/api/v2/network/connections/aggregate' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil? + query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil? + query_params[:'group_by'] = opts[:'group_by'] if !opts[:'group_by'].nil? + query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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] || 'SingleAggregatedConnectionResponseArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_aggregated_connections, + :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: CloudNetworkMonitoringAPI#get_aggregated_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/single_aggregated_connection_response_array.rb b/lib/datadog_api_client/v2/models/single_aggregated_connection_response_array.rb new file mode 100644 index 000000000000..075e01da4308 --- /dev/null +++ b/lib/datadog_api_client/v2/models/single_aggregated_connection_response_array.rb @@ -0,0 +1,107 @@ +=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 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `SingleAggregatedConnectionResponseArray` object. + class SingleAggregatedConnectionResponseArray + include BaseGenericModel + + # The `SingleAggregatedConnectionResponseArray` `data`. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SingleAggregatedConnectionResponseArray` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/single_aggregated_connection_response_data.rb b/lib/datadog_api_client/v2/models/single_aggregated_connection_response_data.rb new file mode 100644 index 000000000000..0eab57aca79e --- /dev/null +++ b/lib/datadog_api_client/v2/models/single_aggregated_connection_response_data.rb @@ -0,0 +1,126 @@ +=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 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `SingleAggregatedConnectionResponseData` object. + class SingleAggregatedConnectionResponseData + include BaseGenericModel + + # The definition of `SingleAggregatedConnectionResponseDataAttributes` object. + attr_accessor :attributes + + # The `SingleAggregatedConnectionResponseData` `id`. + attr_accessor :id + + # Aggregated connection resource type. Allowed enum values: `aggregated_connection`. + # default: `aggregated_connection` + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SingleAggregatedConnectionResponseDataAttributes', + :'id' => :'String', + :'type' => :'SingleAggregatedConnectionResponseDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SingleAggregatedConnectionResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/single_aggregated_connection_response_data_attributes.rb b/lib/datadog_api_client/v2/models/single_aggregated_connection_response_data_attributes.rb new file mode 100644 index 000000000000..a9c79f6b9432 --- /dev/null +++ b/lib/datadog_api_client/v2/models/single_aggregated_connection_response_data_attributes.rb @@ -0,0 +1,215 @@ +=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 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `SingleAggregatedConnectionResponseDataAttributes` object. + class SingleAggregatedConnectionResponseDataAttributes + include BaseGenericModel + + # The total number of bytes sent by the client over the given period. + attr_accessor :bytes_sent_by_client + + # The total number of bytes sent by the server over the given period. + attr_accessor :bytes_sent_by_server + + # The `attributes` `group_bys`. + attr_accessor :group_bys + + # The total number of packets sent by the client over the given period. + attr_accessor :packets_sent_by_client + + # The total number of packets sent by the server over the given period. + attr_accessor :packets_sent_by_server + + # Measured as TCP smoothed roundtrip time in microseconds (the time between a TCP frame being sent and acknowledged). + attr_accessor :rtt_micro_seconds + + # The number of TCP connections in a closed state. Measured in connections per second from the client. + attr_accessor :tcp_closed_connections + + # The number of TCP connections in an established state. Measured in connections per second from the client. + attr_accessor :tcp_established_connections + + # The number of TCP connections that were refused by the server. Typically this indicates an attempt to connect to an IP/port that is not receiving connections, or a firewall/security misconfiguration. + attr_accessor :tcp_refusals + + # The number of TCP connections that were reset by the server. + attr_accessor :tcp_resets + + # TCP Retransmits represent detected failures that are retransmitted to ensure delivery. Measured in count of retransmits from the client. + attr_accessor :tcp_retransmits + + # The number of TCP connections that timed out from the perspective of the operating system. This can indicate general connectivity and latency issues. + attr_accessor :tcp_timeouts + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'bytes_sent_by_client' => :'bytes_sent_by_client', + :'bytes_sent_by_server' => :'bytes_sent_by_server', + :'group_bys' => :'group_bys', + :'packets_sent_by_client' => :'packets_sent_by_client', + :'packets_sent_by_server' => :'packets_sent_by_server', + :'rtt_micro_seconds' => :'rtt_micro_seconds', + :'tcp_closed_connections' => :'tcp_closed_connections', + :'tcp_established_connections' => :'tcp_established_connections', + :'tcp_refusals' => :'tcp_refusals', + :'tcp_resets' => :'tcp_resets', + :'tcp_retransmits' => :'tcp_retransmits', + :'tcp_timeouts' => :'tcp_timeouts' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'bytes_sent_by_client' => :'Integer', + :'bytes_sent_by_server' => :'Integer', + :'group_bys' => :'Hash>', + :'packets_sent_by_client' => :'Integer', + :'packets_sent_by_server' => :'Integer', + :'rtt_micro_seconds' => :'Integer', + :'tcp_closed_connections' => :'Integer', + :'tcp_established_connections' => :'Integer', + :'tcp_refusals' => :'Integer', + :'tcp_resets' => :'Integer', + :'tcp_retransmits' => :'Integer', + :'tcp_timeouts' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SingleAggregatedConnectionResponseDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'bytes_sent_by_client') + self.bytes_sent_by_client = attributes[:'bytes_sent_by_client'] + end + + if attributes.key?(:'bytes_sent_by_server') + self.bytes_sent_by_server = attributes[:'bytes_sent_by_server'] + end + + if attributes.key?(:'group_bys') + self.group_bys = attributes[:'group_bys'] + end + + if attributes.key?(:'packets_sent_by_client') + self.packets_sent_by_client = attributes[:'packets_sent_by_client'] + end + + if attributes.key?(:'packets_sent_by_server') + self.packets_sent_by_server = attributes[:'packets_sent_by_server'] + end + + if attributes.key?(:'rtt_micro_seconds') + self.rtt_micro_seconds = attributes[:'rtt_micro_seconds'] + end + + if attributes.key?(:'tcp_closed_connections') + self.tcp_closed_connections = attributes[:'tcp_closed_connections'] + end + + if attributes.key?(:'tcp_established_connections') + self.tcp_established_connections = attributes[:'tcp_established_connections'] + end + + if attributes.key?(:'tcp_refusals') + self.tcp_refusals = attributes[:'tcp_refusals'] + end + + if attributes.key?(:'tcp_resets') + self.tcp_resets = attributes[:'tcp_resets'] + end + + if attributes.key?(:'tcp_retransmits') + self.tcp_retransmits = attributes[:'tcp_retransmits'] + end + + if attributes.key?(:'tcp_timeouts') + self.tcp_timeouts = attributes[:'tcp_timeouts'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + bytes_sent_by_client == o.bytes_sent_by_client && + bytes_sent_by_server == o.bytes_sent_by_server && + group_bys == o.group_bys && + packets_sent_by_client == o.packets_sent_by_client && + packets_sent_by_server == o.packets_sent_by_server && + rtt_micro_seconds == o.rtt_micro_seconds && + tcp_closed_connections == o.tcp_closed_connections && + tcp_established_connections == o.tcp_established_connections && + tcp_refusals == o.tcp_refusals && + tcp_resets == o.tcp_resets && + tcp_retransmits == o.tcp_retransmits && + tcp_timeouts == o.tcp_timeouts && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [bytes_sent_by_client, bytes_sent_by_server, group_bys, packets_sent_by_client, packets_sent_by_server, rtt_micro_seconds, tcp_closed_connections, tcp_established_connections, tcp_refusals, tcp_resets, tcp_retransmits, tcp_timeouts, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/single_aggregated_connection_response_data_type.rb b/lib/datadog_api_client/v2/models/single_aggregated_connection_response_data_type.rb new file mode 100644 index 000000000000..85e7f64abdbb --- /dev/null +++ b/lib/datadog_api_client/v2/models/single_aggregated_connection_response_data_type.rb @@ -0,0 +1,27 @@ +=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 'date' +require 'time' + +module DatadogAPIClient::V2 + # Aggregated connection resource type. Allowed enum values: `aggregated_connection`. + # default: `aggregated_connection` + class SingleAggregatedConnectionResponseDataType + include BaseEnumModel + + AGGREGATED_CONNECTION = "aggregated_connection".freeze + end +end