Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
679 changes: 679 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions examples/v2/dashboards/SearchDashboards.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Search dashboards returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.search_dashboards".to_sym] = true
end
api_instance = DatadogAPIClient::V2::DashboardsAPI.new
p api_instance.search_dashboards()
8 changes: 8 additions & 0 deletions examples/v2/notebooks/SearchNotebooks.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Search notebooks returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.search_notebooks".to_sym] = true
end
api_instance = DatadogAPIClient::V2::NotebooksAPI.new
p api_instance.search_notebooks()
14 changes: 14 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1932,6 +1932,13 @@
"dashboard_list_id" => "Integer",
"body" => "DashboardListUpdateItemsRequest",
},
"v2.SearchDashboards" => {
"query" => "String",
"sort" => "String",
"include" => "String",
"page" => "Integer",
"limit" => "Integer",
},
"v2.CreateDataset" => {
"body" => "DatasetCreateRequest",
},
Expand Down Expand Up @@ -2773,6 +2780,13 @@
"tags" => "String",
"limit" => "Integer",
},
"v2.SearchNotebooks" => {
"query" => "String",
"sort" => "String",
"include" => "String",
"page" => "Integer",
"limit" => "Integer",
},
"v2.ListPipelines" => {
"page_size" => "Integer",
"page_number" => "Integer",
Expand Down
21 changes: 21 additions & 0 deletions features/v2/dashboards.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@endpoint(dashboards) @endpoint(dashboards-v2)
Feature: Dashboards
Interact with your dashboards through the API to search and retrieve
dashboards.

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "Dashboards" API
And operation "SearchDashboards" enabled
And new "SearchDashboards" request

@generated @skip @team:DataDog/notebooks-backend
Scenario: Search dashboards returns "Bad Request" response
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/notebooks-backend
Scenario: Search dashboards returns "OK" response
When the request is sent
Then the response status is 200 OK
21 changes: 21 additions & 0 deletions features/v2/notebooks.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@endpoint(notebooks) @endpoint(notebooks-v2)
Feature: Notebooks
Interact with your notebooks through the API to search and retrieve
notebooks.

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "Notebooks" API
And operation "SearchNotebooks" enabled
And new "SearchNotebooks" request

@generated @skip @team:DataDog/notebooks-backend
Scenario: Search notebooks returns "Bad Request" response
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/notebooks-backend
Scenario: Search notebooks returns "OK" response
When the request is sent
Then the response status is 200 OK
12 changes: 12 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,12 @@
"type": "safe"
}
},
"SearchDashboards": {
"tag": "Dashboards",
"undo": {
"type": "safe"
}
},
"GetAllDatasets": {
"tag": "Datasets",
"undo": {
Expand Down Expand Up @@ -3110,6 +3116,12 @@
"type": "safe"
}
},
"SearchNotebooks": {
"tag": "Notebooks",
"undo": {
"type": "safe"
}
},
"ListPipelines": {
"tag": "Observability Pipelines",
"undo": {
Expand Down
2 changes: 2 additions & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def initialize
"v2.mute_findings": false,
"v2.run_threat_hunting_job": false,
"v2.search_security_monitoring_histsignals": false,
"v2.search_dashboards": false,
"v2.create_dataset": false,
"v2.delete_dataset": false,
"v2.get_all_datasets": false,
Expand Down Expand Up @@ -327,6 +328,7 @@ def initialize
"v2.update_monitor_user_template": false,
"v2.validate_existing_monitor_user_template": false,
"v2.validate_monitor_user_template": false,
"v2.search_notebooks": false,
"v2.list_role_templates": false,
"v2.create_connection": false,
"v2.delete_connection": false,
Expand Down
21 changes: 21 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1990,6 +1990,15 @@ def overrides
"v2.dashboard_list_items" => "DashboardListItems",
"v2.dashboard_list_update_items_request" => "DashboardListUpdateItemsRequest",
"v2.dashboard_list_update_items_response" => "DashboardListUpdateItemsResponse",
"v2.dashboard_search_aggregation_bucket_key" => "DashboardSearchAggregationBucketKey",
"v2.dashboard_search_aggregation_bucket_multi_key" => "DashboardSearchAggregationBucketMultiKey",
"v2.dashboard_search_aggregations" => "DashboardSearchAggregations",
"v2.dashboard_search_attributes" => "DashboardSearchAttributes",
"v2.dashboard_search_metadata" => "DashboardSearchMetadata",
"v2.dashboard_search_response" => "DashboardSearchResponse",
"v2.dashboard_search_response_meta" => "DashboardSearchResponseMeta",
"v2.dashboard_search_result_data" => "DashboardSearchResultData",
"v2.dashboard_search_user" => "DashboardSearchUser",
"v2.dashboard_trigger_wrapper" => "DashboardTriggerWrapper",
"v2.dashboard_type" => "DashboardType",
"v2.database_monitoring_trigger_wrapper" => "DatabaseMonitoringTriggerWrapper",
Expand Down Expand Up @@ -3313,6 +3322,16 @@ def overrides
"v2.monthly_cost_attribution_response" => "MonthlyCostAttributionResponse",
"v2.ms_teams_integration_metadata" => "MSTeamsIntegrationMetadata",
"v2.ms_teams_integration_metadata_teams_item" => "MSTeamsIntegrationMetadataTeamsItem",
"v2.notebook_search_aggregation_bucket_key" => "NotebookSearchAggregationBucketKey",
"v2.notebook_search_aggregation_bucket_multi_key" => "NotebookSearchAggregationBucketMultiKey",
"v2.notebook_search_aggregations" => "NotebookSearchAggregations",
"v2.notebook_search_attributes" => "NotebookSearchAttributes",
"v2.notebook_search_highlight" => "NotebookSearchHighlight",
"v2.notebook_search_metadata" => "NotebookSearchMetadata",
"v2.notebook_search_response" => "NotebookSearchResponse",
"v2.notebook_search_response_meta" => "NotebookSearchResponseMeta",
"v2.notebook_search_result_data" => "NotebookSearchResultData",
"v2.notebook_search_user" => "NotebookSearchUser",
"v2.notebook_trigger_wrapper" => "NotebookTriggerWrapper",
"v2.notification_channel" => "NotificationChannel",
"v2.notification_channel_attributes" => "NotificationChannelAttributes",
Expand Down Expand Up @@ -5252,6 +5271,7 @@ def overrides
"v2.csm_coverage_analysis_api" => "CSMCoverageAnalysisAPI",
"v2.csm_threats_api" => "CSMThreatsAPI",
"v2.dashboard_lists_api" => "DashboardListsAPI",
"v2.dashboards_api" => "DashboardsAPI",
"v2.data_deletion_api" => "DataDeletionAPI",
"v2.datasets_api" => "DatasetsAPI",
"v2.deployment_gates_api" => "DeploymentGatesAPI",
Expand Down Expand Up @@ -5280,6 +5300,7 @@ def overrides
"v2.microsoft_teams_integration_api" => "MicrosoftTeamsIntegrationAPI",
"v2.monitors_api" => "MonitorsAPI",
"v2.network_device_monitoring_api" => "NetworkDeviceMonitoringAPI",
"v2.notebooks_api" => "NotebooksAPI",
"v2.observability_pipelines_api" => "ObservabilityPipelinesAPI",
"v2.oci_integration_api" => "OCIIntegrationAPI",
"v2.okta_integration_api" => "OktaIntegrationAPI",
Expand Down
102 changes: 102 additions & 0 deletions lib/datadog_api_client/v2/api/dashboards_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
=begin
#Datadog API V2 Collection

#Collection of all Datadog Public endpoints.

The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator

Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product includes software developed at Datadog (https://www.datadoghq.com/).
Copyright 2020-Present Datadog, Inc.

=end

require 'cgi'

module DatadogAPIClient::V2
class DashboardsAPI
attr_accessor :api_client

def initialize(api_client = DatadogAPIClient::APIClient.default)
@api_client = api_client
end

# Search dashboards.
#
# @see #search_dashboards_with_http_info
def search_dashboards(opts = {})
data, _status_code, _headers = search_dashboards_with_http_info(opts)
data
end

# Search dashboards.
#
# Search for dashboards using a query string.
#
# @param opts [Hash] the optional parameters
# @option opts [String] :query Search query string.
# @option opts [String] :sort Sort field for results.
# @option opts [String] :include Additional data to include in the response.
# @option opts [Integer] :page Page number for pagination.
# @option opts [Integer] :limit Maximum number of results to return.
# @return [Array<(DashboardSearchResponse, Integer, Hash)>] DashboardSearchResponse data, response status code and response headers
def search_dashboards_with_http_info(opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.search_dashboards".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.search_dashboards")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.search_dashboards"))
end

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: DashboardsAPI.search_dashboards ...'
end
# resource path
local_var_path = '/api/v2/dashboards/search'

# query parameters
query_params = opts[:query_params] || {}
query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'DashboardSearchResponse'

# auth_names
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

new_options = opts.merge(
:operation => :search_dashboards,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type,
:api_version => "V2"
)

data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: DashboardsAPI#search_dashboards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
end
end
102 changes: 102 additions & 0 deletions lib/datadog_api_client/v2/api/notebooks_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
=begin
#Datadog API V2 Collection

#Collection of all Datadog Public endpoints.

The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator

Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product includes software developed at Datadog (https://www.datadoghq.com/).
Copyright 2020-Present Datadog, Inc.

=end

require 'cgi'

module DatadogAPIClient::V2
class NotebooksAPI
attr_accessor :api_client

def initialize(api_client = DatadogAPIClient::APIClient.default)
@api_client = api_client
end

# Search notebooks.
#
# @see #search_notebooks_with_http_info
def search_notebooks(opts = {})
data, _status_code, _headers = search_notebooks_with_http_info(opts)
data
end

# Search notebooks.
#
# Search for notebooks using a query string.
#
# @param opts [Hash] the optional parameters
# @option opts [String] :query Search query string.
# @option opts [String] :sort Sort field for results.
# @option opts [String] :include Additional data to include in the response.
# @option opts [Integer] :page Page number for pagination.
# @option opts [Integer] :limit Maximum number of results to return.
# @return [Array<(NotebookSearchResponse, Integer, Hash)>] NotebookSearchResponse data, response status code and response headers
def search_notebooks_with_http_info(opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.search_notebooks".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.search_notebooks")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.search_notebooks"))
end

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: NotebooksAPI.search_notebooks ...'
end
# resource path
local_var_path = '/api/v2/notebooks/search'

# query parameters
query_params = opts[:query_params] || {}
query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'NotebookSearchResponse'

# auth_names
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

new_options = opts.merge(
:operation => :search_notebooks,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type,
:api_version => "V2"
)

data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: NotebooksAPI#search_notebooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
end
end
Loading
Loading