datadog_api_client 2.7.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +195 -46
  4. data/.generator/schemas/v2/openapi.yaml +877 -96
  5. data/.generator/src/generator/formatter.py +1 -0
  6. data/.generator/src/generator/templates/model_base.j2 +8 -4
  7. data/CHANGELOG.md +39 -0
  8. data/examples/v1/dashboards/CreateDashboard_109450134.rb +44 -0
  9. data/examples/v1/dashboards/CreateDashboard_2800096921.rb +62 -0
  10. data/examples/v1/dashboards/CreateDashboard_3195475781.rb +32 -0
  11. data/examples/v1/service-level-objectives/SearchSLO.rb +0 -3
  12. data/examples/v2/incidents/CreateIncidentIntegration.rb +31 -0
  13. data/examples/v2/incidents/DeleteIncidentIntegration.rb +14 -0
  14. data/examples/v2/incidents/GetIncidentIntegration.rb +14 -0
  15. data/examples/v2/incidents/ListIncidentIntegrations.rb +11 -0
  16. data/examples/v2/incidents/UpdateIncidentIntegration.rb +34 -0
  17. data/examples/v2/ip-allowlist/GetIPAllowlist.rb +5 -0
  18. data/examples/v2/ip-allowlist/UpdateIPAllowlist.rb +25 -0
  19. data/examples/v2/logs-metrics/CreateLogsMetric.rb +1 -1
  20. data/examples/v2/restriction-policies/DeleteRestrictionPolicy.rb +5 -0
  21. data/examples/v2/restriction-policies/GetRestrictionPolicy.rb +5 -0
  22. data/examples/v2/restriction-policies/UpdateRestrictionPolicy.rb +25 -0
  23. data/examples/v2/synthetics/GetOnDemandConcurrencyCap.rb +5 -0
  24. data/examples/v2/synthetics/GetOnDemandConcurrencyCap_2633566918.rb +5 -0
  25. data/examples/v2/synthetics/SetOnDemandConcurrencyCap.rb +7 -0
  26. data/examples/v2/synthetics/SetOnDemandConcurrencyCap_2850884405.rb +9 -0
  27. data/lib/datadog_api_client/configuration.rb +5 -1
  28. data/lib/datadog_api_client/inflector.rb +38 -0
  29. data/lib/datadog_api_client/v1/api/service_level_objectives_api.rb +0 -6
  30. data/lib/datadog_api_client/v1/api/snapshots_api.rb +2 -2
  31. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +3 -3
  32. data/lib/datadog_api_client/v1/model_base.rb +7 -3
  33. data/lib/datadog_api_client/v1/models/application_key.rb +16 -16
  34. data/lib/datadog_api_client/v1/models/cancel_downtimes_by_scope_request.rb +1 -1
  35. data/lib/datadog_api_client/v1/models/downtime.rb +1 -1
  36. data/lib/datadog_api_client/v1/models/downtime_child.rb +1 -1
  37. data/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb +1 -0
  38. data/lib/datadog_api_client/v1/models/host_meta.rb +3 -3
  39. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +1 -0
  40. data/lib/datadog_api_client/v1/models/ip_prefixes_orchestrator.rb +105 -0
  41. data/lib/datadog_api_client/v1/models/ip_ranges.rb +11 -1
  42. data/lib/datadog_api_client/v1/models/list_stream_source.rb +3 -0
  43. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +2 -0
  44. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +31 -11
  45. data/lib/datadog_api_client/v1/models/search_service_level_objective_attributes.rb +11 -1
  46. data/lib/datadog_api_client/v1/models/slo_list_widget_query.rb +16 -4
  47. data/lib/datadog_api_client/v1/models/slo_overall_statuses.rb +24 -1
  48. data/lib/datadog_api_client/v1/models/slo_state.rb +29 -0
  49. data/lib/datadog_api_client/v1/models/slo_status.rb +164 -0
  50. data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +10 -10
  51. data/lib/datadog_api_client/v1/models/usage_rum_sessions_hour.rb +12 -1
  52. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +41 -1
  53. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +41 -1
  54. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +41 -1
  55. data/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb +3 -3
  56. data/lib/datadog_api_client/v2/api/ci_visibility_tests_api.rb +3 -3
  57. data/lib/datadog_api_client/v2/api/incidents_api.rb +384 -0
  58. data/lib/datadog_api_client/v2/api/ip_allowlist_api.rb +153 -0
  59. data/lib/datadog_api_client/v2/api/logs_api.rb +1 -0
  60. data/lib/datadog_api_client/v2/api/metrics_api.rb +2 -2
  61. data/lib/datadog_api_client/v2/api/monitors_api.rb +3 -3
  62. data/lib/datadog_api_client/v2/api/restriction_policies_api.rb +236 -0
  63. data/lib/datadog_api_client/v2/api/synthetics_api.rb +153 -0
  64. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +1 -1
  65. data/lib/datadog_api_client/v2/model_base.rb +7 -3
  66. data/lib/datadog_api_client/v2/models/events_data_source.rb +1 -0
  67. data/lib/datadog_api_client/v2/models/incident_integration_metadata_attributes.rb +161 -0
  68. data/lib/datadog_api_client/v2/models/incident_integration_metadata_create_data.rb +123 -0
  69. data/lib/datadog_api_client/v2/models/incident_integration_metadata_create_request.rb +102 -0
  70. data/lib/datadog_api_client/v2/models/incident_integration_metadata_list_response.rb +126 -0
  71. data/lib/datadog_api_client/v2/models/incident_integration_metadata_metadata.rb +63 -0
  72. data/lib/datadog_api_client/v2/models/incident_integration_metadata_patch_data.rb +123 -0
  73. data/lib/datadog_api_client/v2/models/incident_integration_metadata_patch_request.rb +102 -0
  74. data/lib/datadog_api_client/v2/models/incident_integration_metadata_response.rb +114 -0
  75. data/lib/datadog_api_client/v2/models/incident_integration_metadata_response_data.rb +133 -0
  76. data/lib/datadog_api_client/v2/models/incident_integration_metadata_response_included_item.rb +62 -0
  77. data/lib/datadog_api_client/v2/models/incident_update_data.rb +1 -1
  78. data/lib/datadog_api_client/v2/models/ip_allowlist_attributes.rb +103 -0
  79. data/lib/datadog_api_client/v2/models/ip_allowlist_data.rb +122 -0
  80. data/lib/datadog_api_client/v2/models/ip_allowlist_entry.rb +102 -0
  81. data/lib/datadog_api_client/v2/models/ip_allowlist_entry_attributes.rb +121 -0
  82. data/lib/datadog_api_client/v2/models/ip_allowlist_entry_data.rb +122 -0
  83. data/lib/datadog_api_client/v2/models/ip_allowlist_entry_type.rb +26 -0
  84. data/lib/datadog_api_client/v2/models/ip_allowlist_response.rb +91 -0
  85. data/lib/datadog_api_client/v2/models/ip_allowlist_type.rb +26 -0
  86. data/lib/datadog_api_client/v2/models/ip_allowlist_update_request.rb +102 -0
  87. data/lib/datadog_api_client/v2/models/jira_integration_metadata.rb +104 -0
  88. data/lib/datadog_api_client/v2/models/jira_integration_metadata_issues_item.rb +153 -0
  89. data/lib/datadog_api_client/v2/models/metrics_aggregator.rb +4 -0
  90. data/lib/datadog_api_client/v2/models/metrics_data_source.rb +2 -1
  91. data/lib/datadog_api_client/v2/models/metrics_scalar_query.rb +1 -1
  92. data/lib/datadog_api_client/v2/models/metrics_timeseries_query.rb +1 -1
  93. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap.rb +91 -0
  94. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap_attributes.rb +91 -0
  95. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap_response.rb +91 -0
  96. data/lib/datadog_api_client/v2/models/relationship_to_incident_integration_metadatas.rb +1 -1
  97. data/lib/datadog_api_client/v2/models/restriction_policy.rb +144 -0
  98. data/lib/datadog_api_client/v2/models/restriction_policy_attributes.rb +104 -0
  99. data/lib/datadog_api_client/v2/models/restriction_policy_binding.rb +127 -0
  100. data/lib/datadog_api_client/v2/models/restriction_policy_response.rb +102 -0
  101. data/lib/datadog_api_client/v2/models/restriction_policy_type.rb +26 -0
  102. data/lib/datadog_api_client/v2/models/restriction_policy_update_request.rb +102 -0
  103. data/lib/datadog_api_client/v2/models/rum_application_attributes.rb +7 -7
  104. data/lib/datadog_api_client/v2/models/rum_application_list_attributes.rb +7 -7
  105. data/lib/datadog_api_client/v2/models/security_monitoring_rule_type_read.rb +1 -0
  106. data/lib/datadog_api_client/v2/models/slack_integration_metadata.rb +104 -0
  107. data/lib/datadog_api_client/v2/models/slack_integration_metadata_channel_item.rb +154 -0
  108. data/lib/datadog_api_client/version.rb +1 -1
  109. metadata +57 -2
@@ -47,6 +47,7 @@ KEYWORDS = {
47
47
  "return",
48
48
  "undef",
49
49
  "yield",
50
+ "hash",
50
51
  }
51
52
 
52
53
  with (pathlib.Path(__file__).parent / "replacement.json").open() as f:
@@ -56,7 +56,13 @@ module {{ module_name }}::{{ version|upper }}
56
56
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
57
57
  end
58
58
  elsif !attributes[self.class.attribute_map[key]].nil?
59
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
59
+ res = _deserialize(type, attributes[self.class.attribute_map[key]])
60
+ if res.instance_of? {{ module_name }}::UnparsedObject
61
+ self._unparsed = true
62
+ elsif (res.kind_of? {{ module_name }}::{{ version|upper }}::BaseGenericModel) && res._unparsed
63
+ self._unparsed = true
64
+ end
65
+ self.send("#{key}=", res)
60
66
  end
61
67
  end
62
68
 
@@ -233,14 +239,12 @@ module {{ module_name }}::{{ version|upper }}
233
239
  return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
234
240
  end
235
241
  else # model
236
- const = DatadogAPIClient::{{ version|upper }}.const_get(klass)
242
+ const = {{ module_name }}::{{ version|upper }}.const_get(klass)
237
243
  if const
238
244
  if const.respond_to?(:openapi_one_of) # nested oneOf model
239
245
  model = const.build(data)
240
246
  return model if model
241
247
  else
242
- # raise if data contains keys that are not known to the model
243
- raise unless (data.keys - const.attribute_map.values).empty?
244
248
  model = const.build_from_hash(data)
245
249
  return model if model && model.valid?
246
250
  end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.9.0 / 2023-03-14
4
+
5
+ ### Fixed
6
+ * Don't raise error on unhandled keys by @therve in https://github.com/DataDog/datadog-api-client-ruby/pull/1259
7
+ * Rename hash attribute by @therve in https://github.com/DataDog/datadog-api-client-ruby/pull/1264
8
+ ### Added
9
+ * Add restriction policy APIs by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1238
10
+ * Support RUM data source in Query API and fix aggregators by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1246
11
+ * Add endpoint to get and set on demand concurrency cap for Synthetics by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1242
12
+ * Publish IP allowlist APIs by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1231
13
+ * Expose Flutter fields to rum product in the meter usage API by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1251
14
+ * Add profiled fargate tasks to usage attribution by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1256
15
+ * Add cipipeline stream to ListStreamSource by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1222
16
+ * Add application_security to security monitoring rule type enum by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1254
17
+ * Add `ci_pipelines` enum to `FormulaAndFunctionEventsDataSource` by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1267
18
+ * Add citest stream to ListStreamSource by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1260
19
+ * Add `logs_issue_stream` enum to `ListStreamSource` by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1268
20
+ * Add support for Incident Integration Metadata APIs by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1257
21
+ * Add SLO to GRACE API spec by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1275
22
+ * Add audit trail to usage metering API by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1274
23
+
24
+
25
+ **Full Changelog**: https://github.com/DataDog/datadog-api-client-ruby/compare/v2.8.0...v2.9.0
26
+
27
+ ## 2.8.0 / 2023-02-15
28
+
29
+ ### Fixed
30
+ * Set hosts versions as `type any` by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1240
31
+ ### Added
32
+ * Add orchestrator section in IP ranges by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1232
33
+ * Add Cloud Cost Management fields to Usage Metering endpoints by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1236
34
+ * Add cloud-cost as a supported query data source by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1228
35
+ * Add Cloud Cost And Container Excl Agent Usage Fields by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1241
36
+ * Add SLO status and error budget remaining to search API by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1245
37
+ * Add `sort` field to SLOListWidgetQuery by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1243
38
+
39
+
40
+ **Full Changelog**: https://github.com/DataDog/datadog-api-client-ruby/compare/v2.7.0...v2.8.0
41
+
3
42
  ## 2.7.0 / 2023-02-08
4
43
 
5
44
  ### Fixed
@@ -0,0 +1,44 @@
1
+ # Create a new dashboard with slo list widget with sort
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V1::DashboardsAPI.new
5
+
6
+ body = DatadogAPIClient::V1::Dashboard.new({
7
+ title: "Example-Create_a_new_dashboard_with_slo_list_widget_with_sort",
8
+ description: "",
9
+ widgets: [
10
+ DatadogAPIClient::V1::Widget.new({
11
+ layout: DatadogAPIClient::V1::WidgetLayout.new({
12
+ x: 0,
13
+ y: 0,
14
+ width: 60,
15
+ height: 21,
16
+ }),
17
+ definition: DatadogAPIClient::V1::SLOListWidgetDefinition.new({
18
+ title_size: "16",
19
+ title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT,
20
+ type: DatadogAPIClient::V1::SLOListWidgetDefinitionType::SLO_LIST,
21
+ requests: [
22
+ DatadogAPIClient::V1::SLOListWidgetRequest.new({
23
+ query: DatadogAPIClient::V1::SLOListWidgetQuery.new({
24
+ query_string: "env:prod AND service:my-app",
25
+ limit: 75,
26
+ sort: [
27
+ DatadogAPIClient::V1::WidgetFieldSort.new({
28
+ column: "status.sli",
29
+ order: DatadogAPIClient::V1::WidgetSort::ASCENDING,
30
+ }),
31
+ ],
32
+ }),
33
+ request_type: DatadogAPIClient::V1::SLOListWidgetRequestType::SLO_LIST,
34
+ }),
35
+ ],
36
+ }),
37
+ }),
38
+ ],
39
+ template_variables: [],
40
+ layout_type: DatadogAPIClient::V1::DashboardLayoutType::FREE,
41
+ is_read_only: false,
42
+ notify_list: [],
43
+ })
44
+ p api_instance.create_dashboard(body)
@@ -0,0 +1,62 @@
1
+ # Create a new timeseries widget with ci_pipelines data source
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V1::DashboardsAPI.new
5
+
6
+ body = DatadogAPIClient::V1::Dashboard.new({
7
+ title: "Example-Create_a_new_timeseries_widget_with_ci_pipelines_data_source with ci_pipelines datasource",
8
+ widgets: [
9
+ DatadogAPIClient::V1::Widget.new({
10
+ definition: DatadogAPIClient::V1::TimeseriesWidgetDefinition.new({
11
+ title: "",
12
+ show_legend: true,
13
+ legend_layout: DatadogAPIClient::V1::TimeseriesWidgetLegendLayout::AUTO,
14
+ legend_columns: [
15
+ DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::AVG,
16
+ DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::MIN,
17
+ DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::MAX,
18
+ DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::VALUE,
19
+ DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::SUM,
20
+ ],
21
+ time: DatadogAPIClient::V1::WidgetTime.new({}),
22
+ type: DatadogAPIClient::V1::TimeseriesWidgetDefinitionType::TIMESERIES,
23
+ requests: [
24
+ DatadogAPIClient::V1::TimeseriesWidgetRequest.new({
25
+ formulas: [
26
+ DatadogAPIClient::V1::WidgetFormula.new({
27
+ formula: "query1",
28
+ }),
29
+ ],
30
+ queries: [
31
+ DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinition.new({
32
+ data_source: DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource::CI_PIPELINES,
33
+ name: "query1",
34
+ search: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionSearch.new({
35
+ query: "ci_level:job",
36
+ }),
37
+ indexes: [
38
+ "*",
39
+ ],
40
+ compute: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionCompute.new({
41
+ aggregation: DatadogAPIClient::V1::FormulaAndFunctionEventAggregation::COUNT,
42
+ metric: "@ci.queue_time",
43
+ }),
44
+ group_by: [],
45
+ }),
46
+ ],
47
+ response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES,
48
+ style: DatadogAPIClient::V1::WidgetRequestStyle.new({
49
+ palette: "dog_classic",
50
+ line_type: DatadogAPIClient::V1::WidgetLineType::SOLID,
51
+ line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL,
52
+ }),
53
+ display_type: DatadogAPIClient::V1::WidgetDisplayType::LINE,
54
+ }),
55
+ ],
56
+ }),
57
+ }),
58
+ ],
59
+ layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
60
+ reflow_type: DatadogAPIClient::V1::DashboardReflowType::AUTO,
61
+ })
62
+ p api_instance.create_dashboard(body)
@@ -0,0 +1,32 @@
1
+ # Create a new dashboard with ci_test_stream list_stream widget
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V1::DashboardsAPI.new
5
+
6
+ body = DatadogAPIClient::V1::Dashboard.new({
7
+ layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
8
+ title: "Example-Create_a_new_dashboard_with_ci_test_stream_list_stream_widget with list_stream widget",
9
+ widgets: [
10
+ DatadogAPIClient::V1::Widget.new({
11
+ definition: DatadogAPIClient::V1::ListStreamWidgetDefinition.new({
12
+ type: DatadogAPIClient::V1::ListStreamWidgetDefinitionType::LIST_STREAM,
13
+ requests: [
14
+ DatadogAPIClient::V1::ListStreamWidgetRequest.new({
15
+ columns: [
16
+ DatadogAPIClient::V1::ListStreamColumn.new({
17
+ width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO,
18
+ field: "timestamp",
19
+ }),
20
+ ],
21
+ query: DatadogAPIClient::V1::ListStreamQuery.new({
22
+ data_source: DatadogAPIClient::V1::ListStreamSource::CI_TEST_STREAM,
23
+ query_string: "test_level:suite",
24
+ }),
25
+ response_format: DatadogAPIClient::V1::ListStreamResponseFormat::EVENT_LIST,
26
+ }),
27
+ ],
28
+ }),
29
+ }),
30
+ ],
31
+ })
32
+ p api_instance.create_dashboard(body)
@@ -1,9 +1,6 @@
1
1
  # Search for SLOs returns "OK" response
2
2
 
3
3
  require "datadog_api_client"
4
- DatadogAPIClient::V2.configure do |config|
5
- config.unstable_operations["v1.search_slo".to_sym] = true
6
- end
7
4
  api_instance = DatadogAPIClient::V1::ServiceLevelObjectivesAPI.new
8
5
 
9
6
  # there is a valid "slo" in the system
@@ -0,0 +1,31 @@
1
+ # Create an incident integration metadata returns "CREATED" response
2
+
3
+ require "datadog_api_client"
4
+ DatadogAPIClient::V2.configure do |config|
5
+ config.unstable_operations["v2.create_incident_integration".to_sym] = true
6
+ end
7
+ api_instance = DatadogAPIClient::V2::IncidentsAPI.new
8
+
9
+ # there is a valid "incident" in the system
10
+ INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]
11
+
12
+ body = DatadogAPIClient::V2::IncidentIntegrationMetadataCreateRequest.new({
13
+ data: DatadogAPIClient::V2::IncidentIntegrationMetadataCreateData.new({
14
+ attributes: DatadogAPIClient::V2::IncidentIntegrationMetadataAttributes.new({
15
+ incident_id: INCIDENT_DATA_ID,
16
+ integration_type: 1,
17
+ metadata: DatadogAPIClient::V2::SlackIntegrationMetadata.new({
18
+ channels: [
19
+ DatadogAPIClient::V2::SlackIntegrationMetadataChannelItem.new({
20
+ channel_id: "C0123456789",
21
+ channel_name: "#new-channel",
22
+ team_id: "T01234567",
23
+ redirect_url: "https://slack.com/app_redirect?channel=C0123456789&team=T01234567",
24
+ }),
25
+ ],
26
+ }),
27
+ }),
28
+ type: DatadogAPIClient::V2::IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS,
29
+ }),
30
+ })
31
+ p api_instance.create_incident_integration(INCIDENT_DATA_ID, body)
@@ -0,0 +1,14 @@
1
+ # Delete an incident integration metadata returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ DatadogAPIClient::V2.configure do |config|
5
+ config.unstable_operations["v2.delete_incident_integration".to_sym] = true
6
+ end
7
+ api_instance = DatadogAPIClient::V2::IncidentsAPI.new
8
+
9
+ # there is a valid "incident" in the system
10
+ INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]
11
+
12
+ # the "incident" has an "incident_integration_metadata"
13
+ INCIDENT_INTEGRATION_METADATA_DATA_ID = ENV["INCIDENT_INTEGRATION_METADATA_DATA_ID"]
14
+ api_instance.delete_incident_integration(INCIDENT_DATA_ID, INCIDENT_INTEGRATION_METADATA_DATA_ID)
@@ -0,0 +1,14 @@
1
+ # Get incident integration metadata details returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ DatadogAPIClient::V2.configure do |config|
5
+ config.unstable_operations["v2.get_incident_integration".to_sym] = true
6
+ end
7
+ api_instance = DatadogAPIClient::V2::IncidentsAPI.new
8
+
9
+ # there is a valid "incident" in the system
10
+ INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]
11
+
12
+ # the "incident" has an "incident_integration_metadata"
13
+ INCIDENT_INTEGRATION_METADATA_DATA_ID = ENV["INCIDENT_INTEGRATION_METADATA_DATA_ID"]
14
+ p api_instance.get_incident_integration(INCIDENT_DATA_ID, INCIDENT_INTEGRATION_METADATA_DATA_ID)
@@ -0,0 +1,11 @@
1
+ # Get a list of an incident's integration metadata returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ DatadogAPIClient::V2.configure do |config|
5
+ config.unstable_operations["v2.list_incident_integrations".to_sym] = true
6
+ end
7
+ api_instance = DatadogAPIClient::V2::IncidentsAPI.new
8
+
9
+ # there is a valid "incident" in the system
10
+ INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]
11
+ p api_instance.list_incident_integrations(INCIDENT_DATA_ID)
@@ -0,0 +1,34 @@
1
+ # Update an existing incident integration metadata returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ DatadogAPIClient::V2.configure do |config|
5
+ config.unstable_operations["v2.update_incident_integration".to_sym] = true
6
+ end
7
+ api_instance = DatadogAPIClient::V2::IncidentsAPI.new
8
+
9
+ # there is a valid "incident" in the system
10
+ INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]
11
+
12
+ # the "incident" has an "incident_integration_metadata"
13
+ INCIDENT_INTEGRATION_METADATA_DATA_ID = ENV["INCIDENT_INTEGRATION_METADATA_DATA_ID"]
14
+
15
+ body = DatadogAPIClient::V2::IncidentIntegrationMetadataPatchRequest.new({
16
+ data: DatadogAPIClient::V2::IncidentIntegrationMetadataPatchData.new({
17
+ attributes: DatadogAPIClient::V2::IncidentIntegrationMetadataAttributes.new({
18
+ incident_id: INCIDENT_DATA_ID,
19
+ integration_type: 1,
20
+ metadata: DatadogAPIClient::V2::SlackIntegrationMetadata.new({
21
+ channels: [
22
+ DatadogAPIClient::V2::SlackIntegrationMetadataChannelItem.new({
23
+ channel_id: "C0123456789",
24
+ channel_name: "#updated-channel-name",
25
+ team_id: "T01234567",
26
+ redirect_url: "https://slack.com/app_redirect?channel=C0123456789&team=T01234567",
27
+ }),
28
+ ],
29
+ }),
30
+ }),
31
+ type: DatadogAPIClient::V2::IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS,
32
+ }),
33
+ })
34
+ p api_instance.update_incident_integration(INCIDENT_DATA_ID, INCIDENT_INTEGRATION_METADATA_DATA_ID, body)
@@ -0,0 +1,5 @@
1
+ # Get IP Allowlist returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::IPAllowlistAPI.new
5
+ p api_instance.get_ip_allowlist()
@@ -0,0 +1,25 @@
1
+ # Update IP Allowlist returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::IPAllowlistAPI.new
5
+
6
+ body = DatadogAPIClient::V2::IPAllowlistUpdateRequest.new({
7
+ data: DatadogAPIClient::V2::IPAllowlistData.new({
8
+ attributes: DatadogAPIClient::V2::IPAllowlistAttributes.new({
9
+ entries: [
10
+ DatadogAPIClient::V2::IPAllowlistEntry.new({
11
+ data: DatadogAPIClient::V2::IPAllowlistEntryData.new({
12
+ attributes: DatadogAPIClient::V2::IPAllowlistEntryAttributes.new({
13
+ note: "Example-Update_IP_Allowlist_returns_OK_response",
14
+ cidr_block: "127.0.0.1",
15
+ }),
16
+ type: DatadogAPIClient::V2::IPAllowlistEntryType::IP_ALLOWLIST_ENTRY,
17
+ }),
18
+ }),
19
+ ],
20
+ enabled: false,
21
+ }),
22
+ type: DatadogAPIClient::V2::IPAllowlistType::IP_ALLOWLIST,
23
+ }),
24
+ })
25
+ p api_instance.update_ip_allowlist(body)
@@ -5,7 +5,7 @@ api_instance = DatadogAPIClient::V2::LogsMetricsAPI.new
5
5
 
6
6
  body = DatadogAPIClient::V2::LogsMetricCreateRequest.new({
7
7
  data: DatadogAPIClient::V2::LogsMetricCreateData.new({
8
- id: "Example-Create_a_log_based_metric_returns_OK_response",
8
+ id: "ExampleCreatealogbasedmetricreturnsOKresponse",
9
9
  type: DatadogAPIClient::V2::LogsMetricType::LOGS_METRICS,
10
10
  attributes: DatadogAPIClient::V2::LogsMetricCreateAttributes.new({
11
11
  compute: DatadogAPIClient::V2::LogsMetricCompute.new({
@@ -0,0 +1,5 @@
1
+ # Delete a restriction policy returns "No Content" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::RestrictionPoliciesAPI.new
5
+ api_instance.delete_restriction_policy("dashboard:test-delete")
@@ -0,0 +1,5 @@
1
+ # Get a restriction policy returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::RestrictionPoliciesAPI.new
5
+ p api_instance.get_restriction_policy("dashboard:test-get")
@@ -0,0 +1,25 @@
1
+ # Update a restriction policy returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::RestrictionPoliciesAPI.new
5
+
6
+ # there is a valid "user" in the system
7
+ USER_DATA_RELATIONSHIPS_ORG_DATA_ID = ENV["USER_DATA_RELATIONSHIPS_ORG_DATA_ID"]
8
+
9
+ body = DatadogAPIClient::V2::RestrictionPolicyUpdateRequest.new({
10
+ data: DatadogAPIClient::V2::RestrictionPolicy.new({
11
+ id: "dashboard:test-update",
12
+ type: DatadogAPIClient::V2::RestrictionPolicyType::RESTRICTION_POLICY,
13
+ attributes: DatadogAPIClient::V2::RestrictionPolicyAttributes.new({
14
+ bindings: [
15
+ DatadogAPIClient::V2::RestrictionPolicyBinding.new({
16
+ relation: "editor",
17
+ principals: [
18
+ "org:00000000-0000-beef-0000-000000000000",
19
+ ],
20
+ }),
21
+ ],
22
+ }),
23
+ }),
24
+ })
25
+ p api_instance.update_restriction_policy("dashboard:test-update", body)
@@ -0,0 +1,5 @@
1
+ # Get the on-demand concurrency cap returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::SyntheticsAPI.new
5
+ p api_instance.get_on_demand_concurrency_cap()
@@ -0,0 +1,5 @@
1
+ # Get on demand concurrency cap
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::SyntheticsAPI.new
5
+ p api_instance.get_on_demand_concurrency_cap()
@@ -0,0 +1,7 @@
1
+ # Save new value for on-demand concurrency cap returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::SyntheticsAPI.new
5
+
6
+ body = DatadogAPIClient::V2::OnDemandConcurrencyCapAttributes.new({})
7
+ p api_instance.set_on_demand_concurrency_cap(body)
@@ -0,0 +1,9 @@
1
+ # Save on demand concurrency cap
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::SyntheticsAPI.new
5
+
6
+ body = DatadogAPIClient::V2::OnDemandConcurrencyCapAttributes.new({
7
+ on_demand_concurrency_cap: 20,
8
+ })
9
+ p api_instance.set_on_demand_concurrency_cap(body)
@@ -175,17 +175,21 @@ module DatadogAPIClient
175
175
  @http_proxypass = nil
176
176
  @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
177
177
  @unstable_operations = {
178
- "v1.search_slo": false,
179
178
  "v2.list_events": false,
180
179
  "v2.search_events": false,
181
180
  "v2.create_incident": false,
181
+ "v2.create_incident_integration": false,
182
182
  "v2.delete_incident": false,
183
+ "v2.delete_incident_integration": false,
183
184
  "v2.get_incident": false,
185
+ "v2.get_incident_integration": false,
184
186
  "v2.list_incident_attachments": false,
187
+ "v2.list_incident_integrations": false,
185
188
  "v2.list_incidents": false,
186
189
  "v2.search_incidents": false,
187
190
  "v2.update_incident": false,
188
191
  "v2.update_incident_attachments": false,
192
+ "v2.update_incident_integration": false,
189
193
  "v2.query_scalar_data": false,
190
194
  "v2.query_timeseries_data": false,
191
195
  "v2.create_incident_service": false,
@@ -174,6 +174,7 @@ module DatadogAPIClient
174
174
  "v1.ip_prefixes_api" => "IPPrefixesAPI",
175
175
  "v1.ip_prefixes_apm" => "IPPrefixesAPM",
176
176
  "v1.ip_prefixes_logs" => "IPPrefixesLogs",
177
+ "v1.ip_prefixes_orchestrator" => "IPPrefixesOrchestrator",
177
178
  "v1.ip_prefixes_process" => "IPPrefixesProcess",
178
179
  "v1.ip_prefixes_synthetics" => "IPPrefixesSynthetics",
179
180
  "v1.ip_prefixes_synthetics_private_locations" => "IPPrefixesSyntheticsPrivateLocations",
@@ -453,6 +454,8 @@ module DatadogAPIClient
453
454
  "v1.slo_raw_error_budget_remaining" => "SLORawErrorBudgetRemaining",
454
455
  "v1.slo_response" => "SLOResponse",
455
456
  "v1.slo_response_data" => "SLOResponseData",
457
+ "v1.slo_state" => "SLOState",
458
+ "v1.slo_status" => "SLOStatus",
456
459
  "v1.slo_threshold" => "SLOThreshold",
457
460
  "v1.slo_timeframe" => "SLOTimeframe",
458
461
  "v1.slo_type" => "SLOType",
@@ -1027,6 +1030,16 @@ module DatadogAPIClient
1027
1030
  "v2.incident_field_attributes_single_value" => "IncidentFieldAttributesSingleValue",
1028
1031
  "v2.incident_field_attributes_single_value_type" => "IncidentFieldAttributesSingleValueType",
1029
1032
  "v2.incident_field_attributes_value_type" => "IncidentFieldAttributesValueType",
1033
+ "v2.incident_integration_metadata_attributes" => "IncidentIntegrationMetadataAttributes",
1034
+ "v2.incident_integration_metadata_create_data" => "IncidentIntegrationMetadataCreateData",
1035
+ "v2.incident_integration_metadata_create_request" => "IncidentIntegrationMetadataCreateRequest",
1036
+ "v2.incident_integration_metadata_list_response" => "IncidentIntegrationMetadataListResponse",
1037
+ "v2.incident_integration_metadata_metadata" => "IncidentIntegrationMetadataMetadata",
1038
+ "v2.incident_integration_metadata_patch_data" => "IncidentIntegrationMetadataPatchData",
1039
+ "v2.incident_integration_metadata_patch_request" => "IncidentIntegrationMetadataPatchRequest",
1040
+ "v2.incident_integration_metadata_response" => "IncidentIntegrationMetadataResponse",
1041
+ "v2.incident_integration_metadata_response_data" => "IncidentIntegrationMetadataResponseData",
1042
+ "v2.incident_integration_metadata_response_included_item" => "IncidentIntegrationMetadataResponseIncludedItem",
1030
1043
  "v2.incident_integration_metadata_type" => "IncidentIntegrationMetadataType",
1031
1044
  "v2.incident_notification_handle" => "IncidentNotificationHandle",
1032
1045
  "v2.incident_postmortem_type" => "IncidentPostmortemType",
@@ -1087,6 +1100,17 @@ module DatadogAPIClient
1087
1100
  "v2.incident_update_relationships" => "IncidentUpdateRelationships",
1088
1101
  "v2.incident_update_request" => "IncidentUpdateRequest",
1089
1102
  "v2.intake_payload_accepted" => "IntakePayloadAccepted",
1103
+ "v2.ip_allowlist_attributes" => "IPAllowlistAttributes",
1104
+ "v2.ip_allowlist_data" => "IPAllowlistData",
1105
+ "v2.ip_allowlist_entry" => "IPAllowlistEntry",
1106
+ "v2.ip_allowlist_entry_attributes" => "IPAllowlistEntryAttributes",
1107
+ "v2.ip_allowlist_entry_data" => "IPAllowlistEntryData",
1108
+ "v2.ip_allowlist_entry_type" => "IPAllowlistEntryType",
1109
+ "v2.ip_allowlist_response" => "IPAllowlistResponse",
1110
+ "v2.ip_allowlist_type" => "IPAllowlistType",
1111
+ "v2.ip_allowlist_update_request" => "IPAllowlistUpdateRequest",
1112
+ "v2.jira_integration_metadata" => "JiraIntegrationMetadata",
1113
+ "v2.jira_integration_metadata_issues_item" => "JiraIntegrationMetadataIssuesItem",
1090
1114
  "v2.list_application_keys_response" => "ListApplicationKeysResponse",
1091
1115
  "v2.log" => "Log",
1092
1116
  "v2.log_attributes" => "LogAttributes",
@@ -1242,6 +1266,9 @@ module DatadogAPIClient
1242
1266
  "v2.monitor_type" => "MonitorType",
1243
1267
  "v2.nullable_relationship_to_user" => "NullableRelationshipToUser",
1244
1268
  "v2.nullable_relationship_to_user_data" => "NullableRelationshipToUserData",
1269
+ "v2.on_demand_concurrency_cap" => "OnDemandConcurrencyCap",
1270
+ "v2.on_demand_concurrency_cap_attributes" => "OnDemandConcurrencyCapAttributes",
1271
+ "v2.on_demand_concurrency_cap_response" => "OnDemandConcurrencyCapResponse",
1245
1272
  "v2.opsgenie_service_create_attributes" => "OpsgenieServiceCreateAttributes",
1246
1273
  "v2.opsgenie_service_create_data" => "OpsgenieServiceCreateData",
1247
1274
  "v2.opsgenie_service_create_request" => "OpsgenieServiceCreateRequest",
@@ -1296,6 +1323,12 @@ module DatadogAPIClient
1296
1323
  "v2.relationship_to_user_data" => "RelationshipToUserData",
1297
1324
  "v2.relationship_to_users" => "RelationshipToUsers",
1298
1325
  "v2.response_meta_attributes" => "ResponseMetaAttributes",
1326
+ "v2.restriction_policy" => "RestrictionPolicy",
1327
+ "v2.restriction_policy_attributes" => "RestrictionPolicyAttributes",
1328
+ "v2.restriction_policy_binding" => "RestrictionPolicyBinding",
1329
+ "v2.restriction_policy_response" => "RestrictionPolicyResponse",
1330
+ "v2.restriction_policy_type" => "RestrictionPolicyType",
1331
+ "v2.restriction_policy_update_request" => "RestrictionPolicyUpdateRequest",
1299
1332
  "v2.role" => "Role",
1300
1333
  "v2.role_attributes" => "RoleAttributes",
1301
1334
  "v2.role_clone" => "RoleClone",
@@ -1538,6 +1571,8 @@ module DatadogAPIClient
1538
1571
  "v2.service_definition_v2_slack" => "ServiceDefinitionV2Slack",
1539
1572
  "v2.service_definition_v2_slack_type" => "ServiceDefinitionV2SlackType",
1540
1573
  "v2.service_definition_v2_version" => "ServiceDefinitionV2Version",
1574
+ "v2.slack_integration_metadata" => "SlackIntegrationMetadata",
1575
+ "v2.slack_integration_metadata_channel_item" => "SlackIntegrationMetadataChannelItem",
1541
1576
  "v2.timeseries_formula_query_request" => "TimeseriesFormulaQueryRequest",
1542
1577
  "v2.timeseries_formula_query_response" => "TimeseriesFormulaQueryResponse",
1543
1578
  "v2.timeseries_formula_request" => "TimeseriesFormulaRequest",
@@ -1623,6 +1658,7 @@ module DatadogAPIClient
1623
1658
  "v2.incident_services_api" => "IncidentServicesAPI",
1624
1659
  "v2.incident_teams_api" => "IncidentTeamsAPI",
1625
1660
  "v2.incidents_api" => "IncidentsAPI",
1661
+ "v2.ip_allowlist_api" => "IPAllowlistAPI",
1626
1662
  "v2.key_management_api" => "KeyManagementAPI",
1627
1663
  "v2.logs_api" => "LogsAPI",
1628
1664
  "v2.logs_archives_api" => "LogsArchivesAPI",
@@ -1632,12 +1668,14 @@ module DatadogAPIClient
1632
1668
  "v2.opsgenie_integration_api" => "OpsgenieIntegrationAPI",
1633
1669
  "v2.organizations_api" => "OrganizationsAPI",
1634
1670
  "v2.processes_api" => "ProcessesAPI",
1671
+ "v2.restriction_policies_api" => "RestrictionPoliciesAPI",
1635
1672
  "v2.roles_api" => "RolesAPI",
1636
1673
  "v2.rum_api" => "RUMAPI",
1637
1674
  "v2.security_monitoring_api" => "SecurityMonitoringAPI",
1638
1675
  "v2.sensitive_data_scanner_api" => "SensitiveDataScannerAPI",
1639
1676
  "v2.service_accounts_api" => "ServiceAccountsAPI",
1640
1677
  "v2.service_definition_api" => "ServiceDefinitionAPI",
1678
+ "v2.synthetics_api" => "SyntheticsAPI",
1641
1679
  "v2.usage_metering_api" => "UsageMeteringAPI",
1642
1680
  "v2.users_api" => "UsersAPI"
1643
1681
  }
@@ -615,12 +615,6 @@ module DatadogAPIClient::V1
615
615
  # @option opts [Boolean] :include_facets Whether or not to return facet information in the response `[default=false]`.
616
616
  # @return [Array<(SearchSLOResponse, Integer, Hash)>] SearchSLOResponse data, response status code and response headers
617
617
  def search_slo_with_http_info(opts = {})
618
- unstable_enabled = @api_client.config.unstable_operations["v1.search_slo".to_sym]
619
- if unstable_enabled
620
- @api_client.config.logger.warn format("Using unstable operation '%s'", "v1.search_slo")
621
- else
622
- raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v1.search_slo"))
623
- end
624
618
 
625
619
  if @api_client.config.debugging
626
620
  @api_client.config.logger.debug 'Calling API: ServiceLevelObjectivesAPI.search_slo ...'
@@ -36,8 +36,8 @@ module DatadogAPIClient::V1
36
36
  # Take graph snapshots.
37
37
  # **Note**: When a snapshot is created, there is some delay before it is available.
38
38
  #
39
- # @param start [Integer] The POSIX timestamp of the start of the query.
40
- # @param _end [Integer] The POSIX timestamp of the end of the query.
39
+ # @param start [Integer] The POSIX timestamp of the start of the query in seconds.
40
+ # @param _end [Integer] The POSIX timestamp of the end of the query in seconds.
41
41
  # @param opts [Hash] the optional parameters
42
42
  # @option opts [String] :metric_query The metric query.
43
43
  # @option opts [String] :event_query A query that adds event bands to the graph.