datadog_api_client 1.9.0 → 2.0.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 +1486 -273
- data/.generator/schemas/v2/openapi.yaml +2348 -146
- data/.generator/src/generator/cli.py +57 -40
- data/.generator/src/generator/formatter.py +20 -1
- data/.generator/src/generator/openapi.py +15 -9
- data/.generator/src/generator/templates/api.j2 +14 -13
- data/.generator/src/generator/templates/api_client.j2 +64 -15
- data/.generator/src/generator/templates/configuration.j2 +12 -8
- data/.generator/src/generator/templates/example.j2 +1 -1
- data/.generator/src/generator/templates/inflector.j2 +28 -0
- data/.generator/src/generator/templates/model_base.j2 +2 -2
- data/.generator/src/generator/templates/model_generic.j2 +42 -3
- data/.generator/src/generator/templates/model_oneof.j2 +1 -1
- data/.generator/src/generator/templates/package.j2 +7 -12
- data/.github/workflows/approved_status.yml +0 -2
- data/.github/workflows/codeql-analysis.yml +49 -0
- data/.github/workflows/docs.yml +1 -1
- data/.github/workflows/prepare_release.yml +16 -4
- data/.github/workflows/publish.yml +1 -1
- data/.github/workflows/release.yml +1 -1
- data/.github/workflows/test.yml +4 -6
- data/.github/workflows/test_integration.yml +1 -8
- data/.pre-commit-config.yaml +3 -12
- data/CHANGELOG.md +91 -0
- data/Gemfile +1 -0
- data/Makefile +2 -3
- data/README.md +16 -0
- data/check-examples.sh +0 -2
- data/datadog_api_client.gemspec +2 -0
- data/examples/v1/aws-integration/UpdateAWSAccount.rb +8 -4
- data/examples/v1/dashboards/CreateDashboard_1442588603.rb +61 -0
- data/examples/v1/dashboards/CreateDashboard_252716965.rb +52 -0
- data/examples/v1/dashboards/CreateDashboard_3882428227.rb +60 -0
- data/examples/v1/downtimes/CreateDowntime_1393233946.rb +3 -0
- data/examples/v1/downtimes/CreateDowntime_2908359488.rb +4 -0
- data/examples/v1/downtimes/CreateDowntime_3059354445.rb +4 -0
- data/examples/v1/downtimes/UpdateDowntime.rb +1 -0
- data/examples/v1/events/ListEvents.rb +1 -1
- data/examples/v1/metrics/SubmitDistributionPoints.rb +22 -0
- data/examples/v1/metrics/SubmitDistributionPoints_3109558960.rb +25 -0
- data/examples/v1/monitors/CreateMonitor_1969035628.rb +52 -0
- data/examples/v1/monitors/CreateMonitor_2520912138.rb +22 -0
- data/examples/v1/organizations/DowngradeOrg.rb +5 -0
- data/examples/v1/organizations/UpdateOrg.rb +1 -0
- data/examples/v1/security-monitoring/AddSecurityMonitoringSignalToIncident.rb +9 -0
- data/examples/v1/security-monitoring/EditSecurityMonitoringSignalAssignee.rb +9 -0
- data/examples/v1/security-monitoring/EditSecurityMonitoringSignalState.rb +10 -0
- data/examples/v1/service-level-objective-corrections/CreateSLOCorrection.rb +0 -3
- data/examples/v1/service-level-objective-corrections/CreateSLOCorrection_1326388368.rb +0 -3
- data/examples/v1/service-level-objective-corrections/DeleteSLOCorrection.rb +0 -3
- data/examples/v1/service-level-objective-corrections/GetSLOCorrection.rb +0 -3
- data/examples/v1/service-level-objective-corrections/ListSLOCorrection.rb +0 -3
- data/examples/v1/service-level-objective-corrections/UpdateSLOCorrection.rb +0 -3
- data/examples/v1/service-level-objectives/GetSLOCorrections.rb +0 -3
- data/examples/v1/service-level-objectives/GetSLOHistory.rb +1 -1
- data/examples/v1/service-level-objectives/SearchSLO.rb +16 -0
- data/examples/v1/snapshots/GetGraphSnapshot.rb +2 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest.rb +8 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1402674167.rb +44 -0
- data/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.rb +67 -0
- data/examples/v1/synthetics/GetAPITestLatestResults.rb +1 -1
- data/examples/v1/synthetics/GetAPITestResult.rb +1 -1
- data/examples/v1/synthetics/GetBrowserTestLatestResults.rb +1 -1
- data/examples/v1/synthetics/GetBrowserTestResult.rb +1 -1
- data/examples/v1/synthetics/UpdateBrowserTest.rb +8 -0
- data/examples/v1/usage-metering/GetDailyCustomReports.rb +1 -1
- data/examples/v1/usage-metering/GetHourlyUsageAttribution.rb +1 -4
- data/examples/v1/usage-metering/GetMonthlyCustomReports.rb +1 -1
- data/examples/v1/usage-metering/GetMonthlyUsageAttribution.rb +1 -4
- data/examples/v1/usage-metering/{GetMonthlyUsageAttribution_3738504447.rb → GetMonthlyUsageAttribution_3849653599.rb} +1 -1
- data/examples/v1/usage-metering/GetSpecifiedDailyCustomReports.rb +1 -1
- data/examples/v1/usage-metering/GetSpecifiedMonthlyCustomReports.rb +1 -1
- data/examples/v1/usage-metering/GetUsageAttribution.rb +2 -2
- data/examples/v1/usage-metering/GetUsageCIApp.rb +2 -5
- data/examples/v1/usage-metering/GetUsageCIApp_1064440884.rb +8 -0
- data/examples/v1/usage-metering/GetUsageCWS.rb +2 -5
- data/examples/v1/usage-metering/GetUsageCWS_736958514.rb +8 -0
- data/examples/v1/usage-metering/GetUsageDBM.rb +2 -5
- data/examples/v1/usage-metering/GetUsageDBM_3446806203.rb +8 -0
- data/examples/v1/usage-metering/GetUsageLambda.rb +2 -5
- data/examples/v1/usage-metering/GetUsageLambda_3132428705.rb +8 -0
- data/examples/v1/usage-metering/GetUsageLogs.rb +2 -5
- data/examples/v1/usage-metering/GetUsageLogsByIndex.rb +2 -5
- data/examples/v1/usage-metering/GetUsageLogsByIndex_1025184776.rb +8 -0
- data/examples/v1/usage-metering/GetUsageLogs_2562396405.rb +8 -0
- data/examples/v1/usage-metering/GetUsageNetworkFlows.rb +2 -5
- data/examples/v1/usage-metering/GetUsageNetworkFlows_1239422069.rb +8 -0
- data/examples/v1/usage-metering/GetUsageNetworkHosts.rb +2 -5
- data/examples/v1/usage-metering/GetUsageNetworkHosts_1249907835.rb +8 -0
- data/examples/v1/usage-metering/GetUsageOnlineArchive.rb +2 -5
- data/examples/v1/usage-metering/GetUsageOnlineArchive_1501172903.rb +8 -0
- data/examples/v1/usage-metering/GetUsageRumSessions.rb +2 -5
- data/examples/v1/usage-metering/GetUsageRumSessions_3271366243.rb +9 -0
- data/examples/v1/usage-metering/GetUsageRumSessions_714937291.rb +8 -0
- data/examples/v1/usage-metering/GetUsageRumUnits.rb +2 -5
- data/examples/v1/usage-metering/GetUsageRumUnits_3959755399.rb +8 -0
- data/examples/v1/usage-metering/GetUsageSDS.rb +2 -5
- data/examples/v1/usage-metering/GetUsageSDS_271128478.rb +8 -0
- data/examples/v1/usage-metering/GetUsageSynthetics.rb +1 -1
- data/examples/v1/usage-metering/GetUsageSyntheticsAPI.rb +2 -5
- data/examples/v1/usage-metering/GetUsageSyntheticsAPI_4048033529.rb +8 -0
- data/examples/v1/usage-metering/GetUsageSyntheticsBrowser.rb +2 -5
- data/examples/v1/usage-metering/GetUsageSyntheticsBrowser_1704663299.rb +8 -0
- data/examples/v2/events/ListEvents.rb +8 -0
- data/examples/v2/events/ListEvents_2663715109.rb +14 -0
- data/examples/v2/events/SearchEvents.rb +23 -0
- data/examples/v2/incident-services/CreateIncidentService.rb +1 -1
- data/examples/v2/incident-services/DeleteIncidentService.rb +1 -1
- data/examples/v2/incident-services/GetIncidentService.rb +1 -1
- data/examples/v2/incident-services/ListIncidentServices.rb +1 -1
- data/examples/v2/incident-services/UpdateIncidentService.rb +1 -1
- data/examples/v2/incident-teams/CreateIncidentTeam.rb +1 -1
- data/examples/v2/incident-teams/DeleteIncidentTeam.rb +1 -1
- data/examples/v2/incident-teams/GetIncidentTeam.rb +1 -1
- data/examples/v2/incident-teams/ListIncidentTeams.rb +1 -1
- data/examples/v2/incident-teams/UpdateIncidentTeam.rb +1 -1
- data/examples/v2/incidents/CreateIncident.rb +1 -1
- data/examples/v2/incidents/DeleteIncident.rb +1 -1
- data/examples/v2/incidents/GetIncident.rb +1 -1
- data/examples/v2/incidents/ListIncidents.rb +1 -1
- data/examples/v2/incidents/UpdateIncident.rb +1 -1
- data/examples/v2/incidents/UpdateIncident_1009194038.rb +1 -1
- data/examples/v2/incidents/UpdateIncident_3369341440.rb +1 -1
- data/examples/v2/logs/SubmitLog.rb +1 -0
- data/examples/v2/logs-archives/CreateLogsArchive.rb +1 -0
- data/examples/v2/logs-archives/UpdateLogsArchive.rb +1 -0
- data/examples/v2/metrics/CreateTagConfiguration.rb +0 -3
- data/examples/v2/metrics/DeleteTagConfiguration.rb +0 -3
- data/examples/v2/metrics/EstimateMetricsOutputSeries.rb +9 -0
- data/examples/v2/metrics/ListTagConfigurationByName.rb +0 -3
- data/examples/v2/metrics/ListTagConfigurations.rb +0 -3
- data/examples/v2/metrics/ListTagConfigurations_103226315.rb +0 -3
- data/examples/v2/metrics/ListTagConfigurations_1799362914.rb +0 -3
- data/examples/v2/metrics/SubmitMetrics.rb +26 -0
- data/examples/v2/metrics/UpdateTagConfiguration.rb +0 -3
- data/examples/v2/opsgenie-integration/CreateOpsgenieService.rb +16 -0
- data/examples/v2/opsgenie-integration/DeleteOpsgenieService.rb +8 -0
- data/examples/v2/opsgenie-integration/GetOpsgenieService.rb +8 -0
- data/examples/v2/opsgenie-integration/ListOpsgenieServices.rb +5 -0
- data/examples/v2/opsgenie-integration/UpdateOpsgenieService.rb +21 -0
- data/examples/v2/security-monitoring/EditSecurityMonitoringSignalAssignee.rb +15 -0
- data/examples/v2/security-monitoring/EditSecurityMonitoringSignalIncidents.rb +15 -0
- data/examples/v2/security-monitoring/EditSecurityMonitoringSignalState.rb +14 -0
- data/examples/v2/security-monitoring/ListSecurityMonitoringSignals.rb +0 -3
- data/examples/v2/security-monitoring/SearchSecurityMonitoringSignals.rb +0 -3
- data/examples/v2/security-monitoring/UpdateSecurityMonitoringRule.rb +5 -0
- data/examples/v2/usage-metering/GetCostByOrg.rb +5 -0
- data/examples/v2/usage-metering/GetEstimatedCostByOrg.rb +8 -0
- data/examples/v2/usage-metering/GetEstimatedCostByOrg_2734954020.rb +11 -0
- data/examples/v2/usage-metering/GetEstimatedCostByOrg_3186693804.rb +11 -0
- data/examples/v2/usage-metering/GetUsageApplicationSecurityMonitoring.rb +5 -0
- data/examples/v2/usage-metering/GetUsageApplicationSecurityMonitoring_3959166796.rb +8 -0
- data/examples/v2/usage-metering/GetUsageLambdaTracedInvocations.rb +5 -0
- data/examples/v2/usage-metering/GetUsageLambdaTracedInvocations_1436752065.rb +8 -0
- data/examples/v2/usage-metering/GetUsageObservabilityPipelines.rb +2 -5
- data/examples/v2/usage-metering/GetUsageObservabilityPipelines_970725512.rb +8 -0
- data/lib/datadog_api_client/{v2/api_client.rb → api_client.rb} +64 -15
- data/lib/datadog_api_client/api_key_configuration.rb +1 -18
- data/lib/datadog_api_client/{v1/configuration.rb → configuration.rb} +133 -35
- data/lib/datadog_api_client/inflector.rb +1293 -0
- data/lib/datadog_api_client/models.rb +66 -0
- data/lib/datadog_api_client/v1/api/authentication_api.rb +3 -11
- data/lib/datadog_api_client/v1/api/aws_integration_api.rb +19 -91
- data/lib/datadog_api_client/v1/api/aws_logs_integration_api.rb +15 -71
- data/lib/datadog_api_client/v1/api/azure_integration_api.rb +11 -51
- data/lib/datadog_api_client/v1/api/dashboard_lists_api.rb +11 -51
- data/lib/datadog_api_client/v1/api/dashboards_api.rb +15 -71
- data/lib/datadog_api_client/v1/api/downtimes_api.rb +15 -71
- data/lib/datadog_api_client/v1/api/events_api.rb +9 -33
- data/lib/datadog_api_client/v1/api/gcp_integration_api.rb +9 -41
- data/lib/datadog_api_client/v1/api/hosts_api.rb +9 -41
- data/lib/datadog_api_client/v1/api/ip_ranges_api.rb +3 -11
- data/lib/datadog_api_client/v1/api/key_management_api.rb +21 -101
- data/lib/datadog_api_client/v1/api/logs_api.rb +5 -21
- data/lib/datadog_api_client/v1/api/logs_indexes_api.rb +13 -61
- data/lib/datadog_api_client/v1/api/logs_pipelines_api.rb +15 -71
- data/lib/datadog_api_client/v1/api/metrics_api.rb +87 -62
- data/lib/datadog_api_client/v1/api/monitors_api.rb +90 -157
- data/lib/datadog_api_client/v1/api/notebooks_api.rb +11 -51
- data/lib/datadog_api_client/v1/api/organizations_api.rb +77 -52
- data/lib/datadog_api_client/v1/api/pager_duty_integration_api.rb +9 -41
- data/lib/datadog_api_client/v1/api/security_monitoring_api.rb +242 -0
- data/lib/datadog_api_client/v1/api/service_checks_api.rb +3 -11
- data/lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb +12 -52
- data/lib/datadog_api_client/v1/api/service_level_objectives_api.rb +100 -94
- data/lib/datadog_api_client/v1/api/slack_integration_api.rb +11 -51
- data/lib/datadog_api_client/v1/api/snapshots_api.rb +7 -11
- data/lib/datadog_api_client/v1/api/synthetics_api.rb +55 -271
- data/lib/datadog_api_client/v1/api/tags_api.rb +11 -51
- data/lib/datadog_api_client/v1/api/usage_metering_api.rb +184 -427
- data/lib/datadog_api_client/v1/api/users_api.rb +11 -51
- data/lib/datadog_api_client/v1/api/webhooks_integration_api.rb +17 -81
- data/lib/datadog_api_client/v1/model_base.rb +2 -2
- data/lib/datadog_api_client/v1/models/add_signal_to_incident_request.rb +142 -0
- data/lib/datadog_api_client/v1/models/distribution_point_item.rb +63 -0
- data/lib/datadog_api_client/v1/models/distribution_points_content_encoding.rb +26 -0
- data/lib/datadog_api_client/v1/models/distribution_points_payload.rb +124 -0
- data/lib/datadog_api_client/v1/models/distribution_points_series.rb +179 -0
- data/lib/datadog_api_client/v1/models/distribution_points_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/distribution_widget_histogram_request_query.rb +64 -0
- data/lib/datadog_api_client/v1/models/distribution_widget_histogram_request_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/distribution_widget_request.rb +21 -1
- data/lib/datadog_api_client/v1/models/downtime.rb +11 -1
- data/lib/datadog_api_client/v1/models/downtime_child.rb +11 -1
- data/lib/datadog_api_client/v1/models/event.rb +1 -1
- data/lib/datadog_api_client/v1/models/formula_and_function_apm_resource_stat_name.rb +1 -0
- data/lib/datadog_api_client/v1/models/formula_and_function_query_definition.rb +1 -1
- data/lib/datadog_api_client/v1/models/hourly_usage_attribution_body.rb +5 -1
- data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +9 -0
- data/lib/datadog_api_client/v1/models/http_log_item.rb +29 -4
- data/lib/datadog_api_client/v1/models/ip_prefixes_synthetics_private_locations.rb +125 -0
- data/lib/datadog_api_client/v1/models/ip_ranges.rb +11 -1
- data/lib/datadog_api_client/v1/models/logs_category_processor.rb +1 -1
- data/lib/datadog_api_client/v1/models/logs_list_request.rb +1 -1
- data/lib/datadog_api_client/v1/models/logs_processor.rb +1 -1
- data/lib/datadog_api_client/v1/models/logs_sort.rb +1 -1
- data/lib/datadog_api_client/v1/models/monitor_formula_and_function_events_data_source.rb +1 -0
- data/lib/datadog_api_client/v1/models/monitor_formula_and_function_query_definition.rb +1 -1
- data/lib/datadog_api_client/v1/models/monitor_group_search_response_counts.rb +2 -2
- data/lib/datadog_api_client/v1/models/{monitor_search_response_counts_tag_item.rb → monitor_search_count_item.rb} +3 -3
- data/lib/datadog_api_client/v1/models/monitor_search_response_counts.rb +4 -4
- data/lib/datadog_api_client/v1/models/monitor_type.rb +1 -0
- data/lib/datadog_api_client/v1/models/monthly_usage_attribution_body.rb +6 -2
- data/lib/datadog_api_client/v1/models/monthly_usage_attribution_response.rb +1 -1
- data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +18 -0
- data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +61 -1
- data/lib/datadog_api_client/v1/models/notebook_cell_create_request.rb +146 -0
- data/lib/datadog_api_client/v1/models/notebook_cell_create_request_attributes.rb +68 -0
- data/lib/datadog_api_client/v1/models/notebook_cell_response_attributes.rb +1 -1
- data/lib/datadog_api_client/v1/models/notebook_cell_time.rb +1 -1
- data/lib/datadog_api_client/v1/models/notebook_cell_update_request_attributes.rb +1 -1
- data/lib/datadog_api_client/v1/models/notebook_global_time.rb +1 -1
- data/lib/datadog_api_client/v1/models/notebook_update_cell.rb +1 -1
- data/lib/datadog_api_client/v1/models/org_downgraded_response.rb +111 -0
- data/lib/datadog_api_client/v1/models/organization.rb +14 -4
- data/lib/datadog_api_client/v1/models/search_slo_response.rb +131 -0
- data/lib/datadog_api_client/v1/models/{monitor_group_search_response_counts_status_item.rb → search_slo_response_data.rb} +19 -19
- data/lib/datadog_api_client/v1/models/{monitor_group_search_response_counts_type_item.rb → search_slo_response_data_attributes.rb} +21 -19
- data/lib/datadog_api_client/v1/models/search_slo_response_data_attributes_facets.rb +197 -0
- data/lib/datadog_api_client/v1/models/{monitor_search_response_counts_type_item.rb → search_slo_response_data_attributes_facets_object_int.rb} +7 -7
- data/lib/datadog_api_client/v1/models/{monitor_search_response_counts_muted_item.rb → search_slo_response_data_attributes_facets_object_string.rb} +7 -7
- data/lib/datadog_api_client/v1/models/search_slo_response_links.rb +151 -0
- data/lib/datadog_api_client/v1/models/search_slo_response_meta.rb +111 -0
- data/lib/datadog_api_client/v1/models/search_slo_response_meta_page.rb +181 -0
- data/lib/datadog_api_client/v1/models/series.rb +2 -2
- data/lib/datadog_api_client/v1/models/service_level_objective.rb +3 -3
- data/lib/datadog_api_client/v1/models/service_level_objective_query.rb +1 -1
- data/lib/datadog_api_client/v1/models/service_level_objective_request.rb +3 -3
- data/lib/datadog_api_client/v1/models/signal_archive_reason.rb +29 -0
- data/lib/datadog_api_client/v1/models/signal_assignee_update_request.rb +132 -0
- data/lib/datadog_api_client/v1/models/signal_state_update_request.rb +152 -0
- data/lib/datadog_api_client/v1/models/signal_triage_state.rb +28 -0
- data/lib/datadog_api_client/v1/models/slo_correction_create_request_attributes.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_correction_response_attributes.rb +4 -4
- data/lib/datadog_api_client/v1/models/slo_correction_update_request_attributes.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_history_metrics.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_response_data.rb +1 -1
- data/lib/datadog_api_client/v1/models/successful_signal_update_response.rb +111 -0
- data/lib/datadog_api_client/v1/models/sunburst_widget_legend.rb +1 -1
- data/lib/datadog_api_client/v1/models/synthetics_api_test.rb +12 -1
- data/lib/datadog_api_client/v1/models/synthetics_assertion.rb +1 -1
- data/lib/datadog_api_client/v1/models/synthetics_assertion_type.rb +2 -0
- data/lib/datadog_api_client/v1/models/synthetics_basic_auth.rb +1 -1
- data/lib/datadog_api_client/v1/models/synthetics_browser_test.rb +11 -0
- data/lib/datadog_api_client/v1/models/synthetics_browser_test_rum_settings.rb +152 -0
- data/lib/datadog_api_client/v1/models/synthetics_core_web_vitals.rb +2 -2
- data/lib/datadog_api_client/v1/models/synthetics_test_ci_options.rb +111 -0
- data/lib/datadog_api_client/v1/models/synthetics_test_details.rb +1 -1
- data/lib/datadog_api_client/v1/models/synthetics_test_details_sub_type.rb +2 -1
- data/lib/datadog_api_client/v1/models/synthetics_test_options.rb +31 -1
- data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +21 -1
- data/lib/datadog_api_client/v1/models/tree_map_color_by.rb +1 -1
- data/lib/datadog_api_client/v1/models/tree_map_group_by.rb +1 -1
- data/lib/datadog_api_client/v1/models/tree_map_size_by.rb +1 -1
- data/lib/datadog_api_client/v1/models/tree_map_widget_definition.rb +28 -6
- data/lib/datadog_api_client/v1/models/usage_attribution_body.rb +6 -2
- data/lib/datadog_api_client/v1/models/usage_attribution_response.rb +1 -1
- data/lib/datadog_api_client/v1/models/usage_attribution_sort.rb +6 -0
- data/lib/datadog_api_client/v1/models/usage_attribution_supported_metrics.rb +6 -0
- data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +61 -1
- data/lib/datadog_api_client/v1/models/usage_billable_summary_keys.rb +474 -4
- data/lib/datadog_api_client/v1/models/usage_rum_sessions_hour.rb +18 -4
- data/lib/datadog_api_client/v1/models/usage_summary_date.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_summary_response.rb +11 -1
- data/lib/datadog_api_client/v1/models/widget_definition.rb +1 -1
- data/lib/datadog_api_client/v2/api/audit_api.rb +11 -25
- data/lib/datadog_api_client/v2/api/authn_mappings_api.rb +11 -53
- data/lib/datadog_api_client/v2/api/cloud_workload_security_api.rb +14 -62
- data/lib/datadog_api_client/v2/api/dashboard_lists_api.rb +9 -41
- data/lib/datadog_api_client/v2/api/events_api.rb +228 -0
- data/lib/datadog_api_client/v2/api/incident_services_api.rb +36 -46
- data/lib/datadog_api_client/v2/api/incident_teams_api.rb +36 -46
- data/lib/datadog_api_client/v2/api/incidents_api.rb +39 -48
- data/lib/datadog_api_client/v2/api/key_management_api.rb +29 -141
- data/lib/datadog_api_client/v2/api/logs_api.rb +15 -45
- data/lib/datadog_api_client/v2/api/logs_archives_api.rb +21 -101
- data/lib/datadog_api_client/v2/api/logs_metrics_api.rb +11 -51
- data/lib/datadog_api_client/v2/api/metrics_api.rb +179 -94
- data/lib/datadog_api_client/v2/api/opsgenie_integration_api.rb +355 -0
- data/lib/datadog_api_client/v2/api/organizations_api.rb +3 -11
- data/lib/datadog_api_client/v2/api/processes_api.rb +6 -13
- data/lib/datadog_api_client/v2/api/roles_api.rb +27 -131
- data/lib/datadog_api_client/v2/api/rum_api.rb +13 -35
- data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +247 -125
- data/lib/datadog_api_client/v2/api/service_accounts_api.rb +11 -51
- data/lib/datadog_api_client/v2/api/usage_metering_api.rb +382 -14
- data/lib/datadog_api_client/v2/api/users_api.rb +21 -101
- data/lib/datadog_api_client/v2/model_base.rb +2 -2
- data/lib/datadog_api_client/v2/models/api_key_response_included_item.rb +1 -1
- data/lib/datadog_api_client/v2/models/application_key_response_included_item.rb +1 -1
- data/lib/datadog_api_client/v2/models/authn_mapping.rb +1 -13
- data/lib/datadog_api_client/v2/models/authn_mapping_attributes.rb +1 -12
- data/lib/datadog_api_client/v2/models/authn_mapping_included.rb +1 -1
- data/lib/datadog_api_client/v2/models/authn_mapping_response.rb +16 -4
- data/lib/datadog_api_client/v2/models/authn_mappings_response.rb +13 -1
- data/lib/datadog_api_client/v2/models/chargeback_breakdown.rb +131 -0
- data/lib/datadog_api_client/v2/models/cost_by_org.rb +133 -0
- data/lib/datadog_api_client/v2/models/cost_by_org_attributes.rb +153 -0
- data/lib/datadog_api_client/v2/models/cost_by_org_response.rb +113 -0
- data/lib/datadog_api_client/v2/models/cost_by_org_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/event.rb +141 -0
- data/lib/datadog_api_client/v2/models/event_attributes.rb +305 -0
- data/lib/datadog_api_client/v2/models/event_priority.rb +27 -0
- data/lib/datadog_api_client/v2/models/event_response.rb +133 -0
- data/lib/datadog_api_client/v2/models/event_response_attributes.rb +133 -0
- data/lib/datadog_api_client/v2/models/event_status_type.rb +35 -0
- data/lib/datadog_api_client/v2/models/event_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/events_list_request.rb +142 -0
- data/lib/datadog_api_client/v2/models/events_list_response.rb +133 -0
- data/lib/datadog_api_client/v2/models/events_list_response_links.rb +112 -0
- data/lib/datadog_api_client/v2/models/events_query_filter.rb +137 -0
- data/lib/datadog_api_client/v2/models/events_query_options.rb +124 -0
- data/lib/datadog_api_client/v2/models/events_request_page.rb +134 -0
- data/lib/datadog_api_client/v2/models/events_response_metadata.rb +144 -0
- data/lib/datadog_api_client/v2/models/events_response_metadata_page.rb +112 -0
- data/lib/datadog_api_client/v2/models/events_sort.rb +27 -0
- data/lib/datadog_api_client/v2/models/events_warning.rb +131 -0
- data/lib/datadog_api_client/v2/models/hourly_usage.rb +133 -0
- data/lib/datadog_api_client/v2/models/hourly_usage_attributes.rb +163 -0
- data/lib/datadog_api_client/v2/models/hourly_usage_measurement.rb +122 -0
- data/lib/datadog_api_client/v2/models/hourly_usage_metadata.rb +111 -0
- data/lib/datadog_api_client/v2/models/hourly_usage_pagination.rb +112 -0
- data/lib/datadog_api_client/v2/models/hourly_usage_response.rb +123 -0
- data/lib/datadog_api_client/v2/models/hourly_usage_type.rb +2 -0
- data/lib/datadog_api_client/v2/models/http_log_item.rb +40 -4
- data/lib/datadog_api_client/v2/models/incident_field_attributes.rb +1 -1
- data/lib/datadog_api_client/v2/models/incident_response_included_item.rb +1 -1
- data/lib/datadog_api_client/v2/models/incident_service_included_items.rb +1 -1
- data/lib/datadog_api_client/v2/models/incident_team_included_items.rb +1 -1
- data/lib/datadog_api_client/v2/models/incident_timeline_cell_create_attributes.rb +1 -1
- data/lib/datadog_api_client/v2/models/intake_payload_accepted.rb +113 -0
- data/lib/datadog_api_client/v2/models/logs_aggregate_bucket_value.rb +1 -1
- data/lib/datadog_api_client/v2/models/logs_archive_attributes.rb +12 -1
- data/lib/datadog_api_client/v2/models/logs_archive_create_request_attributes.rb +12 -1
- data/lib/datadog_api_client/v2/models/logs_archive_create_request_destination.rb +1 -1
- data/lib/datadog_api_client/v2/models/logs_archive_destination.rb +1 -1
- data/lib/datadog_api_client/v2/models/logs_group_by_missing.rb +1 -1
- data/lib/datadog_api_client/v2/models/logs_group_by_total.rb +1 -1
- data/lib/datadog_api_client/v2/models/metric_content_encoding.rb +26 -0
- data/lib/datadog_api_client/v2/models/metric_estimate.rb +133 -0
- data/lib/datadog_api_client/v2/models/metric_estimate_attributes.rb +133 -0
- data/lib/datadog_api_client/v2/models/metric_estimate_resource_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/metric_estimate_response.rb +111 -0
- data/lib/datadog_api_client/v2/models/metric_estimate_type.rb +28 -0
- data/lib/datadog_api_client/v2/models/metric_intake_type.rb +29 -0
- data/lib/datadog_api_client/v2/models/metric_metadata.rb +111 -0
- data/lib/datadog_api_client/v2/models/metric_origin.rb +170 -0
- data/lib/datadog_api_client/v2/models/metric_payload.rb +124 -0
- data/lib/datadog_api_client/v2/models/metric_point.rb +122 -0
- data/lib/datadog_api_client/{v1/models/monitor_search_response_counts_status_item.rb → v2/models/metric_resource.rb} +21 -21
- data/lib/datadog_api_client/v2/models/metric_series.rb +220 -0
- data/lib/datadog_api_client/v2/models/metric_tag_configuration_create_attributes.rb +0 -2
- data/lib/datadog_api_client/v2/models/metric_tag_configuration_update_attributes.rb +0 -2
- data/lib/datadog_api_client/v2/models/metric_volumes.rb +1 -1
- data/lib/datadog_api_client/v2/models/metrics_and_metric_tag_configurations.rb +1 -1
- data/lib/datadog_api_client/v2/models/monitor_type.rb +215 -0
- data/lib/datadog_api_client/v2/models/opsgenie_service_create_attributes.rb +174 -0
- data/lib/datadog_api_client/v2/models/opsgenie_service_create_data.rb +145 -0
- data/lib/datadog_api_client/v2/models/opsgenie_service_create_request.rb +122 -0
- data/lib/datadog_api_client/v2/models/opsgenie_service_region_type.rb +28 -0
- data/lib/datadog_api_client/v2/models/opsgenie_service_response.rb +122 -0
- data/lib/datadog_api_client/v2/models/opsgenie_service_response_attributes.rb +132 -0
- data/lib/datadog_api_client/v2/models/opsgenie_service_response_data.rb +166 -0
- data/lib/datadog_api_client/v2/models/opsgenie_service_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/opsgenie_service_update_attributes.rb +142 -0
- data/lib/datadog_api_client/v2/models/opsgenie_service_update_data.rb +166 -0
- data/lib/datadog_api_client/v2/models/opsgenie_service_update_request.rb +122 -0
- data/lib/datadog_api_client/v2/models/opsgenie_services_response.rb +124 -0
- data/lib/datadog_api_client/v2/models/relationship_to_saml_assertion_attribute_data.rb +1 -5
- data/lib/datadog_api_client/v2/models/rum_aggregate_bucket_value.rb +1 -1
- data/lib/datadog_api_client/v2/models/rum_group_by_missing.rb +1 -1
- data/lib/datadog_api_client/v2/models/rum_group_by_total.rb +1 -1
- data/lib/datadog_api_client/v2/models/saml_assertion_attribute.rb +1 -5
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_detection_method.rb +1 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_hardcoded_evaluator_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options.rb +30 -4
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options_learning_method.rb +27 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options_learning_threshold.rb +27 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_options.rb +23 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_query.rb +13 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_create.rb +13 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_archive_reason.rb +29 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_assignee_update_attributes.rb +132 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_assignee_update_data.rb +122 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_assignee_update_request.rb +122 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_incidents_update_attributes.rb +134 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_incidents_update_data.rb +122 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_incidents_update_request.rb +122 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_state.rb +28 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_state_update_attributes.rb +152 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_state_update_data.rb +122 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_state_update_request.rb +122 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_triage_attributes.rb +248 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_triage_update_data.rb +111 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_triage_update_response.rb +122 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_triage_user.rb +152 -0
- data/lib/datadog_api_client/v2/models/usage_application_security_monitoring_response.rb +113 -0
- data/lib/datadog_api_client/v2/models/usage_lambda_traced_invocations_response.rb +113 -0
- data/lib/datadog_api_client/v2/models/user_response_included_item.rb +1 -1
- data/lib/datadog_api_client/v2.rb +77 -0
- data/lib/datadog_api_client/version.rb +1 -1
- data/lib/datadog_api_client.rb +11 -5
- data/spec/{v1/api_client_spec.rb → api_client_spec.rb} +32 -32
- data/spec/{v1/configuration_spec.rb → configuration_spec.rb} +3 -3
- data/spec/spec_helper.rb +1 -3
- metadata +191 -28
- data/.dockerignore +0 -1
- data/.generator/src/generator/templates/api_error.j2 +0 -49
- data/extract-code-blocks.awk +0 -81
- data/extract-code-blocks.sh +0 -3
- data/lib/datadog_api_client/v1/api_client.rb +0 -456
- data/lib/datadog_api_client/v1/api_error.rb +0 -60
- data/lib/datadog_api_client/v1.rb +0 -789
- data/lib/datadog_api_client/v2/api_error.rb +0 -60
- data/lib/datadog_api_client/v2/configuration.rb +0 -427
- data/spec/v2/api_client_spec.rb +0 -210
- data/spec/v2/configuration_spec.rb +0 -45
@@ -1,9 +1,6 @@
|
|
1
1
|
# Create a tag configuration returns "Created" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient::V2.configure do |config|
|
5
|
-
config.unstable_operations[:create_tag_configuration] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::MetricsAPI.new
|
8
5
|
|
9
6
|
body = DatadogAPIClient::V2::MetricTagConfigurationCreateRequest.new({
|
@@ -1,8 +1,5 @@
|
|
1
1
|
# Delete a tag configuration returns "No Content" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient::V2.configure do |config|
|
5
|
-
config.unstable_operations[:delete_tag_configuration] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::MetricsAPI.new
|
8
5
|
api_instance.delete_tag_configuration("ExampleDeleteatagconfigurationreturnsNoContentresponse")
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# Tag Configuration Cardinality Estimator returns "Success" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::MetricsAPI.new
|
5
|
+
opts = {
|
6
|
+
filter_groups: "app,host",
|
7
|
+
filter_num_aggregations: 4,
|
8
|
+
}
|
9
|
+
p api_instance.estimate_metrics_output_series("system.cpu.idle", opts)
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# List tag configuration by name returns "Success" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient::V2.configure do |config|
|
5
|
-
config.unstable_operations[:list_tag_configuration_by_name] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::MetricsAPI.new
|
8
5
|
|
9
6
|
# there is a valid "metric_tag_configuration" in the system
|
@@ -1,8 +1,5 @@
|
|
1
1
|
# List tag configurations returns "Success" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient::V2.configure do |config|
|
5
|
-
config.unstable_operations[:list_tag_configurations] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::MetricsAPI.new
|
8
5
|
p api_instance.list_tag_configurations()
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# List tag configurations with configured filter returns "Success" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient::V2.configure do |config|
|
5
|
-
config.unstable_operations[:list_tag_configurations] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::MetricsAPI.new
|
8
5
|
opts = {
|
9
6
|
filter_configured: true,
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# List tag configurations with a tag filter returns "Success" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient::V2.configure do |config|
|
5
|
-
config.unstable_operations[:list_tag_configurations] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::MetricsAPI.new
|
8
5
|
opts = {
|
9
6
|
filter_tags: "ExampleListtagconfigurationswithatagfilterreturnsSuccessresponse",
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# Submit metrics returns "Payload accepted" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::MetricsAPI.new
|
5
|
+
|
6
|
+
body = DatadogAPIClient::V2::MetricPayload.new({
|
7
|
+
series: [
|
8
|
+
DatadogAPIClient::V2::MetricSeries.new({
|
9
|
+
metric: "system.load.1",
|
10
|
+
type: DatadogAPIClient::V2::MetricIntakeType::UNSPECIFIED,
|
11
|
+
points: [
|
12
|
+
DatadogAPIClient::V2::MetricPoint.new({
|
13
|
+
timestamp: Time.now.to_i,
|
14
|
+
value: 0.7,
|
15
|
+
}),
|
16
|
+
],
|
17
|
+
resources: [
|
18
|
+
DatadogAPIClient::V2::MetricResource.new({
|
19
|
+
name: "dummyhost",
|
20
|
+
type: "host",
|
21
|
+
}),
|
22
|
+
],
|
23
|
+
}),
|
24
|
+
],
|
25
|
+
})
|
26
|
+
p api_instance.submit_metrics(body)
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# Update a tag configuration returns "OK" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient::V2.configure do |config|
|
5
|
-
config.unstable_operations[:update_tag_configuration] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::MetricsAPI.new
|
8
5
|
|
9
6
|
# there is a valid "metric_tag_configuration" in the system
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Create a new service object returns "CREATED" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::OpsgenieIntegrationAPI.new
|
5
|
+
|
6
|
+
body = DatadogAPIClient::V2::OpsgenieServiceCreateRequest.new({
|
7
|
+
data: DatadogAPIClient::V2::OpsgenieServiceCreateData.new({
|
8
|
+
attributes: DatadogAPIClient::V2::OpsgenieServiceCreateAttributes.new({
|
9
|
+
name: "Example-Create_a_new_service_object_returns_CREATED_response",
|
10
|
+
opsgenie_api_key: "00000000-0000-0000-0000-000000000000",
|
11
|
+
region: DatadogAPIClient::V2::OpsgenieServiceRegionType::US,
|
12
|
+
}),
|
13
|
+
type: DatadogAPIClient::V2::OpsgenieServiceType::OPSGENIE_SERVICE,
|
14
|
+
}),
|
15
|
+
})
|
16
|
+
p api_instance.create_opsgenie_service(body)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Delete a single service object returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::OpsgenieIntegrationAPI.new
|
5
|
+
|
6
|
+
# there is a valid "opsgenie_service" in the system
|
7
|
+
OPSGENIE_SERVICE_DATA_ID = ENV["OPSGENIE_SERVICE_DATA_ID"]
|
8
|
+
api_instance.delete_opsgenie_service(OPSGENIE_SERVICE_DATA_ID)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Get a single service object returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::OpsgenieIntegrationAPI.new
|
5
|
+
|
6
|
+
# there is a valid "opsgenie_service" in the system
|
7
|
+
OPSGENIE_SERVICE_DATA_ID = ENV["OPSGENIE_SERVICE_DATA_ID"]
|
8
|
+
p api_instance.get_opsgenie_service(OPSGENIE_SERVICE_DATA_ID)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Update a single service object returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::OpsgenieIntegrationAPI.new
|
5
|
+
|
6
|
+
# there is a valid "opsgenie_service" in the system
|
7
|
+
OPSGENIE_SERVICE_DATA_ATTRIBUTES_NAME = ENV["OPSGENIE_SERVICE_DATA_ATTRIBUTES_NAME"]
|
8
|
+
OPSGENIE_SERVICE_DATA_ID = ENV["OPSGENIE_SERVICE_DATA_ID"]
|
9
|
+
|
10
|
+
body = DatadogAPIClient::V2::OpsgenieServiceUpdateRequest.new({
|
11
|
+
data: DatadogAPIClient::V2::OpsgenieServiceUpdateData.new({
|
12
|
+
attributes: DatadogAPIClient::V2::OpsgenieServiceUpdateAttributes.new({
|
13
|
+
name: "fake-opsgenie-service-name--updated",
|
14
|
+
opsgenie_api_key: "00000000-0000-0000-0000-000000000000",
|
15
|
+
region: DatadogAPIClient::V2::OpsgenieServiceRegionType::EU,
|
16
|
+
}),
|
17
|
+
id: OPSGENIE_SERVICE_DATA_ID,
|
18
|
+
type: DatadogAPIClient::V2::OpsgenieServiceType::OPSGENIE_SERVICE,
|
19
|
+
}),
|
20
|
+
})
|
21
|
+
p api_instance.update_opsgenie_service(OPSGENIE_SERVICE_DATA_ID, body)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Modify the triage assignee of a security signal returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
|
5
|
+
|
6
|
+
body = DatadogAPIClient::V2::SecurityMonitoringSignalAssigneeUpdateRequest.new({
|
7
|
+
data: DatadogAPIClient::V2::SecurityMonitoringSignalAssigneeUpdateData.new({
|
8
|
+
attributes: DatadogAPIClient::V2::SecurityMonitoringSignalAssigneeUpdateAttributes.new({
|
9
|
+
assignee: DatadogAPIClient::V2::SecurityMonitoringTriageUser.new({
|
10
|
+
uuid: "",
|
11
|
+
}),
|
12
|
+
}),
|
13
|
+
}),
|
14
|
+
})
|
15
|
+
p api_instance.edit_security_monitoring_signal_assignee("AQAAAYG1bl5K4HuUewAAAABBWUcxYmw1S0FBQmt2RmhRN0V4ZUVnQUE", body)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Change the related incidents of a security signal returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
|
5
|
+
|
6
|
+
body = DatadogAPIClient::V2::SecurityMonitoringSignalIncidentsUpdateRequest.new({
|
7
|
+
data: DatadogAPIClient::V2::SecurityMonitoringSignalIncidentsUpdateData.new({
|
8
|
+
attributes: DatadogAPIClient::V2::SecurityMonitoringSignalIncidentsUpdateAttributes.new({
|
9
|
+
incident_ids: [
|
10
|
+
2066,
|
11
|
+
],
|
12
|
+
}),
|
13
|
+
}),
|
14
|
+
})
|
15
|
+
p api_instance.edit_security_monitoring_signal_incidents("AQAAAYG1bl5K4HuUewAAAABBWUcxYmw1S0FBQmt2RmhRN0V4ZUVnQUE", body)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Change the triage state of a security signal returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
|
5
|
+
|
6
|
+
body = DatadogAPIClient::V2::SecurityMonitoringSignalStateUpdateRequest.new({
|
7
|
+
data: DatadogAPIClient::V2::SecurityMonitoringSignalStateUpdateData.new({
|
8
|
+
attributes: DatadogAPIClient::V2::SecurityMonitoringSignalStateUpdateAttributes.new({
|
9
|
+
archive_reason: DatadogAPIClient::V2::SecurityMonitoringSignalArchiveReason::NONE,
|
10
|
+
state: DatadogAPIClient::V2::SecurityMonitoringSignalState::OPEN,
|
11
|
+
}),
|
12
|
+
}),
|
13
|
+
})
|
14
|
+
p api_instance.edit_security_monitoring_signal_state("AQAAAYG1bl5K4HuUewAAAABBWUcxYmw1S0FBQmt2RmhRN0V4ZUVnQUE", body)
|
@@ -1,8 +1,5 @@
|
|
1
1
|
# Get a quick list of security signals returns "OK" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient::V2.configure do |config|
|
5
|
-
config.unstable_operations[:list_security_monitoring_signals] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
|
8
5
|
p api_instance.list_security_monitoring_signals()
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# Get a list of security signals returns "OK" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient::V2.configure do |config|
|
5
|
-
config.unstable_operations[:search_security_monitoring_signals] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
|
8
5
|
|
9
6
|
body = DatadogAPIClient::V2::SecurityMonitoringSignalListRequest.new({
|
@@ -17,8 +17,10 @@ body = DatadogAPIClient::V2::SecurityMonitoringRuleUpdatePayload.new({
|
|
17
17
|
],
|
18
18
|
has_extended_title: true,
|
19
19
|
options: DatadogAPIClient::V2::SecurityMonitoringRuleOptions.new({
|
20
|
+
decrease_criticality_based_on_env: false,
|
20
21
|
detection_method: DatadogAPIClient::V2::SecurityMonitoringRuleDetectionMethod::THRESHOLD,
|
21
22
|
evaluation_window: DatadogAPIClient::V2::SecurityMonitoringRuleEvaluationWindow::ZERO_MINUTES,
|
23
|
+
hardcoded_evaluator_type: DatadogAPIClient::V2::SecurityMonitoringRuleHardcodedEvaluatorType::LOG4SHELL,
|
22
24
|
impossible_travel_options: DatadogAPIClient::V2::SecurityMonitoringRuleImpossibleTravelOptions.new({
|
23
25
|
baseline_user_locations: true,
|
24
26
|
}),
|
@@ -27,6 +29,8 @@ body = DatadogAPIClient::V2::SecurityMonitoringRuleUpdatePayload.new({
|
|
27
29
|
new_value_options: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptions.new({
|
28
30
|
forget_after: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsForgetAfter::ONE_DAY,
|
29
31
|
learning_duration: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsLearningDuration::ZERO_DAYS,
|
32
|
+
learning_method: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsLearningMethod::DURATION,
|
33
|
+
learning_threshold: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsLearningThreshold::ZERO_OCCURRENCES,
|
30
34
|
}),
|
31
35
|
}),
|
32
36
|
queries: [
|
@@ -34,6 +38,7 @@ body = DatadogAPIClient::V2::SecurityMonitoringRuleUpdatePayload.new({
|
|
34
38
|
aggregation: DatadogAPIClient::V2::SecurityMonitoringRuleQueryAggregation::COUNT,
|
35
39
|
distinct_fields: [],
|
36
40
|
group_by_fields: [],
|
41
|
+
metrics: [],
|
37
42
|
}),
|
38
43
|
],
|
39
44
|
tags: [],
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Get estimated cost across your account returns "OK" response
|
2
|
+
|
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
|
+
api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
|
8
|
+
p api_instance.get_estimated_cost_by_org("view")
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# GetEstimatedCostByOrg with start_date returns "OK" response
|
2
|
+
|
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
|
+
api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
|
8
|
+
opts = {
|
9
|
+
start_date: (Time.now + -5 * 86400),
|
10
|
+
}
|
11
|
+
p api_instance.get_estimated_cost_by_org("sub-org", opts)
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# GetEstimatedCostByOrg with start_month returns "OK" response
|
2
|
+
|
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
|
+
api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
|
8
|
+
opts = {
|
9
|
+
start_month: (Time.now + -5 * 86400),
|
10
|
+
}
|
11
|
+
p api_instance.get_estimated_cost_by_org("sub-org", opts)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Get hourly usage for Application Security returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
|
5
|
+
opts = {
|
6
|
+
end_hr: (Time.now + -3 * 86400),
|
7
|
+
}
|
8
|
+
p api_instance.get_usage_application_security_monitoring((Time.now + -5 * 86400), opts)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Get hourly usage for Lambda Traced Invocations returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
|
5
|
+
opts = {
|
6
|
+
end_hr: (Time.now + -3 * 86400),
|
7
|
+
}
|
8
|
+
p api_instance.get_usage_lambda_traced_invocations((Time.now + -5 * 86400), opts)
|
@@ -1,8 +1,5 @@
|
|
1
|
-
# Get hourly usage for
|
1
|
+
# Get hourly usage for observability pipelines returns "OK" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
4
|
api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
|
5
|
-
|
6
|
-
end_hr: (Time.now + -3 * 86400),
|
7
|
-
}
|
8
|
-
p api_instance.get_usage_observability_pipelines((Time.now + -5 * 86400), opts)
|
5
|
+
p api_instance.get_usage_observability_pipelines("2021-11-11T11:11:11.111+00:00")
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Get hourly usage for Observability Pipelines returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
|
5
|
+
opts = {
|
6
|
+
end_hr: (Time.now + -3 * 86400),
|
7
|
+
}
|
8
|
+
p api_instance.get_usage_observability_pipelines((Time.now + -5 * 86400), opts)
|
@@ -19,8 +19,12 @@ require 'logger'
|
|
19
19
|
require 'tempfile'
|
20
20
|
require 'time'
|
21
21
|
require 'httparty'
|
22
|
+
begin
|
23
|
+
require 'zstandard'
|
24
|
+
rescue LoadError
|
25
|
+
end
|
22
26
|
|
23
|
-
module DatadogAPIClient
|
27
|
+
module DatadogAPIClient
|
24
28
|
class APIClient
|
25
29
|
# The Configuration object holding settings to be used in the API client.
|
26
30
|
attr_accessor :config
|
@@ -36,7 +40,6 @@ module DatadogAPIClient::V2
|
|
36
40
|
@config = config
|
37
41
|
@user_agent = "#{DatadogAPIClient::USER_AGENT}"
|
38
42
|
@default_headers = {
|
39
|
-
'Content-Type' => 'application/json',
|
40
43
|
'User-Agent' => @user_agent
|
41
44
|
}
|
42
45
|
@default_headers['Accept-Encoding'] = 'gzip' if @config.compress
|
@@ -112,7 +115,7 @@ module DatadogAPIClient::V2
|
|
112
115
|
end
|
113
116
|
|
114
117
|
if opts[:return_type]
|
115
|
-
data = deserialize(response, opts[:return_type])
|
118
|
+
data = deserialize(opts[:api_version], response, opts[:return_type])
|
116
119
|
else
|
117
120
|
data = nil
|
118
121
|
end
|
@@ -199,6 +202,8 @@ module DatadogAPIClient::V2
|
|
199
202
|
gzip.close
|
200
203
|
elsif header_params['Content-Encoding'] == 'deflate'
|
201
204
|
data = Zlib::deflate(data)
|
205
|
+
elsif header_params['Content-Encoding'] == 'zstd1'
|
206
|
+
data = Zstandard.deflate(data)
|
202
207
|
end
|
203
208
|
data
|
204
209
|
end
|
@@ -217,9 +222,10 @@ module DatadogAPIClient::V2
|
|
217
222
|
|
218
223
|
# Deserialize the response to the given return type.
|
219
224
|
#
|
225
|
+
# @param [String] the api version
|
220
226
|
# @param [Response] response HTTP response
|
221
227
|
# @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
|
222
|
-
def deserialize(response, return_type)
|
228
|
+
def deserialize(api_version, response, return_type)
|
223
229
|
body = response.body
|
224
230
|
|
225
231
|
# handle file downloading - return the File instance processed in request callbacks
|
@@ -252,14 +258,14 @@ module DatadogAPIClient::V2
|
|
252
258
|
end
|
253
259
|
end
|
254
260
|
|
255
|
-
convert_to_type data, return_type
|
261
|
+
convert_to_type data, return_type, api_version
|
256
262
|
end
|
257
263
|
|
258
264
|
# Convert data to the given return type.
|
259
265
|
# @param [Object] data Data to be converted
|
260
266
|
# @param [String] return_type Return type
|
261
267
|
# @return [Mixed] Data in a particular type
|
262
|
-
def convert_to_type(data, return_type)
|
268
|
+
def convert_to_type(data, return_type, api_version)
|
263
269
|
return nil if data.nil?
|
264
270
|
case return_type
|
265
271
|
when 'String'
|
@@ -282,16 +288,16 @@ module DatadogAPIClient::V2
|
|
282
288
|
when /\AArray<(.+)>\z/
|
283
289
|
# e.g. Array<Pet>
|
284
290
|
sub_type = $1
|
285
|
-
data.map { |item| convert_to_type(item, sub_type) }
|
291
|
+
data.map { |item| convert_to_type(item, sub_type, api_version) }
|
286
292
|
when /\AHash\<String, (.+)\>\z/
|
287
293
|
# e.g. Hash<String, Integer>
|
288
294
|
sub_type = $1
|
289
295
|
{}.tap do |hash|
|
290
|
-
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
|
296
|
+
data.each { |k, v| hash[k] = convert_to_type(v, sub_type, api_version) }
|
291
297
|
end
|
292
298
|
else
|
293
299
|
# models (e.g. Pet) or oneOf
|
294
|
-
klass = DatadogAPIClient
|
300
|
+
klass = DatadogAPIClient.const_get(api_version).const_get(return_type)
|
295
301
|
klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
|
296
302
|
end
|
297
303
|
end
|
@@ -308,7 +314,7 @@ module DatadogAPIClient::V2
|
|
308
314
|
def build_request_url(path, opts = {})
|
309
315
|
# Add leading and trailing slashes to path
|
310
316
|
path = "/#{path}".gsub(/\/+/, '/')
|
311
|
-
@config.base_url(opts[:operation]) + path
|
317
|
+
@config.base_url("#{opts[:api_version].respond_to?(:downcase) ? opts[:api_version].downcase : opts[:api_version]}.#{opts[:operation]}") + path
|
312
318
|
end
|
313
319
|
|
314
320
|
# Update header and query params based on authentication settings.
|
@@ -341,9 +347,7 @@ module DatadogAPIClient::V2
|
|
341
347
|
# @return [String] the Accept header (e.g. application/json)
|
342
348
|
def select_header_accept(accepts)
|
343
349
|
return nil if accepts.nil? || accepts.empty?
|
344
|
-
|
345
|
-
json_accept = accepts.find { |s| json_mime?(s) }
|
346
|
-
json_accept || accepts.join(',')
|
350
|
+
accepts.join(', ')
|
347
351
|
end
|
348
352
|
|
349
353
|
# Return Content-Type header based on an array of content types provided.
|
@@ -425,12 +429,13 @@ module DatadogAPIClient::V2
|
|
425
429
|
|
426
430
|
# Set an attribute at the given path
|
427
431
|
#
|
432
|
+
# @param [String] api_version The api version
|
428
433
|
# @param [Object] obj The source object
|
429
434
|
# @param [String] attribute_path The path spefication, separated by "."
|
430
435
|
# @param [Object] builder The class matching the top level attribute
|
431
436
|
# @param [Object] value The value to set
|
432
437
|
# @!visibility private
|
433
|
-
def set_attribute_from_path(obj, attribute_path, builder, value)
|
438
|
+
def set_attribute_from_path(api_version, obj, attribute_path, builder, value)
|
434
439
|
attrs = attribute_path.split(".")
|
435
440
|
last = attrs.pop
|
436
441
|
i = 0
|
@@ -441,7 +446,7 @@ module DatadogAPIClient::V2
|
|
441
446
|
else
|
442
447
|
obj = obj.send(attr)
|
443
448
|
end
|
444
|
-
builder = DatadogAPIClient
|
449
|
+
builder = DatadogAPIClient.const_get(api_version).const_get(builder.openapi_types[attr.to_sym]) if i > 0
|
445
450
|
obj = builder.new if obj.nil?
|
446
451
|
i += 1
|
447
452
|
end
|
@@ -453,4 +458,48 @@ module DatadogAPIClient::V2
|
|
453
458
|
end
|
454
459
|
end
|
455
460
|
end
|
461
|
+
|
462
|
+
class APIError < StandardError
|
463
|
+
attr_reader :code, :response_headers, :response_body
|
464
|
+
|
465
|
+
# Usage examples:
|
466
|
+
# APIError.new
|
467
|
+
# APIError.new("message")
|
468
|
+
# APIError.new(:code => 500, :response_headers => {}, :response_body => "")
|
469
|
+
# APIError.new(:code => 404, :message => "Not Found")
|
470
|
+
def initialize(arg = nil)
|
471
|
+
if arg.is_a? Hash
|
472
|
+
if arg.key?(:message) || arg.key?('message')
|
473
|
+
super(arg[:message] || arg['message'])
|
474
|
+
else
|
475
|
+
super arg
|
476
|
+
end
|
477
|
+
|
478
|
+
arg.each do |k, v|
|
479
|
+
instance_variable_set "@#{k}", v
|
480
|
+
end
|
481
|
+
else
|
482
|
+
super arg
|
483
|
+
end
|
484
|
+
end
|
485
|
+
|
486
|
+
# Override to_s to display a friendly error message
|
487
|
+
def to_s
|
488
|
+
message
|
489
|
+
end
|
490
|
+
|
491
|
+
def message
|
492
|
+
if @message.nil?
|
493
|
+
msg = "Error message: the server returns an error"
|
494
|
+
else
|
495
|
+
msg = @message
|
496
|
+
end
|
497
|
+
|
498
|
+
msg += "\nHTTP status code: #{code}" if code
|
499
|
+
msg += "\nResponse headers: #{response_headers}" if response_headers
|
500
|
+
msg += "\nResponse body: #{response_body}" if response_body
|
501
|
+
|
502
|
+
msg
|
503
|
+
end
|
504
|
+
end
|
456
505
|
end
|
@@ -1,24 +1,7 @@
|
|
1
|
-
require 'datadog_api_client/v1'
|
2
|
-
require 'datadog_api_client/v2'
|
3
|
-
|
4
1
|
# Extend the automatically-generated client configuration classes with a user-friendly
|
5
2
|
# authentication configuration, hiding the original #api_key method.
|
6
3
|
|
7
|
-
module DatadogAPIClient
|
8
|
-
class Configuration
|
9
|
-
private :api_key # Make original getter private
|
10
|
-
|
11
|
-
def api_key=(api_key)
|
12
|
-
@api_key['apiKeyAuth'] = api_key
|
13
|
-
end
|
14
|
-
|
15
|
-
def application_key=(app_key)
|
16
|
-
@api_key['appKeyAuth'] = app_key
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
module DatadogAPIClient::V2
|
4
|
+
module DatadogAPIClient
|
22
5
|
class Configuration
|
23
6
|
private :api_key # Make original getter private
|
24
7
|
|