Class: Fastly::WafActiveRulesApi
- Inherits:
-
Object
- Object
- Fastly::WafActiveRulesApi
- Defined in:
- lib/fastly/api/waf_active_rules_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#bulk_update_waf_active_rules(opts = {}) ⇒ nil
Update multiple active rules Bulk update all active rules on a [firewall version](developer.fastly.com/reference/api/waf/firewall-version/).
-
#bulk_update_waf_active_rules_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Update multiple active rules Bulk update all active rules on a [firewall version](developer.fastly.com/reference/api/waf/firewall-version/).
-
#create_waf_active_rule(opts = {}) ⇒ WafActiveRuleCreationResponse
Add a rule to a WAF as an active rule Create an active rule for a particular firewall version.
-
#create_waf_active_rule_with_http_info(opts = {}) ⇒ Array<(WafActiveRuleCreationResponse, Integer, Hash)>
Add a rule to a WAF as an active rule Create an active rule for a particular firewall version.
-
#create_waf_active_rules_tag(opts = {}) ⇒ nil
Create active rules by tag Create active rules by tag.
-
#create_waf_active_rules_tag_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create active rules by tag Create active rules by tag.
-
#delete_waf_active_rule(opts = {}) ⇒ nil
Delete an active rule Delete an active rule for a particular firewall version.
-
#delete_waf_active_rule_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete an active rule Delete an active rule for a particular firewall version.
-
#get_waf_active_rule(opts = {}) ⇒ WafActiveRuleResponse
Get an active WAF rule object Get a specific active rule object.
-
#get_waf_active_rule_with_http_info(opts = {}) ⇒ Array<(WafActiveRuleResponse, Integer, Hash)>
Get an active WAF rule object Get a specific active rule object.
-
#initialize(api_client = ApiClient.default) ⇒ WafActiveRulesApi
constructor
A new instance of WafActiveRulesApi.
-
#list_waf_active_rules(opts = {}) ⇒ WafActiveRulesResponse
List active rules on a WAF List all active rules for a particular firewall version.
-
#list_waf_active_rules_with_http_info(opts = {}) ⇒ Array<(WafActiveRulesResponse, Integer, Hash)>
List active rules on a WAF List all active rules for a particular firewall version.
-
#update_waf_active_rule(opts = {}) ⇒ WafActiveRuleResponse
Update an active rule Update an active rule’s status for a particular firewall version.
-
#update_waf_active_rule_with_http_info(opts = {}) ⇒ Array<(WafActiveRuleResponse, Integer, Hash)>
Update an active rule Update an active rule's status for a particular firewall version.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ WafActiveRulesApi
Returns a new instance of WafActiveRulesApi.
17 18 19 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 17 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
15 16 17 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 15 def api_client @api_client end |
Instance Method Details
#bulk_update_waf_active_rules(opts = {}) ⇒ nil
Update multiple active rules Bulk update all active rules on a [firewall version](developer.fastly.com/reference/api/waf/firewall-version/). This endpoint will not add new active rules, only update existing active rules.
26 27 28 29 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 26 def bulk_update_waf_active_rules(opts = {}) bulk_update_waf_active_rules_with_http_info(opts) nil end |
#bulk_update_waf_active_rules_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Update multiple active rules Bulk update all active rules on a [firewall version](developer.fastly.com/reference/api/waf/firewall-version/). This endpoint will not add new active rules, only update existing active rules.
37 38 39 40 41 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 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 37 def bulk_update_waf_active_rules_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WafActiveRulesApi.bulk_update_waf_active_rules ...' end # unbox the parameters from the hash firewall_id = opts[:'firewall_id'] version_id = opts[:'version_id'] # verify the required parameter 'firewall_id' is set if @api_client.config.client_side_validation && firewall_id.nil? fail ArgumentError, "Missing the required parameter 'firewall_id' when calling WafActiveRulesApi.bulk_update_waf_active_rules" end # verify the required parameter 'version_id' is set if @api_client.config.client_side_validation && version_id.nil? fail ArgumentError, "Missing the required parameter 'version_id' when calling WafActiveRulesApi.bulk_update_waf_active_rules" end # resource path local_var_path = '/waf/firewalls/{firewall_id}/versions/{version_id}/active-rules/bulk'.sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body']) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"WafActiveRulesApi.bulk_update_waf_active_rules", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: WafActiveRulesApi#bulk_update_waf_active_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_waf_active_rule(opts = {}) ⇒ WafActiveRuleCreationResponse
Add a rule to a WAF as an active rule Create an active rule for a particular firewall version.
101 102 103 104 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 101 def create_waf_active_rule(opts = {}) data, _status_code, _headers = create_waf_active_rule_with_http_info(opts) data end |
#create_waf_active_rule_with_http_info(opts = {}) ⇒ Array<(WafActiveRuleCreationResponse, Integer, Hash)>
Add a rule to a WAF as an active rule Create an active rule for a particular firewall version.
112 113 114 115 116 117 118 119 120 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 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 112 def create_waf_active_rule_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WafActiveRulesApi.create_waf_active_rule ...' end # unbox the parameters from the hash firewall_id = opts[:'firewall_id'] version_id = opts[:'version_id'] # verify the required parameter 'firewall_id' is set if @api_client.config.client_side_validation && firewall_id.nil? fail ArgumentError, "Missing the required parameter 'firewall_id' when calling WafActiveRulesApi.create_waf_active_rule" end # verify the required parameter 'version_id' is set if @api_client.config.client_side_validation && version_id.nil? fail ArgumentError, "Missing the required parameter 'version_id' when calling WafActiveRulesApi.create_waf_active_rule" end # resource path local_var_path = '/waf/firewalls/{firewall_id}/versions/{version_id}/active-rules'.sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)) # 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/vnd.api+json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/vnd.api+json', 'application/vnd.api+json; ext=bulk']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'waf_active_rule']) # return_type return_type = opts[:debug_return_type] || 'WafActiveRuleCreationResponse' # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"WafActiveRulesApi.create_waf_active_rule", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: WafActiveRulesApi#create_waf_active_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_waf_active_rules_tag(opts = {}) ⇒ nil
Create active rules by tag Create active rules by tag. This endpoint will create active rules using the latest revision available for each rule.
179 180 181 182 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 179 def create_waf_active_rules_tag(opts = {}) create_waf_active_rules_tag_with_http_info(opts) nil end |
#create_waf_active_rules_tag_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create active rules by tag Create active rules by tag. This endpoint will create active rules using the latest revision available for each rule.
191 192 193 194 195 196 197 198 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 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 191 def create_waf_active_rules_tag_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WafActiveRulesApi.create_waf_active_rules_tag ...' end # unbox the parameters from the hash firewall_id = opts[:'firewall_id'] version_id = opts[:'version_id'] waf_tag_name = opts[:'waf_tag_name'] # verify the required parameter 'firewall_id' is set if @api_client.config.client_side_validation && firewall_id.nil? fail ArgumentError, "Missing the required parameter 'firewall_id' when calling WafActiveRulesApi.create_waf_active_rules_tag" end # verify the required parameter 'version_id' is set if @api_client.config.client_side_validation && version_id.nil? fail ArgumentError, "Missing the required parameter 'version_id' when calling WafActiveRulesApi.create_waf_active_rules_tag" end # verify the required parameter 'waf_tag_name' is set if @api_client.config.client_side_validation && waf_tag_name.nil? fail ArgumentError, "Missing the required parameter 'waf_tag_name' when calling WafActiveRulesApi.create_waf_active_rules_tag" end # resource path local_var_path = '/waf/firewalls/{firewall_id}/versions/{version_id}/tags/{waf_tag_name}/active-rules'.sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'waf_tag_name' + '}', CGI.escape(waf_tag_name.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'waf_active_rule']) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"WafActiveRulesApi.create_waf_active_rules_tag", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: WafActiveRulesApi#create_waf_active_rules_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_waf_active_rule(opts = {}) ⇒ nil
Delete an active rule Delete an active rule for a particular firewall version.
260 261 262 263 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 260 def delete_waf_active_rule(opts = {}) delete_waf_active_rule_with_http_info(opts) nil end |
#delete_waf_active_rule_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete an active rule Delete an active rule for a particular firewall version.
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 326 327 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 271 def delete_waf_active_rule_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WafActiveRulesApi.delete_waf_active_rule ...' end # unbox the parameters from the hash firewall_id = opts[:'firewall_id'] version_id = opts[:'version_id'] waf_rule_id = opts[:'waf_rule_id'] # verify the required parameter 'firewall_id' is set if @api_client.config.client_side_validation && firewall_id.nil? fail ArgumentError, "Missing the required parameter 'firewall_id' when calling WafActiveRulesApi.delete_waf_active_rule" end # verify the required parameter 'version_id' is set if @api_client.config.client_side_validation && version_id.nil? fail ArgumentError, "Missing the required parameter 'version_id' when calling WafActiveRulesApi.delete_waf_active_rule" end # verify the required parameter 'waf_rule_id' is set if @api_client.config.client_side_validation && waf_rule_id.nil? fail ArgumentError, "Missing the required parameter 'waf_rule_id' when calling WafActiveRulesApi.delete_waf_active_rule" end # resource path local_var_path = '/waf/firewalls/{firewall_id}/versions/{version_id}/active-rules/{waf_rule_id}'.sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'waf_rule_id' + '}', CGI.escape(waf_rule_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # 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] || ['token'] = opts.merge( :operation => :"WafActiveRulesApi.delete_waf_active_rule", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: WafActiveRulesApi#delete_waf_active_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_waf_active_rule(opts = {}) ⇒ WafActiveRuleResponse
Get an active WAF rule object Get a specific active rule object. Includes details of the rule revision associated with the active rule object by default.
336 337 338 339 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 336 def get_waf_active_rule(opts = {}) data, _status_code, _headers = get_waf_active_rule_with_http_info(opts) data end |
#get_waf_active_rule_with_http_info(opts = {}) ⇒ Array<(WafActiveRuleResponse, Integer, Hash)>
Get an active WAF rule object Get a specific active rule object. Includes details of the rule revision associated with the active rule object by default.
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 402 403 404 405 406 407 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 348 def get_waf_active_rule_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WafActiveRulesApi.get_waf_active_rule ...' end # unbox the parameters from the hash firewall_id = opts[:'firewall_id'] version_id = opts[:'version_id'] waf_rule_id = opts[:'waf_rule_id'] # verify the required parameter 'firewall_id' is set if @api_client.config.client_side_validation && firewall_id.nil? fail ArgumentError, "Missing the required parameter 'firewall_id' when calling WafActiveRulesApi.get_waf_active_rule" end # verify the required parameter 'version_id' is set if @api_client.config.client_side_validation && version_id.nil? fail ArgumentError, "Missing the required parameter 'version_id' when calling WafActiveRulesApi.get_waf_active_rule" end # verify the required parameter 'waf_rule_id' is set if @api_client.config.client_side_validation && waf_rule_id.nil? fail ArgumentError, "Missing the required parameter 'waf_rule_id' when calling WafActiveRulesApi.get_waf_active_rule" end # resource path local_var_path = '/waf/firewalls/{firewall_id}/versions/{version_id}/active-rules/{waf_rule_id}'.sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'waf_rule_id' + '}', CGI.escape(waf_rule_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'WafActiveRuleResponse' # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"WafActiveRulesApi.get_waf_active_rule", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: WafActiveRulesApi#get_waf_active_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_waf_active_rules(opts = {}) ⇒ WafActiveRulesResponse
List active rules on a WAF List all active rules for a particular firewall version.
421 422 423 424 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 421 def list_waf_active_rules(opts = {}) data, _status_code, _headers = list_waf_active_rules_with_http_info(opts) data end |
#list_waf_active_rules_with_http_info(opts = {}) ⇒ Array<(WafActiveRulesResponse, Integer, Hash)>
List active rules on a WAF List all active rules for a particular firewall version.
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 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 438 def list_waf_active_rules_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WafActiveRulesApi.list_waf_active_rules ...' end # unbox the parameters from the hash firewall_id = opts[:'firewall_id'] version_id = opts[:'version_id'] if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling WafActiveRulesApi.list_waf_active_rules, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling WafActiveRulesApi.list_waf_active_rules, must be greater than or equal to 1.' end # verify the required parameter 'firewall_id' is set if @api_client.config.client_side_validation && firewall_id.nil? fail ArgumentError, "Missing the required parameter 'firewall_id' when calling WafActiveRulesApi.list_waf_active_rules" end # verify the required parameter 'version_id' is set if @api_client.config.client_side_validation && version_id.nil? fail ArgumentError, "Missing the required parameter 'version_id' when calling WafActiveRulesApi.list_waf_active_rules" end # resource path local_var_path = '/waf/firewalls/{firewall_id}/versions/{version_id}/active-rules'.sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'filter[status]'] = opts[:'filter_status'] if !opts[:'filter_status'].nil? query_params[:'filter[waf_rule_revision][message]'] = opts[:'filter_waf_rule_revision_message'] if !opts[:'filter_waf_rule_revision_message'].nil? query_params[:'filter[waf_rule_revision][modsec_rule_id]'] = opts[:'filter_waf_rule_revision_modsec_rule_id'] if !opts[:'filter_waf_rule_revision_modsec_rule_id'].nil? query_params[:'filter[outdated]'] = opts[:'filter_outdated'] if !opts[:'filter_outdated'].nil? query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'WafActiveRulesResponse' # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"WafActiveRulesApi.list_waf_active_rules", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: WafActiveRulesApi#list_waf_active_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_waf_active_rule(opts = {}) ⇒ WafActiveRuleResponse
Update an active rule Update an active rule’s status for a particular firewall version.
515 516 517 518 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 515 def update_waf_active_rule(opts = {}) data, _status_code, _headers = update_waf_active_rule_with_http_info(opts) data end |
#update_waf_active_rule_with_http_info(opts = {}) ⇒ Array<(WafActiveRuleResponse, Integer, Hash)>
Update an active rule Update an active rule's status for a particular firewall version.
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 |
# File 'lib/fastly/api/waf_active_rules_api.rb', line 527 def update_waf_active_rule_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WafActiveRulesApi.update_waf_active_rule ...' end # unbox the parameters from the hash firewall_id = opts[:'firewall_id'] version_id = opts[:'version_id'] waf_rule_id = opts[:'waf_rule_id'] # verify the required parameter 'firewall_id' is set if @api_client.config.client_side_validation && firewall_id.nil? fail ArgumentError, "Missing the required parameter 'firewall_id' when calling WafActiveRulesApi.update_waf_active_rule" end # verify the required parameter 'version_id' is set if @api_client.config.client_side_validation && version_id.nil? fail ArgumentError, "Missing the required parameter 'version_id' when calling WafActiveRulesApi.update_waf_active_rule" end # verify the required parameter 'waf_rule_id' is set if @api_client.config.client_side_validation && waf_rule_id.nil? fail ArgumentError, "Missing the required parameter 'waf_rule_id' when calling WafActiveRulesApi.update_waf_active_rule" end # resource path local_var_path = '/waf/firewalls/{firewall_id}/versions/{version_id}/active-rules/{waf_rule_id}'.sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'waf_rule_id' + '}', CGI.escape(waf_rule_id.to_s)) # 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/vnd.api+json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'waf_active_rule']) # return_type return_type = opts[:debug_return_type] || 'WafActiveRuleResponse' # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"WafActiveRulesApi.update_waf_active_rule", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: WafActiveRulesApi#update_waf_active_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |