Skip to content

Commit da2d905

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 5371379 of spec repo (#3490)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent f352815 commit da2d905

21 files changed

Lines changed: 3112 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 519 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# List governance insights returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_governance_insights".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::GovernanceInsightsAPI.new
8+
p api_instance.list_governance_insights()

features/scenarios_model_mapping.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3293,6 +3293,11 @@
32933293
"saml_config_uuid" => "String",
32943294
"body" => "SAMLConfigurationUpdateRequest",
32953295
},
3296+
"v2.ListGovernanceInsights" => {
3297+
"with_values" => "Boolean",
3298+
"org_uuid" => "String",
3299+
"filter_product" => "Array<String>",
3300+
},
32963301
"v2.CreateHamrOrgConnection" => {
32973302
"body" => "HamrOrgConnectionRequest",
32983303
},
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@endpoint(governance-insights) @endpoint(governance-insights-v2)
2+
Feature: Governance Insights
3+
Governance Insights surface key usage, configuration, and best-practice
4+
signals for an organization within the Governance Console. Each insight
5+
reports a current value (and, optionally, a previous value for comparison)
6+
along with the query used to compute it, so that the Console can render
7+
trends and highlight areas that need attention.
8+
9+
Background:
10+
Given a valid "apiKeyAuth" key in the system
11+
And a valid "appKeyAuth" key in the system
12+
And an instance of "GovernanceInsights" API
13+
And operation "ListGovernanceInsights" enabled
14+
And new "ListGovernanceInsights" request
15+
16+
@generated @skip @team:DataDog/aaa-governance-console
17+
Scenario: List governance insights returns "Bad Request" response
18+
When the request is sent
19+
Then the response status is 400 Bad Request
20+
21+
@generated @skip @team:DataDog/aaa-governance-console
22+
Scenario: List governance insights returns "OK" response
23+
When the request is sent
24+
Then the response status is 200 OK

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2762,6 +2762,12 @@
27622762
"type": "safe"
27632763
}
27642764
},
2765+
"ListGovernanceInsights": {
2766+
"tag": "Governance Insights",
2767+
"undo": {
2768+
"type": "safe"
2769+
}
2770+
},
27652771
"GetHamrOrgConnection": {
27662772
"tag": "High Availability MultiRegion",
27672773
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ def initialize
468468
"v2.upsert_and_publish_form_version": false,
469469
"v2.upsert_form_version": false,
470470
"v2.update_org_saml_configurations": false,
471+
"v2.list_governance_insights": false,
471472
"v2.create_hamr_org_connection": false,
472473
"v2.get_hamr_org_connection": false,
473474
"v2.delete_entity_integration_config": false,

lib/datadog_api_client/inflector.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3508,6 +3508,19 @@ def overrides
35083508
"v2.google_chat_update_organization_handle_request_data" => "GoogleChatUpdateOrganizationHandleRequestData",
35093509
"v2.google_meet_configuration_reference" => "GoogleMeetConfigurationReference",
35103510
"v2.google_meet_configuration_reference_data" => "GoogleMeetConfigurationReferenceData",
3511+
"v2.governance_best_practice_definition" => "GovernanceBestPracticeDefinition",
3512+
"v2.governance_insight_attributes" => "GovernanceInsightAttributes",
3513+
"v2.governance_insight_audit_compute" => "GovernanceInsightAuditCompute",
3514+
"v2.governance_insight_audit_query" => "GovernanceInsightAuditQuery",
3515+
"v2.governance_insight_data" => "GovernanceInsightData",
3516+
"v2.governance_insight_event_compute" => "GovernanceInsightEventCompute",
3517+
"v2.governance_insight_event_query" => "GovernanceInsightEventQuery",
3518+
"v2.governance_insight_metric_query" => "GovernanceInsightMetricQuery",
3519+
"v2.governance_insight_percentage_query" => "GovernanceInsightPercentageQuery",
3520+
"v2.governance_insight_query_config" => "GovernanceInsightQueryConfig",
3521+
"v2.governance_insight_resource_type" => "GovernanceInsightResourceType",
3522+
"v2.governance_insights_response" => "GovernanceInsightsResponse",
3523+
"v2.governance_insight_usage_query" => "GovernanceInsightUsageQuery",
35113524
"v2.grey_noise_api_key" => "GreyNoiseAPIKey",
35123525
"v2.grey_noise_api_key_type" => "GreyNoiseAPIKeyType",
35133526
"v2.grey_noise_api_key_update" => "GreyNoiseAPIKeyUpdate",
@@ -7768,6 +7781,7 @@ def overrides
77687781
"v2.forms_api" => "FormsAPI",
77697782
"v2.gcp_integration_api" => "GCPIntegrationAPI",
77707783
"v2.google_chat_integration_api" => "GoogleChatIntegrationAPI",
7784+
"v2.governance_insights_api" => "GovernanceInsightsAPI",
77717785
"v2.high_availability_multi_region_api" => "HighAvailabilityMultiRegionAPI",
77727786
"v2.incidents_api" => "IncidentsAPI",
77737787
"v2.integrations_api" => "IntegrationsAPI",
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'cgi'
17+
18+
module DatadogAPIClient::V2
19+
class GovernanceInsightsAPI
20+
attr_accessor :api_client
21+
22+
def initialize(api_client = DatadogAPIClient::APIClient.default)
23+
@api_client = api_client
24+
end
25+
26+
# List governance insights.
27+
#
28+
# @see #list_governance_insights_with_http_info
29+
def list_governance_insights(opts = {})
30+
data, _status_code, _headers = list_governance_insights_with_http_info(opts)
31+
data
32+
end
33+
34+
# List governance insights.
35+
#
36+
# Retrieve the list of governance insights available to the organization. By default, only
37+
# insight metadata is returned; pass `withValues=true` to also compute and include each
38+
# insight's current and previous values. Insights can be filtered by product.
39+
#
40+
# @param opts [Hash] the optional parameters
41+
# @option opts [Boolean] :with_values Whether to compute and include the current and previous value of each insight. Defaults to `false`, in which case only insight metadata is returned.
42+
# @option opts [String] :org_uuid The UUID of the organization to compute insights for. Defaults to the organization of the authenticated user. Used to retrieve insights for a child organization from a parent organization.
43+
# @option opts [Array<String>] :filter_product Restrict the results to insights belonging to the given products. May be repeated to filter by multiple products. Matching is case-insensitive.
44+
# @return [Array<(GovernanceInsightsResponse, Integer, Hash)>] GovernanceInsightsResponse data, response status code and response headers
45+
def list_governance_insights_with_http_info(opts = {})
46+
unstable_enabled = @api_client.config.unstable_operations["v2.list_governance_insights".to_sym]
47+
if unstable_enabled
48+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_governance_insights")
49+
else
50+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_governance_insights"))
51+
end
52+
53+
if @api_client.config.debugging
54+
@api_client.config.logger.debug 'Calling API: GovernanceInsightsAPI.list_governance_insights ...'
55+
end
56+
# resource path
57+
local_var_path = '/api/v2/governance/insights'
58+
59+
# query parameters
60+
query_params = opts[:query_params] || {}
61+
query_params[:'withValues'] = opts[:'with_values'] if !opts[:'with_values'].nil?
62+
query_params[:'orgUuid'] = opts[:'org_uuid'] if !opts[:'org_uuid'].nil?
63+
query_params[:'filter[product]'] = @api_client.build_collection_param(opts[:'filter_product'], :multi) if !opts[:'filter_product'].nil?
64+
65+
# header parameters
66+
header_params = opts[:header_params] || {}
67+
# HTTP header 'Accept' (if needed)
68+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
69+
70+
# form parameters
71+
form_params = opts[:form_params] || {}
72+
73+
# http body (model)
74+
post_body = opts[:debug_body]
75+
76+
# return_type
77+
return_type = opts[:debug_return_type] || 'GovernanceInsightsResponse'
78+
79+
# auth_names
80+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
81+
82+
new_options = opts.merge(
83+
:operation => :list_governance_insights,
84+
:header_params => header_params,
85+
:query_params => query_params,
86+
:form_params => form_params,
87+
:body => post_body,
88+
:auth_names => auth_names,
89+
:return_type => return_type,
90+
:api_version => "V2"
91+
)
92+
new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER
93+
94+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
95+
if @api_client.config.debugging
96+
@api_client.config.logger.debug "API called: GovernanceInsightsAPI#list_governance_insights\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
97+
end
98+
return data, status_code, headers
99+
end
100+
end
101+
end

0 commit comments

Comments
 (0)