datadog_api_client 2.19.0 → 2.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +97 -44
  4. data/.generator/schemas/v2/openapi.yaml +704 -42
  5. data/.generator/src/generator/templates/api.j2 +5 -5
  6. data/CHANGELOG.md +20 -0
  7. data/examples/v1/logs-indexes/CreateLogsIndex.rb +5 -0
  8. data/examples/v1/logs-indexes/UpdateLogsIndex.rb +5 -0
  9. data/examples/v1/synthetics/CreateSyntheticsAPITest.rb +1 -1
  10. data/examples/v1/synthetics/CreateSyntheticsBrowserTest.rb +1 -1
  11. data/examples/v1/synthetics/TriggerCITests.rb +1 -1
  12. data/examples/v1/synthetics/UpdateBrowserTest.rb +1 -1
  13. data/examples/v1/usage-metering/GetUsageLambda.rb +5 -2
  14. data/examples/v2/api-management/CreateOpenAPI.rb +11 -0
  15. data/examples/v2/api-management/DeleteOpenAPI.rb +11 -0
  16. data/examples/v2/api-management/GetOpenAPI.rb +11 -0
  17. data/examples/v2/api-management/UpdateOpenAPI.rb +14 -0
  18. data/examples/v2/okta-integration/CreateOktaAccount.rb +1 -1
  19. data/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.rb +19 -0
  20. data/examples/v2/security-monitoring/DeleteSecurityMonitoringSuppression.rb +8 -0
  21. data/examples/v2/security-monitoring/GetSecurityMonitoringSuppression.rb +8 -0
  22. data/examples/v2/security-monitoring/ListSecurityMonitoringSuppressions.rb +5 -0
  23. data/examples/v2/security-monitoring/UpdateSecurityMonitoringSuppression.rb +17 -0
  24. data/examples/v2/teams/GetTeamMemberships_3799131168.rb +8 -0
  25. data/examples/v2/usage-metering/GetUsageLambdaTracedInvocations.rb +1 -1
  26. data/lib/datadog_api_client/configuration.rb +4 -0
  27. data/lib/datadog_api_client/inflector.rb +22 -0
  28. data/lib/datadog_api_client/v1/api/organizations_api.rb +1 -1
  29. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +3 -3
  30. data/lib/datadog_api_client/v1/models/dashboard.rb +5 -1
  31. data/lib/datadog_api_client/v1/models/dashboard_summary_definition.rb +2 -0
  32. data/lib/datadog_api_client/v1/models/log.rb +1 -1
  33. data/lib/datadog_api_client/v1/models/logs_daily_limit_reset.rb +90 -0
  34. data/lib/datadog_api_client/v1/models/logs_index.rb +36 -1
  35. data/lib/datadog_api_client/v1/models/logs_index_update_request.rb +36 -1
  36. data/lib/datadog_api_client/v1/models/metrics_payload.rb +1 -1
  37. data/lib/datadog_api_client/v1/models/metrics_query_metadata.rb +1 -1
  38. data/lib/datadog_api_client/v1/models/slo_correction_create_request_attributes.rb +1 -1
  39. data/lib/datadog_api_client/v1/models/slo_correction_response_attributes.rb +1 -1
  40. data/lib/datadog_api_client/v1/models/slo_correction_update_request_attributes.rb +1 -1
  41. data/lib/datadog_api_client/v1/models/slo_history_metrics.rb +2 -2
  42. data/lib/datadog_api_client/v1/models/slo_history_metrics_series.rb +1 -1
  43. data/lib/datadog_api_client/v1/models/slo_history_monitor.rb +1 -1
  44. data/lib/datadog_api_client/v1/models/slo_history_sli_data.rb +1 -1
  45. data/lib/datadog_api_client/v1/models/split_config.rb +6 -6
  46. data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +11 -1
  47. data/lib/datadog_api_client/v1/models/usage_lambda_hour.rb +1 -1
  48. data/lib/datadog_api_client/v1/models/usage_lambda_response.rb +1 -1
  49. data/lib/datadog_api_client/v2/api/api_management_api.rb +319 -0
  50. data/lib/datadog_api_client/v2/api/organizations_api.rb +1 -1
  51. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +329 -0
  52. data/lib/datadog_api_client/v2/api/teams_api.rb +22 -0
  53. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +3 -3
  54. data/lib/datadog_api_client/v2/models/create_open_api_response.rb +80 -0
  55. data/lib/datadog_api_client/v2/models/create_open_api_response_attributes.rb +82 -0
  56. data/lib/datadog_api_client/v2/models/create_open_api_response_data.rb +90 -0
  57. data/lib/datadog_api_client/v2/models/dora_deployment_request_attributes.rb +11 -1
  58. data/lib/datadog_api_client/v2/models/dora_incident_request_attributes.rb +11 -1
  59. data/lib/datadog_api_client/v2/models/metric_payload.rb +1 -1
  60. data/lib/datadog_api_client/v2/models/open_api_endpoint.rb +90 -0
  61. data/lib/datadog_api_client/v2/models/open_api_file.rb +80 -0
  62. data/lib/datadog_api_client/v2/models/security_monitoring_suppression.rb +100 -0
  63. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_attributes.rb +198 -0
  64. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_create_attributes.rb +181 -0
  65. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_create_data.rb +119 -0
  66. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_create_request.rb +98 -0
  67. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_response.rb +80 -0
  68. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_type.rb +26 -0
  69. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_update_attributes.rb +166 -0
  70. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_update_data.rb +119 -0
  71. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_update_request.rb +98 -0
  72. data/lib/datadog_api_client/v2/models/security_monitoring_suppressions_response.rb +82 -0
  73. data/lib/datadog_api_client/v2/models/security_monitoring_user.rb +98 -0
  74. data/lib/datadog_api_client/v2/models/sensitive_data_scanner_included_keyword_configuration.rb +1 -1
  75. data/lib/datadog_api_client/v2/models/update_open_api_response.rb +80 -0
  76. data/lib/datadog_api_client/v2/models/update_open_api_response_attributes.rb +82 -0
  77. data/lib/datadog_api_client/v2/models/update_open_api_response_data.rb +90 -0
  78. data/lib/datadog_api_client/version.rb +1 -1
  79. metadata +34 -3
  80. data/examples/v1/usage-metering/GetUsageLambda_3132428705.rb +0 -8
@@ -24,6 +24,12 @@ module DatadogAPIClient::V1
24
24
  # The number of log events you can send in this index per day before you are rate-limited.
25
25
  attr_accessor :daily_limit
26
26
 
27
+ # Object containing options to override the default daily limit reset time.
28
+ attr_accessor :daily_limit_reset
29
+
30
+ # A percentage threshold of the daily quota at which a Datadog warning event is generated.
31
+ attr_reader :daily_limit_warning_threshold_percentage
32
+
27
33
  # If true, sets the `daily_limit` value to null and the index is not limited on a daily basis (any
28
34
  # specified `daily_limit` value in the request is ignored). If false or omitted, the index's current
29
35
  # `daily_limit` is maintained.
@@ -49,6 +55,8 @@ module DatadogAPIClient::V1
49
55
  def self.attribute_map
50
56
  {
51
57
  :'daily_limit' => :'daily_limit',
58
+ :'daily_limit_reset' => :'daily_limit_reset',
59
+ :'daily_limit_warning_threshold_percentage' => :'daily_limit_warning_threshold_percentage',
52
60
  :'disable_daily_limit' => :'disable_daily_limit',
53
61
  :'exclusion_filters' => :'exclusion_filters',
54
62
  :'filter' => :'filter',
@@ -61,6 +69,8 @@ module DatadogAPIClient::V1
61
69
  def self.openapi_types
62
70
  {
63
71
  :'daily_limit' => :'Integer',
72
+ :'daily_limit_reset' => :'LogsDailyLimitReset',
73
+ :'daily_limit_warning_threshold_percentage' => :'Float',
64
74
  :'disable_daily_limit' => :'Boolean',
65
75
  :'exclusion_filters' => :'Array<LogsExclusion>',
66
76
  :'filter' => :'LogsFilter',
@@ -88,6 +98,14 @@ module DatadogAPIClient::V1
88
98
  self.daily_limit = attributes[:'daily_limit']
89
99
  end
90
100
 
101
+ if attributes.key?(:'daily_limit_reset')
102
+ self.daily_limit_reset = attributes[:'daily_limit_reset']
103
+ end
104
+
105
+ if attributes.key?(:'daily_limit_warning_threshold_percentage')
106
+ self.daily_limit_warning_threshold_percentage = attributes[:'daily_limit_warning_threshold_percentage']
107
+ end
108
+
91
109
  if attributes.key?(:'disable_daily_limit')
92
110
  self.disable_daily_limit = attributes[:'disable_daily_limit']
93
111
  end
@@ -111,10 +129,25 @@ module DatadogAPIClient::V1
111
129
  # @return true if the model is valid
112
130
  # @!visibility private
113
131
  def valid?
132
+ return false if !@daily_limit_warning_threshold_percentage.nil? && @daily_limit_warning_threshold_percentage > 99.99
133
+ return false if !@daily_limit_warning_threshold_percentage.nil? && @daily_limit_warning_threshold_percentage < 50
114
134
  return false if @filter.nil?
115
135
  true
116
136
  end
117
137
 
138
+ # Custom attribute writer method with validation
139
+ # @param daily_limit_warning_threshold_percentage [Object] Object to be assigned
140
+ # @!visibility private
141
+ def daily_limit_warning_threshold_percentage=(daily_limit_warning_threshold_percentage)
142
+ if !daily_limit_warning_threshold_percentage.nil? && daily_limit_warning_threshold_percentage > 99.99
143
+ fail ArgumentError, 'invalid value for "daily_limit_warning_threshold_percentage", must be smaller than or equal to 99.99.'
144
+ end
145
+ if !daily_limit_warning_threshold_percentage.nil? && daily_limit_warning_threshold_percentage < 50
146
+ fail ArgumentError, 'invalid value for "daily_limit_warning_threshold_percentage", must be greater than or equal to 50.'
147
+ end
148
+ @daily_limit_warning_threshold_percentage = daily_limit_warning_threshold_percentage
149
+ end
150
+
118
151
  # Custom attribute writer method with validation
119
152
  # @param filter [Object] Object to be assigned
120
153
  # @!visibility private
@@ -132,6 +165,8 @@ module DatadogAPIClient::V1
132
165
  return true if self.equal?(o)
133
166
  self.class == o.class &&
134
167
  daily_limit == o.daily_limit &&
168
+ daily_limit_reset == o.daily_limit_reset &&
169
+ daily_limit_warning_threshold_percentage == o.daily_limit_warning_threshold_percentage &&
135
170
  disable_daily_limit == o.disable_daily_limit &&
136
171
  exclusion_filters == o.exclusion_filters &&
137
172
  filter == o.filter &&
@@ -142,7 +177,7 @@ module DatadogAPIClient::V1
142
177
  # @return [Integer] Hash code
143
178
  # @!visibility private
144
179
  def hash
145
- [daily_limit, disable_daily_limit, exclusion_filters, filter, num_retention_days].hash
180
+ [daily_limit, daily_limit_reset, daily_limit_warning_threshold_percentage, disable_daily_limit, exclusion_filters, filter, num_retention_days].hash
146
181
  end
147
182
  end
148
183
  end
@@ -21,7 +21,7 @@ module DatadogAPIClient::V1
21
21
  class MetricsPayload
22
22
  include BaseGenericModel
23
23
 
24
- # A list of time series to submit to Datadog.
24
+ # A list of timeseries to submit to Datadog.
25
25
  attr_reader :series
26
26
 
27
27
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -42,7 +42,7 @@ module DatadogAPIClient::V1
42
42
  # Metric name.
43
43
  attr_accessor :metric
44
44
 
45
- # List of points of the time series in milliseconds.
45
+ # List of points of the timeseries in milliseconds.
46
46
  attr_accessor :pointlist
47
47
 
48
48
  # The index of the series' query within the request.
@@ -34,7 +34,7 @@ module DatadogAPIClient::V1
34
34
  attr_accessor :_end
35
35
 
36
36
  # The recurrence rules as defined in the iCalendar RFC 5545. The supported rules for SLO corrections
37
- # are `FREQ`, `INTERVAL`, `COUNT` and `UNTIL`.
37
+ # are `FREQ`, `INTERVAL`, `COUNT`, `UNTIL` and `BYDAY`.
38
38
  attr_accessor :rrule
39
39
 
40
40
  # ID of the SLO that this correction applies to.
@@ -46,7 +46,7 @@ module DatadogAPIClient::V1
46
46
  attr_accessor :modifier
47
47
 
48
48
  # The recurrence rules as defined in the iCalendar RFC 5545. The supported rules for SLO corrections
49
- # are `FREQ`, `INTERVAL`, `COUNT`, and `UNTIL`.
49
+ # are `FREQ`, `INTERVAL`, `COUNT`, `UNTIL` and `BYDAY`.
50
50
  attr_accessor :rrule
51
51
 
52
52
  # ID of the SLO that this correction applies to.
@@ -34,7 +34,7 @@ module DatadogAPIClient::V1
34
34
  attr_accessor :_end
35
35
 
36
36
  # The recurrence rules as defined in the iCalendar RFC 5545. The supported rules for SLO corrections
37
- # are `FREQ`, `INTERVAL`, `COUNT`, and `UNTIL`.
37
+ # are `FREQ`, `INTERVAL`, `COUNT`, `UNTIL` and `BYDAY`.
38
38
  attr_accessor :rrule
39
39
 
40
40
  # Starting time of the correction in epoch seconds.
@@ -23,7 +23,7 @@ module DatadogAPIClient::V1
23
23
  class SLOHistoryMetrics
24
24
  include BaseGenericModel
25
25
 
26
- # A representation of `metric` based SLO time series for the provided queries.
26
+ # A representation of `metric` based SLO timeseries for the provided queries.
27
27
  # This is the same response type from `batch_query` endpoint.
28
28
  attr_reader :denominator
29
29
 
@@ -33,7 +33,7 @@ module DatadogAPIClient::V1
33
33
  # Optional message if there are specific query issues/warnings.
34
34
  attr_accessor :message
35
35
 
36
- # A representation of `metric` based SLO time series for the provided queries.
36
+ # A representation of `metric` based SLO timeseries for the provided queries.
37
37
  # This is the same response type from `batch_query` endpoint.
38
38
  attr_reader :numerator
39
39
 
@@ -17,7 +17,7 @@ require 'date'
17
17
  require 'time'
18
18
 
19
19
  module DatadogAPIClient::V1
20
- # A representation of `metric` based SLO time series for the provided queries.
20
+ # A representation of `metric` based SLO timeseries for the provided queries.
21
21
  # This is the same response type from `batch_query` endpoint.
22
22
  class SLOHistoryMetricsSeries
23
23
  include BaseGenericModel
@@ -31,7 +31,7 @@ module DatadogAPIClient::V1
31
31
  # For groups in a grouped SLO, this is the group name.
32
32
  attr_accessor :group
33
33
 
34
- # For `monitor` based SLOs, this includes the aggregated history as arrays that include time series and uptime data where `0=monitor` is in `OK` state and `1=monitor` is in `alert` state.
34
+ # For `monitor` based SLOs, this includes the aggregated history as arrays that include timeseries and uptime data where `0=monitor` is in `OK` state and `1=monitor` is in `alert` state.
35
35
  attr_accessor :history
36
36
 
37
37
  # For `monitor` based SLOs, this is the last modified timestamp in epoch seconds of the monitor.
@@ -31,7 +31,7 @@ module DatadogAPIClient::V1
31
31
  # For groups in a grouped SLO, this is the group name.
32
32
  attr_accessor :group
33
33
 
34
- # For `monitor` based SLOs, this includes the aggregated history as arrays that include time series and uptime data where `0=monitor` is in `OK` state and `1=monitor` is in `alert` state.
34
+ # For `monitor` based SLOs, this includes the aggregated history as arrays that include timeseries and uptime data where `0=monitor` is in `OK` state and `1=monitor` is in `alert` state.
35
35
  attr_accessor :history
36
36
 
37
37
  # For `monitor` based SLOs, this is the last modified timestamp in epoch seconds of the monitor.
@@ -97,13 +97,13 @@ module DatadogAPIClient::V1
97
97
  # @!visibility private
98
98
  def valid?
99
99
  return false if @limit.nil?
100
- return false if @limit > 100
100
+ return false if @limit > 500
101
101
  return false if @limit < 1
102
102
  return false if @sort.nil?
103
103
  return false if @split_dimensions.nil?
104
104
  return false if @split_dimensions.length > 1
105
105
  return false if @split_dimensions.length < 1
106
- return false if !@static_splits.nil? && @static_splits.length > 100
106
+ return false if !@static_splits.nil? && @static_splits.length > 500
107
107
  true
108
108
  end
109
109
 
@@ -114,8 +114,8 @@ module DatadogAPIClient::V1
114
114
  if limit.nil?
115
115
  fail ArgumentError, 'invalid value for "limit", limit cannot be nil.'
116
116
  end
117
- if limit > 100
118
- fail ArgumentError, 'invalid value for "limit", must be smaller than or equal to 100.'
117
+ if limit > 500
118
+ fail ArgumentError, 'invalid value for "limit", must be smaller than or equal to 500.'
119
119
  end
120
120
  if limit < 1
121
121
  fail ArgumentError, 'invalid value for "limit", must be greater than or equal to 1.'
@@ -153,8 +153,8 @@ module DatadogAPIClient::V1
153
153
  # @param static_splits [Object] Object to be assigned
154
154
  # @!visibility private
155
155
  def static_splits=(static_splits)
156
- if !static_splits.nil? && static_splits.length > 100
157
- fail ArgumentError, 'invalid value for "static_splits", number of items must be less than or equal to 100.'
156
+ if !static_splits.nil? && static_splits.length > 500
157
+ fail ArgumentError, 'invalid value for "static_splits", number of items must be less than or equal to 500.'
158
158
  end
159
159
  @static_splits = static_splits
160
160
  end
@@ -45,6 +45,9 @@ module DatadogAPIClient::V1
45
45
  # A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.
46
46
  attr_accessor :compressed_json_descriptor
47
47
 
48
+ # A protobuf file that needs to be gzipped first then base64 encoded.
49
+ attr_accessor :compressed_proto_file
50
+
48
51
  # DNS server to use for DNS tests.
49
52
  attr_accessor :dns_server
50
53
 
@@ -116,6 +119,7 @@ module DatadogAPIClient::V1
116
119
  :'certificate' => :'certificate',
117
120
  :'certificate_domains' => :'certificateDomains',
118
121
  :'compressed_json_descriptor' => :'compressedJsonDescriptor',
122
+ :'compressed_proto_file' => :'compressedProtoFile',
119
123
  :'dns_server' => :'dnsServer',
120
124
  :'dns_server_port' => :'dnsServerPort',
121
125
  :'follow_redirects' => :'follow_redirects',
@@ -150,6 +154,7 @@ module DatadogAPIClient::V1
150
154
  :'certificate' => :'SyntheticsTestRequestCertificate',
151
155
  :'certificate_domains' => :'Array<String>',
152
156
  :'compressed_json_descriptor' => :'String',
157
+ :'compressed_proto_file' => :'String',
153
158
  :'dns_server' => :'String',
154
159
  :'dns_server_port' => :'Integer',
155
160
  :'follow_redirects' => :'Boolean',
@@ -222,6 +227,10 @@ module DatadogAPIClient::V1
222
227
  self.compressed_json_descriptor = attributes[:'compressed_json_descriptor']
223
228
  end
224
229
 
230
+ if attributes.key?(:'compressed_proto_file')
231
+ self.compressed_proto_file = attributes[:'compressed_proto_file']
232
+ end
233
+
225
234
  if attributes.key?(:'dns_server')
226
235
  self.dns_server = attributes[:'dns_server']
227
236
  end
@@ -350,6 +359,7 @@ module DatadogAPIClient::V1
350
359
  certificate == o.certificate &&
351
360
  certificate_domains == o.certificate_domains &&
352
361
  compressed_json_descriptor == o.compressed_json_descriptor &&
362
+ compressed_proto_file == o.compressed_proto_file &&
353
363
  dns_server == o.dns_server &&
354
364
  dns_server_port == o.dns_server_port &&
355
365
  follow_redirects == o.follow_redirects &&
@@ -375,7 +385,7 @@ module DatadogAPIClient::V1
375
385
  # @return [Integer] Hash code
376
386
  # @!visibility private
377
387
  def hash
378
- [allow_insecure, basic_auth, body, body_type, call_type, certificate, certificate_domains, compressed_json_descriptor, dns_server, dns_server_port, follow_redirects, headers, host, message, metadata, method, no_saving_response_body, number_of_packets, persist_cookies, port, proxy, query, servername, service, should_track_hops, timeout, url].hash
388
+ [allow_insecure, basic_auth, body, body_type, call_type, certificate, certificate_domains, compressed_json_descriptor, compressed_proto_file, dns_server, dns_server_port, follow_redirects, headers, host, message, metadata, method, no_saving_response_body, number_of_packets, persist_cookies, port, proxy, query, servername, service, should_track_hops, timeout, url].hash
379
389
  end
380
390
  end
381
391
  end
@@ -17,7 +17,7 @@ require 'date'
17
17
  require 'time'
18
18
 
19
19
  module DatadogAPIClient::V1
20
- # Number of lambda functions and sum of the invocations of all lambda functions
20
+ # Number of Lambda functions and sum of the invocations of all Lambda functions
21
21
  # for each hour for a given organization.
22
22
  class UsageLambdaHour
23
23
  include BaseGenericModel
@@ -17,7 +17,7 @@ require 'date'
17
17
  require 'time'
18
18
 
19
19
  module DatadogAPIClient::V1
20
- # Response containing the number of lambda functions and sum of the invocations of all lambda functions
20
+ # Response containing the number of Lambda functions and sum of the invocations of all Lambda functions
21
21
  # for each hour for a given organization.
22
22
  class UsageLambdaResponse
23
23
  include BaseGenericModel
@@ -0,0 +1,319 @@
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 APIManagementAPI
20
+ attr_accessor :api_client
21
+
22
+ def initialize(api_client = DatadogAPIClient::APIClient.default)
23
+ @api_client = api_client
24
+ end
25
+
26
+ # Create a new API.
27
+ #
28
+ # @see #create_open_api_with_http_info
29
+ def create_open_api(opts = {})
30
+ data, _status_code, _headers = create_open_api_with_http_info(opts)
31
+ data
32
+ end
33
+
34
+ # Create a new API.
35
+ #
36
+ # Create a new API from the [OpenAPI](https://spec.openapis.org/oas/latest.html) specification given.
37
+ # It supports version `2.0`, `3.0` and `3.1` of the specification. A specific extension section, `x-datadog`,
38
+ # let you specify the `teamHandle` for your team responsible for the API in Datadog.
39
+ # It returns the created API ID.
40
+ #
41
+ #
42
+ # @param opts [Hash] the optional parameters
43
+ # @option opts [File] :openapi_spec_file Binary `OpenAPI` spec file
44
+ # @return [Array<(CreateOpenAPIResponse, Integer, Hash)>] CreateOpenAPIResponse data, response status code and response headers
45
+ def create_open_api_with_http_info(opts = {})
46
+ unstable_enabled = @api_client.config.unstable_operations["v2.create_open_api".to_sym]
47
+ if unstable_enabled
48
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_open_api")
49
+ else
50
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_open_api"))
51
+ end
52
+
53
+ if @api_client.config.debugging
54
+ @api_client.config.logger.debug 'Calling API: APIManagementAPI.create_open_api ...'
55
+ end
56
+ # resource path
57
+ local_var_path = '/api/v2/apicatalog/openapi'
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(['application/json'])
66
+ # HTTP header 'Content-Type'
67
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
68
+
69
+ # form parameters
70
+ form_params = opts[:form_params] || {}
71
+ form_params['openapi_spec_file'] = opts[:'openapi_spec_file'] if !opts[:'openapi_spec_file'].nil?
72
+
73
+ # http body (model)
74
+ post_body = opts[:debug_body]
75
+
76
+ # return_type
77
+ return_type = opts[:debug_return_type] || 'CreateOpenAPIResponse'
78
+
79
+ # auth_names
80
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
81
+
82
+ new_options = opts.merge(
83
+ :operation => :create_open_api,
84
+ :header_params => header_params,
85
+ :query_params => query_params,
86
+ :form_params => form_params,
87
+ :body => post_body,
88
+ :auth_names => auth_names,
89
+ :return_type => return_type,
90
+ :api_version => "V2"
91
+ )
92
+
93
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug "API called: APIManagementAPI#create_open_api\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
96
+ end
97
+ return data, status_code, headers
98
+ end
99
+
100
+ # Delete an API.
101
+ #
102
+ # @see #delete_open_api_with_http_info
103
+ def delete_open_api(id, opts = {})
104
+ delete_open_api_with_http_info(id, opts)
105
+ nil
106
+ end
107
+
108
+ # Delete an API.
109
+ #
110
+ # Delete a specific API by ID.
111
+ #
112
+ # @param id [UUID] ID of the API to delete
113
+ # @param opts [Hash] the optional parameters
114
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
115
+ def delete_open_api_with_http_info(id, opts = {})
116
+ unstable_enabled = @api_client.config.unstable_operations["v2.delete_open_api".to_sym]
117
+ if unstable_enabled
118
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_open_api")
119
+ else
120
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_open_api"))
121
+ end
122
+
123
+ if @api_client.config.debugging
124
+ @api_client.config.logger.debug 'Calling API: APIManagementAPI.delete_open_api ...'
125
+ end
126
+ # verify the required parameter 'id' is set
127
+ if @api_client.config.client_side_validation && id.nil?
128
+ fail ArgumentError, "Missing the required parameter 'id' when calling APIManagementAPI.delete_open_api"
129
+ end
130
+ # resource path
131
+ local_var_path = '/api/v2/apicatalog/api/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))
132
+
133
+ # query parameters
134
+ query_params = opts[:query_params] || {}
135
+
136
+ # header parameters
137
+ header_params = opts[:header_params] || {}
138
+ # HTTP header 'Accept' (if needed)
139
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
140
+
141
+ # form parameters
142
+ form_params = opts[:form_params] || {}
143
+
144
+ # http body (model)
145
+ post_body = opts[:debug_body]
146
+
147
+ # return_type
148
+ return_type = opts[:debug_return_type]
149
+
150
+ # auth_names
151
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
152
+
153
+ new_options = opts.merge(
154
+ :operation => :delete_open_api,
155
+ :header_params => header_params,
156
+ :query_params => query_params,
157
+ :form_params => form_params,
158
+ :body => post_body,
159
+ :auth_names => auth_names,
160
+ :return_type => return_type,
161
+ :api_version => "V2"
162
+ )
163
+
164
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
165
+ if @api_client.config.debugging
166
+ @api_client.config.logger.debug "API called: APIManagementAPI#delete_open_api\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
167
+ end
168
+ return data, status_code, headers
169
+ end
170
+
171
+ # Get an API.
172
+ #
173
+ # @see #get_open_api_with_http_info
174
+ def get_open_api(id, opts = {})
175
+ data, _status_code, _headers = get_open_api_with_http_info(id, opts)
176
+ data
177
+ end
178
+
179
+ # Get an API.
180
+ #
181
+ # Retrieve information about a specific API in [OpenAPI](https://spec.openapis.org/oas/latest.html) format file.
182
+ #
183
+ # @param id [UUID] ID of the API to retrieve
184
+ # @param opts [Hash] the optional parameters
185
+ # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
186
+ def get_open_api_with_http_info(id, opts = {})
187
+ unstable_enabled = @api_client.config.unstable_operations["v2.get_open_api".to_sym]
188
+ if unstable_enabled
189
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_open_api")
190
+ else
191
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_open_api"))
192
+ end
193
+
194
+ if @api_client.config.debugging
195
+ @api_client.config.logger.debug 'Calling API: APIManagementAPI.get_open_api ...'
196
+ end
197
+ # verify the required parameter 'id' is set
198
+ if @api_client.config.client_side_validation && id.nil?
199
+ fail ArgumentError, "Missing the required parameter 'id' when calling APIManagementAPI.get_open_api"
200
+ end
201
+ # resource path
202
+ local_var_path = '/api/v2/apicatalog/api/{id}/openapi'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))
203
+
204
+ # query parameters
205
+ query_params = opts[:query_params] || {}
206
+
207
+ # header parameters
208
+ header_params = opts[:header_params] || {}
209
+ # HTTP header 'Accept' (if needed)
210
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data', 'application/json'])
211
+
212
+ # form parameters
213
+ form_params = opts[:form_params] || {}
214
+
215
+ # http body (model)
216
+ post_body = opts[:debug_body]
217
+
218
+ # return_type
219
+ return_type = opts[:debug_return_type] || 'File'
220
+
221
+ # auth_names
222
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
223
+
224
+ new_options = opts.merge(
225
+ :operation => :get_open_api,
226
+ :header_params => header_params,
227
+ :query_params => query_params,
228
+ :form_params => form_params,
229
+ :body => post_body,
230
+ :auth_names => auth_names,
231
+ :return_type => return_type,
232
+ :api_version => "V2"
233
+ )
234
+
235
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
236
+ if @api_client.config.debugging
237
+ @api_client.config.logger.debug "API called: APIManagementAPI#get_open_api\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
238
+ end
239
+ return data, status_code, headers
240
+ end
241
+
242
+ # Update an API.
243
+ #
244
+ # @see #update_open_api_with_http_info
245
+ def update_open_api(id, opts = {})
246
+ data, _status_code, _headers = update_open_api_with_http_info(id, opts)
247
+ data
248
+ end
249
+
250
+ # Update an API.
251
+ #
252
+ # Update information about a specific API. The given content will replace all API content of the given ID.
253
+ # The ID is returned by the create API, or can be found in the URL in the API catalog UI.
254
+ #
255
+ #
256
+ # @param id [UUID] ID of the API to modify
257
+ # @param opts [Hash] the optional parameters
258
+ # @option opts [File] :openapi_spec_file Binary `OpenAPI` spec file
259
+ # @return [Array<(UpdateOpenAPIResponse, Integer, Hash)>] UpdateOpenAPIResponse data, response status code and response headers
260
+ def update_open_api_with_http_info(id, opts = {})
261
+ unstable_enabled = @api_client.config.unstable_operations["v2.update_open_api".to_sym]
262
+ if unstable_enabled
263
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_open_api")
264
+ else
265
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_open_api"))
266
+ end
267
+
268
+ if @api_client.config.debugging
269
+ @api_client.config.logger.debug 'Calling API: APIManagementAPI.update_open_api ...'
270
+ end
271
+ # verify the required parameter 'id' is set
272
+ if @api_client.config.client_side_validation && id.nil?
273
+ fail ArgumentError, "Missing the required parameter 'id' when calling APIManagementAPI.update_open_api"
274
+ end
275
+ # resource path
276
+ local_var_path = '/api/v2/apicatalog/api/{id}/openapi'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))
277
+
278
+ # query parameters
279
+ query_params = opts[:query_params] || {}
280
+
281
+ # header parameters
282
+ header_params = opts[:header_params] || {}
283
+ # HTTP header 'Accept' (if needed)
284
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
285
+ # HTTP header 'Content-Type'
286
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
287
+
288
+ # form parameters
289
+ form_params = opts[:form_params] || {}
290
+ form_params['openapi_spec_file'] = opts[:'openapi_spec_file'] if !opts[:'openapi_spec_file'].nil?
291
+
292
+ # http body (model)
293
+ post_body = opts[:debug_body]
294
+
295
+ # return_type
296
+ return_type = opts[:debug_return_type] || 'UpdateOpenAPIResponse'
297
+
298
+ # auth_names
299
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
300
+
301
+ new_options = opts.merge(
302
+ :operation => :update_open_api,
303
+ :header_params => header_params,
304
+ :query_params => query_params,
305
+ :form_params => form_params,
306
+ :body => post_body,
307
+ :auth_names => auth_names,
308
+ :return_type => return_type,
309
+ :api_version => "V2"
310
+ )
311
+
312
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
313
+ if @api_client.config.debugging
314
+ @api_client.config.logger.debug "API called: APIManagementAPI#update_open_api\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
315
+ end
316
+ return data, status_code, headers
317
+ end
318
+ end
319
+ end
@@ -63,7 +63,7 @@ module DatadogAPIClient::V2
63
63
  form_params['idp_file'] = opts[:'idp_file'] if !opts[:'idp_file'].nil?
64
64
 
65
65
  # http body (model)
66
- post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
66
+ post_body = opts[:debug_body]
67
67
 
68
68
  # return_type
69
69
  return_type = opts[:debug_return_type]