Skip to content

Commit 6eca1a3

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 881c84e of spec repo
1 parent d13e137 commit 6eca1a3

13 files changed

Lines changed: 1753 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 388 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+
# Get Application Security details for a service returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_asm_service_by_name".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::ApplicationSecurityAPI.new
8+
p api_instance.get_asm_service_by_name("service_filter")

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4601,6 +4601,9 @@
46014601
"policy_id" => "String",
46024602
"body" => "ApplicationSecurityPolicyUpdateRequest",
46034603
},
4604+
"v2.GetAsmServiceByName" => {
4605+
"service_filter" => "String",
4606+
},
46044607
"v2.ListCSMThreatsAgentRules" => {
46054608
"policy_id" => "String",
46064609
},

features/v2/application_security.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@ Feature: Application Security
148148
When the request is sent
149149
Then the response status is 204 OK
150150

151+
@generated @skip @team:DataDog/asm-backend
152+
Scenario: Get Application Security details for a service returns "OK" response
153+
Given operation "GetAsmServiceByName" enabled
154+
And new "GetAsmServiceByName" request
155+
And request contains "service_filter" parameter from "REPLACE.ME"
156+
When the request is sent
157+
Then the response status is 200 OK
158+
151159
@team:DataDog/asm-backend
152160
Scenario: Get a WAF Policy returns "OK" response
153161
Given there is a valid "policy" in the system

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6700,6 +6700,12 @@
67006700
"type": "safe"
67016701
}
67026702
},
6703+
"GetAsmServiceByName": {
6704+
"tag": "Application Security",
6705+
"undo": {
6706+
"type": "safe"
6707+
}
6708+
},
67036709
"DownloadCloudWorkloadPolicyFile": {
67046710
"tag": "CSM Threats",
67056711
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,7 @@ def initialize
594594
"v2.update_connection": false,
595595
"v2.get_pruned_trace_by_id": false,
596596
"v2.get_trace_by_id": false,
597+
"v2.get_asm_service_by_name": false,
597598
"v2.create_report_schedule": false,
598599
"v2.patch_report_schedule": false,
599600
"v2.delete_sourcemaps": false,

lib/datadog_api_client/inflector.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,11 @@ def overrides
13831383
"v2.application_security_policy_update_attributes" => "ApplicationSecurityPolicyUpdateAttributes",
13841384
"v2.application_security_policy_update_data" => "ApplicationSecurityPolicyUpdateData",
13851385
"v2.application_security_policy_update_request" => "ApplicationSecurityPolicyUpdateRequest",
1386+
"v2.application_security_service_attributes" => "ApplicationSecurityServiceAttributes",
1387+
"v2.application_security_service_resource" => "ApplicationSecurityServiceResource",
1388+
"v2.application_security_services_metadata" => "ApplicationSecurityServicesMetadata",
1389+
"v2.application_security_services_response" => "ApplicationSecurityServicesResponse",
1390+
"v2.application_security_service_type" => "ApplicationSecurityServiceType",
13861391
"v2.application_security_waf_custom_rule_action" => "ApplicationSecurityWafCustomRuleAction",
13871392
"v2.application_security_waf_custom_rule_action_action" => "ApplicationSecurityWafCustomRuleActionAction",
13881393
"v2.application_security_waf_custom_rule_action_parameters" => "ApplicationSecurityWafCustomRuleActionParameters",

lib/datadog_api_client/v2/api/application_security_api.rb

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,80 @@ def get_application_security_waf_policy_with_http_info(policy_id, opts = {})
617617
return data, status_code, headers
618618
end
619619

620+
# Get Application Security details for a service.
621+
#
622+
# @see #get_asm_service_by_name_with_http_info
623+
def get_asm_service_by_name(service_filter, opts = {})
624+
data, _status_code, _headers = get_asm_service_by_name_with_http_info(service_filter, opts)
625+
data
626+
end
627+
628+
# Get Application Security details for a service.
629+
#
630+
# Retrieve Application Security details for services matching the given name.
631+
# Returns Application Security activation, compatibility, and product enablement
632+
# information for each matching `(service, environment)` pair, along with a count
633+
# of services that have Application Security Management (Threats) enabled.
634+
#
635+
# @param service_filter [String] The name of the service to retrieve Application Security details for. Returns all matching services across environments.
636+
# @param opts [Hash] the optional parameters
637+
# @return [Array<(ApplicationSecurityServicesResponse, Integer, Hash)>] ApplicationSecurityServicesResponse data, response status code and response headers
638+
def get_asm_service_by_name_with_http_info(service_filter, opts = {})
639+
unstable_enabled = @api_client.config.unstable_operations["v2.get_asm_service_by_name".to_sym]
640+
if unstable_enabled
641+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_asm_service_by_name")
642+
else
643+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_asm_service_by_name"))
644+
end
645+
646+
if @api_client.config.debugging
647+
@api_client.config.logger.debug 'Calling API: ApplicationSecurityAPI.get_asm_service_by_name ...'
648+
end
649+
# verify the required parameter 'service_filter' is set
650+
if @api_client.config.client_side_validation && service_filter.nil?
651+
fail ArgumentError, "Missing the required parameter 'service_filter' when calling ApplicationSecurityAPI.get_asm_service_by_name"
652+
end
653+
# resource path
654+
local_var_path = '/api/v2/security/asm/services/{service_filter}'.sub('{service_filter}', CGI.escape(service_filter.to_s).gsub('%2F', '/'))
655+
656+
# query parameters
657+
query_params = opts[:query_params] || {}
658+
659+
# header parameters
660+
header_params = opts[:header_params] || {}
661+
# HTTP header 'Accept' (if needed)
662+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
663+
664+
# form parameters
665+
form_params = opts[:form_params] || {}
666+
667+
# http body (model)
668+
post_body = opts[:debug_body]
669+
670+
# return_type
671+
return_type = opts[:debug_return_type] || 'ApplicationSecurityServicesResponse'
672+
673+
# auth_names
674+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
675+
676+
new_options = opts.merge(
677+
:operation => :get_asm_service_by_name,
678+
:header_params => header_params,
679+
:query_params => query_params,
680+
:form_params => form_params,
681+
:body => post_body,
682+
:auth_names => auth_names,
683+
:return_type => return_type,
684+
:api_version => "V2"
685+
)
686+
687+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
688+
if @api_client.config.debugging
689+
@api_client.config.logger.debug "API called: ApplicationSecurityAPI#get_asm_service_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
690+
end
691+
return data, status_code, headers
692+
end
693+
620694
# List all WAF custom rules.
621695
#
622696
# @see #list_application_security_waf_custom_rules_with_http_info

0 commit comments

Comments
 (0)