Class: Falcon::FirewallPoliciesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/crimson-falcon/api/firewall_policies_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ FirewallPoliciesApi

Returns a new instance of FirewallPoliciesApi.



36
37
38
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 36

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



34
35
36
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 34

def api_client
  @api_client
end

Instance Method Details

#create_firewall_policies(body, opts = {}) ⇒ FirewallRespV1

Create Firewall Policies by specifying details about the policy to create

Parameters:

Options Hash (opts):

  • :clone_id (String)

    The policy ID to be cloned from

Returns:



44
45
46
47
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 44

def create_firewall_policies(body, opts = {})
  data, _status_code, _headers = create_firewall_policies_with_http_info(body, opts)
  data
end

#create_firewall_policies_with_http_info(body, opts = {}) ⇒ Array<(FirewallRespV1, Integer, Hash)>

Create Firewall Policies by specifying details about the policy to create

Parameters:

Options Hash (opts):

  • :clone_id (String)

    The policy ID to be cloned from

Returns:

  • (Array<(FirewallRespV1, Integer, Hash)>)

    FirewallRespV1 data, response status code and response headers



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
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 54

def create_firewall_policies_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FirewallPoliciesApi.create_firewall_policies ...'
  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 FirewallPoliciesApi.create_firewall_policies"
  end
  if @api_client.config.client_side_validation && !opts[:'clone_id'].nil? && opts[:'clone_id'].to_s.length > 32
    fail ArgumentError, 'invalid value for "opts[:"clone_id"]" when calling FirewallPoliciesApi.create_firewall_policies, the character length must be smaller than or equal to 32.'
  end

  if @api_client.config.client_side_validation && !opts[:'clone_id'].nil? && opts[:'clone_id'].to_s.length < 32
    fail ArgumentError, 'invalid value for "opts[:"clone_id"]" when calling FirewallPoliciesApi.create_firewall_policies, the character length must be great than or equal to 32.'
  end

  # resource path
  local_var_path = '/policy/entities/firewall/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'clone_id'] = opts[:'clone_id'] if !opts[:'clone_id'].nil?

  # 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'
  content_type = @api_client.select_header_content_type(['application/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(body)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"FirewallPoliciesApi.create_firewall_policies",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FirewallPoliciesApi#create_firewall_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_firewall_policies(ids, opts = {}) ⇒ MsaQueryResponse

Delete a set of Firewall Policies by specifying their IDs

Parameters:

  • ids (Array<String>)

    The IDs of the Firewall Policies to delete

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



120
121
122
123
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 120

def delete_firewall_policies(ids, opts = {})
  data, _status_code, _headers = delete_firewall_policies_with_http_info(ids, opts)
  data
end

#delete_firewall_policies_with_http_info(ids, opts = {}) ⇒ Array<(MsaQueryResponse, Integer, Hash)>

Delete a set of Firewall Policies by specifying their IDs

Parameters:

  • ids (Array<String>)

    The IDs of the Firewall Policies to delete

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MsaQueryResponse, Integer, Hash)>)

    MsaQueryResponse data, response status code and response headers



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
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 129

def delete_firewall_policies_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FirewallPoliciesApi.delete_firewall_policies ...'
  end
  # verify the required parameter 'ids' is set
  if @api_client.config.client_side_validation && ids.nil?
    fail ArgumentError, "Missing the required parameter 'ids' when calling FirewallPoliciesApi.delete_firewall_policies"
  end
  # resource path
  local_var_path = '/policy/entities/firewall/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = @api_client.build_collection_param(ids, :multi)

  # 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] || 'MsaQueryResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"FirewallPoliciesApi.delete_firewall_policies",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FirewallPoliciesApi#delete_firewall_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_firewall_policies(ids, opts = {}) ⇒ FirewallRespV1

Retrieve a set of Firewall Policies by specifying their IDs

Parameters:

  • ids (Array<String>)

    The IDs of the Firewall Policies to return

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



182
183
184
185
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 182

def get_firewall_policies(ids, opts = {})
  data, _status_code, _headers = get_firewall_policies_with_http_info(ids, opts)
  data
end

#get_firewall_policies_with_http_info(ids, opts = {}) ⇒ Array<(FirewallRespV1, Integer, Hash)>

Retrieve a set of Firewall Policies by specifying their IDs

Parameters:

  • ids (Array<String>)

    The IDs of the Firewall Policies to return

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(FirewallRespV1, Integer, Hash)>)

    FirewallRespV1 data, response status code and response headers



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
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 191

def get_firewall_policies_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FirewallPoliciesApi.get_firewall_policies ...'
  end
  # verify the required parameter 'ids' is set
  if @api_client.config.client_side_validation && ids.nil?
    fail ArgumentError, "Missing the required parameter 'ids' when calling FirewallPoliciesApi.get_firewall_policies"
  end
  # resource path
  local_var_path = '/policy/entities/firewall/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = @api_client.build_collection_param(ids, :multi)

  # 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] || 'FirewallRespV1'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"FirewallPoliciesApi.get_firewall_policies",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FirewallPoliciesApi#get_firewall_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#perform_firewall_policies_action(action_name, body, opts = {}) ⇒ FirewallRespV1

Perform the specified action on the Firewall Policies specified in the request

Parameters:

  • action_name (String)

    The action to perform

  • body (MsaEntityActionRequestV2)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



245
246
247
248
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 245

def perform_firewall_policies_action(action_name, body, opts = {})
  data, _status_code, _headers = perform_firewall_policies_action_with_http_info(action_name, body, opts)
  data
end

#perform_firewall_policies_action_with_http_info(action_name, body, opts = {}) ⇒ Array<(FirewallRespV1, Integer, Hash)>

Perform the specified action on the Firewall Policies specified in the request

Parameters:

  • action_name (String)

    The action to perform

  • body (MsaEntityActionRequestV2)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(FirewallRespV1, Integer, Hash)>)

    FirewallRespV1 data, response status code and response headers



255
256
257
258
259
260
261
262
263
264
265
266
267
268
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
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 255

def perform_firewall_policies_action_with_http_info(action_name, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FirewallPoliciesApi.perform_firewall_policies_action ...'
  end
  # verify the required parameter 'action_name' is set
  if @api_client.config.client_side_validation && action_name.nil?
    fail ArgumentError, "Missing the required parameter 'action_name' when calling FirewallPoliciesApi.perform_firewall_policies_action"
  end
  # verify enum value
  allowable_values = ["add-host-group", "add-rule-group", "disable", "enable", "remove-host-group", "remove-rule-group"]
  if @api_client.config.client_side_validation && !allowable_values.include?(action_name)
    fail ArgumentError, "invalid value for \"action_name\", must be one of #{allowable_values}"
  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 FirewallPoliciesApi.perform_firewall_policies_action"
  end
  # resource path
  local_var_path = '/policy/entities/firewall-actions/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'action_name'] = action_name

  # 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'
  content_type = @api_client.select_header_content_type(['application/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(body)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"FirewallPoliciesApi.perform_firewall_policies_action",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FirewallPoliciesApi#perform_firewall_policies_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_combined_firewall_policies(opts = {}) ⇒ FirewallRespV1

Search for Firewall Policies in your environment by providing an FQL filter and paging details. Returns a set of Firewall Policies which match the filter criteria

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :filter (String)

    The filter expression that should be used to limit the results

  • :offset (Integer)

    The offset to start retrieving records from

  • :limit (Integer)

    The maximum records to return. [1-5000]

  • :sort (String)

    The property to sort by

Returns:



325
326
327
328
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 325

def query_combined_firewall_policies(opts = {})
  data, _status_code, _headers = query_combined_firewall_policies_with_http_info(opts)
  data
end

#query_combined_firewall_policies_with_http_info(opts = {}) ⇒ Array<(FirewallRespV1, Integer, Hash)>

Search for Firewall Policies in your environment by providing an FQL filter and paging details. Returns a set of Firewall Policies which match the filter criteria

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :filter (String)

    The filter expression that should be used to limit the results

  • :offset (Integer)

    The offset to start retrieving records from

  • :limit (Integer)

    The maximum records to return. [1-5000]

  • :sort (String)

    The property to sort by

Returns:

  • (Array<(FirewallRespV1, Integer, Hash)>)

    FirewallRespV1 data, response status code and response headers



337
338
339
340
341
342
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
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 337

def query_combined_firewall_policies_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FirewallPoliciesApi.query_combined_firewall_policies ...'
  end
  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling FirewallPoliciesApi.query_combined_firewall_policies, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 5000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FirewallPoliciesApi.query_combined_firewall_policies, must be smaller than or equal to 5000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FirewallPoliciesApi.query_combined_firewall_policies, must be greater than or equal to 1.'
  end

  allowable_values = ["created_by.asc", "created_by.desc", "created_timestamp.asc", "created_timestamp.desc", "enabled.asc", "enabled.desc", "modified_by.asc", "modified_by.desc", "modified_timestamp.asc", "modified_timestamp.desc", "name.asc", "name.desc", "platform_name.asc", "platform_name.desc", "precedence.asc", "precedence.desc"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/policy/combined/firewall/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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] || 'FirewallRespV1'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"FirewallPoliciesApi.query_combined_firewall_policies",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FirewallPoliciesApi#query_combined_firewall_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_combined_firewall_policy_members(opts = {}) ⇒ BasePolicyMembersRespV1

Search for members of a Firewall Policy in your environment by providing an FQL filter and paging details. Returns a set of host details which match the filter criteria

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :id (String)

    The ID of the Firewall Policy to search for members of

  • :filter (String)

    The filter expression that should be used to limit the results

  • :offset (Integer)

    The offset to start retrieving records from

  • :limit (Integer)

    The maximum records to return. [1-5000]

  • :sort (String)

    The property to sort by

Returns:



409
410
411
412
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 409

def query_combined_firewall_policy_members(opts = {})
  data, _status_code, _headers = query_combined_firewall_policy_members_with_http_info(opts)
  data
end

#query_combined_firewall_policy_members_with_http_info(opts = {}) ⇒ Array<(BasePolicyMembersRespV1, Integer, Hash)>

Search for members of a Firewall Policy in your environment by providing an FQL filter and paging details. Returns a set of host details which match the filter criteria

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :id (String)

    The ID of the Firewall Policy to search for members of

  • :filter (String)

    The filter expression that should be used to limit the results

  • :offset (Integer)

    The offset to start retrieving records from

  • :limit (Integer)

    The maximum records to return. [1-5000]

  • :sort (String)

    The property to sort by

Returns:

  • (Array<(BasePolicyMembersRespV1, Integer, Hash)>)

    BasePolicyMembersRespV1 data, response status code and response headers



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
473
474
475
476
477
478
479
480
481
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 422

def query_combined_firewall_policy_members_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FirewallPoliciesApi.query_combined_firewall_policy_members ...'
  end
  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling FirewallPoliciesApi.query_combined_firewall_policy_members, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 5000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FirewallPoliciesApi.query_combined_firewall_policy_members, must be smaller than or equal to 5000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FirewallPoliciesApi.query_combined_firewall_policy_members, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/policy/combined/firewall-members/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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] || 'BasePolicyMembersRespV1'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"FirewallPoliciesApi.query_combined_firewall_policy_members",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FirewallPoliciesApi#query_combined_firewall_policy_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_firewall_policies(opts = {}) ⇒ MsaQueryResponse

Search for Firewall Policies in your environment by providing an FQL filter and paging details. Returns a set of Firewall Policy IDs which match the filter criteria

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :filter (String)

    The filter expression that should be used to limit the results

  • :offset (Integer)

    The offset to start retrieving records from

  • :limit (Integer)

    The maximum records to return. [1-5000]

  • :sort (String)

    The property to sort by

Returns:



490
491
492
493
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 490

def query_firewall_policies(opts = {})
  data, _status_code, _headers = query_firewall_policies_with_http_info(opts)
  data
end

#query_firewall_policies_with_http_info(opts = {}) ⇒ Array<(MsaQueryResponse, Integer, Hash)>

Search for Firewall Policies in your environment by providing an FQL filter and paging details. Returns a set of Firewall Policy IDs which match the filter criteria

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :filter (String)

    The filter expression that should be used to limit the results

  • :offset (Integer)

    The offset to start retrieving records from

  • :limit (Integer)

    The maximum records to return. [1-5000]

  • :sort (String)

    The property to sort by

Returns:

  • (Array<(MsaQueryResponse, Integer, Hash)>)

    MsaQueryResponse data, response status code and response headers



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
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 502

def query_firewall_policies_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FirewallPoliciesApi.query_firewall_policies ...'
  end
  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling FirewallPoliciesApi.query_firewall_policies, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 5000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FirewallPoliciesApi.query_firewall_policies, must be smaller than or equal to 5000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FirewallPoliciesApi.query_firewall_policies, must be greater than or equal to 1.'
  end

  allowable_values = ["created_by.asc", "created_by.desc", "created_timestamp.asc", "created_timestamp.desc", "enabled.asc", "enabled.desc", "modified_by.asc", "modified_by.desc", "modified_timestamp.asc", "modified_timestamp.desc", "name.asc", "name.desc", "platform_name.asc", "platform_name.desc", "precedence.asc", "precedence.desc"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/policy/queries/firewall/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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] || 'MsaQueryResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"FirewallPoliciesApi.query_firewall_policies",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FirewallPoliciesApi#query_firewall_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_firewall_policy_members(opts = {}) ⇒ MsaQueryResponse

Search for members of a Firewall Policy in your environment by providing an FQL filter and paging details. Returns a set of Agent IDs which match the filter criteria

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :id (String)

    The ID of the Firewall Policy to search for members of

  • :filter (String)

    The filter expression that should be used to limit the results

  • :offset (Integer)

    The offset to start retrieving records from

  • :limit (Integer)

    The maximum records to return. [1-5000]

  • :sort (String)

    The property to sort by

Returns:



574
575
576
577
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 574

def query_firewall_policy_members(opts = {})
  data, _status_code, _headers = query_firewall_policy_members_with_http_info(opts)
  data
end

#query_firewall_policy_members_with_http_info(opts = {}) ⇒ Array<(MsaQueryResponse, Integer, Hash)>

Search for members of a Firewall Policy in your environment by providing an FQL filter and paging details. Returns a set of Agent IDs which match the filter criteria

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :id (String)

    The ID of the Firewall Policy to search for members of

  • :filter (String)

    The filter expression that should be used to limit the results

  • :offset (Integer)

    The offset to start retrieving records from

  • :limit (Integer)

    The maximum records to return. [1-5000]

  • :sort (String)

    The property to sort by

Returns:

  • (Array<(MsaQueryResponse, Integer, Hash)>)

    MsaQueryResponse data, response status code and response headers



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
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 587

def query_firewall_policy_members_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FirewallPoliciesApi.query_firewall_policy_members ...'
  end
  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling FirewallPoliciesApi.query_firewall_policy_members, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 5000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FirewallPoliciesApi.query_firewall_policy_members, must be smaller than or equal to 5000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FirewallPoliciesApi.query_firewall_policy_members, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/policy/queries/firewall-members/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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] || 'MsaQueryResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"FirewallPoliciesApi.query_firewall_policy_members",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FirewallPoliciesApi#query_firewall_policy_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_firewall_policies_precedence(body, opts = {}) ⇒ MsaQueryResponse

Sets the precedence of Firewall Policies based on the order of IDs specified in the request. The first ID specified will have the highest precedence and the last ID specified will have the lowest. You must specify all non-Default Policies for a platform when updating precedence

Parameters:

Returns:



652
653
654
655
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 652

def set_firewall_policies_precedence(body, opts = {})
  data, _status_code, _headers = set_firewall_policies_precedence_with_http_info(body, opts)
  data
end

#set_firewall_policies_precedence_with_http_info(body, opts = {}) ⇒ Array<(MsaQueryResponse, Integer, Hash)>

Sets the precedence of Firewall Policies based on the order of IDs specified in the request. The first ID specified will have the highest precedence and the last ID specified will have the lowest. You must specify all non-Default Policies for a platform when updating precedence

Parameters:

Returns:

  • (Array<(MsaQueryResponse, Integer, Hash)>)

    MsaQueryResponse data, response status code and response headers



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
701
702
703
704
705
706
707
708
709
710
711
712
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 661

def set_firewall_policies_precedence_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FirewallPoliciesApi.set_firewall_policies_precedence ...'
  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 FirewallPoliciesApi.set_firewall_policies_precedence"
  end
  # resource path
  local_var_path = '/policy/entities/firewall-precedence/v1'

  # 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'
  content_type = @api_client.select_header_content_type(['application/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(body)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"FirewallPoliciesApi.set_firewall_policies_precedence",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FirewallPoliciesApi#set_firewall_policies_precedence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_firewall_policies(body, opts = {}) ⇒ FirewallRespV1

Update Firewall Policies by specifying the ID of the policy and details to update

Parameters:

Returns:



718
719
720
721
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 718

def update_firewall_policies(body, opts = {})
  data, _status_code, _headers = update_firewall_policies_with_http_info(body, opts)
  data
end

#update_firewall_policies_with_http_info(body, opts = {}) ⇒ Array<(FirewallRespV1, Integer, Hash)>

Update Firewall Policies by specifying the ID of the policy and details to update

Parameters:

Returns:

  • (Array<(FirewallRespV1, Integer, Hash)>)

    FirewallRespV1 data, response status code and response headers



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
# File 'lib/crimson-falcon/api/firewall_policies_api.rb', line 727

def update_firewall_policies_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FirewallPoliciesApi.update_firewall_policies ...'
  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 FirewallPoliciesApi.update_firewall_policies"
  end
  # resource path
  local_var_path = '/policy/entities/firewall/v1'

  # 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'
  content_type = @api_client.select_header_content_type(['application/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(body)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"FirewallPoliciesApi.update_firewall_policies",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FirewallPoliciesApi#update_firewall_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end