Class: Fastly::LegacyWafUpdateStatusApi

Inherits:
Object
  • Object
show all
Defined in:
lib/fastly/api/legacy_waf_update_status_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LegacyWafUpdateStatusApi

Returns a new instance of LegacyWafUpdateStatusApi.



17
18
19
# File 'lib/fastly/api/legacy_waf_update_status_api.rb', line 17

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



15
16
17
# File 'lib/fastly/api/legacy_waf_update_status_api.rb', line 15

def api_client
  @api_client
end

Instance Method Details

#get_waf_update_status(opts = {}) ⇒ Object

Get the status of a WAF update Get a specific update status object for a particular service and firewall object.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :firewall_id (String)

    Alphanumeric string identifying a Firewall. (required)

  • :update_status_id (String)

    Alphanumeric string identifying a WAF update status. (required)

Returns:

  • (Object)


26
27
28
29
# File 'lib/fastly/api/legacy_waf_update_status_api.rb', line 26

def get_waf_update_status(opts = {})
  data, _status_code, _headers = get_waf_update_status_with_http_info(opts)
  data
end

#get_waf_update_status_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get the status of a WAF update Get a specific update status object for a particular service and firewall object.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :firewall_id (String)

    Alphanumeric string identifying a Firewall. (required)

  • :update_status_id (String)

    Alphanumeric string identifying a WAF update status. (required)

Returns:

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

    Object data, response status code and response headers



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
94
95
# File 'lib/fastly/api/legacy_waf_update_status_api.rb', line 37

def get_waf_update_status_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LegacyWafUpdateStatusApi.get_waf_update_status ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  firewall_id = opts[:'firewall_id']
  update_status_id = opts[:'update_status_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafUpdateStatusApi.get_waf_update_status"
  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 LegacyWafUpdateStatusApi.get_waf_update_status"
  end
  # verify the required parameter 'update_status_id' is set
  if @api_client.config.client_side_validation && update_status_id.nil?
    fail ArgumentError, "Missing the required parameter 'update_status_id' when calling LegacyWafUpdateStatusApi.get_waf_update_status"
  end
  # resource path
  local_var_path = '/service/{service_id}/wafs/{firewall_id}/update_statuses/{update_status_id}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s)).sub('{' + 'update_status_id' + '}', CGI.escape(update_status_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'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

  new_options = opts.merge(
    :operation => :"LegacyWafUpdateStatusApi.get_waf_update_status",
    :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: LegacyWafUpdateStatusApi#get_waf_update_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_waf_update_statuses(opts = {}) ⇒ Object

List update statuses List all update statuses for a particular service and firewall object.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :firewall_id (String)

    Alphanumeric string identifying a Firewall. (required)

  • :page_number (Integer)

    Current page.

  • :page_size (Integer)

    Number of records per page. (default to 20)

  • :include (String)

    Include relationships. Optional, comma separated values. Permitted values: &#x60;waf&#x60;.

Returns:

  • (Object)


105
106
107
108
# File 'lib/fastly/api/legacy_waf_update_status_api.rb', line 105

def list_waf_update_statuses(opts = {})
  data, _status_code, _headers = list_waf_update_statuses_with_http_info(opts)
  data
end

#list_waf_update_statuses_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

List update statuses List all update statuses for a particular service and firewall object.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :firewall_id (String)

    Alphanumeric string identifying a Firewall. (required)

  • :page_number (Integer)

    Current page.

  • :page_size (Integer)

    Number of records per page. (default to 20)

  • :include (String)

    Include relationships. Optional, comma separated values. Permitted values: &#x60;waf&#x60;.

Returns:

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

    Object data, response status code and response headers



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
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/fastly/api/legacy_waf_update_status_api.rb', line 118

def list_waf_update_statuses_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LegacyWafUpdateStatusApi.list_waf_update_statuses ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  firewall_id = opts[:'firewall_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 LegacyWafUpdateStatusApi.list_waf_update_statuses, 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 LegacyWafUpdateStatusApi.list_waf_update_statuses, must be greater than or equal to 1.'
  end

  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafUpdateStatusApi.list_waf_update_statuses"
  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 LegacyWafUpdateStatusApi.list_waf_update_statuses"
  end
  # resource path
  local_var_path = '/service/{service_id}/wafs/{firewall_id}/update_statuses'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  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] || 'Object'

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

  new_options = opts.merge(
    :operation => :"LegacyWafUpdateStatusApi.list_waf_update_statuses",
    :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: LegacyWafUpdateStatusApi#list_waf_update_statuses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end