datadog_api_client 2.12.0 → 2.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.apigentools-info +6 -6
- data/.generator/conftest.py +7 -0
- data/.generator/poetry.lock +45 -75
- data/.generator/pyproject.toml +7 -7
- data/.generator/schemas/v1/openapi.yaml +76 -3
- data/.generator/schemas/v2/openapi.yaml +2328 -459
- data/.generator/src/generator/formatter.py +9 -3
- data/.generator/src/generator/openapi.py +4 -2
- data/.github/workflows/test_integration.yml +7 -1
- data/.pre-commit-config.yaml +2 -2
- data/CHANGELOG.md +31 -0
- data/examples/v1/dashboards/CreateDashboard_1284514532.rb +43 -0
- data/examples/v1/dashboards/CreateDashboard_2261785072.rb +47 -0
- data/examples/v1/dashboards/CreateDashboard_3513586382.rb +74 -0
- data/examples/v1/dashboards/CreateDashboard_3562282606.rb +1 -0
- data/examples/v1/organizations/UpdateOrg.rb +1 -1
- data/examples/v1/users/CreateUser.rb +1 -1
- data/examples/v1/users/CreateUser_266604071.rb +13 -0
- data/examples/v1/users/UpdateUser.rb +1 -1
- data/examples/v2/confluent-cloud/CreateConfluentAccount.rb +1 -0
- data/examples/v2/confluent-cloud/CreateConfluentResource.rb +1 -0
- data/examples/v2/confluent-cloud/UpdateConfluentResource.rb +1 -0
- data/examples/v2/downtimes/CancelDowntime.rb +11 -0
- data/examples/v2/downtimes/CreateDowntime.rb +26 -0
- data/examples/v2/downtimes/GetDowntime.rb +11 -0
- data/examples/v2/downtimes/ListDowntimes.rb +8 -0
- data/examples/v2/downtimes/ListMonitorDowntimes.rb +8 -0
- data/examples/v2/downtimes/ListMonitorDowntimes_128979780.rb +8 -0
- data/examples/v2/downtimes/UpdateDowntime.rb +21 -0
- data/examples/v2/logs/ListLogsGet_2034110533.rb +3 -1
- data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_1092490364.rb +10 -0
- data/examples/v2/spans/AggregateSpans.rb +25 -0
- data/examples/v2/spans/ListSpans.rb +25 -0
- data/examples/v2/spans/ListSpansGet.rb +5 -0
- data/examples/v2/spans/ListSpansGet_1130763422.rb +8 -0
- data/examples/v2/spans/ListSpans_3495563906.rb +25 -0
- data/lib/datadog_api_client/configuration.rb +6 -0
- data/lib/datadog_api_client/inflector.rb +87 -0
- data/lib/datadog_api_client/v1/models/change_widget_request.rb +1 -1
- data/lib/datadog_api_client/v1/models/formula_and_function_cloud_cost_data_source.rb +26 -0
- data/lib/datadog_api_client/v1/models/formula_and_function_cloud_cost_query_definition.rb +150 -0
- data/lib/datadog_api_client/v1/models/formula_and_function_query_definition.rb +2 -1
- data/lib/datadog_api_client/v1/models/formula_and_function_response_format.rb +2 -1
- data/lib/datadog_api_client/v1/models/formula_and_function_slo_query_definition.rb +11 -1
- data/lib/datadog_api_client/v1/models/geomap_widget_request.rb +24 -2
- data/lib/datadog_api_client/v1/models/ip_prefixes_remote_configuration.rb +94 -0
- data/lib/datadog_api_client/v1/models/ip_ranges.rb +11 -1
- data/lib/datadog_api_client/v1/models/organization_settings.rb +8 -0
- data/lib/datadog_api_client/v1/models/query_value_widget_request.rb +1 -1
- data/lib/datadog_api_client/v1/models/scatterplot_table_request.rb +1 -1
- data/lib/datadog_api_client/v1/models/sunburst_widget_request.rb +1 -1
- data/lib/datadog_api_client/v1/models/table_widget_request.rb +1 -1
- data/lib/datadog_api_client/v1/models/timeseries_widget_request.rb +1 -1
- data/lib/datadog_api_client/v1/models/toplist_widget_request.rb +1 -1
- data/lib/datadog_api_client/v1/models/tree_map_widget_request.rb +1 -1
- data/lib/datadog_api_client/v1/models/user.rb +8 -0
- data/lib/datadog_api_client/v1/models/widget_display_type.rb +1 -0
- data/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb +2 -0
- data/lib/datadog_api_client/v2/api/downtimes_api.rb +462 -0
- data/lib/datadog_api_client/v2/api/logs_api.rb +2 -2
- data/lib/datadog_api_client/v2/api/metrics_api.rb +1 -1
- data/lib/datadog_api_client/v2/api/rum_api.rb +2 -2
- data/lib/datadog_api_client/v2/api/spans_api.rb +294 -0
- data/lib/datadog_api_client/v2/models/ci_app_pipeline_event_pipeline.rb +1 -1
- data/lib/datadog_api_client/v2/models/cloud_configuration_rule_create_payload.rb +13 -1
- data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_attributes.rb +41 -1
- data/lib/datadog_api_client/v2/models/confluent_account_resource_attributes.rb +11 -1
- data/lib/datadog_api_client/v2/models/confluent_resource_request_attributes.rb +11 -1
- data/lib/datadog_api_client/v2/models/confluent_resource_response_attributes.rb +21 -1
- data/lib/datadog_api_client/v2/models/dashboard_list_item.rb +12 -1
- data/lib/datadog_api_client/v2/models/downtime_create_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/downtime_create_request_attributes.rb +194 -0
- data/lib/datadog_api_client/v2/models/downtime_create_request_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/downtime_included_monitor_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/downtime_meta.rb +80 -0
- data/lib/datadog_api_client/v2/models/downtime_meta_page.rb +80 -0
- data/lib/datadog_api_client/v2/models/downtime_monitor_identifier.rb +63 -0
- data/lib/datadog_api_client/v2/models/downtime_monitor_identifier_id.rb +98 -0
- data/lib/datadog_api_client/v2/models/downtime_monitor_identifier_tags.rb +107 -0
- data/lib/datadog_api_client/v2/models/downtime_monitor_included_attributes.rb +80 -0
- data/lib/datadog_api_client/v2/models/downtime_monitor_included_item.rb +100 -0
- data/lib/datadog_api_client/v2/models/downtime_notify_end_state_actions.rb +27 -0
- data/lib/datadog_api_client/v2/models/downtime_notify_end_state_types.rb +28 -0
- data/lib/datadog_api_client/v2/models/downtime_relationships.rb +90 -0
- data/lib/datadog_api_client/v2/models/downtime_relationships_created_by.rb +88 -0
- data/lib/datadog_api_client/v2/models/downtime_relationships_created_by_data.rb +90 -0
- data/lib/datadog_api_client/v2/models/downtime_relationships_monitor.rb +88 -0
- data/lib/datadog_api_client/v2/models/downtime_relationships_monitor_data.rb +90 -0
- data/lib/datadog_api_client/v2/models/downtime_resource_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/downtime_response.rb +95 -0
- data/lib/datadog_api_client/v2/models/downtime_response_attributes.rb +208 -0
- data/lib/datadog_api_client/v2/models/downtime_response_data.rb +110 -0
- data/lib/datadog_api_client/v2/models/downtime_response_included_item.rb +63 -0
- data/lib/datadog_api_client/v2/models/downtime_schedule_create_request.rb +63 -0
- data/lib/datadog_api_client/v2/models/downtime_schedule_current_downtime_response.rb +100 -0
- data/lib/datadog_api_client/v2/models/downtime_schedule_one_time_create_update_request.rb +101 -0
- data/lib/datadog_api_client/v2/models/downtime_schedule_one_time_response.rb +98 -0
- data/lib/datadog_api_client/v2/models/downtime_schedule_recurrence_create_update_request.rb +143 -0
- data/lib/datadog_api_client/v2/models/downtime_schedule_recurrence_response.rb +106 -0
- data/lib/datadog_api_client/v2/models/downtime_schedule_recurrences_create_request.rb +110 -0
- data/lib/datadog_api_client/v2/models/downtime_schedule_recurrences_response.rb +131 -0
- data/lib/datadog_api_client/v2/models/downtime_schedule_recurrences_update_request.rb +92 -0
- data/lib/datadog_api_client/v2/models/downtime_schedule_response.rb +65 -0
- data/lib/datadog_api_client/v2/models/downtime_schedule_update_request.rb +63 -0
- data/lib/datadog_api_client/v2/models/downtime_status.rb +29 -0
- data/lib/datadog_api_client/v2/models/downtime_update_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/downtime_update_request_attributes.rb +165 -0
- data/lib/datadog_api_client/v2/models/downtime_update_request_data.rb +140 -0
- data/lib/datadog_api_client/v2/models/event_response_attributes.rb +11 -1
- data/lib/datadog_api_client/v2/models/events_group_by_sort.rb +1 -1
- data/lib/datadog_api_client/v2/models/events_response_metadata.rb +11 -1
- data/lib/datadog_api_client/v2/models/list_downtimes_response.rb +104 -0
- data/lib/datadog_api_client/v2/models/metrics_aggregator.rb +1 -1
- data/lib/datadog_api_client/v2/models/metrics_scalar_query.rb +1 -1
- data/lib/datadog_api_client/v2/models/monitor_downtime_match_resource_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/monitor_downtime_match_response.rb +92 -0
- data/lib/datadog_api_client/v2/models/monitor_downtime_match_response_attributes.rb +120 -0
- data/lib/datadog_api_client/v2/models/monitor_downtime_match_response_data.rb +108 -0
- data/lib/datadog_api_client/v2/models/restriction_policy_binding.rb +2 -1
- data/lib/datadog_api_client/v2/models/rum_application_list.rb +11 -1
- data/lib/datadog_api_client/v2/models/service_definition_data.rb +11 -1
- data/lib/datadog_api_client/v2/models/service_definition_meta.rb +36 -4
- data/lib/datadog_api_client/v2/models/service_definition_meta_warnings.rb +100 -0
- data/lib/datadog_api_client/v2/models/span.rb +100 -0
- data/lib/datadog_api_client/v2/models/spans_aggregate_bucket.rb +100 -0
- data/lib/datadog_api_client/v2/models/spans_aggregate_bucket_attributes.rb +100 -0
- data/lib/datadog_api_client/v2/models/spans_aggregate_bucket_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/spans_aggregate_bucket_value.rb +64 -0
- data/lib/datadog_api_client/v2/models/spans_aggregate_bucket_value_timeseries_point.rb +90 -0
- data/lib/datadog_api_client/v2/models/spans_aggregate_data.rb +90 -0
- data/lib/datadog_api_client/v2/models/spans_aggregate_request.rb +80 -0
- data/lib/datadog_api_client/v2/models/spans_aggregate_request_attributes.rb +115 -0
- data/lib/datadog_api_client/v2/models/spans_aggregate_request_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/spans_aggregate_response.rb +92 -0
- data/lib/datadog_api_client/v2/models/spans_aggregate_response_metadata.rb +113 -0
- data/lib/datadog_api_client/v2/models/spans_aggregate_response_status.rb +27 -0
- data/lib/datadog_api_client/v2/models/spans_aggregate_sort.rb +110 -0
- data/lib/datadog_api_client/v2/models/spans_aggregate_sort_type.rb +27 -0
- data/lib/datadog_api_client/v2/models/spans_aggregation_function.rb +37 -0
- data/lib/datadog_api_client/v2/models/spans_attributes.rb +244 -0
- data/lib/datadog_api_client/v2/models/spans_compute.rb +129 -0
- data/lib/datadog_api_client/v2/models/spans_compute_type.rb +27 -0
- data/lib/datadog_api_client/v2/models/spans_group_by.rb +149 -0
- data/lib/datadog_api_client/v2/models/spans_group_by_histogram.rb +143 -0
- data/lib/datadog_api_client/v2/models/spans_group_by_missing.rb +63 -0
- data/lib/datadog_api_client/v2/models/spans_group_by_total.rb +64 -0
- data/lib/datadog_api_client/v2/models/spans_list_request.rb +80 -0
- data/lib/datadog_api_client/v2/models/spans_list_request_attributes.rb +111 -0
- data/lib/datadog_api_client/v2/models/spans_list_request_data.rb +90 -0
- data/lib/datadog_api_client/v2/models/spans_list_request_page.rb +108 -0
- data/lib/datadog_api_client/v2/models/spans_list_request_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/spans_list_response.rb +102 -0
- data/lib/datadog_api_client/v2/models/spans_list_response_links.rb +81 -0
- data/lib/datadog_api_client/v2/models/spans_list_response_metadata.rb +123 -0
- data/lib/datadog_api_client/v2/models/spans_query_filter.rb +100 -0
- data/lib/datadog_api_client/v2/models/spans_query_options.rb +91 -0
- data/lib/datadog_api_client/v2/models/spans_response_metadata_page.rb +81 -0
- data/lib/datadog_api_client/v2/models/spans_sort.rb +27 -0
- data/lib/datadog_api_client/v2/models/spans_sort_order.rb +27 -0
- data/lib/datadog_api_client/v2/models/spans_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/spans_warning.rb +100 -0
- data/lib/datadog_api_client/v2/models/user_invitation_response_data.rb +11 -1
- data/lib/datadog_api_client/version.rb +1 -1
- metadata +105 -2
@@ -86,6 +86,14 @@ module DatadogAPIClient::V1
|
|
86
86
|
}
|
87
87
|
end
|
88
88
|
|
89
|
+
# List of attributes with nullable: true
|
90
|
+
# @!visibility private
|
91
|
+
def self.openapi_nullable
|
92
|
+
Set.new([
|
93
|
+
:'saml_autocreate_access_role',
|
94
|
+
])
|
95
|
+
end
|
96
|
+
|
89
97
|
# Initializes the object
|
90
98
|
# @param attributes [Hash] Model attributes in the form of hash
|
91
99
|
# @!visibility private
|
@@ -57,7 +57,7 @@ module DatadogAPIClient::V1
|
|
57
57
|
# List of queries that can be returned directly or used in formulas.
|
58
58
|
attr_accessor :queries
|
59
59
|
|
60
|
-
# Timeseries or
|
60
|
+
# Timeseries, scalar, or event list response. Event list response formats are supported by Geomap widgets.
|
61
61
|
attr_accessor :response_format
|
62
62
|
|
63
63
|
# The log query.
|
@@ -27,7 +27,7 @@ module DatadogAPIClient::V1
|
|
27
27
|
# List of queries that can be returned directly or used in formulas.
|
28
28
|
attr_accessor :queries
|
29
29
|
|
30
|
-
# Timeseries or
|
30
|
+
# Timeseries, scalar, or event list response. Event list response formats are supported by Geomap widgets.
|
31
31
|
attr_accessor :response_format
|
32
32
|
|
33
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -51,7 +51,7 @@ module DatadogAPIClient::V1
|
|
51
51
|
# List of queries that can be returned directly or used in formulas.
|
52
52
|
attr_accessor :queries
|
53
53
|
|
54
|
-
# Timeseries or
|
54
|
+
# Timeseries, scalar, or event list response. Event list response formats are supported by Geomap widgets.
|
55
55
|
attr_accessor :response_format
|
56
56
|
|
57
57
|
# The log query.
|
@@ -69,7 +69,7 @@ module DatadogAPIClient::V1
|
|
69
69
|
# List of queries that can be returned directly or used in formulas.
|
70
70
|
attr_accessor :queries
|
71
71
|
|
72
|
-
# Timeseries or
|
72
|
+
# Timeseries, scalar, or event list response. Event list response formats are supported by Geomap widgets.
|
73
73
|
attr_accessor :response_format
|
74
74
|
|
75
75
|
# The log query.
|
@@ -60,7 +60,7 @@ module DatadogAPIClient::V1
|
|
60
60
|
# List of queries that can be returned directly or used in formulas.
|
61
61
|
attr_accessor :queries
|
62
62
|
|
63
|
-
# Timeseries or
|
63
|
+
# Timeseries, scalar, or event list response. Event list response formats are supported by Geomap widgets.
|
64
64
|
attr_accessor :response_format
|
65
65
|
|
66
66
|
# The log query.
|
@@ -54,7 +54,7 @@ module DatadogAPIClient::V1
|
|
54
54
|
# List of queries that can be returned directly or used in formulas.
|
55
55
|
attr_accessor :queries
|
56
56
|
|
57
|
-
# Timeseries or
|
57
|
+
# Timeseries, scalar, or event list response. Event list response formats are supported by Geomap widgets.
|
58
58
|
attr_accessor :response_format
|
59
59
|
|
60
60
|
# The log query.
|
@@ -30,7 +30,7 @@ module DatadogAPIClient::V1
|
|
30
30
|
# List of queries that can be returned directly or used in formulas.
|
31
31
|
attr_accessor :queries
|
32
32
|
|
33
|
-
# Timeseries or
|
33
|
+
# Timeseries, scalar, or event list response. Event list response formats are supported by Geomap widgets.
|
34
34
|
attr_accessor :response_format
|
35
35
|
|
36
36
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -70,6 +70,14 @@ module DatadogAPIClient::V1
|
|
70
70
|
}
|
71
71
|
end
|
72
72
|
|
73
|
+
# List of attributes with nullable: true
|
74
|
+
# @!visibility private
|
75
|
+
def self.openapi_nullable
|
76
|
+
Set.new([
|
77
|
+
:'access_role',
|
78
|
+
])
|
79
|
+
end
|
80
|
+
|
73
81
|
# Initializes the object
|
74
82
|
# @param attributes [Hash] Model attributes in the form of hash
|
75
83
|
# @!visibility private
|
@@ -102,6 +102,8 @@ module DatadogAPIClient::V2
|
|
102
102
|
#
|
103
103
|
# Send your pipeline event to your Datadog platform over HTTP. For details about how pipeline executions are modeled and what execution types we support, see the [guide](https://docs.datadoghq.com/continuous_integration/guides/pipeline_data_model/).
|
104
104
|
#
|
105
|
+
# Pipeline events can be submitted with a timestamp that is up to 18 hours in the past.
|
106
|
+
#
|
105
107
|
# This API endpoint is in private beta.
|
106
108
|
#
|
107
109
|
# @param body [CIAppCreatePipelineEventRequest]
|
@@ -0,0 +1,462 @@
|
|
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 DowntimesAPI
|
20
|
+
attr_accessor :api_client
|
21
|
+
|
22
|
+
def initialize(api_client = DatadogAPIClient::APIClient.default)
|
23
|
+
@api_client = api_client
|
24
|
+
end
|
25
|
+
|
26
|
+
# Cancel a downtime.
|
27
|
+
#
|
28
|
+
# @see #cancel_downtime_with_http_info
|
29
|
+
def cancel_downtime(downtime_id, opts = {})
|
30
|
+
cancel_downtime_with_http_info(downtime_id, opts)
|
31
|
+
nil
|
32
|
+
end
|
33
|
+
|
34
|
+
# Cancel a downtime.
|
35
|
+
#
|
36
|
+
# Cancel a downtime.
|
37
|
+
#
|
38
|
+
# @param downtime_id [String] ID of the downtime to cancel.
|
39
|
+
# @param opts [Hash] the optional parameters
|
40
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
41
|
+
def cancel_downtime_with_http_info(downtime_id, opts = {})
|
42
|
+
unstable_enabled = @api_client.config.unstable_operations["v2.cancel_downtime".to_sym]
|
43
|
+
if unstable_enabled
|
44
|
+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.cancel_downtime")
|
45
|
+
else
|
46
|
+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.cancel_downtime"))
|
47
|
+
end
|
48
|
+
|
49
|
+
if @api_client.config.debugging
|
50
|
+
@api_client.config.logger.debug 'Calling API: DowntimesAPI.cancel_downtime ...'
|
51
|
+
end
|
52
|
+
# verify the required parameter 'downtime_id' is set
|
53
|
+
if @api_client.config.client_side_validation && downtime_id.nil?
|
54
|
+
fail ArgumentError, "Missing the required parameter 'downtime_id' when calling DowntimesAPI.cancel_downtime"
|
55
|
+
end
|
56
|
+
# resource path
|
57
|
+
local_var_path = '/api/v2/downtime/{downtime_id}'.sub('{downtime_id}', CGI.escape(downtime_id.to_s).gsub('%2F', '/'))
|
58
|
+
|
59
|
+
# query parameters
|
60
|
+
query_params = opts[:query_params] || {}
|
61
|
+
|
62
|
+
# header parameters
|
63
|
+
header_params = opts[:header_params] || {}
|
64
|
+
# HTTP header 'Accept' (if needed)
|
65
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
66
|
+
|
67
|
+
# form parameters
|
68
|
+
form_params = opts[:form_params] || {}
|
69
|
+
|
70
|
+
# http body (model)
|
71
|
+
post_body = opts[:debug_body]
|
72
|
+
|
73
|
+
# return_type
|
74
|
+
return_type = opts[:debug_return_type]
|
75
|
+
|
76
|
+
# auth_names
|
77
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
|
78
|
+
|
79
|
+
new_options = opts.merge(
|
80
|
+
:operation => :cancel_downtime,
|
81
|
+
:header_params => header_params,
|
82
|
+
:query_params => query_params,
|
83
|
+
:form_params => form_params,
|
84
|
+
:body => post_body,
|
85
|
+
:auth_names => auth_names,
|
86
|
+
:return_type => return_type,
|
87
|
+
:api_version => "V2"
|
88
|
+
)
|
89
|
+
|
90
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
|
91
|
+
if @api_client.config.debugging
|
92
|
+
@api_client.config.logger.debug "API called: DowntimesAPI#cancel_downtime\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
93
|
+
end
|
94
|
+
return data, status_code, headers
|
95
|
+
end
|
96
|
+
|
97
|
+
# Schedule a downtime.
|
98
|
+
#
|
99
|
+
# @see #create_downtime_with_http_info
|
100
|
+
def create_downtime(body, opts = {})
|
101
|
+
data, _status_code, _headers = create_downtime_with_http_info(body, opts)
|
102
|
+
data
|
103
|
+
end
|
104
|
+
|
105
|
+
# Schedule a downtime.
|
106
|
+
#
|
107
|
+
# Schedule a downtime.
|
108
|
+
#
|
109
|
+
# @param body [DowntimeCreateRequest] Schedule a downtime request body.
|
110
|
+
# @param opts [Hash] the optional parameters
|
111
|
+
# @return [Array<(DowntimeResponse, Integer, Hash)>] DowntimeResponse data, response status code and response headers
|
112
|
+
def create_downtime_with_http_info(body, opts = {})
|
113
|
+
unstable_enabled = @api_client.config.unstable_operations["v2.create_downtime".to_sym]
|
114
|
+
if unstable_enabled
|
115
|
+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_downtime")
|
116
|
+
else
|
117
|
+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_downtime"))
|
118
|
+
end
|
119
|
+
|
120
|
+
if @api_client.config.debugging
|
121
|
+
@api_client.config.logger.debug 'Calling API: DowntimesAPI.create_downtime ...'
|
122
|
+
end
|
123
|
+
# verify the required parameter 'body' is set
|
124
|
+
if @api_client.config.client_side_validation && body.nil?
|
125
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling DowntimesAPI.create_downtime"
|
126
|
+
end
|
127
|
+
# resource path
|
128
|
+
local_var_path = '/api/v2/downtime'
|
129
|
+
|
130
|
+
# query parameters
|
131
|
+
query_params = opts[:query_params] || {}
|
132
|
+
|
133
|
+
# header parameters
|
134
|
+
header_params = opts[:header_params] || {}
|
135
|
+
# HTTP header 'Accept' (if needed)
|
136
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
137
|
+
# HTTP header 'Content-Type'
|
138
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
139
|
+
|
140
|
+
# form parameters
|
141
|
+
form_params = opts[:form_params] || {}
|
142
|
+
|
143
|
+
# http body (model)
|
144
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
145
|
+
|
146
|
+
# return_type
|
147
|
+
return_type = opts[:debug_return_type] || 'DowntimeResponse'
|
148
|
+
|
149
|
+
# auth_names
|
150
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
|
151
|
+
|
152
|
+
new_options = opts.merge(
|
153
|
+
:operation => :create_downtime,
|
154
|
+
:header_params => header_params,
|
155
|
+
:query_params => query_params,
|
156
|
+
:form_params => form_params,
|
157
|
+
:body => post_body,
|
158
|
+
:auth_names => auth_names,
|
159
|
+
:return_type => return_type,
|
160
|
+
:api_version => "V2"
|
161
|
+
)
|
162
|
+
|
163
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
|
164
|
+
if @api_client.config.debugging
|
165
|
+
@api_client.config.logger.debug "API called: DowntimesAPI#create_downtime\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
166
|
+
end
|
167
|
+
return data, status_code, headers
|
168
|
+
end
|
169
|
+
|
170
|
+
# Get a downtime.
|
171
|
+
#
|
172
|
+
# @see #get_downtime_with_http_info
|
173
|
+
def get_downtime(downtime_id, opts = {})
|
174
|
+
data, _status_code, _headers = get_downtime_with_http_info(downtime_id, opts)
|
175
|
+
data
|
176
|
+
end
|
177
|
+
|
178
|
+
# Get a downtime.
|
179
|
+
#
|
180
|
+
# Get downtime detail by `downtime_id`.
|
181
|
+
#
|
182
|
+
# @param downtime_id [String] ID of the downtime to fetch.
|
183
|
+
# @param opts [Hash] the optional parameters
|
184
|
+
# @option opts [String] :include Comma-separated list of resource paths for related resources to include in the response. Supported resource paths are `created_by` and `monitor`.
|
185
|
+
# @return [Array<(DowntimeResponse, Integer, Hash)>] DowntimeResponse data, response status code and response headers
|
186
|
+
def get_downtime_with_http_info(downtime_id, opts = {})
|
187
|
+
unstable_enabled = @api_client.config.unstable_operations["v2.get_downtime".to_sym]
|
188
|
+
if unstable_enabled
|
189
|
+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_downtime")
|
190
|
+
else
|
191
|
+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_downtime"))
|
192
|
+
end
|
193
|
+
|
194
|
+
if @api_client.config.debugging
|
195
|
+
@api_client.config.logger.debug 'Calling API: DowntimesAPI.get_downtime ...'
|
196
|
+
end
|
197
|
+
# verify the required parameter 'downtime_id' is set
|
198
|
+
if @api_client.config.client_side_validation && downtime_id.nil?
|
199
|
+
fail ArgumentError, "Missing the required parameter 'downtime_id' when calling DowntimesAPI.get_downtime"
|
200
|
+
end
|
201
|
+
# resource path
|
202
|
+
local_var_path = '/api/v2/downtime/{downtime_id}'.sub('{downtime_id}', CGI.escape(downtime_id.to_s).gsub('%2F', '/'))
|
203
|
+
|
204
|
+
# query parameters
|
205
|
+
query_params = opts[:query_params] || {}
|
206
|
+
query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
|
207
|
+
|
208
|
+
# header parameters
|
209
|
+
header_params = opts[:header_params] || {}
|
210
|
+
# HTTP header 'Accept' (if needed)
|
211
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
212
|
+
|
213
|
+
# form parameters
|
214
|
+
form_params = opts[:form_params] || {}
|
215
|
+
|
216
|
+
# http body (model)
|
217
|
+
post_body = opts[:debug_body]
|
218
|
+
|
219
|
+
# return_type
|
220
|
+
return_type = opts[:debug_return_type] || 'DowntimeResponse'
|
221
|
+
|
222
|
+
# auth_names
|
223
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
|
224
|
+
|
225
|
+
new_options = opts.merge(
|
226
|
+
:operation => :get_downtime,
|
227
|
+
:header_params => header_params,
|
228
|
+
:query_params => query_params,
|
229
|
+
:form_params => form_params,
|
230
|
+
:body => post_body,
|
231
|
+
:auth_names => auth_names,
|
232
|
+
:return_type => return_type,
|
233
|
+
:api_version => "V2"
|
234
|
+
)
|
235
|
+
|
236
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
|
237
|
+
if @api_client.config.debugging
|
238
|
+
@api_client.config.logger.debug "API called: DowntimesAPI#get_downtime\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
239
|
+
end
|
240
|
+
return data, status_code, headers
|
241
|
+
end
|
242
|
+
|
243
|
+
# Get all downtimes.
|
244
|
+
#
|
245
|
+
# @see #list_downtimes_with_http_info
|
246
|
+
def list_downtimes(opts = {})
|
247
|
+
data, _status_code, _headers = list_downtimes_with_http_info(opts)
|
248
|
+
data
|
249
|
+
end
|
250
|
+
|
251
|
+
# Get all downtimes.
|
252
|
+
#
|
253
|
+
# Get all scheduled downtimes.
|
254
|
+
#
|
255
|
+
# @param opts [Hash] the optional parameters
|
256
|
+
# @option opts [Boolean] :current_only Only return downtimes that are active when the request is made.
|
257
|
+
# @option opts [String] :include Comma-separated list of resource paths for related resources to include in the response. Supported resource paths are `created_by` and `monitor`.
|
258
|
+
# @return [Array<(ListDowntimesResponse, Integer, Hash)>] ListDowntimesResponse data, response status code and response headers
|
259
|
+
def list_downtimes_with_http_info(opts = {})
|
260
|
+
unstable_enabled = @api_client.config.unstable_operations["v2.list_downtimes".to_sym]
|
261
|
+
if unstable_enabled
|
262
|
+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_downtimes")
|
263
|
+
else
|
264
|
+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_downtimes"))
|
265
|
+
end
|
266
|
+
|
267
|
+
if @api_client.config.debugging
|
268
|
+
@api_client.config.logger.debug 'Calling API: DowntimesAPI.list_downtimes ...'
|
269
|
+
end
|
270
|
+
# resource path
|
271
|
+
local_var_path = '/api/v2/downtime'
|
272
|
+
|
273
|
+
# query parameters
|
274
|
+
query_params = opts[:query_params] || {}
|
275
|
+
query_params[:'current_only'] = opts[:'current_only'] if !opts[:'current_only'].nil?
|
276
|
+
query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
|
277
|
+
|
278
|
+
# header parameters
|
279
|
+
header_params = opts[:header_params] || {}
|
280
|
+
# HTTP header 'Accept' (if needed)
|
281
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
282
|
+
|
283
|
+
# form parameters
|
284
|
+
form_params = opts[:form_params] || {}
|
285
|
+
|
286
|
+
# http body (model)
|
287
|
+
post_body = opts[:debug_body]
|
288
|
+
|
289
|
+
# return_type
|
290
|
+
return_type = opts[:debug_return_type] || 'ListDowntimesResponse'
|
291
|
+
|
292
|
+
# auth_names
|
293
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
|
294
|
+
|
295
|
+
new_options = opts.merge(
|
296
|
+
:operation => :list_downtimes,
|
297
|
+
:header_params => header_params,
|
298
|
+
:query_params => query_params,
|
299
|
+
:form_params => form_params,
|
300
|
+
:body => post_body,
|
301
|
+
:auth_names => auth_names,
|
302
|
+
:return_type => return_type,
|
303
|
+
:api_version => "V2"
|
304
|
+
)
|
305
|
+
|
306
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
|
307
|
+
if @api_client.config.debugging
|
308
|
+
@api_client.config.logger.debug "API called: DowntimesAPI#list_downtimes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
309
|
+
end
|
310
|
+
return data, status_code, headers
|
311
|
+
end
|
312
|
+
|
313
|
+
# Get active downtimes for a monitor.
|
314
|
+
#
|
315
|
+
# @see #list_monitor_downtimes_with_http_info
|
316
|
+
def list_monitor_downtimes(monitor_id, opts = {})
|
317
|
+
data, _status_code, _headers = list_monitor_downtimes_with_http_info(monitor_id, opts)
|
318
|
+
data
|
319
|
+
end
|
320
|
+
|
321
|
+
# Get active downtimes for a monitor.
|
322
|
+
#
|
323
|
+
# Get all active downtimes for the specified monitor.
|
324
|
+
#
|
325
|
+
# @param monitor_id [Integer] The id of the monitor.
|
326
|
+
# @param opts [Hash] the optional parameters
|
327
|
+
# @return [Array<(MonitorDowntimeMatchResponse, Integer, Hash)>] MonitorDowntimeMatchResponse data, response status code and response headers
|
328
|
+
def list_monitor_downtimes_with_http_info(monitor_id, opts = {})
|
329
|
+
unstable_enabled = @api_client.config.unstable_operations["v2.list_monitor_downtimes".to_sym]
|
330
|
+
if unstable_enabled
|
331
|
+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_monitor_downtimes")
|
332
|
+
else
|
333
|
+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_monitor_downtimes"))
|
334
|
+
end
|
335
|
+
|
336
|
+
if @api_client.config.debugging
|
337
|
+
@api_client.config.logger.debug 'Calling API: DowntimesAPI.list_monitor_downtimes ...'
|
338
|
+
end
|
339
|
+
# verify the required parameter 'monitor_id' is set
|
340
|
+
if @api_client.config.client_side_validation && monitor_id.nil?
|
341
|
+
fail ArgumentError, "Missing the required parameter 'monitor_id' when calling DowntimesAPI.list_monitor_downtimes"
|
342
|
+
end
|
343
|
+
# resource path
|
344
|
+
local_var_path = '/api/v2/monitor/{monitor_id}/downtime_matches'.sub('{monitor_id}', CGI.escape(monitor_id.to_s).gsub('%2F', '/'))
|
345
|
+
|
346
|
+
# query parameters
|
347
|
+
query_params = opts[:query_params] || {}
|
348
|
+
|
349
|
+
# header parameters
|
350
|
+
header_params = opts[:header_params] || {}
|
351
|
+
# HTTP header 'Accept' (if needed)
|
352
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
353
|
+
|
354
|
+
# form parameters
|
355
|
+
form_params = opts[:form_params] || {}
|
356
|
+
|
357
|
+
# http body (model)
|
358
|
+
post_body = opts[:debug_body]
|
359
|
+
|
360
|
+
# return_type
|
361
|
+
return_type = opts[:debug_return_type] || 'MonitorDowntimeMatchResponse'
|
362
|
+
|
363
|
+
# auth_names
|
364
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
|
365
|
+
|
366
|
+
new_options = opts.merge(
|
367
|
+
:operation => :list_monitor_downtimes,
|
368
|
+
:header_params => header_params,
|
369
|
+
:query_params => query_params,
|
370
|
+
:form_params => form_params,
|
371
|
+
:body => post_body,
|
372
|
+
:auth_names => auth_names,
|
373
|
+
:return_type => return_type,
|
374
|
+
:api_version => "V2"
|
375
|
+
)
|
376
|
+
|
377
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
|
378
|
+
if @api_client.config.debugging
|
379
|
+
@api_client.config.logger.debug "API called: DowntimesAPI#list_monitor_downtimes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
380
|
+
end
|
381
|
+
return data, status_code, headers
|
382
|
+
end
|
383
|
+
|
384
|
+
# Update a downtime.
|
385
|
+
#
|
386
|
+
# @see #update_downtime_with_http_info
|
387
|
+
def update_downtime(downtime_id, body, opts = {})
|
388
|
+
data, _status_code, _headers = update_downtime_with_http_info(downtime_id, body, opts)
|
389
|
+
data
|
390
|
+
end
|
391
|
+
|
392
|
+
# Update a downtime.
|
393
|
+
#
|
394
|
+
# Update a downtime by `downtime_id`.
|
395
|
+
#
|
396
|
+
# @param downtime_id [String] ID of the downtime to update.
|
397
|
+
# @param body [DowntimeUpdateRequest] Update a downtime request body.
|
398
|
+
# @param opts [Hash] the optional parameters
|
399
|
+
# @return [Array<(DowntimeResponse, Integer, Hash)>] DowntimeResponse data, response status code and response headers
|
400
|
+
def update_downtime_with_http_info(downtime_id, body, opts = {})
|
401
|
+
unstable_enabled = @api_client.config.unstable_operations["v2.update_downtime".to_sym]
|
402
|
+
if unstable_enabled
|
403
|
+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_downtime")
|
404
|
+
else
|
405
|
+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_downtime"))
|
406
|
+
end
|
407
|
+
|
408
|
+
if @api_client.config.debugging
|
409
|
+
@api_client.config.logger.debug 'Calling API: DowntimesAPI.update_downtime ...'
|
410
|
+
end
|
411
|
+
# verify the required parameter 'downtime_id' is set
|
412
|
+
if @api_client.config.client_side_validation && downtime_id.nil?
|
413
|
+
fail ArgumentError, "Missing the required parameter 'downtime_id' when calling DowntimesAPI.update_downtime"
|
414
|
+
end
|
415
|
+
# verify the required parameter 'body' is set
|
416
|
+
if @api_client.config.client_side_validation && body.nil?
|
417
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling DowntimesAPI.update_downtime"
|
418
|
+
end
|
419
|
+
# resource path
|
420
|
+
local_var_path = '/api/v2/downtime/{downtime_id}'.sub('{downtime_id}', CGI.escape(downtime_id.to_s).gsub('%2F', '/'))
|
421
|
+
|
422
|
+
# query parameters
|
423
|
+
query_params = opts[:query_params] || {}
|
424
|
+
|
425
|
+
# header parameters
|
426
|
+
header_params = opts[:header_params] || {}
|
427
|
+
# HTTP header 'Accept' (if needed)
|
428
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
429
|
+
# HTTP header 'Content-Type'
|
430
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
431
|
+
|
432
|
+
# form parameters
|
433
|
+
form_params = opts[:form_params] || {}
|
434
|
+
|
435
|
+
# http body (model)
|
436
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
437
|
+
|
438
|
+
# return_type
|
439
|
+
return_type = opts[:debug_return_type] || 'DowntimeResponse'
|
440
|
+
|
441
|
+
# auth_names
|
442
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
|
443
|
+
|
444
|
+
new_options = opts.merge(
|
445
|
+
:operation => :update_downtime,
|
446
|
+
:header_params => header_params,
|
447
|
+
:query_params => query_params,
|
448
|
+
:form_params => form_params,
|
449
|
+
:body => post_body,
|
450
|
+
:auth_names => auth_names,
|
451
|
+
:return_type => return_type,
|
452
|
+
:api_version => "V2"
|
453
|
+
)
|
454
|
+
|
455
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
|
456
|
+
if @api_client.config.debugging
|
457
|
+
@api_client.config.logger.debug "API called: DowntimesAPI#update_downtime\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
458
|
+
end
|
459
|
+
return data, status_code, headers
|
460
|
+
end
|
461
|
+
end
|
462
|
+
end
|
@@ -208,7 +208,7 @@ module DatadogAPIClient::V2
|
|
208
208
|
#
|
209
209
|
# @param opts [Hash] the optional parameters
|
210
210
|
# @option opts [String] :filter_query Search query following logs syntax.
|
211
|
-
# @option opts [String] :
|
211
|
+
# @option opts [Array<String>] :filter_indexes For customers with multiple indexes, the indexes to search. Defaults to '*' which means all indexes
|
212
212
|
# @option opts [Time] :filter_from Minimum timestamp for requested logs.
|
213
213
|
# @option opts [Time] :filter_to Maximum timestamp for requested logs.
|
214
214
|
# @option opts [LogsStorageTier] :filter_storage_tier Specifies the storage type to be used
|
@@ -238,7 +238,7 @@ module DatadogAPIClient::V2
|
|
238
238
|
# query parameters
|
239
239
|
query_params = opts[:query_params] || {}
|
240
240
|
query_params[:'filter[query]'] = opts[:'filter_query'] if !opts[:'filter_query'].nil?
|
241
|
-
query_params[:'filter[
|
241
|
+
query_params[:'filter[indexes]'] = @api_client.build_collection_param(opts[:'filter_indexes'], :csv) if !opts[:'filter_indexes'].nil?
|
242
242
|
query_params[:'filter[from]'] = opts[:'filter_from'] if !opts[:'filter_from'].nil?
|
243
243
|
query_params[:'filter[to]'] = opts[:'filter_to'] if !opts[:'filter_to'].nil?
|
244
244
|
query_params[:'filter[storage_tier]'] = opts[:'filter_storage_tier'] if !opts[:'filter_storage_tier'].nil?
|
@@ -742,7 +742,7 @@ module DatadogAPIClient::V2
|
|
742
742
|
|
743
743
|
# Query scalar data across multiple products.
|
744
744
|
#
|
745
|
-
# Query scalar values (as seen on Query Value, Table and Toplist widgets).
|
745
|
+
# Query scalar values (as seen on Query Value, Table, and Toplist widgets).
|
746
746
|
# Multiple data sources are supported with the ability to
|
747
747
|
# process the data using formulas and functions.
|
748
748
|
#
|
@@ -534,14 +534,14 @@ module DatadogAPIClient::V2
|
|
534
534
|
def search_rum_events_with_pagination(body, opts = {})
|
535
535
|
api_version = "V2"
|
536
536
|
page_size = @api_client.get_attribute_from_path(body, "page.limit", 10)
|
537
|
-
@api_client.set_attribute_from_path(api_version, body, "page.limit",
|
537
|
+
@api_client.set_attribute_from_path(api_version, body, "page.limit", RUMQueryPageOptions, page_size)
|
538
538
|
while true do
|
539
539
|
response = search_rum_events(body, opts)
|
540
540
|
@api_client.get_attribute_from_path(response, "data").each { |item| yield(item) }
|
541
541
|
if @api_client.get_attribute_from_path(response, "data").length < page_size
|
542
542
|
break
|
543
543
|
end
|
544
|
-
@api_client.set_attribute_from_path(api_version, body, "page.cursor",
|
544
|
+
@api_client.set_attribute_from_path(api_version, body, "page.cursor", RUMQueryPageOptions, @api_client.get_attribute_from_path(response, "meta.page.after"))
|
545
545
|
end
|
546
546
|
end
|
547
547
|
|