datadog_api_client 2.17.0 → 2.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.apigentools-info +4 -4
- data/.generator/schemas/v1/openapi.yaml +145 -5
- data/.generator/schemas/v2/openapi.yaml +1306 -45
- data/.generator/src/generator/cli.py +5 -0
- data/.generator/src/generator/templates/datadog_api_client.j2 +19 -0
- data/.pre-commit-config.yaml +1 -1
- data/CHANGELOG.md +25 -0
- data/examples/v1/aws-integration/CreateAWSAccount.rb +2 -2
- data/examples/v1/aws-integration/DeleteAWSAccount.rb +1 -1
- data/examples/v1/aws-integration/UpdateAWSAccount.rb +6 -6
- data/examples/v1/azure-integration/CreateAzureIntegration.rb +1 -0
- data/examples/v1/azure-integration/DeleteAzureIntegration.rb +1 -0
- data/examples/v1/azure-integration/UpdateAzureHostFilters.rb +1 -0
- data/examples/v1/azure-integration/UpdateAzureIntegration.rb +1 -0
- data/examples/v1/dashboards/CreateDashboard_1284514532.rb +3 -0
- data/examples/v1/synthetics/PatchTest.rb +22 -0
- data/examples/v2/container-images/ListContainerImages.rb +0 -3
- data/examples/v2/container-images/ListContainerImages_3088586393.rb +0 -3
- data/examples/v2/container-images/ListContainerImages_3974828736.rb +0 -3
- data/examples/v2/containers/ListContainers.rb +0 -3
- data/examples/v2/containers/ListContainers_2175733917.rb +0 -3
- data/examples/v2/containers/ListContainers_931009654.rb +0 -3
- data/examples/v2/dora-metrics/CreateDORADeployment.rb +23 -0
- data/examples/v2/dora-metrics/CreateDORAIncident.rb +25 -0
- data/examples/v2/events/ListEvents.rb +0 -3
- data/examples/v2/events/ListEvents_1527584014.rb +0 -3
- data/examples/v2/events/ListEvents_2663715109.rb +0 -3
- data/examples/v2/events/SearchEvents.rb +0 -3
- data/examples/v2/events/SearchEvents_3856995058.rb +0 -3
- data/examples/v2/okta-integration/CreateOktaAccount.rb +19 -0
- data/examples/v2/okta-integration/DeleteOktaAccount.rb +5 -0
- data/examples/v2/okta-integration/GetOktaAccount.rb +8 -0
- data/examples/v2/okta-integration/ListOktaAccounts.rb +5 -0
- data/examples/v2/okta-integration/UpdateOktaAccount.rb +20 -0
- data/examples/v2/usage-metering/GetActiveBillingDimensions.rb +8 -0
- data/examples/v2/usage-metering/GetMonthlyCostAttribution.rb +8 -0
- data/examples/v2/usage-metering/GetProjectedCost.rb +8 -0
- data/lib/datadog_api_client/configuration.rb +4 -4
- data/lib/datadog_api_client/inflector.rb +61 -0
- data/lib/datadog_api_client/v1/api/hosts_api.rb +1 -1
- data/lib/datadog_api_client/v1/api/synthetics_api.rb +73 -1
- data/lib/datadog_api_client/v1/models/azure_account.rb +13 -2
- data/lib/datadog_api_client/v1/models/synthetics_patch_test_body.rb +82 -0
- data/lib/datadog_api_client/v1/models/synthetics_patch_test_operation.rb +100 -0
- data/lib/datadog_api_client/v1/models/synthetics_patch_test_operation_name.rb +31 -0
- data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +21 -1
- data/lib/datadog_api_client/v1/models/usage_summary_response.rb +21 -1
- data/lib/datadog_api_client/v1/models/widget_live_span.rb +2 -0
- data/lib/datadog_api_client/v2/api/container_images_api.rb +0 -6
- data/lib/datadog_api_client/v2/api/containers_api.rb +0 -6
- data/lib/datadog_api_client/v2/api/dora_metrics_api.rb +181 -0
- data/lib/datadog_api_client/v2/api/events_api.rb +0 -12
- data/lib/datadog_api_client/v2/api/okta_integration_api.rb +355 -0
- data/lib/datadog_api_client/v2/api/usage_metering_api.rb +241 -0
- data/lib/datadog_api_client/v2/models/active_billing_dimensions_attributes.rb +92 -0
- data/lib/datadog_api_client/v2/models/active_billing_dimensions_body.rb +100 -0
- data/lib/datadog_api_client/v2/models/active_billing_dimensions_response.rb +80 -0
- data/lib/datadog_api_client/v2/models/active_billing_dimensions_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/api_keys_response.rb +14 -4
- data/lib/datadog_api_client/v2/models/api_keys_response_meta.rb +90 -0
- data/lib/datadog_api_client/v2/models/api_keys_response_meta_page.rb +80 -0
- data/lib/datadog_api_client/v2/models/application_key_response_meta.rb +90 -0
- data/lib/datadog_api_client/v2/models/application_key_response_meta_page.rb +80 -0
- data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_attributes.rb +13 -1
- data/lib/datadog_api_client/v2/models/cost_attribution_aggregates_body.rb +100 -0
- data/lib/datadog_api_client/v2/models/cost_attribution_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/dora_deployment_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/dora_deployment_request_attributes.rb +170 -0
- data/lib/datadog_api_client/v2/models/dora_deployment_request_data.rb +98 -0
- data/lib/datadog_api_client/v2/models/dora_deployment_response.rb +98 -0
- data/lib/datadog_api_client/v2/models/dora_deployment_response_data.rb +108 -0
- data/lib/datadog_api_client/v2/models/dora_deployment_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/dora_git_info.rb +125 -0
- data/lib/datadog_api_client/v2/models/dora_incident_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/dora_incident_request_attributes.rb +179 -0
- data/lib/datadog_api_client/v2/models/dora_incident_request_data.rb +98 -0
- data/lib/datadog_api_client/v2/models/dora_incident_response.rb +98 -0
- data/lib/datadog_api_client/v2/models/dora_incident_response_data.rb +108 -0
- data/lib/datadog_api_client/v2/models/dora_incident_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/full_api_key_attributes.rb +24 -4
- data/lib/datadog_api_client/v2/models/incident_attachment_link_attributes.rb +14 -4
- data/lib/datadog_api_client/v2/models/incident_create_relationships.rb +9 -19
- data/lib/datadog_api_client/v2/models/incident_impacts_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/incident_integration_metadata_attributes.rb +21 -1
- data/lib/datadog_api_client/v2/models/incident_integration_metadata_response_data.rb +11 -1
- data/lib/datadog_api_client/v2/models/incident_integration_relationships.rb +90 -0
- data/lib/datadog_api_client/v2/models/incident_non_datadog_creator.rb +90 -0
- data/lib/datadog_api_client/v2/models/incident_responders_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/incident_response_attributes.rb +69 -4
- data/lib/datadog_api_client/v2/models/incident_response_relationships.rb +42 -4
- data/lib/datadog_api_client/v2/models/incident_severity.rb +31 -0
- data/lib/datadog_api_client/v2/models/incident_todo_attributes.rb +24 -4
- data/lib/datadog_api_client/v2/models/incident_todo_relationships.rb +90 -0
- data/lib/datadog_api_client/v2/models/incident_todo_response_data.rb +11 -1
- data/lib/datadog_api_client/v2/models/incident_update_relationships.rb +8 -0
- data/lib/datadog_api_client/v2/models/incident_user_defined_field_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/list_application_keys_response.rb +14 -4
- data/lib/datadog_api_client/v2/models/monthly_cost_attribution_attributes.rb +151 -0
- data/lib/datadog_api_client/v2/models/monthly_cost_attribution_body.rb +100 -0
- data/lib/datadog_api_client/v2/models/monthly_cost_attribution_meta.rb +92 -0
- data/lib/datadog_api_client/v2/models/monthly_cost_attribution_pagination.rb +88 -0
- data/lib/datadog_api_client/v2/models/monthly_cost_attribution_response.rb +92 -0
- data/lib/datadog_api_client/v2/models/okta_account.rb +129 -0
- data/lib/datadog_api_client/v2/models/okta_account_attributes.rb +170 -0
- data/lib/datadog_api_client/v2/models/okta_account_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/okta_account_response.rb +80 -0
- data/lib/datadog_api_client/v2/models/okta_account_response_data.rb +140 -0
- data/lib/datadog_api_client/v2/models/okta_account_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/okta_account_update_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/okta_account_update_request_attributes.rb +149 -0
- data/lib/datadog_api_client/v2/models/okta_account_update_request_data.rb +90 -0
- data/lib/datadog_api_client/v2/models/okta_accounts_response.rb +82 -0
- data/lib/datadog_api_client/v2/models/partial_api_key_attributes.rb +24 -4
- data/lib/datadog_api_client/v2/models/powerpack_relationships.rb +2 -2
- data/lib/datadog_api_client/v2/models/powerpacks_response_meta_pagination.rb +8 -0
- data/lib/datadog_api_client/v2/models/projected_cost.rb +100 -0
- data/lib/datadog_api_client/v2/models/projected_cost_attributes.rb +132 -0
- data/lib/datadog_api_client/v2/models/projected_cost_response.rb +82 -0
- data/lib/datadog_api_client/v2/models/projected_cost_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/relationship_to_incident_impact_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/relationship_to_incident_impacts.rb +100 -0
- data/lib/datadog_api_client/v2/models/relationship_to_incident_responder_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/relationship_to_incident_responders.rb +100 -0
- data/lib/datadog_api_client/v2/models/relationship_to_incident_user_defined_field_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/relationship_to_incident_user_defined_fields.rb +100 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_type_create.rb +1 -0
- data/lib/datadog_api_client/v2/models/sensitive_data_scanner_standard_pattern_attributes.rb +13 -1
- data/lib/datadog_api_client/v2/models/sort_direction.rb +27 -0
- data/lib/datadog_api_client/version.rb +1 -1
- data/lib/datadog_api_client.rb +16 -1
- metadata +75 -2
@@ -55,6 +55,7 @@ def cli(specs, output):
|
|
55
55
|
api_j2 = env.get_template("api.j2")
|
56
56
|
model_j2 = env.get_template("model.j2")
|
57
57
|
package_j2 = env.get_template("package.j2")
|
58
|
+
datadog_api_client_j2 = env.get_template("datadog_api_client.j2")
|
58
59
|
|
59
60
|
extra_files = {
|
60
61
|
"model_base.rb": env.get_template("model_base.j2"),
|
@@ -120,6 +121,10 @@ def cli(specs, output):
|
|
120
121
|
with filename.open("w") as fp:
|
121
122
|
fp.write(template.render(all_apis=all_apis, all_specs=all_specs, all_models=all_models))
|
122
123
|
|
124
|
+
datadog_api_client_output = output / "datadog_api_client.rb"
|
125
|
+
with datadog_api_client_output.open("w") as fp:
|
126
|
+
fp.write(datadog_api_client_j2.render(all_apis=all_apis))
|
127
|
+
|
123
128
|
# Parameter mappings for bdd tests
|
124
129
|
scenarios_test_output = pathlib.Path("../features/")
|
125
130
|
for name, template in test_scenarios_files.items():
|
@@ -0,0 +1,19 @@
|
|
1
|
+
=begin
|
2
|
+
{% include "api_info.j2" %}
|
3
|
+
=end
|
4
|
+
|
5
|
+
require 'datadog_api_client/models'
|
6
|
+
require_relative 'datadog_api_client/inflector'
|
7
|
+
|
8
|
+
loader = Zeitwerk::Loader.new
|
9
|
+
loader.tag = File.basename(__FILE__, ".rb")
|
10
|
+
loader.collapse("#{__dir__}/datadog_api_client/*/models/")
|
11
|
+
loader.collapse("#{__dir__}/datadog_api_client/*/api/")
|
12
|
+
|
13
|
+
{%- for version, apis in all_apis.items() %}
|
14
|
+
loader.push_dir("#{__dir__}/datadog_api_client/{{ version }}", namespace: DatadogAPIClient::{{ version|upper }})
|
15
|
+
{%- endfor %}
|
16
|
+
# Ignore model_base.rb from being loaded in by zeitwerk as it is loaded in by default
|
17
|
+
loader.ignore("#{__dir__}/datadog_api_client/*/model_base.rb")
|
18
|
+
loader.inflector = {{ module_name }}::{{ module_name }}Inflector.new
|
19
|
+
loader.setup
|
data/.pre-commit-config.yaml
CHANGED
@@ -5,7 +5,7 @@ repos:
|
|
5
5
|
name: Generate
|
6
6
|
language: system
|
7
7
|
entry: bash -c "./generate.sh"
|
8
|
-
files: '^(\.generator/.*|\.pre-commit-config\.yaml|Makefile|\features/.*)'
|
8
|
+
files: '^(\.generator/.*|\.pre-commit-config\.yaml|Makefile|\features/.*|lib/.*)'
|
9
9
|
pass_filenames: false
|
10
10
|
- id: format-examples
|
11
11
|
name: Format generated examples
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,30 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 2.18.0 / 2023-12-12
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
* Fix Powerpack schema by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1613
|
7
|
+
### Added
|
8
|
+
* Add support for projected-cost endpoint by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1598
|
9
|
+
* Document missing incident fields by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1617
|
10
|
+
* Add active billing dimensions to usage metering by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1637
|
11
|
+
* Add Cost Attribution To Usage Metering Public Beta Documentation by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1622
|
12
|
+
* Update spec to include new DORA API endpoints by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1636
|
13
|
+
* Add support to patch Synthetics test with partial data using JSON Patch by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1630
|
14
|
+
* Document new api/app key schemas by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1616
|
15
|
+
* Document new field `filters` for `CloudWorkloadSecurityAgentRule` by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1638
|
16
|
+
* Live and historical custom timeseries docs by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1628
|
17
|
+
* Add week_to_date and month_to_date to widget livespan by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1631
|
18
|
+
* Document `included_keywords` in `ListStandardPatterns` response by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1641
|
19
|
+
* Document fields `remote_config_read_enabled` and `category` by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1639
|
20
|
+
* Update Azure Spec to include Resource Collection by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1646
|
21
|
+
* Allow creation of Application Security detection rules from the v2 API by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1648
|
22
|
+
* Add Okta Integration APIs by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1629
|
23
|
+
* Remove unstable flag for Events v2 api by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1653
|
24
|
+
|
25
|
+
|
26
|
+
**Full Changelog**: https://github.com/DataDog/datadog-api-client-ruby/compare/v2.17.0...v2.18.0
|
27
|
+
|
3
28
|
## 2.17.0 / 2023-11-15
|
4
29
|
|
5
30
|
### Fixed
|
@@ -4,9 +4,9 @@ require "datadog_api_client"
|
|
4
4
|
api_instance = DatadogAPIClient::V1::AWSIntegrationAPI.new
|
5
5
|
|
6
6
|
body = DatadogAPIClient::V1::AWSAccount.new({
|
7
|
-
account_id: "
|
7
|
+
account_id: "163662907100",
|
8
8
|
account_specific_namespace_rules: {
|
9
|
-
auto_scaling: false,
|
9
|
+
auto_scaling: false,
|
10
10
|
},
|
11
11
|
cspm_resource_collection_enabled: true,
|
12
12
|
excluded_regions: [
|
@@ -4,7 +4,7 @@ require "datadog_api_client"
|
|
4
4
|
api_instance = DatadogAPIClient::V1::AWSIntegrationAPI.new
|
5
5
|
|
6
6
|
body = DatadogAPIClient::V1::AWSAccountDeleteRequest.new({
|
7
|
-
account_id: "
|
7
|
+
account_id: "163662907100",
|
8
8
|
role_name: "DatadogAWSIntegrationRole",
|
9
9
|
})
|
10
10
|
p api_instance.delete_aws_account(body)
|
@@ -4,11 +4,11 @@ require "datadog_api_client"
|
|
4
4
|
api_instance = DatadogAPIClient::V1::AWSIntegrationAPI.new
|
5
5
|
|
6
6
|
body = DatadogAPIClient::V1::AWSAccount.new({
|
7
|
-
account_id: "
|
7
|
+
account_id: "163662907100",
|
8
8
|
account_specific_namespace_rules: {
|
9
9
|
auto_scaling: false,
|
10
10
|
},
|
11
|
-
cspm_resource_collection_enabled:
|
11
|
+
cspm_resource_collection_enabled: false,
|
12
12
|
excluded_regions: [
|
13
13
|
"us-east-1",
|
14
14
|
"us-west-2",
|
@@ -19,12 +19,12 @@ body = DatadogAPIClient::V1::AWSAccount.new({
|
|
19
19
|
host_tags: [
|
20
20
|
"$KEY:$VALUE",
|
21
21
|
],
|
22
|
-
metrics_collection_enabled:
|
22
|
+
metrics_collection_enabled: true,
|
23
23
|
resource_collection_enabled: true,
|
24
|
-
role_name: "
|
24
|
+
role_name: "DatadogAWSIntegrationRole",
|
25
25
|
})
|
26
26
|
opts = {
|
27
|
-
account_id: "
|
28
|
-
role_name: "
|
27
|
+
account_id: "163662907100",
|
28
|
+
role_name: "DatadogAWSIntegrationRole",
|
29
29
|
}
|
30
30
|
p api_instance.update_aws_account(body, opts)
|
@@ -17,6 +17,7 @@ body = DatadogAPIClient::V1::AzureAccount.new({
|
|
17
17
|
host_filters: "key:value,filter:example",
|
18
18
|
new_client_id: "new1c7f6-1234-5678-9101-3fcbf464test",
|
19
19
|
new_tenant_name: "new1c44-1234-5678-9101-cc00736ftest",
|
20
|
+
resource_collection_enabled: true,
|
20
21
|
tenant_name: "testc44-1234-5678-9101-cc00736ftest",
|
21
22
|
})
|
22
23
|
p api_instance.create_azure_integration(body)
|
@@ -17,6 +17,7 @@ body = DatadogAPIClient::V1::AzureAccount.new({
|
|
17
17
|
host_filters: "key:value,filter:example",
|
18
18
|
new_client_id: "new1c7f6-1234-5678-9101-3fcbf464test",
|
19
19
|
new_tenant_name: "new1c44-1234-5678-9101-cc00736ftest",
|
20
|
+
resource_collection_enabled: true,
|
20
21
|
tenant_name: "testc44-1234-5678-9101-cc00736ftest",
|
21
22
|
})
|
22
23
|
p api_instance.delete_azure_integration(body)
|
@@ -17,6 +17,7 @@ body = DatadogAPIClient::V1::AzureAccount.new({
|
|
17
17
|
host_filters: "key:value,filter:example",
|
18
18
|
new_client_id: "new1c7f6-1234-5678-9101-3fcbf464test",
|
19
19
|
new_tenant_name: "new1c44-1234-5678-9101-cc00736ftest",
|
20
|
+
resource_collection_enabled: true,
|
20
21
|
tenant_name: "testc44-1234-5678-9101-cc00736ftest",
|
21
22
|
})
|
22
23
|
p api_instance.update_azure_host_filters(body)
|
@@ -17,6 +17,7 @@ body = DatadogAPIClient::V1::AzureAccount.new({
|
|
17
17
|
host_filters: "key:value,filter:example",
|
18
18
|
new_client_id: "new1c7f6-1234-5678-9101-3fcbf464test",
|
19
19
|
new_tenant_name: "new1c44-1234-5678-9101-cc00736ftest",
|
20
|
+
resource_collection_enabled: true,
|
20
21
|
tenant_name: "testc44-1234-5678-9101-cc00736ftest",
|
21
22
|
})
|
22
23
|
p api_instance.update_azure_integration(body)
|
@@ -35,6 +35,9 @@ body = DatadogAPIClient::V1::Dashboard.new({
|
|
35
35
|
display_type: DatadogAPIClient::V1::WidgetDisplayType::BARS,
|
36
36
|
}),
|
37
37
|
],
|
38
|
+
time: DatadogAPIClient::V1::WidgetTime.new({
|
39
|
+
live_span: DatadogAPIClient::V1::WidgetLiveSpan::WEEK_TO_DATE,
|
40
|
+
}),
|
38
41
|
}),
|
39
42
|
}),
|
40
43
|
],
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Patch a Synthetic test returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V1::SyntheticsAPI.new
|
5
|
+
|
6
|
+
# there is a valid "synthetics_api_test" in the system
|
7
|
+
SYNTHETICS_API_TEST_PUBLIC_ID = ENV["SYNTHETICS_API_TEST_PUBLIC_ID"]
|
8
|
+
|
9
|
+
body = DatadogAPIClient::V1::SyntheticsPatchTestBody.new({
|
10
|
+
data: [
|
11
|
+
DatadogAPIClient::V1::SyntheticsPatchTestOperation.new({
|
12
|
+
op: DatadogAPIClient::V1::SyntheticsPatchTestOperationName::REPLACE,
|
13
|
+
path: "/name",
|
14
|
+
value: "New test name",
|
15
|
+
}),
|
16
|
+
DatadogAPIClient::V1::SyntheticsPatchTestOperation.new({
|
17
|
+
op: DatadogAPIClient::V1::SyntheticsPatchTestOperationName::REMOVE,
|
18
|
+
path: "/config/assertions/0",
|
19
|
+
}),
|
20
|
+
],
|
21
|
+
})
|
22
|
+
p api_instance.patch_test(SYNTHETICS_API_TEST_PUBLIC_ID, body)
|
@@ -1,8 +1,5 @@
|
|
1
1
|
# Get all Container Images returns "OK" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient.configure do |config|
|
5
|
-
config.unstable_operations["v2.list_container_images".to_sym] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::ContainerImagesAPI.new
|
8
5
|
p api_instance.list_container_images()
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# Get all Container Images returns "OK" response with pagination
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient.configure do |config|
|
5
|
-
config.unstable_operations["v2.list_container_images".to_sym] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::ContainerImagesAPI.new
|
8
5
|
opts = {
|
9
6
|
page_size: 2,
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# Get all Container Image groups returns "OK" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient.configure do |config|
|
5
|
-
config.unstable_operations["v2.list_container_images".to_sym] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::ContainerImagesAPI.new
|
8
5
|
opts = {
|
9
6
|
group_by: "short_image",
|
@@ -1,8 +1,5 @@
|
|
1
1
|
# Get All Containers returns "OK" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient.configure do |config|
|
5
|
-
config.unstable_operations["v2.list_containers".to_sym] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::ContainersAPI.new
|
8
5
|
p api_instance.list_containers()
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# Get All Container groups returns "OK" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient.configure do |config|
|
5
|
-
config.unstable_operations["v2.list_containers".to_sym] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::ContainersAPI.new
|
8
5
|
opts = {
|
9
6
|
group_by: "short_image",
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# Get All Containers returns "OK" response with pagination
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient.configure do |config|
|
5
|
-
config.unstable_operations["v2.list_containers".to_sym] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::ContainersAPI.new
|
8
5
|
opts = {
|
9
6
|
page_size: 2,
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Send a deployment event for DORA Metrics returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
DatadogAPIClient.configure do |config|
|
5
|
+
config.unstable_operations["v2.create_dora_deployment".to_sym] = true
|
6
|
+
end
|
7
|
+
api_instance = DatadogAPIClient::V2::DORAMetricsAPI.new
|
8
|
+
|
9
|
+
body = DatadogAPIClient::V2::DORADeploymentRequest.new({
|
10
|
+
data: DatadogAPIClient::V2::DORADeploymentRequestData.new({
|
11
|
+
attributes: DatadogAPIClient::V2::DORADeploymentRequestAttributes.new({
|
12
|
+
finished_at: 1693491984000000000,
|
13
|
+
git: DatadogAPIClient::V2::DORAGitInfo.new({
|
14
|
+
commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588",
|
15
|
+
repository_url: "https://github.com/organization/example-repository",
|
16
|
+
}),
|
17
|
+
service: "shopist",
|
18
|
+
started_at: 1693491974000000000,
|
19
|
+
version: "v1.12.07",
|
20
|
+
}),
|
21
|
+
}),
|
22
|
+
})
|
23
|
+
p api_instance.create_dora_deployment(body)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Send an incident event for DORA Metrics returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
DatadogAPIClient.configure do |config|
|
5
|
+
config.unstable_operations["v2.create_dora_incident".to_sym] = true
|
6
|
+
end
|
7
|
+
api_instance = DatadogAPIClient::V2::DORAMetricsAPI.new
|
8
|
+
|
9
|
+
body = DatadogAPIClient::V2::DORAIncidentRequest.new({
|
10
|
+
data: DatadogAPIClient::V2::DORAIncidentRequestData.new({
|
11
|
+
attributes: DatadogAPIClient::V2::DORAIncidentRequestAttributes.new({
|
12
|
+
finished_at: 1693491984000000000,
|
13
|
+
git: DatadogAPIClient::V2::DORAGitInfo.new({
|
14
|
+
commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588",
|
15
|
+
repository_url: "https://github.com/organization/example-repository",
|
16
|
+
}),
|
17
|
+
name: "Webserver is down failing all requests",
|
18
|
+
service: "shopist",
|
19
|
+
severity: "High",
|
20
|
+
started_at: 1693491974000000000,
|
21
|
+
version: "v1.12.07",
|
22
|
+
}),
|
23
|
+
}),
|
24
|
+
})
|
25
|
+
p api_instance.create_dora_incident(body)
|
@@ -1,8 +1,5 @@
|
|
1
1
|
# Get a list of events returns "OK" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient.configure do |config|
|
5
|
-
config.unstable_operations["v2.list_events".to_sym] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::EventsAPI.new
|
8
5
|
p api_instance.list_events()
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# Get a list of events returns "OK" response with pagination
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient.configure do |config|
|
5
|
-
config.unstable_operations["v2.list_events".to_sym] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::EventsAPI.new
|
8
5
|
opts = {
|
9
6
|
filter_from: "now-15m",
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# Get a quick list of events returns "OK" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient.configure do |config|
|
5
|
-
config.unstable_operations["v2.list_events".to_sym] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::EventsAPI.new
|
8
5
|
opts = {
|
9
6
|
filter_query: "datadog-agent",
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# Search events returns "OK" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient.configure do |config|
|
5
|
-
config.unstable_operations["v2.search_events".to_sym] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::EventsAPI.new
|
8
5
|
|
9
6
|
body = DatadogAPIClient::V2::EventsListRequest.new({
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# Search events returns "OK" response with pagination
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient.configure do |config|
|
5
|
-
config.unstable_operations["v2.search_events".to_sym] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::EventsAPI.new
|
8
5
|
|
9
6
|
body = DatadogAPIClient::V2::EventsListRequest.new({
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Add Okta account returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::OktaIntegrationAPI.new
|
5
|
+
|
6
|
+
body = DatadogAPIClient::V2::OktaAccountRequest.new({
|
7
|
+
data: DatadogAPIClient::V2::OktaAccount.new({
|
8
|
+
attributes: DatadogAPIClient::V2::OktaAccountAttributes.new({
|
9
|
+
auth_method: "oauth",
|
10
|
+
domain: "https://example.okta.com/",
|
11
|
+
name: "Okta_Prod",
|
12
|
+
client_id: "client_id",
|
13
|
+
client_secret: "client_secret",
|
14
|
+
}),
|
15
|
+
id: "f749daaf-682e-4208-a38d-c9b43162c609",
|
16
|
+
type: DatadogAPIClient::V2::OktaAccountType::OKTA_ACCOUNTS,
|
17
|
+
}),
|
18
|
+
})
|
19
|
+
p api_instance.create_okta_account(body)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Get Okta account returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::OktaIntegrationAPI.new
|
5
|
+
|
6
|
+
# there is a valid "okta_account" in the system
|
7
|
+
OKTA_ACCOUNT_DATA_ID = ENV["OKTA_ACCOUNT_DATA_ID"]
|
8
|
+
p api_instance.get_okta_account(OKTA_ACCOUNT_DATA_ID)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Update Okta account returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::OktaIntegrationAPI.new
|
5
|
+
|
6
|
+
# there is a valid "okta_account" in the system
|
7
|
+
OKTA_ACCOUNT_DATA_ID = ENV["OKTA_ACCOUNT_DATA_ID"]
|
8
|
+
|
9
|
+
body = DatadogAPIClient::V2::OktaAccountUpdateRequest.new({
|
10
|
+
data: DatadogAPIClient::V2::OktaAccountUpdateRequestData.new({
|
11
|
+
attributes: DatadogAPIClient::V2::OktaAccountUpdateRequestAttributes.new({
|
12
|
+
auth_method: "oauth",
|
13
|
+
domain: "https://example.okta.com/",
|
14
|
+
client_id: "client_id",
|
15
|
+
client_secret: "client_secret",
|
16
|
+
}),
|
17
|
+
type: DatadogAPIClient::V2::OktaAccountType::OKTA_ACCOUNTS,
|
18
|
+
}),
|
19
|
+
})
|
20
|
+
p api_instance.update_okta_account(OKTA_ACCOUNT_DATA_ID, body)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Get active billing dimensions for cost attribution returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
DatadogAPIClient.configure do |config|
|
5
|
+
config.unstable_operations["v2.get_active_billing_dimensions".to_sym] = true
|
6
|
+
end
|
7
|
+
api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
|
8
|
+
p api_instance.get_active_billing_dimensions()
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Get Monthly Cost Attribution returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
DatadogAPIClient.configure do |config|
|
5
|
+
config.unstable_operations["v2.get_monthly_cost_attribution".to_sym] = true
|
6
|
+
end
|
7
|
+
api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
|
8
|
+
p api_instance.get_monthly_cost_attribution((Time.now + -5 * 86400), (Time.now + -3 * 86400), "infra_host_total_cost")
|
@@ -190,10 +190,10 @@ module DatadogAPIClient
|
|
190
190
|
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
191
191
|
@unstable_operations = {
|
192
192
|
"v2.create_ci_app_pipeline_event": false,
|
193
|
-
"v2.
|
194
|
-
"v2.
|
195
|
-
"v2.
|
196
|
-
"v2.
|
193
|
+
"v2.get_active_billing_dimensions": false,
|
194
|
+
"v2.get_monthly_cost_attribution": false,
|
195
|
+
"v2.create_dora_deployment": false,
|
196
|
+
"v2.create_dora_incident": false,
|
197
197
|
"v2.create_incident": false,
|
198
198
|
"v2.create_incident_integration": false,
|
199
199
|
"v2.create_incident_todo": false,
|