Class: DatadogAPIClient::V2::StaticAnalysisAPI
- Inherits:
-
Object
- Object
- DatadogAPIClient::V2::StaticAnalysisAPI
- Defined in:
- lib/datadog_api_client/v2/api/static_analysis_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_custom_rule(ruleset_name, body, opts = {}) ⇒ Object
Create Custom Rule.
-
#create_custom_rule_revision(ruleset_name, rule_name, body, opts = {}) ⇒ Object
Create Custom Rule Revision.
-
#create_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create Custom Rule Revision.
-
#create_custom_rule_with_http_info(ruleset_name, body, opts = {}) ⇒ Array<(CustomRuleResponse, Integer, Hash)>
Create Custom Rule.
-
#create_sca_resolve_vulnerable_symbols(body, opts = {}) ⇒ Object
POST request to resolve vulnerable symbols.
-
#create_sca_resolve_vulnerable_symbols_with_http_info(body, opts = {}) ⇒ Array<(ResolveVulnerableSymbolsResponse, Integer, Hash)>
POST request to resolve vulnerable symbols.
-
#create_sca_result(body, opts = {}) ⇒ Object
Post dependencies for analysis.
-
#create_sca_result_with_http_info(body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Post dependencies for analysis.
-
#delete_custom_rule(ruleset_name, rule_name, opts = {}) ⇒ Object
Delete Custom Rule.
-
#delete_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete Custom Rule.
-
#delete_custom_ruleset(ruleset_name, opts = {}) ⇒ Object
Delete Custom Ruleset.
-
#delete_custom_ruleset_with_http_info(ruleset_name, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete Custom Ruleset.
-
#get_custom_rule(ruleset_name, rule_name, opts = {}) ⇒ Object
Show Custom Rule.
-
#get_custom_rule_revision(ruleset_name, rule_name, id, opts = {}) ⇒ Object
Show Custom Rule Revision.
-
#get_custom_rule_revision_with_http_info(ruleset_name, rule_name, id, opts = {}) ⇒ Array<(CustomRuleRevisionResponse, Integer, Hash)>
Show Custom Rule Revision.
-
#get_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) ⇒ Array<(CustomRuleResponse, Integer, Hash)>
Show Custom Rule.
-
#get_custom_ruleset(ruleset_name, opts = {}) ⇒ Object
Show Custom Ruleset.
-
#get_custom_ruleset_with_http_info(ruleset_name, opts = {}) ⇒ Array<(CustomRulesetResponse, Integer, Hash)>
Show Custom Ruleset.
-
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ StaticAnalysisAPI
constructor
A new instance of StaticAnalysisAPI.
-
#list_custom_rule_revisions(ruleset_name, rule_name, opts = {}) ⇒ Object
List Custom Rule Revisions.
-
#list_custom_rule_revisions_with_http_info(ruleset_name, rule_name, opts = {}) ⇒ Array<(CustomRuleRevisionsResponse, Integer, Hash)>
List Custom Rule Revisions.
-
#list_custom_rule_revisions_with_pagination(ruleset_name, rule_name, opts = {}) {|CustomRuleRevision| ... } ⇒ Object
List Custom Rule Revisions.
-
#revert_custom_rule_revision(ruleset_name, rule_name, body, opts = {}) ⇒ Object
Revert Custom Rule Revision.
-
#revert_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Revert Custom Rule Revision.
-
#update_custom_ruleset(ruleset_name, body, opts = {}) ⇒ Object
Update Custom Ruleset.
-
#update_custom_ruleset_with_http_info(ruleset_name, body, opts = {}) ⇒ Array<(CustomRulesetResponse, Integer, Hash)>
Update Custom Ruleset.
Constructor Details
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ StaticAnalysisAPI
Returns a new instance of StaticAnalysisAPI.
22 23 24 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 22 def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
20 21 22 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 20 def api_client @api_client end |
Instance Method Details
#create_custom_rule(ruleset_name, body, opts = {}) ⇒ Object
Create Custom Rule.
29 30 31 32 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 29 def create_custom_rule(ruleset_name, body, opts = {}) data, _status_code, _headers = create_custom_rule_with_http_info(ruleset_name, body, opts) data end |
#create_custom_rule_revision(ruleset_name, rule_name, body, opts = {}) ⇒ Object
Create Custom Rule Revision.
107 108 109 110 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 107 def create_custom_rule_revision(ruleset_name, rule_name, body, opts = {}) create_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, opts) nil end |
#create_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create Custom Rule Revision.
Create a new revision for a custom rule
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 121 def create_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.create_custom_rule_revision".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_custom_rule_revision") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_custom_rule_revision")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_custom_rule_revision ...' end # verify the required parameter 'ruleset_name' is set if @api_client.config.client_side_validation && ruleset_name.nil? fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.create_custom_rule_revision" end # verify the required parameter 'rule_name' is set if @api_client.config.client_side_validation && rule_name.nil? fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.create_custom_rule_revision" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_custom_rule_revision" end # resource path local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :create_custom_rule_revision, :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::Put, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_custom_rule_revision\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_custom_rule_with_http_info(ruleset_name, body, opts = {}) ⇒ Array<(CustomRuleResponse, Integer, Hash)>
Create Custom Rule.
Create a new custom rule within a ruleset
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 42 def create_custom_rule_with_http_info(ruleset_name, body, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.create_custom_rule".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_custom_rule") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_custom_rule")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_custom_rule ...' end # verify the required parameter 'ruleset_name' is set if @api_client.config.client_side_validation && ruleset_name.nil? fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.create_custom_rule" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_custom_rule" end # resource path local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'CustomRuleResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :create_custom_rule, :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::Put, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_custom_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_sca_resolve_vulnerable_symbols(body, opts = {}) ⇒ Object
POST request to resolve vulnerable symbols.
190 191 192 193 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 190 def create_sca_resolve_vulnerable_symbols(body, opts = {}) data, _status_code, _headers = create_sca_resolve_vulnerable_symbols_with_http_info(body, opts) data end |
#create_sca_resolve_vulnerable_symbols_with_http_info(body, opts = {}) ⇒ Array<(ResolveVulnerableSymbolsResponse, Integer, Hash)>
POST request to resolve vulnerable symbols.
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 199 def create_sca_resolve_vulnerable_symbols_with_http_info(body, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.create_sca_resolve_vulnerable_symbols".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_sca_resolve_vulnerable_symbols") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_sca_resolve_vulnerable_symbols")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_sca_resolve_vulnerable_symbols ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_sca_resolve_vulnerable_symbols" end # resource path local_var_path = '/api/v2/static-analysis-sca/vulnerabilities/resolve-vulnerable-symbols' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'ResolveVulnerableSymbolsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :create_sca_resolve_vulnerable_symbols, :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::Post, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_sca_resolve_vulnerable_symbols\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_sca_result(body, opts = {}) ⇒ Object
Post dependencies for analysis.
260 261 262 263 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 260 def create_sca_result(body, opts = {}) create_sca_result_with_http_info(body, opts) nil end |
#create_sca_result_with_http_info(body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Post dependencies for analysis.
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 269 def create_sca_result_with_http_info(body, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.create_sca_result".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_sca_result") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_sca_result")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_sca_result ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_sca_result" end # resource path local_var_path = '/api/v2/static-analysis-sca/dependencies' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :create_sca_result, :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::Post, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_sca_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_custom_rule(ruleset_name, rule_name, opts = {}) ⇒ Object
Delete Custom Rule.
330 331 332 333 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 330 def delete_custom_rule(ruleset_name, rule_name, opts = {}) delete_custom_rule_with_http_info(ruleset_name, rule_name, opts) nil end |
#delete_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete Custom Rule.
Delete a custom rule
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 343 def delete_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.delete_custom_rule".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_custom_rule") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_custom_rule")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.delete_custom_rule ...' end # verify the required parameter 'ruleset_name' is set if @api_client.config.client_side_validation && ruleset_name.nil? fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.delete_custom_rule" end # verify the required parameter 'rule_name' is set if @api_client.config.client_side_validation && rule_name.nil? fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.delete_custom_rule" end # resource path local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :delete_custom_rule, :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::Delete, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: StaticAnalysisAPI#delete_custom_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_custom_ruleset(ruleset_name, opts = {}) ⇒ Object
Delete Custom Ruleset.
406 407 408 409 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 406 def delete_custom_ruleset(ruleset_name, opts = {}) delete_custom_ruleset_with_http_info(ruleset_name, opts) nil end |
#delete_custom_ruleset_with_http_info(ruleset_name, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete Custom Ruleset.
Delete a custom ruleset
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 418 def delete_custom_ruleset_with_http_info(ruleset_name, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.delete_custom_ruleset".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_custom_ruleset") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_custom_ruleset")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.delete_custom_ruleset ...' end # verify the required parameter 'ruleset_name' is set if @api_client.config.client_side_validation && ruleset_name.nil? fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.delete_custom_ruleset" end # resource path local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :delete_custom_ruleset, :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::Delete, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: StaticAnalysisAPI#delete_custom_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_custom_rule(ruleset_name, rule_name, opts = {}) ⇒ Object
Show Custom Rule.
477 478 479 480 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 477 def get_custom_rule(ruleset_name, rule_name, opts = {}) data, _status_code, _headers = get_custom_rule_with_http_info(ruleset_name, rule_name, opts) data end |
#get_custom_rule_revision(ruleset_name, rule_name, id, opts = {}) ⇒ Object
Show Custom Rule Revision.
553 554 555 556 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 553 def get_custom_rule_revision(ruleset_name, rule_name, id, opts = {}) data, _status_code, _headers = get_custom_rule_revision_with_http_info(ruleset_name, rule_name, id, opts) data end |
#get_custom_rule_revision_with_http_info(ruleset_name, rule_name, id, opts = {}) ⇒ Array<(CustomRuleRevisionResponse, Integer, Hash)>
Show Custom Rule Revision.
Get a specific revision of a custom rule
567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 567 def get_custom_rule_revision_with_http_info(ruleset_name, rule_name, id, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.get_custom_rule_revision".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_custom_rule_revision") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_custom_rule_revision")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.get_custom_rule_revision ...' end # verify the required parameter 'ruleset_name' is set if @api_client.config.client_side_validation && ruleset_name.nil? fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.get_custom_rule_revision" end # verify the required parameter 'rule_name' is set if @api_client.config.client_side_validation && rule_name.nil? fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.get_custom_rule_revision" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling StaticAnalysisAPI.get_custom_rule_revision" end # resource path local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions/{id}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')).sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # 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] || 'CustomRuleRevisionResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :get_custom_rule_revision, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: StaticAnalysisAPI#get_custom_rule_revision\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) ⇒ Array<(CustomRuleResponse, Integer, Hash)>
Show Custom Rule.
Get a custom rule by name
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 490 def get_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.get_custom_rule".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_custom_rule") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_custom_rule")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.get_custom_rule ...' end # verify the required parameter 'ruleset_name' is set if @api_client.config.client_side_validation && ruleset_name.nil? fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.get_custom_rule" end # verify the required parameter 'rule_name' is set if @api_client.config.client_side_validation && rule_name.nil? fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.get_custom_rule" end # resource path local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # 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] || 'CustomRuleResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :get_custom_rule, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: StaticAnalysisAPI#get_custom_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_custom_ruleset(ruleset_name, opts = {}) ⇒ Object
Show Custom Ruleset.
634 635 636 637 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 634 def get_custom_ruleset(ruleset_name, opts = {}) data, _status_code, _headers = get_custom_ruleset_with_http_info(ruleset_name, opts) data end |
#get_custom_ruleset_with_http_info(ruleset_name, opts = {}) ⇒ Array<(CustomRulesetResponse, Integer, Hash)>
Show Custom Ruleset.
Get a custom ruleset by name
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 646 def get_custom_ruleset_with_http_info(ruleset_name, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.get_custom_ruleset".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_custom_ruleset") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_custom_ruleset")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.get_custom_ruleset ...' end # verify the required parameter 'ruleset_name' is set if @api_client.config.client_side_validation && ruleset_name.nil? fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.get_custom_ruleset" end # resource path local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # 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] || 'CustomRulesetResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :get_custom_ruleset, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: StaticAnalysisAPI#get_custom_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_custom_rule_revisions(ruleset_name, rule_name, opts = {}) ⇒ Object
List Custom Rule Revisions.
705 706 707 708 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 705 def list_custom_rule_revisions(ruleset_name, rule_name, opts = {}) data, _status_code, _headers = list_custom_rule_revisions_with_http_info(ruleset_name, rule_name, opts) data end |
#list_custom_rule_revisions_with_http_info(ruleset_name, rule_name, opts = {}) ⇒ Array<(CustomRuleRevisionsResponse, Integer, Hash)>
List Custom Rule Revisions.
Get all revisions for a custom rule
720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 720 def list_custom_rule_revisions_with_http_info(ruleset_name, rule_name, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.list_custom_rule_revisions".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_custom_rule_revisions") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_custom_rule_revisions")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.list_custom_rule_revisions ...' end # verify the required parameter 'ruleset_name' is set if @api_client.config.client_side_validation && ruleset_name.nil? fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.list_custom_rule_revisions" end # verify the required parameter 'rule_name' is set if @api_client.config.client_side_validation && rule_name.nil? fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.list_custom_rule_revisions" end # resource path local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_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] || 'CustomRuleRevisionsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :list_custom_rule_revisions, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: StaticAnalysisAPI#list_custom_rule_revisions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_custom_rule_revisions_with_pagination(ruleset_name, rule_name, opts = {}) {|CustomRuleRevision| ... } ⇒ Object
List Custom Rule Revisions.
Provide a paginated version of #list_custom_rule_revisions, returning all items.
To use it you need to use a block: list_custom_rule_revisions_with_pagination { |item| p item }
789 790 791 792 793 794 795 796 797 798 799 800 801 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 789 def list_custom_rule_revisions_with_pagination(ruleset_name, rule_name, opts = {}) api_version = "V2" page_size = @api_client.get_attribute_from_path(opts, "page_limit", 10) @api_client.set_attribute_from_path(api_version, opts, "page_limit", Integer, page_size) while true do response = list_custom_rule_revisions(ruleset_name, rule_name, opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } if @api_client.get_attribute_from_path(response, "data").length < page_size break end @api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size) end end |
#revert_custom_rule_revision(ruleset_name, rule_name, body, opts = {}) ⇒ Object
Revert Custom Rule Revision.
806 807 808 809 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 806 def revert_custom_rule_revision(ruleset_name, rule_name, body, opts = {}) revert_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, opts) nil end |
#revert_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Revert Custom Rule Revision.
Revert a custom rule to a previous revision
820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 820 def revert_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.revert_custom_rule_revision".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.revert_custom_rule_revision") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.revert_custom_rule_revision")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.revert_custom_rule_revision ...' end # verify the required parameter 'ruleset_name' is set if @api_client.config.client_side_validation && ruleset_name.nil? fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.revert_custom_rule_revision" end # verify the required parameter 'rule_name' is set if @api_client.config.client_side_validation && rule_name.nil? fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.revert_custom_rule_revision" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.revert_custom_rule_revision" end # resource path local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions/revert'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :revert_custom_rule_revision, :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::Post, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: StaticAnalysisAPI#revert_custom_rule_revision\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_custom_ruleset(ruleset_name, body, opts = {}) ⇒ Object
Update Custom Ruleset.
889 890 891 892 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 889 def update_custom_ruleset(ruleset_name, body, opts = {}) data, _status_code, _headers = update_custom_ruleset_with_http_info(ruleset_name, body, opts) data end |
#update_custom_ruleset_with_http_info(ruleset_name, body, opts = {}) ⇒ Array<(CustomRulesetResponse, Integer, Hash)>
Update Custom Ruleset.
Update an existing custom ruleset
902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 |
# File 'lib/datadog_api_client/v2/api/static_analysis_api.rb', line 902 def update_custom_ruleset_with_http_info(ruleset_name, body, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.update_custom_ruleset".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_custom_ruleset") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_custom_ruleset")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.update_custom_ruleset ...' end # verify the required parameter 'ruleset_name' is set if @api_client.config.client_side_validation && ruleset_name.nil? fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.update_custom_ruleset" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.update_custom_ruleset" end # resource path local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'CustomRulesetResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :update_custom_ruleset, :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::Patch, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: StaticAnalysisAPI#update_custom_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |