datadog_api_client 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/poetry.lock +21 -14
  4. data/.generator/pyproject.toml +1 -1
  5. data/.generator/schemas/v1/openapi.yaml +558 -8
  6. data/.generator/schemas/v2/openapi.yaml +973 -253
  7. data/.generator/src/generator/templates/api_client.j2 +5 -1
  8. data/.generator/src/generator/templates/configuration.j2 +17 -0
  9. data/.github/workflows/test.yml +3 -0
  10. data/.pre-commit-config.yaml +1 -1
  11. data/CHANGELOG.md +26 -0
  12. data/README.md +11 -0
  13. data/examples/v1/dashboards/CreateDashboard_1423904722.rb +38 -0
  14. data/examples/v1/dashboards/CreateDashboard_2652180930.rb +43 -0
  15. data/examples/v1/dashboards/CreateDashboard_2850365602.rb +55 -0
  16. data/examples/v1/dashboards/CreateDashboard_3117424216.rb +33 -0
  17. data/examples/v1/dashboards/CreateDashboard_3669695268.rb +50 -0
  18. data/examples/v1/dashboards/CreateDashboard_858397694.rb +41 -0
  19. data/examples/v1/synthetics/CreateGlobalVariable_1068962881.rb +1 -1
  20. data/examples/v2/incidents/ListIncidentAttachments.rb +8 -0
  21. data/examples/v2/incidents/ListIncidentAttachments_2457735435.rb +11 -0
  22. data/examples/v2/incidents/UpdateIncidentAttachments.rb +38 -0
  23. data/examples/v2/incidents/UpdateIncidentAttachments_3881702075.rb +26 -0
  24. data/examples/v2/metrics/ListActiveMetricConfigurations.rb +5 -0
  25. data/examples/v2/metrics/ListTagConfigurations.rb +1 -1
  26. data/examples/v2/metrics/ListTagConfigurations_265033704.rb +8 -0
  27. data/examples/v2/metrics/{ListTagConfigurations_103226315.rb → ListTagConfigurations_2739018321.rb} +1 -1
  28. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule.rb +3 -2
  29. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_461183901.rb +2 -2
  30. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_498211763.rb +2 -2
  31. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_914562040.rb +50 -0
  32. data/examples/v2/security-monitoring/GetSecurityMonitoringSignal.rb +5 -0
  33. data/examples/v2/security-monitoring/UpdateSecurityMonitoringRule.rb +2 -1
  34. data/examples/v2/usage-metering/GetEstimatedCostByOrg.rb +1 -4
  35. data/examples/v2/usage-metering/GetEstimatedCostByOrg_2734954020.rb +2 -4
  36. data/examples/v2/usage-metering/GetEstimatedCostByOrg_3186693804.rb +2 -4
  37. data/examples/v2/usage-metering/GetHistoricalCostByOrg.rb +8 -0
  38. data/generate.sh +30 -0
  39. data/lib/datadog_api_client/api_client.rb +5 -1
  40. data/lib/datadog_api_client/configuration.rb +20 -1
  41. data/lib/datadog_api_client/inflector.rb +51 -1
  42. data/lib/datadog_api_client/v1/api/service_level_objectives_api.rb +3 -1
  43. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +5 -5
  44. data/lib/datadog_api_client/v1/models/dashboard_template_variable.rb +14 -2
  45. data/lib/datadog_api_client/v1/models/dashboard_template_variable_preset_value.rb +28 -5
  46. data/lib/datadog_api_client/v1/models/formula_and_function_event_query_definition.rb +14 -4
  47. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +1 -0
  48. data/lib/datadog_api_client/v1/models/list_stream_query.rb +14 -4
  49. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +2 -0
  50. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +21 -1
  51. data/lib/datadog_api_client/v1/models/search_service_level_objective.rb +111 -0
  52. data/lib/datadog_api_client/v1/models/search_service_level_objective_attributes.rb +286 -0
  53. data/lib/datadog_api_client/v1/models/search_service_level_objective_data.rb +134 -0
  54. data/lib/datadog_api_client/v1/models/search_slo_query.rb +137 -0
  55. data/lib/datadog_api_client/v1/models/search_slo_response_data_attributes.rb +8 -8
  56. data/lib/datadog_api_client/v1/models/search_slo_response_links.rb +2 -0
  57. data/lib/datadog_api_client/v1/models/search_slo_threshold.rb +184 -0
  58. data/lib/datadog_api_client/v1/models/search_slo_timeframe.rb +28 -0
  59. data/lib/datadog_api_client/v1/models/slo_creator.rb +131 -0
  60. data/lib/datadog_api_client/v1/models/slo_list_widget_definition.rb +185 -0
  61. data/lib/datadog_api_client/v1/models/slo_list_widget_definition_type.rb +26 -0
  62. data/lib/datadog_api_client/v1/models/slo_list_widget_query.rb +149 -0
  63. data/lib/datadog_api_client/v1/models/slo_list_widget_request.rb +143 -0
  64. data/lib/datadog_api_client/v1/models/slo_list_widget_request_type.rb +26 -0
  65. data/lib/datadog_api_client/v1/models/slo_overall_statuses.rb +174 -0
  66. data/lib/datadog_api_client/v1/models/slo_raw_error_budget_remaining.rb +121 -0
  67. data/lib/datadog_api_client/v1/models/synthetics_assertion_operator.rb +1 -0
  68. data/lib/datadog_api_client/v1/models/topology_map_widget_definition.rb +193 -0
  69. data/lib/datadog_api_client/v1/models/topology_map_widget_definition_type.rb +26 -0
  70. data/lib/datadog_api_client/v1/models/topology_query.rb +144 -0
  71. data/lib/datadog_api_client/v1/models/topology_query_data_source.rb +27 -0
  72. data/lib/datadog_api_client/v1/models/topology_request.rb +121 -0
  73. data/lib/datadog_api_client/v1/models/topology_request_type.rb +26 -0
  74. data/lib/datadog_api_client/v1/models/usage_attribution_sort.rb +2 -0
  75. data/lib/datadog_api_client/v1/models/usage_attribution_supported_metrics.rb +2 -0
  76. data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +21 -1
  77. data/lib/datadog_api_client/v1/models/usage_fargate_hour.rb +11 -1
  78. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +11 -1
  79. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +11 -1
  80. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +11 -1
  81. data/lib/datadog_api_client/v1/models/widget_definition.rb +3 -1
  82. data/lib/datadog_api_client/v2/api/incident_services_api.rb +2 -2
  83. data/lib/datadog_api_client/v2/api/incident_teams_api.rb +2 -2
  84. data/lib/datadog_api_client/v2/api/incidents_api.rb +155 -0
  85. data/lib/datadog_api_client/v2/api/metrics_api.rb +76 -8
  86. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +65 -0
  87. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +83 -17
  88. data/lib/datadog_api_client/v2/models/incident_attachment_attachment_type.rb +27 -0
  89. data/lib/datadog_api_client/v2/models/incident_attachment_attributes.rb +63 -0
  90. data/lib/datadog_api_client/v2/models/incident_attachment_data.rb +187 -0
  91. data/lib/datadog_api_client/v2/models/incident_attachment_link_attachment_type.rb +26 -0
  92. data/lib/datadog_api_client/v2/models/incident_attachment_link_attributes.rb +145 -0
  93. data/lib/datadog_api_client/v2/models/incident_attachment_link_attributes_attachment_object.rb +143 -0
  94. data/lib/datadog_api_client/v2/models/incident_attachment_postmortem_attachment_type.rb +26 -0
  95. data/lib/datadog_api_client/v2/models/incident_attachment_postmortem_attributes.rb +145 -0
  96. data/lib/datadog_api_client/v2/models/incident_attachment_related_object.rb +26 -0
  97. data/lib/datadog_api_client/v2/models/incident_attachment_relationships.rb +111 -0
  98. data/lib/datadog_api_client/v2/models/incident_attachment_type.rb +26 -0
  99. data/lib/datadog_api_client/v2/models/incident_attachment_update_attributes.rb +63 -0
  100. data/lib/datadog_api_client/v2/models/incident_attachment_update_data.rb +144 -0
  101. data/lib/datadog_api_client/v2/models/incident_attachment_update_request.rb +127 -0
  102. data/lib/datadog_api_client/v2/models/incident_attachment_update_response.rb +137 -0
  103. data/lib/datadog_api_client/v2/models/incident_attachments_postmortem_attributes_attachment_object.rb +143 -0
  104. data/lib/datadog_api_client/v2/models/incident_attachments_response.rb +136 -0
  105. data/lib/datadog_api_client/v2/models/incident_attachments_response_included_item.rb +62 -0
  106. data/lib/datadog_api_client/v2/models/incident_related_object.rb +1 -0
  107. data/lib/datadog_api_client/v2/models/incident_response_attributes.rb +1 -11
  108. data/lib/datadog_api_client/v2/models/incident_response_included_item.rb +2 -1
  109. data/lib/datadog_api_client/v2/models/incident_response_relationships.rb +14 -14
  110. data/lib/datadog_api_client/v2/models/metric_active_configuration_type.rb +26 -0
  111. data/lib/datadog_api_client/v2/models/metric_suggested_tags_and_aggregations.rb +133 -0
  112. data/lib/datadog_api_client/v2/models/metric_suggested_tags_and_aggregations_response.rb +111 -0
  113. data/lib/datadog_api_client/v2/models/metric_suggested_tags_attributes.rb +125 -0
  114. data/lib/datadog_api_client/v2/models/relationship_to_incident_attachment.rb +124 -0
  115. data/lib/datadog_api_client/v2/models/relationship_to_incident_attachment_data.rb +145 -0
  116. data/lib/datadog_api_client/v2/models/security_monitoring_rule_create_payload.rb +36 -248
  117. data/lib/datadog_api_client/v2/models/security_monitoring_rule_query.rb +36 -151
  118. data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_aggregation.rb +1 -0
  119. data/lib/datadog_api_client/v2/models/security_monitoring_rule_response.rb +37 -253
  120. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_create_payload.rb +275 -0
  121. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_query.rb +187 -0
  122. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_response.rb +279 -0
  123. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_type.rb +26 -0
  124. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_create_payload.rb +275 -0
  125. data/lib/datadog_api_client/v2/models/{security_monitoring_rule_query_create.rb → security_monitoring_standard_rule_query.rb} +3 -3
  126. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +279 -0
  127. data/lib/datadog_api_client/version.rb +1 -1
  128. metadata +70 -6
  129. data/Makefile +0 -7
  130. data/examples/v2/metrics/ListTagConfigurations_1799362914.rb +0 -8
@@ -138,7 +138,11 @@ module {{ module_name }}
138
138
  :timeout => @config.timeout,
139
139
  :verify_peer => @config.verify_ssl,
140
140
  :verify => _verify_ssl_host,
141
- :verbose => @config.debugging
141
+ :verbose => @config.debugging,
142
+ :http_proxyaddr => @config.http_proxyaddr,
143
+ :http_proxyport => @config.http_proxyport,
144
+ :http_proxyuser => @config.http_proxyuser,
145
+ :http_proxypass => @config.http_proxypass
142
146
  }
143
147
 
144
148
  req_opts[:pem] = File.read(@config.cert_file) if @config.cert_file
@@ -125,6 +125,19 @@ module {{ module_name }}
125
125
  # Set this to add accept encoding header for compression
126
126
  attr_accessor :compress
127
127
 
128
+ ### Proxy settings
129
+ # Address of proxy server to use
130
+ attr_accessor :http_proxyaddr
131
+
132
+ # Port of proxy server to use
133
+ attr_accessor :http_proxyport
134
+
135
+ # User for proxy server authentication
136
+ attr_accessor :http_proxyuser
137
+
138
+ # Password for proxy server authentication
139
+ attr_accessor :http_proxypass
140
+
128
141
  def initialize
129
142
  {%- set default_server = openapi.servers[0]|format_server %}
130
143
  @scheme = '{{ default_server.scheme }}'
@@ -146,6 +159,10 @@ module {{ module_name }}
146
159
  @inject_format = false
147
160
  @force_ending_format = false
148
161
  @compress = true
162
+ @http_proxyaddr = nil
163
+ @http_proxyport = nil
164
+ @http_proxyuser = nil
165
+ @http_proxypass = nil
149
166
  @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
150
167
  @unstable_operations = {
151
168
  {%- for version, apis in all_apis.items() %}
@@ -32,6 +32,9 @@ jobs:
32
32
  fetch-depth: 0
33
33
  ref: ${{ github.event.pull_request.head.sha }}
34
34
  token: ${{ steps.get_token.outputs.token }}
35
+ - uses: actions/setup-python@v4
36
+ with:
37
+ python-version: '3.10'
35
38
  - name: Install pre-commit
36
39
  run: python -m pip install pre-commit
37
40
  - name: set PY
@@ -4,7 +4,7 @@ repos:
4
4
  - id: generate
5
5
  name: Generate
6
6
  language: system
7
- entry: make
7
+ entry: bash -c "./generate.sh"
8
8
  files: '^(\.generator/.*|\.pre-commit-config\.yaml|Makefile|\features/.*)'
9
9
  pass_filenames: false
10
10
  - id: format-examples
data/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.2.0 / 2022-10-03
4
+
5
+ ### Fixed
6
+ * Refactor RuleQuery models by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1082
7
+ * Fix SearchSLO response structure by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1084
8
+ ### Added
9
+ * Add ListActiveConfigurations endpoint and add new filter[queried] param to list tag configurations endpoint by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1017
10
+ * Add doesNotExist to synthetics operator enum by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1059
11
+ * Add TopologyMapWidget to dashboard schema by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1063
12
+ * Add Overall Status support to SLO Search API by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1065
13
+ * Add support for proxy usage by @skarimo in https://github.com/DataDog/datadog-api-client-ruby/pull/1069
14
+ * Add APM Fargate to Usage Metering API by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1058
15
+ * Add support for template variable multiselect in dashboards by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1068
16
+ * Add storage option to widget query definitions by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1072
17
+ * Add support for retrieving a security signal by ID by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1077
18
+ * Add support for signal correlation API by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1073
19
+ * Add support for SLO List widget by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1076
20
+ * Add new historical_cost endpoint, and update estimate_cost by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1071
21
+ * Add support for incident attachment APIs by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1083
22
+
23
+ ## New Contributors
24
+ * @nkzou made their first contribution in https://github.com/DataDog/datadog-api-client-ruby/pull/1057
25
+ * @dependabot made their first contribution in https://github.com/DataDog/datadog-api-client-ruby/pull/1091
26
+
27
+ **Full Changelog**: https://github.com/DataDog/datadog-api-client-ruby/compare/v2.1.0...v2.2.0
28
+
3
29
  ## 2.1.0 / 2022-08-31
4
30
 
5
31
  ### Added
data/README.md CHANGED
@@ -138,6 +138,17 @@ config.debugging = true
138
138
  client = DatadogAPIClient::APIClient.new(config)
139
139
  ```
140
140
 
141
+ ### Configure proxy
142
+
143
+ You can configure the client to use proxy by setting `http_proxyaddr` and `http_proxyport` keys on configuration object:
144
+
145
+ ```ruby
146
+ config = DatadogAPIClient::Configuration.new
147
+ config.http_proxyaddr = '127.0.0.1'
148
+ config.http_proxyport = '3128'
149
+ client = DatadogAPIClient::APIClient.new(config)
150
+ ```
151
+
141
152
  ### Pagination
142
153
 
143
154
  Several listing operations have a pagination method to help consume all the items available.
@@ -0,0 +1,38 @@
1
+ # Create a new dashboard with slo list widget
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",
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
+ }),
27
+ request_type: DatadogAPIClient::V1::SLOListWidgetRequestType::SLO_LIST,
28
+ }),
29
+ ],
30
+ }),
31
+ }),
32
+ ],
33
+ template_variables: [],
34
+ layout_type: DatadogAPIClient::V1::DashboardLayoutType::FREE,
35
+ is_read_only: false,
36
+ notify_list: [],
37
+ })
38
+ p api_instance.create_dashboard(body)
@@ -0,0 +1,43 @@
1
+ # Create a new dashboard with topology_map widget
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_topology_map_widget",
8
+ description: "",
9
+ widgets: [
10
+ DatadogAPIClient::V1::Widget.new({
11
+ layout: DatadogAPIClient::V1::WidgetLayout.new({
12
+ x: 0,
13
+ y: 0,
14
+ width: 47,
15
+ height: 15,
16
+ }),
17
+ definition: DatadogAPIClient::V1::TopologyMapWidgetDefinition.new({
18
+ title: "",
19
+ title_size: "16",
20
+ title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT,
21
+ type: DatadogAPIClient::V1::TopologyMapWidgetDefinitionType::TOPOLOGY_MAP,
22
+ requests: [
23
+ DatadogAPIClient::V1::TopologyRequest.new({
24
+ request_type: DatadogAPIClient::V1::TopologyRequestType::TOPOLOGY,
25
+ query: DatadogAPIClient::V1::TopologyQuery.new({
26
+ data_source: DatadogAPIClient::V1::TopologyQueryDataSource::SERVICE_MAP,
27
+ service: "",
28
+ filters: [
29
+ "env:none",
30
+ "environment:*",
31
+ ],
32
+ }),
33
+ }),
34
+ ],
35
+ }),
36
+ }),
37
+ ],
38
+ template_variables: [],
39
+ layout_type: DatadogAPIClient::V1::DashboardLayoutType::FREE,
40
+ is_read_only: false,
41
+ notify_list: [],
42
+ })
43
+ p api_instance.create_dashboard(body)
@@ -0,0 +1,55 @@
1
+ # Create a new dashboard with template variable presets using values returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V1::DashboardsAPI.new
5
+
6
+ body = DatadogAPIClient::V1::Dashboard.new({
7
+ description: nil,
8
+ is_read_only: false,
9
+ layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
10
+ notify_list: [],
11
+ reflow_type: DatadogAPIClient::V1::DashboardReflowType::AUTO,
12
+ restricted_roles: [],
13
+ template_variable_presets: [
14
+ DatadogAPIClient::V1::DashboardTemplateVariablePreset.new({
15
+ name: "my saved view",
16
+ template_variables: [
17
+ DatadogAPIClient::V1::DashboardTemplateVariablePresetValue.new({
18
+ name: "datacenter",
19
+ values: [
20
+ "*",
21
+ "my-host",
22
+ ],
23
+ }),
24
+ ],
25
+ }),
26
+ ],
27
+ template_variables: [
28
+ DatadogAPIClient::V1::DashboardTemplateVariable.new({
29
+ available_values: [
30
+ "my-host",
31
+ "host1",
32
+ "host2",
33
+ ],
34
+ defaults: [
35
+ "my-host",
36
+ ],
37
+ name: "host1",
38
+ prefix: "host",
39
+ }),
40
+ ],
41
+ title: "",
42
+ widgets: [
43
+ DatadogAPIClient::V1::Widget.new({
44
+ definition: DatadogAPIClient::V1::HostMapWidgetDefinition.new({
45
+ requests: DatadogAPIClient::V1::HostMapWidgetDefinitionRequests.new({
46
+ fill: DatadogAPIClient::V1::HostMapRequest.new({
47
+ q: "avg:system.cpu.user{*}",
48
+ }),
49
+ }),
50
+ type: DatadogAPIClient::V1::HostMapWidgetDefinitionType::HOSTMAP,
51
+ }),
52
+ }),
53
+ ],
54
+ })
55
+ p api_instance.create_dashboard(body)
@@ -0,0 +1,33 @@
1
+ # Create a new dashboard with logs_stream list_stream widget and storage parameter
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_logs_stream_list_stream_widget_and_storage_parameter 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::LOGS_STREAM,
23
+ query_string: "",
24
+ storage: "hot",
25
+ }),
26
+ response_format: DatadogAPIClient::V1::ListStreamResponseFormat::EVENT_LIST,
27
+ }),
28
+ ],
29
+ }),
30
+ }),
31
+ ],
32
+ })
33
+ p api_instance.create_dashboard(body)
@@ -0,0 +1,50 @@
1
+ # Create a new dashboard with logs query table widget and storage parameter
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_logs_query_table_widget_and_storage_parameter with query table widget and storage parameter",
9
+ widgets: [
10
+ DatadogAPIClient::V1::Widget.new({
11
+ definition: DatadogAPIClient::V1::TableWidgetDefinition.new({
12
+ type: DatadogAPIClient::V1::TableWidgetDefinitionType::QUERY_TABLE,
13
+ requests: [
14
+ DatadogAPIClient::V1::TableWidgetRequest.new({
15
+ queries: [
16
+ DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinition.new({
17
+ data_source: DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource::LOGS,
18
+ name: "query1",
19
+ search: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionSearch.new({
20
+ query: "",
21
+ }),
22
+ indexes: [
23
+ "*",
24
+ ],
25
+ compute: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionCompute.new({
26
+ aggregation: DatadogAPIClient::V1::FormulaAndFunctionEventAggregation::COUNT,
27
+ }),
28
+ group_by: [],
29
+ storage: "online_archives",
30
+ }),
31
+ ],
32
+ formulas: [
33
+ DatadogAPIClient::V1::WidgetFormula.new({
34
+ conditional_formats: [],
35
+ cell_display_mode: DatadogAPIClient::V1::TableWidgetCellDisplayMode::BAR,
36
+ formula: "query1",
37
+ limit: DatadogAPIClient::V1::WidgetFormulaLimit.new({
38
+ count: 50,
39
+ order: DatadogAPIClient::V1::QuerySortOrder::DESC,
40
+ }),
41
+ }),
42
+ ],
43
+ response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::SCALAR,
44
+ }),
45
+ ],
46
+ }),
47
+ }),
48
+ ],
49
+ })
50
+ p api_instance.create_dashboard(body)
@@ -0,0 +1,41 @@
1
+ # Create a new dashboard with template variable defaults returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V1::DashboardsAPI.new
5
+
6
+ body = DatadogAPIClient::V1::Dashboard.new({
7
+ description: nil,
8
+ is_read_only: false,
9
+ layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
10
+ notify_list: [],
11
+ reflow_type: DatadogAPIClient::V1::DashboardReflowType::AUTO,
12
+ restricted_roles: [],
13
+ template_variables: [
14
+ DatadogAPIClient::V1::DashboardTemplateVariable.new({
15
+ available_values: [
16
+ "my-host",
17
+ "host1",
18
+ "host2",
19
+ ],
20
+ defaults: [
21
+ "my-host",
22
+ ],
23
+ name: "host1",
24
+ prefix: "host",
25
+ }),
26
+ ],
27
+ title: "",
28
+ widgets: [
29
+ DatadogAPIClient::V1::Widget.new({
30
+ definition: DatadogAPIClient::V1::HostMapWidgetDefinition.new({
31
+ requests: DatadogAPIClient::V1::HostMapWidgetDefinitionRequests.new({
32
+ fill: DatadogAPIClient::V1::HostMapRequest.new({
33
+ q: "avg:system.cpu.user{*}",
34
+ }),
35
+ }),
36
+ type: DatadogAPIClient::V1::HostMapWidgetDefinitionType::HOSTMAP,
37
+ }),
38
+ }),
39
+ ],
40
+ })
41
+ p api_instance.create_dashboard(body)
@@ -8,7 +8,7 @@ SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID = ENV["SYNTHETICS_API_TEST_MULTI_STEP_P
8
8
 
9
9
  body = DatadogAPIClient::V1::SyntheticsGlobalVariable.new({
10
10
  description: "",
11
- name: "GLOBAL_VARIABLE_PAYLOAD",
11
+ name: "GLOBAL_VARIABLE_PAYLOAD_EXAMPLECREATEAGLOBALVARIABLEFROMTESTRETURNSOKRESPONSE",
12
12
  tags: [],
13
13
  value: DatadogAPIClient::V1::SyntheticsGlobalVariableValue.new({
14
14
  secure: false,
@@ -0,0 +1,8 @@
1
+ # Get a list of attachments returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ DatadogAPIClient::V2.configure do |config|
5
+ config.unstable_operations["v2.list_incident_attachments".to_sym] = true
6
+ end
7
+ api_instance = DatadogAPIClient::V2::IncidentsAPI.new
8
+ p api_instance.list_incident_attachments("incident_id")
@@ -0,0 +1,11 @@
1
+ # Get incident attachments returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ DatadogAPIClient::V2.configure do |config|
5
+ config.unstable_operations["v2.list_incident_attachments".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_attachments(INCIDENT_DATA_ID)
@@ -0,0 +1,38 @@
1
+ # Create, update, and delete incident attachments returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ DatadogAPIClient::V2.configure do |config|
5
+ config.unstable_operations["v2.update_incident_attachments".to_sym] = true
6
+ end
7
+ api_instance = DatadogAPIClient::V2::IncidentsAPI.new
8
+
9
+ body = DatadogAPIClient::V2::IncidentAttachmentUpdateRequest.new({
10
+ data: [
11
+ DatadogAPIClient::V2::IncidentAttachmentUpdateData.new({
12
+ attributes: DatadogAPIClient::V2::IncidentAttachmentPostmortemAttributes.new({
13
+ attachment: DatadogAPIClient::V2::IncidentAttachmentsPostmortemAttributesAttachmentObject.new({
14
+ document_url: "https://app.datadoghq.com/notebook/123",
15
+ title: "Postmortem IR-123",
16
+ }),
17
+ attachment_type: DatadogAPIClient::V2::IncidentAttachmentPostmortemAttachmentType::POSTMORTEM,
18
+ }),
19
+ id: "00000000-abcd-0002-0000-000000000000",
20
+ type: DatadogAPIClient::V2::IncidentAttachmentType::INCIDENT_ATTACHMENTS,
21
+ }),
22
+ DatadogAPIClient::V2::IncidentAttachmentUpdateData.new({
23
+ attributes: DatadogAPIClient::V2::IncidentAttachmentLinkAttributes.new({
24
+ attachment: DatadogAPIClient::V2::IncidentAttachmentLinkAttributesAttachmentObject.new({
25
+ document_url: "https://www.example.com/webstore-failure-runbook",
26
+ title: "Runbook for webstore service failures",
27
+ }),
28
+ attachment_type: DatadogAPIClient::V2::IncidentAttachmentLinkAttachmentType::LINK,
29
+ }),
30
+ type: DatadogAPIClient::V2::IncidentAttachmentType::INCIDENT_ATTACHMENTS,
31
+ }),
32
+ DatadogAPIClient::V2::IncidentAttachmentUpdateData.new({
33
+ id: "00000000-abcd-0003-0000-000000000000",
34
+ type: DatadogAPIClient::V2::IncidentAttachmentType::INCIDENT_ATTACHMENTS,
35
+ }),
36
+ ],
37
+ })
38
+ p api_instance.update_incident_attachments("incident_id", body)
@@ -0,0 +1,26 @@
1
+ # Create an incident attachment returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ DatadogAPIClient::V2.configure do |config|
5
+ config.unstable_operations["v2.update_incident_attachments".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::IncidentAttachmentUpdateRequest.new({
13
+ data: [
14
+ DatadogAPIClient::V2::IncidentAttachmentUpdateData.new({
15
+ type: DatadogAPIClient::V2::IncidentAttachmentType::INCIDENT_ATTACHMENTS,
16
+ attributes: DatadogAPIClient::V2::IncidentAttachmentLinkAttributes.new({
17
+ attachment_type: DatadogAPIClient::V2::IncidentAttachmentLinkAttachmentType::LINK,
18
+ attachment: DatadogAPIClient::V2::IncidentAttachmentLinkAttributesAttachmentObject.new({
19
+ document_url: "https://www.example.com/doc",
20
+ title: "Example-Create_an_incident_attachment_returns_OK_response",
21
+ }),
22
+ }),
23
+ }),
24
+ ],
25
+ })
26
+ p api_instance.update_incident_attachments(INCIDENT_DATA_ID, body)
@@ -0,0 +1,5 @@
1
+ # List active tags and aggregations returns "Success" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::MetricsAPI.new
5
+ p api_instance.list_active_metric_configurations("ExampleListactivetagsandaggregationsreturnsSuccessresponse")
@@ -1,4 +1,4 @@
1
- # List tag configurations returns "Success" response
1
+ # Get a list of metrics returns "Success" response
2
2
 
3
3
  require "datadog_api_client"
4
4
  api_instance = DatadogAPIClient::V2::MetricsAPI.new
@@ -0,0 +1,8 @@
1
+ # Get a list of metrics with a tag filter returns "Success" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::MetricsAPI.new
5
+ opts = {
6
+ filter_tags: "ExampleGetalistofmetricswithatagfilterreturnsSuccessresponse",
7
+ }
8
+ p api_instance.list_tag_configurations(opts)
@@ -1,4 +1,4 @@
1
- # List tag configurations with configured filter returns "Success" response
1
+ # Get a list of metrics with configured filter returns "Success" response
2
2
 
3
3
  require "datadog_api_client"
4
4
  api_instance = DatadogAPIClient::V2::MetricsAPI.new
@@ -3,10 +3,10 @@
3
3
  require "datadog_api_client"
4
4
  api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
5
5
 
6
- body = DatadogAPIClient::V2::SecurityMonitoringRuleCreatePayload.new({
6
+ body = DatadogAPIClient::V2::SecurityMonitoringStandardRuleCreatePayload.new({
7
7
  name: "Example-Create_a_detection_rule_returns_OK_response",
8
8
  queries: [
9
- DatadogAPIClient::V2::SecurityMonitoringRuleQueryCreate.new({
9
+ DatadogAPIClient::V2::SecurityMonitoringStandardRuleQuery.new({
10
10
  query: "@test:true",
11
11
  aggregation: DatadogAPIClient::V2::SecurityMonitoringRuleQueryAggregation::COUNT,
12
12
  group_by_fields: [],
@@ -31,5 +31,6 @@ body = DatadogAPIClient::V2::SecurityMonitoringRuleCreatePayload.new({
31
31
  message: "Test rule",
32
32
  tags: [],
33
33
  is_enabled: true,
34
+ type: DatadogAPIClient::V2::SecurityMonitoringRuleTypeCreate::LOG_DETECTION,
34
35
  })
35
36
  p api_instance.create_security_monitoring_rule(body)
@@ -3,9 +3,9 @@
3
3
  require "datadog_api_client"
4
4
  api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
5
5
 
6
- body = DatadogAPIClient::V2::SecurityMonitoringRuleCreatePayload.new({
6
+ body = DatadogAPIClient::V2::SecurityMonitoringStandardRuleCreatePayload.new({
7
7
  queries: [
8
- DatadogAPIClient::V2::SecurityMonitoringRuleQueryCreate.new({
8
+ DatadogAPIClient::V2::SecurityMonitoringStandardRuleQuery.new({
9
9
  aggregation: DatadogAPIClient::V2::SecurityMonitoringRuleQueryAggregation::GEO_DATA,
10
10
  group_by_fields: [
11
11
  "@usr.id",
@@ -3,10 +3,10 @@
3
3
  require "datadog_api_client"
4
4
  api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
5
5
 
6
- body = DatadogAPIClient::V2::SecurityMonitoringRuleCreatePayload.new({
6
+ body = DatadogAPIClient::V2::SecurityMonitoringStandardRuleCreatePayload.new({
7
7
  name: "Example-Create_a_detection_rule_with_type_workload_security_returns_OK_response",
8
8
  queries: [
9
- DatadogAPIClient::V2::SecurityMonitoringRuleQueryCreate.new({
9
+ DatadogAPIClient::V2::SecurityMonitoringStandardRuleQuery.new({
10
10
  query: "@test:true",
11
11
  aggregation: DatadogAPIClient::V2::SecurityMonitoringRuleQueryAggregation::COUNT,
12
12
  group_by_fields: [],
@@ -0,0 +1,50 @@
1
+ # Create a detection rule with type 'signal_correlation' returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
5
+
6
+ # there is a valid "security_rule" in the system
7
+ SECURITY_RULE_ID = ENV["SECURITY_RULE_ID"]
8
+
9
+ # there is a valid "security_rule_bis" in the system
10
+ SECURITY_RULE_BIS_ID = ENV["SECURITY_RULE_BIS_ID"]
11
+
12
+ body = DatadogAPIClient::V2::SecurityMonitoringSignalRuleCreatePayload.new({
13
+ name: "Example-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response_signal_rule",
14
+ queries: [
15
+ DatadogAPIClient::V2::SecurityMonitoringSignalRuleQuery.new({
16
+ rule_id: SECURITY_RULE_ID,
17
+ aggregation: DatadogAPIClient::V2::SecurityMonitoringRuleQueryAggregation::EVENT_COUNT,
18
+ correlated_by_fields: [
19
+ "host",
20
+ ],
21
+ correlated_query_index: 1,
22
+ }),
23
+ DatadogAPIClient::V2::SecurityMonitoringSignalRuleQuery.new({
24
+ rule_id: SECURITY_RULE_BIS_ID,
25
+ aggregation: DatadogAPIClient::V2::SecurityMonitoringRuleQueryAggregation::EVENT_COUNT,
26
+ correlated_by_fields: [
27
+ "host",
28
+ ],
29
+ }),
30
+ ],
31
+ filters: [],
32
+ cases: [
33
+ DatadogAPIClient::V2::SecurityMonitoringRuleCaseCreate.new({
34
+ name: "",
35
+ status: DatadogAPIClient::V2::SecurityMonitoringRuleSeverity::INFO,
36
+ condition: "a > 0 && b > 0",
37
+ notifications: [],
38
+ }),
39
+ ],
40
+ options: DatadogAPIClient::V2::SecurityMonitoringRuleOptions.new({
41
+ evaluation_window: DatadogAPIClient::V2::SecurityMonitoringRuleEvaluationWindow::FIFTEEN_MINUTES,
42
+ keep_alive: DatadogAPIClient::V2::SecurityMonitoringRuleKeepAlive::ONE_HOUR,
43
+ max_signal_duration: DatadogAPIClient::V2::SecurityMonitoringRuleMaxSignalDuration::ONE_DAY,
44
+ }),
45
+ message: "Test signal correlation rule",
46
+ tags: [],
47
+ is_enabled: true,
48
+ type: DatadogAPIClient::V2::SecurityMonitoringSignalRuleType::SIGNAL_CORRELATION,
49
+ })
50
+ p api_instance.create_security_monitoring_rule(body)
@@ -0,0 +1,5 @@
1
+ # Get a signal's details returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
5
+ p api_instance.get_security_monitoring_signal("AQAAAYNqUBVU4-rffwAAAABBWU5xVUJWVUFBQjJBd3ptMDdQUnF3QUE")
@@ -34,11 +34,12 @@ body = DatadogAPIClient::V2::SecurityMonitoringRuleUpdatePayload.new({
34
34
  }),
35
35
  }),
36
36
  queries: [
37
- DatadogAPIClient::V2::SecurityMonitoringRuleQuery.new({
37
+ DatadogAPIClient::V2::SecurityMonitoringStandardRuleQuery.new({
38
38
  aggregation: DatadogAPIClient::V2::SecurityMonitoringRuleQueryAggregation::COUNT,
39
39
  distinct_fields: [],
40
40
  group_by_fields: [],
41
41
  metrics: [],
42
+ query: "a > 3",
42
43
  }),
43
44
  ],
44
45
  tags: [],
@@ -1,8 +1,5 @@
1
1
  # Get estimated cost across your account returns "OK" response
2
2
 
3
3
  require "datadog_api_client"
4
- DatadogAPIClient::V2.configure do |config|
5
- config.unstable_operations["v2.get_estimated_cost_by_org".to_sym] = true
6
- end
7
4
  api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
8
- p api_instance.get_estimated_cost_by_org("view")
5
+ p api_instance.get_estimated_cost_by_org()
@@ -1,11 +1,9 @@
1
1
  # GetEstimatedCostByOrg with start_date returns "OK" response
2
2
 
3
3
  require "datadog_api_client"
4
- DatadogAPIClient::V2.configure do |config|
5
- config.unstable_operations["v2.get_estimated_cost_by_org".to_sym] = true
6
- end
7
4
  api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
8
5
  opts = {
6
+ view: "sub-org",
9
7
  start_date: (Time.now + -5 * 86400),
10
8
  }
11
- p api_instance.get_estimated_cost_by_org("sub-org", opts)
9
+ p api_instance.get_estimated_cost_by_org(opts)