datadog_api_client 2.23.0 → 2.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +666 -156
  4. data/.generator/schemas/v2/openapi.yaml +774 -89
  5. data/.generator/src/generator/replacement.json +1 -1
  6. data/.github/CODEOWNERS +5 -5
  7. data/CHANGELOG.md +26 -0
  8. data/examples/v1/dashboards/CreateDashboard_1213075383.rb +10 -4
  9. data/examples/v1/dashboards/CreateDashboard_2336428357.rb +10 -4
  10. data/examples/v1/dashboards/CreateDashboard_2563642929.rb +66 -0
  11. data/examples/v1/dashboards/CreateDashboard_3669695268.rb +10 -4
  12. data/examples/v1/dashboards/CreateDashboard_915214113.rb +10 -4
  13. data/examples/v1/monitors/UpdateMonitor.rb +1 -0
  14. data/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.rb +1 -0
  15. data/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.rb +9 -4
  16. data/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.rb +15 -0
  17. data/examples/v1/synthetics/CreateSyntheticsAPITest_1987645492.rb +134 -0
  18. data/examples/v2/api-management/ListAPIs.rb +8 -0
  19. data/examples/v2/csm-threats/CreateCSMThreatsAgentRule.rb +3 -0
  20. data/examples/v2/csm-threats/UpdateCloudWorkloadSecurityAgentRule.rb +1 -0
  21. data/examples/v2/organizations/GetOrgConfig.rb +5 -0
  22. data/examples/v2/organizations/ListOrgConfigs.rb +5 -0
  23. data/examples/v2/organizations/UpdateOrgConfig.rb +14 -0
  24. data/examples/v2/security-monitoring/TestExistingSecurityMonitoringRule.rb +21 -0
  25. data/examples/v2/security-monitoring/TestSecurityMonitoringRule.rb +58 -0
  26. data/examples/v2/security-monitoring/ValidateSecurityMonitoringRule.rb +1 -1
  27. data/lib/datadog_api_client/configuration.rb +1 -0
  28. data/lib/datadog_api_client/inflector.rb +37 -1
  29. data/lib/datadog_api_client/v1/api/monitors_api.rb +1 -1
  30. data/lib/datadog_api_client/v1/models/event.rb +1 -1
  31. data/lib/datadog_api_client/v1/models/formula_type.rb +26 -0
  32. data/lib/datadog_api_client/v1/models/geomap_widget_request.rb +14 -4
  33. data/lib/datadog_api_client/v1/models/group_type.rb +26 -0
  34. data/lib/datadog_api_client/v1/models/monitor.rb +1 -16
  35. data/lib/datadog_api_client/v1/models/monitor_update_request.rb +2 -23
  36. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +2 -2
  37. data/lib/datadog_api_client/v1/models/synthetics_api_step.rb +37 -180
  38. data/lib/datadog_api_client/v1/models/synthetics_api_test_step.rb +206 -0
  39. data/lib/datadog_api_client/v1/models/{synthetics_api_step_subtype.rb → synthetics_api_test_step_subtype.rb} +2 -2
  40. data/lib/datadog_api_client/v1/models/synthetics_api_wait_step.rb +148 -0
  41. data/lib/datadog_api_client/v1/models/synthetics_api_wait_step_subtype.rb +26 -0
  42. data/lib/datadog_api_client/v1/models/synthetics_assertion.rb +1 -0
  43. data/lib/datadog_api_client/v1/models/synthetics_assertion_body_hash_operator.rb +28 -0
  44. data/lib/datadog_api_client/v1/models/synthetics_assertion_body_hash_target.rb +140 -0
  45. data/lib/datadog_api_client/v1/models/synthetics_assertion_body_hash_type.rb +26 -0
  46. data/lib/datadog_api_client/v1/models/synthetics_assertion_json_path_target_target.rb +11 -1
  47. data/lib/datadog_api_client/v1/models/synthetics_test_options_monitor_options.rb +0 -4
  48. data/lib/datadog_api_client/v1/models/synthetics_test_request_body_file.rb +22 -1
  49. data/lib/datadog_api_client/v1/models/table_widget_request.rb +14 -4
  50. data/lib/datadog_api_client/v1/models/toplist_widget_request.rb +11 -1
  51. data/lib/datadog_api_client/v1/models/usage_rum_sessions_hour.rb +7 -7
  52. data/lib/datadog_api_client/v1/models/usage_rum_sessions_response.rb +2 -2
  53. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +168 -18
  54. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +169 -19
  55. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +171 -21
  56. data/lib/datadog_api_client/v1/models/widget_formula_sort.rb +144 -0
  57. data/lib/datadog_api_client/v1/models/widget_group_sort.rb +140 -0
  58. data/lib/datadog_api_client/v1/models/widget_sort_by.rb +110 -0
  59. data/lib/datadog_api_client/v1/models/widget_sort_order_by.rb +63 -0
  60. data/lib/datadog_api_client/v2/api/api_management_api.rb +80 -2
  61. data/lib/datadog_api_client/v2/api/organizations_api.rb +197 -0
  62. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +140 -1
  63. data/lib/datadog_api_client/v2/models/cloud_configuration_rule_payload.rb +240 -0
  64. data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_create_attributes.rb +13 -1
  65. data/lib/datadog_api_client/v2/models/dora_incident_request_attributes.rb +1 -1
  66. data/lib/datadog_api_client/v2/models/events_group_by.rb +5 -4
  67. data/lib/datadog_api_client/v2/models/list_apis_response.rb +92 -0
  68. data/lib/datadog_api_client/v2/models/list_apis_response_data.rb +90 -0
  69. data/lib/datadog_api_client/v2/models/list_apis_response_data_attributes.rb +80 -0
  70. data/lib/datadog_api_client/v2/models/list_apis_response_meta.rb +80 -0
  71. data/lib/datadog_api_client/v2/models/list_apis_response_meta_pagination.rb +100 -0
  72. data/lib/datadog_api_client/v2/models/org_config_get_response.rb +98 -0
  73. data/lib/datadog_api_client/v2/models/org_config_list_response.rb +100 -0
  74. data/lib/datadog_api_client/v2/models/org_config_read.rb +140 -0
  75. data/lib/datadog_api_client/v2/models/org_config_read_attributes.rb +179 -0
  76. data/lib/datadog_api_client/v2/models/org_config_type.rb +26 -0
  77. data/lib/datadog_api_client/v2/models/org_config_write.rb +119 -0
  78. data/lib/datadog_api_client/v2/models/org_config_write_attributes.rb +98 -0
  79. data/lib/datadog_api_client/v2/models/org_config_write_request.rb +98 -0
  80. data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_payload.rb +118 -0
  81. data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_payload_data.rb +120 -0
  82. data/lib/datadog_api_client/v2/models/security_monitoring_rule_test_payload.rb +62 -0
  83. data/lib/datadog_api_client/v2/models/security_monitoring_rule_test_request.rb +92 -0
  84. data/lib/datadog_api_client/v2/models/security_monitoring_rule_test_response.rb +84 -0
  85. data/lib/datadog_api_client/v2/models/security_monitoring_rule_type_test.rb +26 -0
  86. data/lib/datadog_api_client/v2/models/security_monitoring_rule_update_payload.rb +1 -1
  87. data/lib/datadog_api_client/v2/models/security_monitoring_rule_validate_payload.rb +64 -0
  88. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_payload.rb +251 -0
  89. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_create_payload.rb +1 -1
  90. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_payload.rb +263 -0
  91. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +1 -1
  92. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_test_payload.rb +263 -0
  93. data/lib/datadog_api_client/version.rb +1 -1
  94. metadata +47 -3
@@ -1 +1 @@
1
- {"IdP": "Idp", "AuthNMapping": "AuthnMapping", "AuthN ": "Authn ", "IoT": "Iot", "SLOs": "Slos"}
1
+ {"IdP": "Idp", "AuthNMapping": "AuthnMapping", "AuthN ": "Authn ", "IoT": "Iot", "SLOs": "Slos", "APIs": "Apis"}
data/.github/CODEOWNERS CHANGED
@@ -3,10 +3,10 @@
3
3
  # and another team can own the rest of the directory.
4
4
 
5
5
  # All your base
6
- * @DataDog/integrations-tools-and-libraries
6
+ * @DataDog/api-clients
7
7
 
8
8
  # Documentation
9
- *.md @DataDog/baklava @DataDog/integrations-tools-and-libraries
10
- LICENSE @DataDog/baklava @DataDog/integrations-tools-and-libraries
11
- NOTICE @DataDog/baklava @DataDog/integrations-tools-and-libraries
12
- LICENSE-3rdparty.csv @DataDog/baklava @DataDog/integrations-tools-and-libraries
9
+ *.md @DataDog/documentation @DataDog/api-clients
10
+ LICENSE @DataDog/documentation @DataDog/api-clients
11
+ NOTICE @DataDog/documentation @DataDog/api-clients
12
+ LICENSE-3rdparty.csv @DataDog/documentation @DataDog/api-clients
data/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.24.0 / 2024-07-01
4
+
5
+ ### Fixed
6
+ * Security Monitoring - Define specific payload for rule validation/testing by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1843
7
+ * Remove the maximum limitation for the synthetics renotify_interval monitor option by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1847
8
+ * Add bodyHash as a synthetics assertion type. by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1848
9
+ * Add missing attributes envelope in ListAPIs response by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1856
10
+ ### Added
11
+ * Allow the usage of the filters field when creating an agent rule by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1824
12
+ * Add tileDef sort attribute by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1826
13
+ * Add Security Monitoring rule test endpoint by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1839
14
+ * Add originalFileName field to the SyntheticsTestRequestBodyFile definition by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1844
15
+ * Add support for API management ListAPIs by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1851
16
+ * Add elementsOperator to json path assertion for synthetic HTTP tests by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1862
17
+ * Add /api/v2/org_configs specs by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1861
18
+ * Update docs for RU Rollout New and Deprecated Keys planned for Oct 1st by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1873
19
+ * Add option for wait step in multistep api tests by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1872
20
+ ### Changed
21
+ * Monitor priority can have custom ranges and be null by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1870
22
+
23
+ ## New Contributors
24
+ * @tim-chaplin-dd made their first contribution in https://github.com/DataDog/datadog-api-client-ruby/pull/1784
25
+ * @jack-edmonds-dd made their first contribution in https://github.com/DataDog/datadog-api-client-ruby/pull/1866
26
+
27
+ **Full Changelog**: https://github.com/DataDog/datadog-api-client-ruby/compare/v2.23.0...v2.24.0
28
+
3
29
  ## 2.23.0 / 2024-05-22
4
30
 
5
31
  ### Fixed
@@ -40,12 +40,18 @@ body = DatadogAPIClient::V1::Dashboard.new({
40
40
  formulas: [
41
41
  DatadogAPIClient::V1::WidgetFormula.new({
42
42
  formula: "query1",
43
- limit: DatadogAPIClient::V1::WidgetFormulaLimit.new({
44
- count: 10,
45
- order: DatadogAPIClient::V1::QuerySortOrder::DESC,
46
- }),
47
43
  }),
48
44
  ],
45
+ sort: DatadogAPIClient::V1::WidgetSortBy.new({
46
+ count: 10,
47
+ order_by: [
48
+ DatadogAPIClient::V1::WidgetFormulaSort.new({
49
+ type: DatadogAPIClient::V1::FormulaType::FORMULA,
50
+ index: 0,
51
+ order: DatadogAPIClient::V1::WidgetSort::DESCENDING,
52
+ }),
53
+ ],
54
+ }),
49
55
  response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::SCALAR,
50
56
  }),
51
57
  ],
@@ -33,14 +33,20 @@ body = DatadogAPIClient::V1::Dashboard.new({
33
33
  formulas: [
34
34
  DatadogAPIClient::V1::WidgetFormula.new({
35
35
  formula: "query1",
36
- limit: DatadogAPIClient::V1::WidgetFormulaLimit.new({
37
- count: 500,
38
- order: DatadogAPIClient::V1::QuerySortOrder::DESC,
39
- }),
40
36
  conditional_formats: [],
41
37
  cell_display_mode: DatadogAPIClient::V1::TableWidgetCellDisplayMode::BAR,
42
38
  }),
43
39
  ],
40
+ sort: DatadogAPIClient::V1::WidgetSortBy.new({
41
+ count: 500,
42
+ order_by: [
43
+ DatadogAPIClient::V1::WidgetFormulaSort.new({
44
+ type: DatadogAPIClient::V1::FormulaType::FORMULA,
45
+ index: 0,
46
+ order: DatadogAPIClient::V1::WidgetSort::DESCENDING,
47
+ }),
48
+ ],
49
+ }),
44
50
  response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::SCALAR,
45
51
  }),
46
52
  ],
@@ -0,0 +1,66 @@
1
+ # Create a new dashboard with a toplist widget sorted by group
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V1::DashboardsAPI.new
5
+
6
+ body = DatadogAPIClient::V1::Dashboard.new({
7
+ title: "Example-Dashboard",
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::ToplistWidgetDefinition.new({
18
+ title: "",
19
+ title_size: "16",
20
+ title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT,
21
+ time: DatadogAPIClient::V1::WidgetTime.new({}),
22
+ style: DatadogAPIClient::V1::ToplistWidgetStyle.new({
23
+ display: DatadogAPIClient::V1::ToplistWidgetStacked.new({
24
+ type: DatadogAPIClient::V1::ToplistWidgetStackedType::STACKED,
25
+ legend: DatadogAPIClient::V1::ToplistWidgetLegend::INLINE,
26
+ }),
27
+ scaling: DatadogAPIClient::V1::ToplistWidgetScaling::RELATIVE,
28
+ }),
29
+ type: DatadogAPIClient::V1::ToplistWidgetDefinitionType::TOPLIST,
30
+ requests: [
31
+ DatadogAPIClient::V1::ToplistWidgetRequest.new({
32
+ queries: [
33
+ DatadogAPIClient::V1::FormulaAndFunctionMetricQueryDefinition.new({
34
+ data_source: DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource::METRICS,
35
+ name: "query1",
36
+ query: "avg:system.cpu.user{*} by {service}",
37
+ aggregator: DatadogAPIClient::V1::FormulaAndFunctionMetricAggregation::AVG,
38
+ }),
39
+ ],
40
+ formulas: [
41
+ DatadogAPIClient::V1::WidgetFormula.new({
42
+ formula: "query1",
43
+ }),
44
+ ],
45
+ sort: DatadogAPIClient::V1::WidgetSortBy.new({
46
+ count: 10,
47
+ order_by: [
48
+ DatadogAPIClient::V1::WidgetGroupSort.new({
49
+ type: DatadogAPIClient::V1::GroupType::GROUP,
50
+ name: "service",
51
+ order: DatadogAPIClient::V1::WidgetSort::ASCENDING,
52
+ }),
53
+ ],
54
+ }),
55
+ response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::SCALAR,
56
+ }),
57
+ ],
58
+ }),
59
+ }),
60
+ ],
61
+ template_variables: [],
62
+ layout_type: DatadogAPIClient::V1::DashboardLayoutType::FREE,
63
+ is_read_only: false,
64
+ notify_list: [],
65
+ })
66
+ p api_instance.create_dashboard(body)
@@ -34,12 +34,18 @@ body = DatadogAPIClient::V1::Dashboard.new({
34
34
  conditional_formats: [],
35
35
  cell_display_mode: DatadogAPIClient::V1::TableWidgetCellDisplayMode::BAR,
36
36
  formula: "query1",
37
- limit: DatadogAPIClient::V1::WidgetFormulaLimit.new({
38
- count: 50,
39
- order: DatadogAPIClient::V1::QuerySortOrder::DESC,
40
- }),
41
37
  }),
42
38
  ],
39
+ sort: DatadogAPIClient::V1::WidgetSortBy.new({
40
+ count: 50,
41
+ order_by: [
42
+ DatadogAPIClient::V1::WidgetFormulaSort.new({
43
+ type: DatadogAPIClient::V1::FormulaType::FORMULA,
44
+ index: 0,
45
+ order: DatadogAPIClient::V1::WidgetSort::DESCENDING,
46
+ }),
47
+ ],
48
+ }),
43
49
  response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::SCALAR,
44
50
  }),
45
51
  ],
@@ -25,10 +25,6 @@ body = DatadogAPIClient::V1::Dashboard.new({
25
25
  formulas: [
26
26
  DatadogAPIClient::V1::WidgetFormula.new({
27
27
  formula: "query1",
28
- limit: DatadogAPIClient::V1::WidgetFormulaLimit.new({
29
- count: 250,
30
- order: DatadogAPIClient::V1::QuerySortOrder::DESC,
31
- }),
32
28
  }),
33
29
  ],
34
30
  queries: [
@@ -56,6 +52,16 @@ body = DatadogAPIClient::V1::Dashboard.new({
56
52
  ],
57
53
  }),
58
54
  ],
55
+ sort: DatadogAPIClient::V1::WidgetSortBy.new({
56
+ count: 250,
57
+ order_by: [
58
+ DatadogAPIClient::V1::WidgetFormulaSort.new({
59
+ type: DatadogAPIClient::V1::FormulaType::FORMULA,
60
+ index: 0,
61
+ order: DatadogAPIClient::V1::WidgetSort::DESCENDING,
62
+ }),
63
+ ],
64
+ }),
59
65
  response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::SCALAR,
60
66
  }),
61
67
  ],
@@ -9,6 +9,7 @@ MONITOR_NAME = ENV["MONITOR_NAME"]
9
9
 
10
10
  body = DatadogAPIClient::V1::MonitorUpdateRequest.new({
11
11
  name: "My monitor-updated",
12
+ priority: nil,
12
13
  options: DatadogAPIClient::V1::MonitorOptions.new({
13
14
  evaluation_delay: nil,
14
15
  new_group_delay: 600,
@@ -72,6 +72,7 @@ body = DatadogAPIClient::V1::SyntheticsAPITest.new({
72
72
  files: [
73
73
  DatadogAPIClient::V1::SyntheticsTestRequestBodyFile.new({
74
74
  name: "file name",
75
+ original_file_name: "image.png",
75
76
  content: "file content",
76
77
  type: "file type",
77
78
  }),
@@ -14,7 +14,7 @@ body = DatadogAPIClient::V1::SyntheticsAPITest.new({
14
14
  }),
15
15
  ],
16
16
  steps: [
17
- DatadogAPIClient::V1::SyntheticsAPIStep.new({
17
+ DatadogAPIClient::V1::SyntheticsAPITestStep.new({
18
18
  allow_failure: true,
19
19
  assertions: [
20
20
  DatadogAPIClient::V1::SyntheticsAssertionTarget.new({
@@ -46,11 +46,16 @@ body = DatadogAPIClient::V1::SyntheticsAPITest.new({
46
46
  count: 5,
47
47
  interval: 1000,
48
48
  }),
49
- subtype: DatadogAPIClient::V1::SyntheticsAPIStepSubtype::HTTP,
49
+ subtype: DatadogAPIClient::V1::SyntheticsAPITestStepSubtype::HTTP,
50
50
  }),
51
- DatadogAPIClient::V1::SyntheticsAPIStep.new({
51
+ DatadogAPIClient::V1::SyntheticsAPIWaitStep.new({
52
+ name: "Wait",
53
+ subtype: DatadogAPIClient::V1::SyntheticsAPIWaitStepSubtype::WAIT,
54
+ value: 1,
55
+ }),
56
+ DatadogAPIClient::V1::SyntheticsAPITestStep.new({
52
57
  name: "GRPC CALL",
53
- subtype: DatadogAPIClient::V1::SyntheticsAPIStepSubtype::GRPC,
58
+ subtype: DatadogAPIClient::V1::SyntheticsAPITestStepSubtype::GRPC,
54
59
  extracted_values: [],
55
60
  allow_failure: false,
56
61
  is_critical: true,
@@ -27,6 +27,16 @@ body = DatadogAPIClient::V1::SyntheticsAPITest.new({
27
27
  }),
28
28
  type: DatadogAPIClient::V1::SyntheticsAssertionType::BODY,
29
29
  }),
30
+ DatadogAPIClient::V1::SyntheticsAssertionJSONPathTarget.new({
31
+ operator: DatadogAPIClient::V1::SyntheticsAssertionJSONPathOperator::VALIDATES_JSON_PATH,
32
+ target: DatadogAPIClient::V1::SyntheticsAssertionJSONPathTargetTarget.new({
33
+ elements_operator: "atLeastOneElementMatches",
34
+ json_path: "topKey",
35
+ operator: "isNot",
36
+ target_value: "0",
37
+ }),
38
+ type: DatadogAPIClient::V1::SyntheticsAssertionType::BODY,
39
+ }),
30
40
  DatadogAPIClient::V1::SyntheticsAssertionJSONSchemaTarget.new({
31
41
  operator: DatadogAPIClient::V1::SyntheticsAssertionJSONSchemaOperator::VALIDATES_JSON_SCHEMA,
32
42
  target: DatadogAPIClient::V1::SyntheticsAssertionJSONSchemaTargetTarget.new({
@@ -44,6 +54,11 @@ body = DatadogAPIClient::V1::SyntheticsAPITest.new({
44
54
  }),
45
55
  type: DatadogAPIClient::V1::SyntheticsAssertionType::BODY,
46
56
  }),
57
+ DatadogAPIClient::V1::SyntheticsAssertionBodyHashTarget.new({
58
+ operator: DatadogAPIClient::V1::SyntheticsAssertionBodyHashOperator::MD5,
59
+ target: "a",
60
+ type: DatadogAPIClient::V1::SyntheticsAssertionBodyHashType::BODY_HASH,
61
+ }),
47
62
  ],
48
63
  config_variables: [
49
64
  DatadogAPIClient::V1::SyntheticsConfigVariable.new({
@@ -0,0 +1,134 @@
1
+ # Create an API HTTP test has bodyHash filled out
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V1::SyntheticsAPI.new
5
+
6
+ body = DatadogAPIClient::V1::SyntheticsAPITest.new({
7
+ config: DatadogAPIClient::V1::SyntheticsAPITestConfig.new({
8
+ assertions: [
9
+ DatadogAPIClient::V1::SyntheticsAssertionTarget.new({
10
+ operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::IS,
11
+ property: "{{ PROPERTY }}",
12
+ target: "text/html",
13
+ type: DatadogAPIClient::V1::SyntheticsAssertionType::HEADER,
14
+ }),
15
+ DatadogAPIClient::V1::SyntheticsAssertionTarget.new({
16
+ operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::LESS_THAN,
17
+ target: 2000,
18
+ type: DatadogAPIClient::V1::SyntheticsAssertionType::RESPONSE_TIME,
19
+ timings_scope: DatadogAPIClient::V1::SyntheticsAssertionTimingsScope::WITHOUT_DNS,
20
+ }),
21
+ DatadogAPIClient::V1::SyntheticsAssertionJSONPathTarget.new({
22
+ operator: DatadogAPIClient::V1::SyntheticsAssertionJSONPathOperator::VALIDATES_JSON_PATH,
23
+ target: DatadogAPIClient::V1::SyntheticsAssertionJSONPathTargetTarget.new({
24
+ json_path: "topKey",
25
+ operator: "isNot",
26
+ target_value: "0",
27
+ }),
28
+ type: DatadogAPIClient::V1::SyntheticsAssertionType::BODY,
29
+ }),
30
+ DatadogAPIClient::V1::SyntheticsAssertionJSONPathTarget.new({
31
+ operator: DatadogAPIClient::V1::SyntheticsAssertionJSONPathOperator::VALIDATES_JSON_PATH,
32
+ target: DatadogAPIClient::V1::SyntheticsAssertionJSONPathTargetTarget.new({
33
+ elements_operator: "atLeastOneElementMatches",
34
+ json_path: "topKey",
35
+ operator: "isNot",
36
+ target_value: "0",
37
+ }),
38
+ type: DatadogAPIClient::V1::SyntheticsAssertionType::BODY,
39
+ }),
40
+ DatadogAPIClient::V1::SyntheticsAssertionJSONSchemaTarget.new({
41
+ operator: DatadogAPIClient::V1::SyntheticsAssertionJSONSchemaOperator::VALIDATES_JSON_SCHEMA,
42
+ target: DatadogAPIClient::V1::SyntheticsAssertionJSONSchemaTargetTarget.new({
43
+ meta_schema: DatadogAPIClient::V1::SyntheticsAssertionJSONSchemaMetaSchema::DRAFT_07,
44
+ json_schema: '{"type": "object", "properties":{"slideshow":{"type":"object"}}}',
45
+ }),
46
+ type: DatadogAPIClient::V1::SyntheticsAssertionType::BODY,
47
+ }),
48
+ DatadogAPIClient::V1::SyntheticsAssertionXPathTarget.new({
49
+ operator: DatadogAPIClient::V1::SyntheticsAssertionXPathOperator::VALIDATES_X_PATH,
50
+ target: DatadogAPIClient::V1::SyntheticsAssertionXPathTargetTarget.new({
51
+ x_path: "target-xpath",
52
+ target_value: "0",
53
+ operator: "contains",
54
+ }),
55
+ type: DatadogAPIClient::V1::SyntheticsAssertionType::BODY,
56
+ }),
57
+ DatadogAPIClient::V1::SyntheticsAssertionBodyHashTarget.new({
58
+ operator: DatadogAPIClient::V1::SyntheticsAssertionBodyHashOperator::MD5,
59
+ target: "a",
60
+ type: DatadogAPIClient::V1::SyntheticsAssertionBodyHashType::BODY_HASH,
61
+ }),
62
+ ],
63
+ config_variables: [
64
+ DatadogAPIClient::V1::SyntheticsConfigVariable.new({
65
+ example: "content-type",
66
+ name: "PROPERTY",
67
+ pattern: "content-type",
68
+ type: DatadogAPIClient::V1::SyntheticsConfigVariableType::TEXT,
69
+ }),
70
+ ],
71
+ variables_from_script: 'dd.variable.set("FOO", "foo")',
72
+ request: DatadogAPIClient::V1::SyntheticsTestRequest.new({
73
+ certificate: DatadogAPIClient::V1::SyntheticsTestRequestCertificate.new({
74
+ cert: DatadogAPIClient::V1::SyntheticsTestRequestCertificateItem.new({
75
+ content: "cert-content",
76
+ filename: "cert-filename",
77
+ updated_at: "2020-10-16T09:23:24.857Z",
78
+ }),
79
+ key: DatadogAPIClient::V1::SyntheticsTestRequestCertificateItem.new({
80
+ content: "key-content",
81
+ filename: "key-filename",
82
+ updated_at: "2020-10-16T09:23:24.857Z",
83
+ }),
84
+ }),
85
+ headers: {
86
+ unique: "examplesynthetic",
87
+ },
88
+ method: "GET",
89
+ timeout: 10,
90
+ url: "https://datadoghq.com",
91
+ proxy: DatadogAPIClient::V1::SyntheticsTestRequestProxy.new({
92
+ url: "https://datadoghq.com",
93
+ headers: {},
94
+ }),
95
+ basic_auth: DatadogAPIClient::V1::SyntheticsBasicAuthOauthClient.new({
96
+ access_token_url: "https://datadog-token.com",
97
+ audience: "audience",
98
+ client_id: "client-id",
99
+ client_secret: "client-secret",
100
+ resource: "resource",
101
+ scope: "yoyo",
102
+ token_api_authentication: DatadogAPIClient::V1::SyntheticsBasicAuthOauthTokenApiAuthentication::HEADER,
103
+ type: DatadogAPIClient::V1::SyntheticsBasicAuthOauthClientType::OAUTH_CLIENT,
104
+ }),
105
+ persist_cookies: true,
106
+ }),
107
+ }),
108
+ locations: [
109
+ "aws:us-east-2",
110
+ ],
111
+ message: "BDD test payload: synthetics_api_http_test_payload.json",
112
+ name: "Example-Synthetic",
113
+ options: DatadogAPIClient::V1::SyntheticsTestOptions.new({
114
+ accept_self_signed: false,
115
+ allow_insecure: true,
116
+ follow_redirects: true,
117
+ min_failure_duration: 10,
118
+ min_location_failed: 1,
119
+ monitor_name: "Example-Synthetic",
120
+ monitor_priority: 5,
121
+ _retry: DatadogAPIClient::V1::SyntheticsTestOptionsRetry.new({
122
+ count: 3,
123
+ interval: 10,
124
+ }),
125
+ tick_every: 60,
126
+ http_version: DatadogAPIClient::V1::SyntheticsTestOptionsHTTPVersion::HTTP2,
127
+ }),
128
+ subtype: DatadogAPIClient::V1::SyntheticsTestDetailsSubType::HTTP,
129
+ tags: [
130
+ "testing:api",
131
+ ],
132
+ type: DatadogAPIClient::V1::SyntheticsAPITestType::API,
133
+ })
134
+ p api_instance.create_synthetics_api_test(body)
@@ -0,0 +1,8 @@
1
+ # List APIs returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ DatadogAPIClient.configure do |config|
5
+ config.unstable_operations["v2.list_apis".to_sym] = true
6
+ end
7
+ api_instance = DatadogAPIClient::V2::APIManagementAPI.new
8
+ p api_instance.list_apis()
@@ -9,6 +9,9 @@ body = DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleCreateRequest.new({
9
9
  description: "My Agent rule",
10
10
  enabled: true,
11
11
  expression: 'exec.file.name == "sh"',
12
+ filters: [
13
+ 'os == "linux"',
14
+ ],
12
15
  name: "examplecsmthreat",
13
16
  }),
14
17
  type: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
@@ -14,6 +14,7 @@ body = DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleUpdateRequest.new({
14
14
  expression: 'exec.file.name == "sh"',
15
15
  }),
16
16
  type: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
17
+ id: AGENT_RULE_DATA_ID,
17
18
  }),
18
19
  })
19
20
  p api_instance.update_cloud_workload_security_agent_rule(AGENT_RULE_DATA_ID, body)
@@ -0,0 +1,5 @@
1
+ # Get a specific Org Config value returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::OrganizationsAPI.new
5
+ p api_instance.get_org_config("custom_roles")
@@ -0,0 +1,5 @@
1
+ # List Org Configs returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::OrganizationsAPI.new
5
+ p api_instance.list_org_configs()
@@ -0,0 +1,14 @@
1
+ # Update a specific Org Config returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::OrganizationsAPI.new
5
+
6
+ body = DatadogAPIClient::V2::OrgConfigWriteRequest.new({
7
+ data: DatadogAPIClient::V2::OrgConfigWrite.new({
8
+ attributes: DatadogAPIClient::V2::OrgConfigWriteAttributes.new({
9
+ value: "UTC",
10
+ }),
11
+ type: DatadogAPIClient::V2::OrgConfigType::ORG_CONFIGS,
12
+ }),
13
+ })
14
+ p api_instance.update_org_config("monitor_timezone", body)
@@ -0,0 +1,21 @@
1
+ # Test an existing rule returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
5
+
6
+ body = DatadogAPIClient::V2::SecurityMonitoringRuleTestRequest.new({
7
+ rule_query_payloads: [
8
+ DatadogAPIClient::V2::SecurityMonitoringRuleQueryPayload.new({
9
+ expected_result: true,
10
+ index: 0,
11
+ payload: DatadogAPIClient::V2::SecurityMonitoringRuleQueryPayloadData.new({
12
+ ddsource: "nginx",
13
+ ddtags: "env:staging,version:5.1",
14
+ hostname: "i-012345678",
15
+ message: "2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World",
16
+ service: "payment",
17
+ }),
18
+ }),
19
+ ],
20
+ })
21
+ p api_instance.test_existing_security_monitoring_rule("rule_id", body)
@@ -0,0 +1,58 @@
1
+ # Test a rule returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
5
+
6
+ body = DatadogAPIClient::V2::SecurityMonitoringRuleTestRequest.new({
7
+ rule: DatadogAPIClient::V2::SecurityMonitoringStandardRuleTestPayload.new({
8
+ cases: [
9
+ DatadogAPIClient::V2::SecurityMonitoringRuleCaseCreate.new({
10
+ name: "",
11
+ status: DatadogAPIClient::V2::SecurityMonitoringRuleSeverity::INFO,
12
+ notifications: [],
13
+ condition: "a > 0",
14
+ }),
15
+ ],
16
+ has_extended_title: true,
17
+ is_enabled: true,
18
+ message: "My security monitoring rule message.",
19
+ name: "My security monitoring rule.",
20
+ options: DatadogAPIClient::V2::SecurityMonitoringRuleOptions.new({
21
+ decrease_criticality_based_on_env: false,
22
+ detection_method: DatadogAPIClient::V2::SecurityMonitoringRuleDetectionMethod::THRESHOLD,
23
+ evaluation_window: DatadogAPIClient::V2::SecurityMonitoringRuleEvaluationWindow::ZERO_MINUTES,
24
+ keep_alive: DatadogAPIClient::V2::SecurityMonitoringRuleKeepAlive::ZERO_MINUTES,
25
+ max_signal_duration: DatadogAPIClient::V2::SecurityMonitoringRuleMaxSignalDuration::ZERO_MINUTES,
26
+ }),
27
+ queries: [
28
+ DatadogAPIClient::V2::SecurityMonitoringStandardRuleQuery.new({
29
+ query: "source:source_here",
30
+ group_by_fields: [
31
+ "@userIdentity.assumed_role",
32
+ ],
33
+ distinct_fields: [],
34
+ aggregation: DatadogAPIClient::V2::SecurityMonitoringRuleQueryAggregation::COUNT,
35
+ name: "",
36
+ }),
37
+ ],
38
+ tags: [
39
+ "env:prod",
40
+ "team:security",
41
+ ],
42
+ type: DatadogAPIClient::V2::SecurityMonitoringRuleTypeTest::LOG_DETECTION,
43
+ }),
44
+ rule_query_payloads: [
45
+ DatadogAPIClient::V2::SecurityMonitoringRuleQueryPayload.new({
46
+ expected_result: true,
47
+ index: 0,
48
+ payload: DatadogAPIClient::V2::SecurityMonitoringRuleQueryPayloadData.new({
49
+ ddsource: "source_here",
50
+ ddtags: "env:staging,version:5.1",
51
+ hostname: "i-012345678",
52
+ message: "2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World",
53
+ service: "payment",
54
+ }),
55
+ }),
56
+ ],
57
+ })
58
+ p api_instance.test_security_monitoring_rule(body)
@@ -3,7 +3,7 @@
3
3
  require "datadog_api_client"
4
4
  api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
5
5
 
6
- body = DatadogAPIClient::V2::SecurityMonitoringStandardRuleCreatePayload.new({
6
+ body = DatadogAPIClient::V2::SecurityMonitoringStandardRulePayload.new({
7
7
  cases: [
8
8
  DatadogAPIClient::V2::SecurityMonitoringRuleCaseCreate.new({
9
9
  name: "",
@@ -192,6 +192,7 @@ module DatadogAPIClient
192
192
  "v2.create_open_api": false,
193
193
  "v2.delete_open_api": false,
194
194
  "v2.get_open_api": false,
195
+ "v2.list_apis": false,
195
196
  "v2.update_open_api": false,
196
197
  "v2.get_active_billing_dimensions": false,
197
198
  "v2.get_monthly_cost_attribution": false,