fastly 5.3.1 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +55 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +85 -63
  5. data/docs/AclEntry.md +1 -1
  6. data/docs/AclEntryApi.md +176 -0
  7. data/docs/AclEntryResponse.md +1 -1
  8. data/docs/ApexRedirectApi.md +56 -0
  9. data/docs/BulkUpdateAclEntry.md +1 -1
  10. data/docs/ClientKey.md +12 -0
  11. data/docs/ContactApi.md +50 -0
  12. data/docs/Content.md +2 -2
  13. data/docs/ContentApi.md +52 -0
  14. data/docs/DirectorApi.md +42 -0
  15. data/docs/DomainInspector.md +12 -0
  16. data/docs/DomainInspectorEntry.md +11 -0
  17. data/docs/DomainInspectorEntryDimensions.md +12 -0
  18. data/docs/DomainInspectorHistoricalApi.md +72 -0
  19. data/docs/DomainInspectorMeasurements.md +71 -0
  20. data/docs/DomainInspectorRealtimeApi.md +132 -0
  21. data/docs/DomainInspectorRealtimeEntry.md +12 -0
  22. data/docs/EventAttributes.md +1 -1
  23. data/docs/{EventsResponseAllOf.md → EventData.md} +1 -1
  24. data/docs/HistoricalDomains.md +13 -0
  25. data/docs/HistoricalDomainsData.md +11 -0
  26. data/docs/HistoricalDomainsMeta.md +18 -0
  27. data/docs/HistoricalDomainsMetaFilters.md +12 -0
  28. data/docs/HistoricalDomainsResponse.md +13 -0
  29. data/docs/HistoricalDomainsResponseAllOf.md +10 -0
  30. data/docs/{HistoricalFieldResultsAttributesAllOf.md → HistoricalFieldResultsAttributesAdditional.md} +1 -1
  31. data/docs/HistoricalOriginsResponse.md +13 -0
  32. data/docs/HistoricalOriginsResponseAllOf.md +10 -0
  33. data/docs/IamRolesApi.md +157 -0
  34. data/docs/IamServiceGroupsApi.md +157 -0
  35. data/docs/IamUserGroupsApi.md +315 -0
  36. data/docs/InlineResponse2005.md +11 -0
  37. data/docs/InlineResponse2006.md +11 -0
  38. data/docs/InlineResponse2007.md +10 -0
  39. data/docs/InlineResponse400.md +10 -0
  40. data/docs/LegacyWafConfigurationSet.md +11 -0
  41. data/docs/LegacyWafConfigurationSetsApi.md +125 -0
  42. data/docs/LegacyWafFirewall.md +18 -0
  43. data/docs/LegacyWafFirewallApi.md +352 -0
  44. data/docs/LegacyWafOwasp.md +38 -0
  45. data/docs/LegacyWafOwaspApi.md +138 -0
  46. data/docs/LegacyWafRule.md +14 -0
  47. data/docs/LegacyWafRuleApi.md +184 -0
  48. data/docs/LegacyWafRuleStatus.md +12 -0
  49. data/docs/LegacyWafRuleStatusApi.md +202 -0
  50. data/docs/LegacyWafRuleset.md +11 -0
  51. data/docs/LegacyWafRulesetApi.md +136 -0
  52. data/docs/LegacyWafTag.md +10 -0
  53. data/docs/LegacyWafTagApi.md +58 -0
  54. data/docs/LegacyWafUpdateStatus.md +15 -0
  55. data/docs/LegacyWafUpdateStatusApi.md +102 -0
  56. data/docs/LoggingKafkaApi.md +42 -0
  57. data/docs/LoggingKinesisApi.md +42 -0
  58. data/docs/OriginInspector.md +12 -0
  59. data/docs/OriginInspectorDimensions.md +12 -0
  60. data/docs/OriginInspectorEntry.md +11 -0
  61. data/docs/OriginInspectorHistorical.md +13 -0
  62. data/docs/OriginInspectorHistoricalApi.md +72 -0
  63. data/docs/OriginInspectorHistoricalData.md +11 -0
  64. data/docs/OriginInspectorHistoricalMeta.md +18 -0
  65. data/docs/OriginInspectorHistoricalMetaFilters.md +12 -0
  66. data/docs/OriginInspectorMeasurements.md +161 -0
  67. data/docs/OriginInspectorRealtimeApi.md +132 -0
  68. data/docs/OriginInspectorRealtimeEntry.md +12 -0
  69. data/docs/OriginInspectorRealtimeEntryRecorded.md +9 -0
  70. data/docs/OriginInspectorSubsequentRequestTimestamp.md +9 -0
  71. data/docs/OriginInspectorValues.md +161 -0
  72. data/docs/PaginationCursorMeta.md +11 -0
  73. data/docs/ReadOnlyServiceId.md +9 -0
  74. data/docs/ReadOnlyVersion.md +9 -0
  75. data/docs/RealtimeEntry.md +2 -2
  76. data/docs/RealtimeEntryAggregated.md +227 -0
  77. data/docs/RealtimeEntryRecorded.md +9 -0
  78. data/docs/RealtimeMeasurements.md +1 -1
  79. data/docs/RecordedTimestamp.md +9 -0
  80. data/docs/RequestSettingsApi.md +40 -0
  81. data/docs/ResponseObjectApi.md +82 -0
  82. data/docs/Secret.md +12 -0
  83. data/docs/SecretResponse.md +13 -0
  84. data/docs/SecretStore.md +10 -0
  85. data/docs/SecretStoreApi.md +233 -0
  86. data/docs/SecretStoreItemApi.md +255 -0
  87. data/docs/SecretStoreResponse.md +12 -0
  88. data/docs/ServiceAuthorizationsApi.md +76 -0
  89. data/docs/SigningKey.md +10 -0
  90. data/docs/SnippetApi.md +42 -0
  91. data/docs/SubsequentRequestTimestamp.md +9 -0
  92. data/docs/SudoApi.md +52 -0
  93. data/docs/SudoGenericTokenError.md +10 -0
  94. data/docs/SudoRequest.md +12 -0
  95. data/docs/SudoResponse.md +10 -0
  96. data/docs/TokensApi.md +70 -0
  97. data/docs/Values.md +71 -0
  98. data/docs/WafActiveRulesApi.md +41 -0
  99. data/lib/fastly/api/acl_entry_api.rb +332 -0
  100. data/lib/fastly/api/apex_redirect_api.rb +111 -0
  101. data/lib/fastly/api/contact_api.rb +90 -0
  102. data/lib/fastly/api/content_api.rb +79 -0
  103. data/lib/fastly/api/director_api.rb +82 -0
  104. data/lib/fastly/api/domain_inspector_historical_api.rb +125 -0
  105. data/lib/fastly/api/domain_inspector_realtime_api.rb +223 -0
  106. data/lib/fastly/api/iam_roles_api.rb +271 -0
  107. data/lib/fastly/api/iam_service_groups_api.rb +271 -0
  108. data/lib/fastly/api/iam_user_groups_api.rb +547 -0
  109. data/lib/fastly/api/legacy_waf_configuration_sets_api.rb +209 -0
  110. data/lib/fastly/api/legacy_waf_firewall_api.rb +627 -0
  111. data/lib/fastly/api/legacy_waf_owasp_api.rb +244 -0
  112. data/lib/fastly/api/legacy_waf_rule_api.rb +307 -0
  113. data/lib/fastly/api/legacy_waf_rule_status_api.rb +366 -0
  114. data/lib/fastly/api/legacy_waf_ruleset_api.rb +237 -0
  115. data/lib/fastly/api/legacy_waf_tag_api.rb +96 -0
  116. data/lib/fastly/api/legacy_waf_update_status_api.rb +184 -0
  117. data/lib/fastly/api/logging_kafka_api.rb +82 -0
  118. data/lib/fastly/api/logging_kinesis_api.rb +82 -0
  119. data/lib/fastly/api/origin_inspector_historical_api.rb +125 -0
  120. data/lib/fastly/api/origin_inspector_realtime_api.rb +223 -0
  121. data/lib/fastly/api/request_settings_api.rb +75 -0
  122. data/lib/fastly/api/response_object_api.rb +157 -0
  123. data/lib/fastly/api/secret_store_api.rb +381 -0
  124. data/lib/fastly/api/secret_store_item_api.rb +437 -0
  125. data/lib/fastly/api/service_authorizations_api.rb +126 -0
  126. data/lib/fastly/api/snippet_api.rb +82 -0
  127. data/lib/fastly/api/sudo_api.rb +83 -0
  128. data/lib/fastly/api/tokens_api.rb +122 -0
  129. data/lib/fastly/api/waf_active_rules_api.rb +75 -0
  130. data/lib/fastly/configuration.rb +504 -0
  131. data/lib/fastly/models/acl_entry.rb +1 -1
  132. data/lib/fastly/models/acl_entry_response.rb +1 -1
  133. data/lib/fastly/models/bulk_update_acl_entry.rb +1 -1
  134. data/lib/fastly/models/client_key.rb +239 -0
  135. data/lib/fastly/models/content.rb +8 -4
  136. data/lib/fastly/models/domain.rb +1 -0
  137. data/lib/fastly/models/domain_inspector.rb +238 -0
  138. data/lib/fastly/models/domain_inspector_entry.rb +228 -0
  139. data/lib/fastly/models/domain_inspector_entry_dimensions.rb +238 -0
  140. data/lib/fastly/models/domain_inspector_measurements.rb +828 -0
  141. data/lib/fastly/models/domain_inspector_realtime_entry.rb +241 -0
  142. data/lib/fastly/models/event_attributes.rb +4 -2
  143. data/lib/fastly/models/{events_response_all_of.rb → event_data.rb} +3 -3
  144. data/lib/fastly/models/events_response.rb +1 -1
  145. data/lib/fastly/models/historical_domains.rb +249 -0
  146. data/lib/fastly/models/historical_domains_data.rb +228 -0
  147. data/lib/fastly/models/historical_domains_meta.rb +297 -0
  148. data/lib/fastly/models/historical_domains_meta_filters.rb +235 -0
  149. data/lib/fastly/models/historical_domains_response.rb +257 -0
  150. data/lib/fastly/models/historical_domains_response_all_of.rb +219 -0
  151. data/lib/fastly/models/historical_field_results_attributes.rb +1 -1
  152. data/lib/fastly/models/{historical_field_results_attributes_all_of.rb → historical_field_results_attributes_additional.rb} +3 -3
  153. data/lib/fastly/models/historical_origins_response.rb +257 -0
  154. data/lib/fastly/models/historical_origins_response_all_of.rb +219 -0
  155. data/lib/fastly/models/inline_response2005.rb +227 -0
  156. data/lib/fastly/models/inline_response2006.rb +227 -0
  157. data/lib/fastly/models/inline_response2007.rb +218 -0
  158. data/lib/fastly/models/inline_response400.rb +250 -0
  159. data/lib/fastly/models/legacy_waf_configuration_set.rb +227 -0
  160. data/lib/fastly/models/legacy_waf_firewall.rb +297 -0
  161. data/lib/fastly/models/legacy_waf_owasp.rb +527 -0
  162. data/lib/fastly/models/legacy_waf_rule.rb +257 -0
  163. data/lib/fastly/models/legacy_waf_rule_status.rb +237 -0
  164. data/lib/fastly/models/legacy_waf_ruleset.rb +227 -0
  165. data/lib/fastly/models/legacy_waf_tag.rb +217 -0
  166. data/lib/fastly/models/legacy_waf_update_status.rb +267 -0
  167. data/lib/fastly/models/origin_inspector.rb +238 -0
  168. data/lib/fastly/models/origin_inspector_dimensions.rb +238 -0
  169. data/lib/fastly/models/origin_inspector_entry.rb +228 -0
  170. data/lib/fastly/models/origin_inspector_historical.rb +249 -0
  171. data/lib/fastly/models/origin_inspector_historical_data.rb +225 -0
  172. data/lib/fastly/models/origin_inspector_historical_meta.rb +297 -0
  173. data/lib/fastly/models/origin_inspector_historical_meta_filters.rb +235 -0
  174. data/lib/fastly/models/origin_inspector_measurements.rb +1728 -0
  175. data/lib/fastly/models/origin_inspector_realtime_entry.rb +241 -0
  176. data/lib/fastly/models/origin_inspector_realtime_entry_recorded.rb +208 -0
  177. data/lib/fastly/models/origin_inspector_subsequent_request_timestamp.rb +208 -0
  178. data/lib/fastly/models/origin_inspector_values.rb +1728 -0
  179. data/lib/fastly/models/pagination_cursor_meta.rb +227 -0
  180. data/lib/fastly/models/read_only_service_id.rb +207 -0
  181. data/lib/fastly/models/read_only_version.rb +207 -0
  182. data/lib/fastly/models/realtime_entry.rb +2 -7
  183. data/lib/fastly/models/realtime_entry_aggregated.rb +2397 -0
  184. data/lib/fastly/models/realtime_entry_recorded.rb +208 -0
  185. data/lib/fastly/models/realtime_measurements.rb +4 -2
  186. data/lib/fastly/models/recorded_timestamp.rb +208 -0
  187. data/lib/fastly/models/secret.rb +238 -0
  188. data/lib/fastly/models/secret_response.rb +249 -0
  189. data/lib/fastly/models/secret_store.rb +217 -0
  190. data/lib/fastly/models/secret_store_response.rb +238 -0
  191. data/lib/fastly/models/signing_key.rb +218 -0
  192. data/lib/fastly/models/subsequent_request_timestamp.rb +208 -0
  193. data/lib/fastly/models/sudo_generic_token_error.rb +216 -0
  194. data/lib/fastly/models/sudo_request.rb +244 -0
  195. data/lib/fastly/models/sudo_response.rb +217 -0
  196. data/lib/fastly/models/values.rb +828 -0
  197. data/lib/fastly/version.rb +1 -1
  198. data/lib/fastly.rb +72 -2
  199. data/sig.json +1 -1
  200. metadata +146 -6
@@ -0,0 +1,366 @@
1
+ =begin
2
+ #Fastly API
3
+
4
+ #Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: oss@fastly.com
8
+
9
+ =end
10
+
11
+ require 'cgi'
12
+
13
+ module Fastly
14
+ class LegacyWafRuleStatusApi
15
+ attr_accessor :api_client
16
+
17
+ def initialize(api_client = ApiClient.default)
18
+ @api_client = api_client
19
+ end
20
+ # Get the status of a rule on a firewall
21
+ # Get a specific rule status object for a particular service, firewall, and rule.
22
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
23
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
24
+ # @option opts [String] :waf_rule_id Alphanumeric string identifying a WAF rule. (required)
25
+ # @return [Object]
26
+ def get_waf_firewall_rule_status(opts = {})
27
+ data, _status_code, _headers = get_waf_firewall_rule_status_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # Get the status of a rule on a firewall
32
+ # Get a specific rule status object for a particular service, firewall, and rule.
33
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
34
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
35
+ # @option opts [String] :waf_rule_id Alphanumeric string identifying a WAF rule. (required)
36
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
37
+ def get_waf_firewall_rule_status_with_http_info(opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: LegacyWafRuleStatusApi.get_waf_firewall_rule_status ...'
40
+ end
41
+ # unbox the parameters from the hash
42
+ service_id = opts[:'service_id']
43
+ firewall_id = opts[:'firewall_id']
44
+ waf_rule_id = opts[:'waf_rule_id']
45
+ # verify the required parameter 'service_id' is set
46
+ if @api_client.config.client_side_validation && service_id.nil?
47
+ fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafRuleStatusApi.get_waf_firewall_rule_status"
48
+ end
49
+ # verify the required parameter 'firewall_id' is set
50
+ if @api_client.config.client_side_validation && firewall_id.nil?
51
+ fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafRuleStatusApi.get_waf_firewall_rule_status"
52
+ end
53
+ # verify the required parameter 'waf_rule_id' is set
54
+ if @api_client.config.client_side_validation && waf_rule_id.nil?
55
+ fail ArgumentError, "Missing the required parameter 'waf_rule_id' when calling LegacyWafRuleStatusApi.get_waf_firewall_rule_status"
56
+ end
57
+ # resource path
58
+ local_var_path = '/service/{service_id}/wafs/{firewall_id}/rules/{waf_rule_id}/rule_status'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s)).sub('{' + 'waf_rule_id' + '}', CGI.escape(waf_rule_id.to_s))
59
+
60
+ # query parameters
61
+ query_params = opts[:query_params] || {}
62
+
63
+ # header parameters
64
+ header_params = opts[:header_params] || {}
65
+ # HTTP header 'Accept' (if needed)
66
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
67
+
68
+ # form parameters
69
+ form_params = opts[:form_params] || {}
70
+
71
+ # http body (model)
72
+ post_body = opts[:debug_body]
73
+
74
+ # return_type
75
+ return_type = opts[:debug_return_type] || 'Object'
76
+
77
+ # auth_names
78
+ auth_names = opts[:debug_auth_names] || ['token']
79
+
80
+ new_options = opts.merge(
81
+ :operation => :"LegacyWafRuleStatusApi.get_waf_firewall_rule_status",
82
+ :header_params => header_params,
83
+ :query_params => query_params,
84
+ :form_params => form_params,
85
+ :body => post_body,
86
+ :auth_names => auth_names,
87
+ :return_type => return_type
88
+ )
89
+
90
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
91
+ if @api_client.config.debugging
92
+ @api_client.config.logger.debug "API called: LegacyWafRuleStatusApi#get_waf_firewall_rule_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93
+ end
94
+ return data, status_code, headers
95
+ end
96
+
97
+ # List rule statuses
98
+ # List all rule statuses for a particular service and firewall.
99
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
100
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
101
+ # @option opts [String] :filter_status Limit results to rule statuses with the specified status.
102
+ # @option opts [String] :filter_rule_message Limit results to rule statuses whose rules have the specified message.
103
+ # @option opts [String] :filter_rule_rule_id Limit results to rule statuses whose rules represent the specified ModSecurity rule_id.
104
+ # @option opts [String] :filter_rule_tags Limit results to rule statuses whose rules relate to the specified tag IDs.
105
+ # @option opts [String] :filter_rule_tags_name Limit results to rule statuses whose rules related to the named tags.
106
+ # @option opts [String] :include Include relationships. Optional, comma separated values. Permitted values: &#x60;tags&#x60;.
107
+ # @option opts [Integer] :page_number Current page.
108
+ # @option opts [Integer] :page_size Number of records per page. (default to 20)
109
+ # @return [Object]
110
+ def list_waf_firewall_rule_statuses(opts = {})
111
+ data, _status_code, _headers = list_waf_firewall_rule_statuses_with_http_info(opts)
112
+ data
113
+ end
114
+
115
+ # List rule statuses
116
+ # List all rule statuses for a particular service and firewall.
117
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
118
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
119
+ # @option opts [String] :filter_status Limit results to rule statuses with the specified status.
120
+ # @option opts [String] :filter_rule_message Limit results to rule statuses whose rules have the specified message.
121
+ # @option opts [String] :filter_rule_rule_id Limit results to rule statuses whose rules represent the specified ModSecurity rule_id.
122
+ # @option opts [String] :filter_rule_tags Limit results to rule statuses whose rules relate to the specified tag IDs.
123
+ # @option opts [String] :filter_rule_tags_name Limit results to rule statuses whose rules related to the named tags.
124
+ # @option opts [String] :include Include relationships. Optional, comma separated values. Permitted values: &#x60;tags&#x60;.
125
+ # @option opts [Integer] :page_number Current page.
126
+ # @option opts [Integer] :page_size Number of records per page. (default to 20)
127
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
128
+ def list_waf_firewall_rule_statuses_with_http_info(opts = {})
129
+ if @api_client.config.debugging
130
+ @api_client.config.logger.debug 'Calling API: LegacyWafRuleStatusApi.list_waf_firewall_rule_statuses ...'
131
+ end
132
+ # unbox the parameters from the hash
133
+ service_id = opts[:'service_id']
134
+ firewall_id = opts[:'firewall_id']
135
+ # verify the required parameter 'service_id' is set
136
+ if @api_client.config.client_side_validation && service_id.nil?
137
+ fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafRuleStatusApi.list_waf_firewall_rule_statuses"
138
+ end
139
+ # verify the required parameter 'firewall_id' is set
140
+ if @api_client.config.client_side_validation && firewall_id.nil?
141
+ fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafRuleStatusApi.list_waf_firewall_rule_statuses"
142
+ end
143
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
144
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling LegacyWafRuleStatusApi.list_waf_firewall_rule_statuses, must be smaller than or equal to 100.'
145
+ end
146
+
147
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
148
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling LegacyWafRuleStatusApi.list_waf_firewall_rule_statuses, must be greater than or equal to 1.'
149
+ end
150
+
151
+ # resource path
152
+ local_var_path = '/service/{service_id}/wafs/{firewall_id}/rule_statuses'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s))
153
+
154
+ # query parameters
155
+ query_params = opts[:query_params] || {}
156
+ query_params[:'filter[status]'] = opts[:'filter_status'] if !opts[:'filter_status'].nil?
157
+ query_params[:'filter[rule][message]'] = opts[:'filter_rule_message'] if !opts[:'filter_rule_message'].nil?
158
+ query_params[:'filter[rule][rule_id]'] = opts[:'filter_rule_rule_id'] if !opts[:'filter_rule_rule_id'].nil?
159
+ query_params[:'filter[rule][tags]'] = opts[:'filter_rule_tags'] if !opts[:'filter_rule_tags'].nil?
160
+ query_params[:'filter[rule][tags][name]'] = opts[:'filter_rule_tags_name'] if !opts[:'filter_rule_tags_name'].nil?
161
+ query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
162
+ query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
163
+ query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
164
+
165
+ # header parameters
166
+ header_params = opts[:header_params] || {}
167
+ # HTTP header 'Accept' (if needed)
168
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
169
+
170
+ # form parameters
171
+ form_params = opts[:form_params] || {}
172
+
173
+ # http body (model)
174
+ post_body = opts[:debug_body]
175
+
176
+ # return_type
177
+ return_type = opts[:debug_return_type] || 'Object'
178
+
179
+ # auth_names
180
+ auth_names = opts[:debug_auth_names] || ['token']
181
+
182
+ new_options = opts.merge(
183
+ :operation => :"LegacyWafRuleStatusApi.list_waf_firewall_rule_statuses",
184
+ :header_params => header_params,
185
+ :query_params => query_params,
186
+ :form_params => form_params,
187
+ :body => post_body,
188
+ :auth_names => auth_names,
189
+ :return_type => return_type
190
+ )
191
+
192
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
193
+ if @api_client.config.debugging
194
+ @api_client.config.logger.debug "API called: LegacyWafRuleStatusApi#list_waf_firewall_rule_statuses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
195
+ end
196
+ return data, status_code, headers
197
+ end
198
+
199
+ # Update the status of a rule
200
+ # Update a rule status for a particular service, firewall, and rule.
201
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
202
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
203
+ # @option opts [String] :waf_rule_id Alphanumeric string identifying a WAF rule. (required)
204
+ # @option opts [Hash<String, Object>] :request_body
205
+ # @return [Object]
206
+ def update_waf_firewall_rule_status(opts = {})
207
+ data, _status_code, _headers = update_waf_firewall_rule_status_with_http_info(opts)
208
+ data
209
+ end
210
+
211
+ # Update the status of a rule
212
+ # Update a rule status for a particular service, firewall, and rule.
213
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
214
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
215
+ # @option opts [String] :waf_rule_id Alphanumeric string identifying a WAF rule. (required)
216
+ # @option opts [Hash<String, Object>] :request_body
217
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
218
+ def update_waf_firewall_rule_status_with_http_info(opts = {})
219
+ if @api_client.config.debugging
220
+ @api_client.config.logger.debug 'Calling API: LegacyWafRuleStatusApi.update_waf_firewall_rule_status ...'
221
+ end
222
+ # unbox the parameters from the hash
223
+ service_id = opts[:'service_id']
224
+ firewall_id = opts[:'firewall_id']
225
+ waf_rule_id = opts[:'waf_rule_id']
226
+ # verify the required parameter 'service_id' is set
227
+ if @api_client.config.client_side_validation && service_id.nil?
228
+ fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafRuleStatusApi.update_waf_firewall_rule_status"
229
+ end
230
+ # verify the required parameter 'firewall_id' is set
231
+ if @api_client.config.client_side_validation && firewall_id.nil?
232
+ fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafRuleStatusApi.update_waf_firewall_rule_status"
233
+ end
234
+ # verify the required parameter 'waf_rule_id' is set
235
+ if @api_client.config.client_side_validation && waf_rule_id.nil?
236
+ fail ArgumentError, "Missing the required parameter 'waf_rule_id' when calling LegacyWafRuleStatusApi.update_waf_firewall_rule_status"
237
+ end
238
+ # resource path
239
+ local_var_path = '/service/{service_id}/wafs/{firewall_id}/rules/{waf_rule_id}/rule_status'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s)).sub('{' + 'waf_rule_id' + '}', CGI.escape(waf_rule_id.to_s))
240
+
241
+ # query parameters
242
+ query_params = opts[:query_params] || {}
243
+
244
+ # header parameters
245
+ header_params = opts[:header_params] || {}
246
+ # HTTP header 'Accept' (if needed)
247
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
248
+ # HTTP header 'Content-Type'
249
+ content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
250
+ if !content_type.nil?
251
+ header_params['Content-Type'] = content_type
252
+ end
253
+
254
+ # form parameters
255
+ form_params = opts[:form_params] || {}
256
+
257
+ # http body (model)
258
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'request_body'])
259
+
260
+ # return_type
261
+ return_type = opts[:debug_return_type] || 'Object'
262
+
263
+ # auth_names
264
+ auth_names = opts[:debug_auth_names] || ['token']
265
+
266
+ new_options = opts.merge(
267
+ :operation => :"LegacyWafRuleStatusApi.update_waf_firewall_rule_status",
268
+ :header_params => header_params,
269
+ :query_params => query_params,
270
+ :form_params => form_params,
271
+ :body => post_body,
272
+ :auth_names => auth_names,
273
+ :return_type => return_type
274
+ )
275
+
276
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
277
+ if @api_client.config.debugging
278
+ @api_client.config.logger.debug "API called: LegacyWafRuleStatusApi#update_waf_firewall_rule_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
279
+ end
280
+ return data, status_code, headers
281
+ end
282
+
283
+ # Create or update status of a tagged group of rules
284
+ # Create or update all rule statuses for a particular service and firewall, based on tag name. By default, only rule status for enabled rules (with status log or block) will be updated. To update rule statuses for disabled rules under the specified tag, use the force attribute.
285
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
286
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
287
+ # @option opts [String] :name The tag name to use to determine the set of rules to update. For example, OWASP or language-php.
288
+ # @option opts [String] :force Whether or not to update rule statuses for disabled rules. Optional.
289
+ # @option opts [Hash<String, Object>] :request_body
290
+ # @return [Object]
291
+ def update_waf_firewall_rule_statuses_tag(opts = {})
292
+ data, _status_code, _headers = update_waf_firewall_rule_statuses_tag_with_http_info(opts)
293
+ data
294
+ end
295
+
296
+ # Create or update status of a tagged group of rules
297
+ # Create or update all rule statuses for a particular service and firewall, based on tag name. By default, only rule status for enabled rules (with status log or block) will be updated. To update rule statuses for disabled rules under the specified tag, use the force attribute.
298
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
299
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
300
+ # @option opts [String] :name The tag name to use to determine the set of rules to update. For example, OWASP or language-php.
301
+ # @option opts [String] :force Whether or not to update rule statuses for disabled rules. Optional.
302
+ # @option opts [Hash<String, Object>] :request_body
303
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
304
+ def update_waf_firewall_rule_statuses_tag_with_http_info(opts = {})
305
+ if @api_client.config.debugging
306
+ @api_client.config.logger.debug 'Calling API: LegacyWafRuleStatusApi.update_waf_firewall_rule_statuses_tag ...'
307
+ end
308
+ # unbox the parameters from the hash
309
+ service_id = opts[:'service_id']
310
+ firewall_id = opts[:'firewall_id']
311
+ # verify the required parameter 'service_id' is set
312
+ if @api_client.config.client_side_validation && service_id.nil?
313
+ fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafRuleStatusApi.update_waf_firewall_rule_statuses_tag"
314
+ end
315
+ # verify the required parameter 'firewall_id' is set
316
+ if @api_client.config.client_side_validation && firewall_id.nil?
317
+ fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafRuleStatusApi.update_waf_firewall_rule_statuses_tag"
318
+ end
319
+ # resource path
320
+ local_var_path = '/service/{service_id}/wafs/{firewall_id}/rule_statuses'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s))
321
+
322
+ # query parameters
323
+ query_params = opts[:query_params] || {}
324
+ query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
325
+ query_params[:'force'] = opts[:'force'] if !opts[:'force'].nil?
326
+
327
+ # header parameters
328
+ header_params = opts[:header_params] || {}
329
+ # HTTP header 'Accept' (if needed)
330
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
331
+ # HTTP header 'Content-Type'
332
+ content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
333
+ if !content_type.nil?
334
+ header_params['Content-Type'] = content_type
335
+ end
336
+
337
+ # form parameters
338
+ form_params = opts[:form_params] || {}
339
+
340
+ # http body (model)
341
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'request_body'])
342
+
343
+ # return_type
344
+ return_type = opts[:debug_return_type] || 'Object'
345
+
346
+ # auth_names
347
+ auth_names = opts[:debug_auth_names] || ['token']
348
+
349
+ new_options = opts.merge(
350
+ :operation => :"LegacyWafRuleStatusApi.update_waf_firewall_rule_statuses_tag",
351
+ :header_params => header_params,
352
+ :query_params => query_params,
353
+ :form_params => form_params,
354
+ :body => post_body,
355
+ :auth_names => auth_names,
356
+ :return_type => return_type
357
+ )
358
+
359
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
360
+ if @api_client.config.debugging
361
+ @api_client.config.logger.debug "API called: LegacyWafRuleStatusApi#update_waf_firewall_rule_statuses_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
362
+ end
363
+ return data, status_code, headers
364
+ end
365
+ end
366
+ end
@@ -0,0 +1,237 @@
1
+ =begin
2
+ #Fastly API
3
+
4
+ #Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: oss@fastly.com
8
+
9
+ =end
10
+
11
+ require 'cgi'
12
+
13
+ module Fastly
14
+ class LegacyWafRulesetApi
15
+ attr_accessor :api_client
16
+
17
+ def initialize(api_client = ApiClient.default)
18
+ @api_client = api_client
19
+ end
20
+ # Get a WAF ruleset
21
+ # Get a WAF ruleset for a particular service and firewall object.
22
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
23
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
24
+ # @return [Object]
25
+ def get_waf_ruleset(opts = {})
26
+ data, _status_code, _headers = get_waf_ruleset_with_http_info(opts)
27
+ data
28
+ end
29
+
30
+ # Get a WAF ruleset
31
+ # Get a WAF ruleset for a particular service and firewall object.
32
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
33
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
34
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
35
+ def get_waf_ruleset_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: LegacyWafRulesetApi.get_waf_ruleset ...'
38
+ end
39
+ # unbox the parameters from the hash
40
+ service_id = opts[:'service_id']
41
+ firewall_id = opts[:'firewall_id']
42
+ # verify the required parameter 'service_id' is set
43
+ if @api_client.config.client_side_validation && service_id.nil?
44
+ fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafRulesetApi.get_waf_ruleset"
45
+ end
46
+ # verify the required parameter 'firewall_id' is set
47
+ if @api_client.config.client_side_validation && firewall_id.nil?
48
+ fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafRulesetApi.get_waf_ruleset"
49
+ end
50
+ # resource path
51
+ local_var_path = '/service/{service_id}/wafs/{firewall_id}/ruleset'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s))
52
+
53
+ # query parameters
54
+ query_params = opts[:query_params] || {}
55
+
56
+ # header parameters
57
+ header_params = opts[:header_params] || {}
58
+ # HTTP header 'Accept' (if needed)
59
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body]
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'Object'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['token']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"LegacyWafRulesetApi.get_waf_ruleset",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: LegacyWafRulesetApi#get_waf_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # Generate WAF ruleset VCL
91
+ # Get a preview of the WAF ruleset VCL for a particular service and firewall object based on changes to WAF configuration before deploying the ruleset. The response will include a link to status of the background VCL generation job. Once the background job is completed, the preview WAF ruleset VCL can be retrieved from the status response.
92
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
93
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
94
+ # @return [Object]
95
+ def get_waf_ruleset_vcl(opts = {})
96
+ data, _status_code, _headers = get_waf_ruleset_vcl_with_http_info(opts)
97
+ data
98
+ end
99
+
100
+ # Generate WAF ruleset VCL
101
+ # Get a preview of the WAF ruleset VCL for a particular service and firewall object based on changes to WAF configuration before deploying the ruleset. The response will include a link to status of the background VCL generation job. Once the background job is completed, the preview WAF ruleset VCL can be retrieved from the status response.
102
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
103
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
104
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
105
+ def get_waf_ruleset_vcl_with_http_info(opts = {})
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug 'Calling API: LegacyWafRulesetApi.get_waf_ruleset_vcl ...'
108
+ end
109
+ # unbox the parameters from the hash
110
+ service_id = opts[:'service_id']
111
+ firewall_id = opts[:'firewall_id']
112
+ # verify the required parameter 'service_id' is set
113
+ if @api_client.config.client_side_validation && service_id.nil?
114
+ fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafRulesetApi.get_waf_ruleset_vcl"
115
+ end
116
+ # verify the required parameter 'firewall_id' is set
117
+ if @api_client.config.client_side_validation && firewall_id.nil?
118
+ fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafRulesetApi.get_waf_ruleset_vcl"
119
+ end
120
+ # resource path
121
+ local_var_path = '/service/{service_id}/wafs/{firewall_id}/ruleset/preview'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s))
122
+
123
+ # query parameters
124
+ query_params = opts[:query_params] || {}
125
+
126
+ # header parameters
127
+ header_params = opts[:header_params] || {}
128
+ # HTTP header 'Accept' (if needed)
129
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
130
+
131
+ # form parameters
132
+ form_params = opts[:form_params] || {}
133
+
134
+ # http body (model)
135
+ post_body = opts[:debug_body]
136
+
137
+ # return_type
138
+ return_type = opts[:debug_return_type] || 'Object'
139
+
140
+ # auth_names
141
+ auth_names = opts[:debug_auth_names] || ['token']
142
+
143
+ new_options = opts.merge(
144
+ :operation => :"LegacyWafRulesetApi.get_waf_ruleset_vcl",
145
+ :header_params => header_params,
146
+ :query_params => query_params,
147
+ :form_params => form_params,
148
+ :body => post_body,
149
+ :auth_names => auth_names,
150
+ :return_type => return_type
151
+ )
152
+
153
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
154
+ if @api_client.config.debugging
155
+ @api_client.config.logger.debug "API called: LegacyWafRulesetApi#get_waf_ruleset_vcl\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
156
+ end
157
+ return data, status_code, headers
158
+ end
159
+
160
+ # Update a WAF ruleset
161
+ # Update the WAF ruleset for a particular service and firewall object. Use the URL in the response to view the WAF ruleset deploy status.
162
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
163
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
164
+ # @option opts [Hash<String, Object>] :request_body
165
+ # @return [Object]
166
+ def update_waf_ruleset(opts = {})
167
+ data, _status_code, _headers = update_waf_ruleset_with_http_info(opts)
168
+ data
169
+ end
170
+
171
+ # Update a WAF ruleset
172
+ # Update the WAF ruleset for a particular service and firewall object. Use the URL in the response to view the WAF ruleset deploy status.
173
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
174
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
175
+ # @option opts [Hash<String, Object>] :request_body
176
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
177
+ def update_waf_ruleset_with_http_info(opts = {})
178
+ if @api_client.config.debugging
179
+ @api_client.config.logger.debug 'Calling API: LegacyWafRulesetApi.update_waf_ruleset ...'
180
+ end
181
+ # unbox the parameters from the hash
182
+ service_id = opts[:'service_id']
183
+ firewall_id = opts[:'firewall_id']
184
+ # verify the required parameter 'service_id' is set
185
+ if @api_client.config.client_side_validation && service_id.nil?
186
+ fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafRulesetApi.update_waf_ruleset"
187
+ end
188
+ # verify the required parameter 'firewall_id' is set
189
+ if @api_client.config.client_side_validation && firewall_id.nil?
190
+ fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafRulesetApi.update_waf_ruleset"
191
+ end
192
+ # resource path
193
+ local_var_path = '/service/{service_id}/wafs/{firewall_id}/ruleset'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s))
194
+
195
+ # query parameters
196
+ query_params = opts[:query_params] || {}
197
+
198
+ # header parameters
199
+ header_params = opts[:header_params] || {}
200
+ # HTTP header 'Accept' (if needed)
201
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
202
+ # HTTP header 'Content-Type'
203
+ content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
204
+ if !content_type.nil?
205
+ header_params['Content-Type'] = content_type
206
+ end
207
+
208
+ # form parameters
209
+ form_params = opts[:form_params] || {}
210
+
211
+ # http body (model)
212
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'request_body'])
213
+
214
+ # return_type
215
+ return_type = opts[:debug_return_type] || 'Object'
216
+
217
+ # auth_names
218
+ auth_names = opts[:debug_auth_names] || ['token']
219
+
220
+ new_options = opts.merge(
221
+ :operation => :"LegacyWafRulesetApi.update_waf_ruleset",
222
+ :header_params => header_params,
223
+ :query_params => query_params,
224
+ :form_params => form_params,
225
+ :body => post_body,
226
+ :auth_names => auth_names,
227
+ :return_type => return_type
228
+ )
229
+
230
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
231
+ if @api_client.config.debugging
232
+ @api_client.config.logger.debug "API called: LegacyWafRulesetApi#update_waf_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
233
+ end
234
+ return data, status_code, headers
235
+ end
236
+ end
237
+ end