Class: Fastly::PoolApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PoolApi

Returns a new instance of PoolApi.



17
18
19
# File 'lib/fastly/api/pool_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/pool_api.rb', line 15

def api_client
  @api_client
end

Instance Method Details

#create_server_pool(opts = {}) ⇒ PoolResponsePost

Create a server pool Creates a pool for a particular service and version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :tls_ca_cert (String)

    A secure certificate to authenticate a server with. Must be in PEM format. (default to ‘null’)

  • :tls_client_cert (String)

    The client certificate used to make authenticated requests. Must be in PEM format. (default to ‘null’)

  • :tls_client_key (String)

    The client private key used to make authenticated requests. Must be in PEM format. (default to ‘null’)

  • :tls_cert_hostname (String)

    The hostname used to verify a server's certificate. It can either be the Common Name (CN) or a Subject Alternative Name (SAN). (default to ‘null’)

  • :use_tls (Integer)

    Whether to use TLS. (default to 0)

  • :created_at (Time)

    Date and time in ISO 8601 format.

  • :deleted_at (Time)

    Date and time in ISO 8601 format.

  • :updated_at (Time)

    Date and time in ISO 8601 format.

  • :service_id (String)
  • :version (String)
  • :name (String)

    Name for the Pool.

  • :shield (String)

    Selected POP to serve as a shield for the servers. Defaults to `null` meaning no origin shielding if not set. Refer to the [POPs API endpoint](www.fastly.com/documentation/reference/api/utils/pops/) to get a list of available POPs used for shielding. (default to ‘null’)

  • :request_condition (String)

    Condition which, if met, will select this configuration during a request. Optional.

  • :tls_ciphers (String)

    List of OpenSSL ciphers (see the [openssl.org manpages](www.openssl.org/docs/man1.1.1/man1/ciphers.html) for details). Optional.

  • :tls_sni_hostname (String)

    SNI hostname. Optional.

  • :min_tls_version (Integer)

    Minimum allowed TLS version on connections to this server. Optional.

  • :max_tls_version (Integer)

    Maximum allowed TLS version on connections to this server. Optional.

  • :healthcheck (String)

    Name of the healthcheck to use with this pool. Can be empty and could be reused across multiple backend and pools.

  • :comment (String)

    A freeform descriptive note.

  • :type (String)

    What type of load balance group to use.

  • :override_host (String)

    The hostname to [override the Host header](docs.fastly.com/en/guides/specifying-an-override-host). Defaults to `null` meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting. (default to ‘null’)

  • :between_bytes_timeout (Integer)

    Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, the response received so far will be considered complete and the fetch will end. May be set at runtime using `bereq.between_bytes_timeout`. (default to 10000)

  • :connect_timeout (Integer)

    How long to wait for a timeout in milliseconds. Optional.

  • :first_byte_timeout (Integer)

    How long to wait for the first byte in milliseconds. Optional.

  • :max_conn_default (Integer)

    Maximum number of connections. Optional. (default to 200)

  • :quorum (Integer)

    Percentage of capacity (`0-100`) that needs to be operationally available for a pool to be considered up. (default to 75)

  • :tls_check_cert (Integer)

    Be strict on checking TLS certs. Optional.

Returns:



52
53
54
55
# File 'lib/fastly/api/pool_api.rb', line 52

def create_server_pool(opts = {})
  data, _status_code, _headers = create_server_pool_with_http_info(opts)
  data
end

#create_server_pool_with_http_info(opts = {}) ⇒ Array<(PoolResponsePost, Integer, Hash)>

Create a server pool Creates a pool for a particular service and version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :tls_ca_cert (String)

    A secure certificate to authenticate a server with. Must be in PEM format. (default to ‘null’)

  • :tls_client_cert (String)

    The client certificate used to make authenticated requests. Must be in PEM format. (default to ‘null’)

  • :tls_client_key (String)

    The client private key used to make authenticated requests. Must be in PEM format. (default to ‘null’)

  • :tls_cert_hostname (String)

    The hostname used to verify a server&#39;s certificate. It can either be the Common Name (CN) or a Subject Alternative Name (SAN). (default to ‘null’)

  • :use_tls (Integer)

    Whether to use TLS. (default to 0)

  • :created_at (Time)

    Date and time in ISO 8601 format.

  • :deleted_at (Time)

    Date and time in ISO 8601 format.

  • :updated_at (Time)

    Date and time in ISO 8601 format.

  • :service_id (String)
  • :version (String)
  • :name (String)

    Name for the Pool.

  • :shield (String)

    Selected POP to serve as a shield for the servers. Defaults to &#x60;null&#x60; meaning no origin shielding if not set. Refer to the [POPs API endpoint](www.fastly.com/documentation/reference/api/utils/pops/) to get a list of available POPs used for shielding. (default to ‘null’)

  • :request_condition (String)

    Condition which, if met, will select this configuration during a request. Optional.

  • :tls_ciphers (String)

    List of OpenSSL ciphers (see the [openssl.org manpages](www.openssl.org/docs/man1.1.1/man1/ciphers.html) for details). Optional.

  • :tls_sni_hostname (String)

    SNI hostname. Optional.

  • :min_tls_version (Integer)

    Minimum allowed TLS version on connections to this server. Optional.

  • :max_tls_version (Integer)

    Maximum allowed TLS version on connections to this server. Optional.

  • :healthcheck (String)

    Name of the healthcheck to use with this pool. Can be empty and could be reused across multiple backend and pools.

  • :comment (String)

    A freeform descriptive note.

  • :type (String)

    What type of load balance group to use.

  • :override_host (String)

    The hostname to [override the Host header](docs.fastly.com/en/guides/specifying-an-override-host). Defaults to &#x60;null&#x60; meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting. (default to ‘null’)

  • :between_bytes_timeout (Integer)

    Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, the response received so far will be considered complete and the fetch will end. May be set at runtime using &#x60;bereq.between_bytes_timeout&#x60;. (default to 10000)

  • :connect_timeout (Integer)

    How long to wait for a timeout in milliseconds. Optional.

  • :first_byte_timeout (Integer)

    How long to wait for the first byte in milliseconds. Optional.

  • :max_conn_default (Integer)

    Maximum number of connections. Optional. (default to 200)

  • :quorum (Integer)

    Percentage of capacity (&#x60;0-100&#x60;) that needs to be operationally available for a pool to be considered up. (default to 75)

  • :tls_check_cert (Integer)

    Be strict on checking TLS certs. Optional.

Returns:

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

    PoolResponsePost data, response status code and response headers



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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/fastly/api/pool_api.rb', line 89

def create_server_pool_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PoolApi.create_server_pool ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_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 PoolApi.create_server_pool"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling PoolApi.create_server_pool"
  end
  allowable_values = [0, 1]
  if @api_client.config.client_side_validation && opts[:'use_tls'] && !allowable_values.include?(opts[:'use_tls'])
    fail ArgumentError, "invalid value for \"use_tls\", must be one of #{allowable_values}"
  end
  allowable_values = ["random", "hash", "client"]
  if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
    fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'quorum'].nil? && opts[:'quorum'] > 100
    fail ArgumentError, 'invalid value for "opts[:"quorum"]" when calling PoolApi.create_server_pool, must be smaller than or equal to 100.'
  end

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

  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/pool'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['tls_ca_cert'] = opts[:'tls_ca_cert'] if !opts[:'tls_ca_cert'].nil?
  form_params['tls_client_cert'] = opts[:'tls_client_cert'] if !opts[:'tls_client_cert'].nil?
  form_params['tls_client_key'] = opts[:'tls_client_key'] if !opts[:'tls_client_key'].nil?
  form_params['tls_cert_hostname'] = opts[:'tls_cert_hostname'] if !opts[:'tls_cert_hostname'].nil?
  form_params['use_tls'] = opts[:'use_tls'] if !opts[:'use_tls'].nil?
  form_params['created_at'] = opts[:'created_at'] if !opts[:'created_at'].nil?
  form_params['deleted_at'] = opts[:'deleted_at'] if !opts[:'deleted_at'].nil?
  form_params['updated_at'] = opts[:'updated_at'] if !opts[:'updated_at'].nil?
  form_params['service_id'] = opts[:'service_id'] if !opts[:'service_id'].nil?
  form_params['version'] = opts[:'version'] if !opts[:'version'].nil?
  form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
  form_params['shield'] = opts[:'shield'] if !opts[:'shield'].nil?
  form_params['request_condition'] = opts[:'request_condition'] if !opts[:'request_condition'].nil?
  form_params['tls_ciphers'] = opts[:'tls_ciphers'] if !opts[:'tls_ciphers'].nil?
  form_params['tls_sni_hostname'] = opts[:'tls_sni_hostname'] if !opts[:'tls_sni_hostname'].nil?
  form_params['min_tls_version'] = opts[:'min_tls_version'] if !opts[:'min_tls_version'].nil?
  form_params['max_tls_version'] = opts[:'max_tls_version'] if !opts[:'max_tls_version'].nil?
  form_params['healthcheck'] = opts[:'healthcheck'] if !opts[:'healthcheck'].nil?
  form_params['comment'] = opts[:'comment'] if !opts[:'comment'].nil?
  form_params['type'] = opts[:'type'] if !opts[:'type'].nil?
  form_params['override_host'] = opts[:'override_host'] if !opts[:'override_host'].nil?
  form_params['between_bytes_timeout'] = opts[:'between_bytes_timeout'] if !opts[:'between_bytes_timeout'].nil?
  form_params['connect_timeout'] = opts[:'connect_timeout'] if !opts[:'connect_timeout'].nil?
  form_params['first_byte_timeout'] = opts[:'first_byte_timeout'] if !opts[:'first_byte_timeout'].nil?
  form_params['max_conn_default'] = opts[:'max_conn_default'] if !opts[:'max_conn_default'].nil?
  form_params['quorum'] = opts[:'quorum'] if !opts[:'quorum'].nil?
  form_params['tls_check_cert'] = opts[:'tls_check_cert'] if !opts[:'tls_check_cert'].nil?

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

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

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

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

#delete_server_pool(opts = {}) ⇒ InlineResponse200

Delete a server pool Deletes a specific pool for a particular service and version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :pool_name (String)

    Name for the Pool. (required)

Returns:



198
199
200
201
# File 'lib/fastly/api/pool_api.rb', line 198

def delete_server_pool(opts = {})
  data, _status_code, _headers = delete_server_pool_with_http_info(opts)
  data
end

#delete_server_pool_with_http_info(opts = {}) ⇒ Array<(InlineResponse200, Integer, Hash)>

Delete a server pool Deletes a specific pool for a particular service and version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :pool_name (String)

    Name for the Pool. (required)

Returns:

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

    InlineResponse200 data, response status code and response headers



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/fastly/api/pool_api.rb', line 209

def delete_server_pool_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PoolApi.delete_server_pool ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  pool_name = opts[:'pool_name']
  # 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 PoolApi.delete_server_pool"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling PoolApi.delete_server_pool"
  end
  # verify the required parameter 'pool_name' is set
  if @api_client.config.client_side_validation && pool_name.nil?
    fail ArgumentError, "Missing the required parameter 'pool_name' when calling PoolApi.delete_server_pool"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/pool/{pool_name}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'pool_name' + '}', CGI.escape(pool_name.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/json'])

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

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

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

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

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

#get_server_pool(opts = {}) ⇒ PoolResponse

Get a server pool Gets a single pool for a particular service and version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :pool_name (String)

    Name for the Pool. (required)

Returns:



275
276
277
278
# File 'lib/fastly/api/pool_api.rb', line 275

def get_server_pool(opts = {})
  data, _status_code, _headers = get_server_pool_with_http_info(opts)
  data
end

#get_server_pool_with_http_info(opts = {}) ⇒ Array<(PoolResponse, Integer, Hash)>

Get a server pool Gets a single pool for a particular service and version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :pool_name (String)

    Name for the Pool. (required)

Returns:

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

    PoolResponse data, response status code and response headers



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/fastly/api/pool_api.rb', line 286

def get_server_pool_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PoolApi.get_server_pool ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  pool_name = opts[:'pool_name']
  # 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 PoolApi.get_server_pool"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling PoolApi.get_server_pool"
  end
  # verify the required parameter 'pool_name' is set
  if @api_client.config.client_side_validation && pool_name.nil?
    fail ArgumentError, "Missing the required parameter 'pool_name' when calling PoolApi.get_server_pool"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/pool/{pool_name}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'pool_name' + '}', CGI.escape(pool_name.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/json'])

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

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

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

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

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

#list_server_pools(opts = {}) ⇒ Array<PoolResponse>

List server pools Lists all pools for a particular service and pool.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

Returns:



351
352
353
354
# File 'lib/fastly/api/pool_api.rb', line 351

def list_server_pools(opts = {})
  data, _status_code, _headers = list_server_pools_with_http_info(opts)
  data
end

#list_server_pools_with_http_info(opts = {}) ⇒ Array<(Array<PoolResponse>, Integer, Hash)>

List server pools Lists all pools for a particular service and pool.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

Returns:

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

    Array<PoolResponse> data, response status code and response headers



361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'lib/fastly/api/pool_api.rb', line 361

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

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'Array<PoolResponse>'

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

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

#update_server_pool(opts = {}) ⇒ PoolResponse

Update a server pool Updates a specific pool for a particular service and version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :pool_name (String)

    Name for the Pool. (required)

  • :tls_ca_cert (String)

    A secure certificate to authenticate a server with. Must be in PEM format. (default to ‘null’)

  • :tls_client_cert (String)

    The client certificate used to make authenticated requests. Must be in PEM format. (default to ‘null’)

  • :tls_client_key (String)

    The client private key used to make authenticated requests. Must be in PEM format. (default to ‘null’)

  • :tls_cert_hostname (String)

    The hostname used to verify a server&#39;s certificate. It can either be the Common Name (CN) or a Subject Alternative Name (SAN). (default to ‘null’)

  • :use_tls (Integer)

    Whether to use TLS. (default to USE_TLS::no_tls)

  • :created_at (Time)

    Date and time in ISO 8601 format.

  • :deleted_at (Time)

    Date and time in ISO 8601 format.

  • :updated_at (Time)

    Date and time in ISO 8601 format.

  • :service_id (String)
  • :version (String)
  • :name (String)

    Name for the Pool.

  • :shield (String)

    Selected POP to serve as a shield for the servers. Defaults to &#x60;null&#x60; meaning no origin shielding if not set. Refer to the [POPs API endpoint](www.fastly.com/documentation/reference/api/utils/pops/) to get a list of available POPs used for shielding. (default to ‘null’)

  • :request_condition (String)

    Condition which, if met, will select this configuration during a request. Optional.

  • :tls_ciphers (String)

    List of OpenSSL ciphers (see the [openssl.org manpages](www.openssl.org/docs/man1.1.1/man1/ciphers.html) for details). Optional.

  • :tls_sni_hostname (String)

    SNI hostname. Optional.

  • :min_tls_version (Integer)

    Minimum allowed TLS version on connections to this server. Optional.

  • :max_tls_version (Integer)

    Maximum allowed TLS version on connections to this server. Optional.

  • :healthcheck (String)

    Name of the healthcheck to use with this pool. Can be empty and could be reused across multiple backend and pools.

  • :comment (String)

    A freeform descriptive note.

  • :type (String)

    What type of load balance group to use.

  • :override_host (String)

    The hostname to [override the Host header](docs.fastly.com/en/guides/specifying-an-override-host). Defaults to &#x60;null&#x60; meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting. (default to ‘null’)

  • :between_bytes_timeout (Integer)

    Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, the response received so far will be considered complete and the fetch will end. May be set at runtime using &#x60;bereq.between_bytes_timeout&#x60;. (default to 10000)

  • :connect_timeout (Integer)

    How long to wait for a timeout in milliseconds. Optional.

  • :first_byte_timeout (Integer)

    How long to wait for the first byte in milliseconds. Optional.

  • :max_conn_default (Integer)

    Maximum number of connections. Optional. (default to 200)

  • :quorum (Integer)

    Percentage of capacity (&#x60;0-100&#x60;) that needs to be operationally available for a pool to be considered up. (default to 75)

  • :tls_check_cert (Integer)

    Be strict on checking TLS certs. Optional.

Returns:



449
450
451
452
# File 'lib/fastly/api/pool_api.rb', line 449

def update_server_pool(opts = {})
  data, _status_code, _headers = update_server_pool_with_http_info(opts)
  data
end

#update_server_pool_with_http_info(opts = {}) ⇒ Array<(PoolResponse, Integer, Hash)>

Update a server pool Updates a specific pool for a particular service and version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :pool_name (String)

    Name for the Pool. (required)

  • :tls_ca_cert (String)

    A secure certificate to authenticate a server with. Must be in PEM format. (default to ‘null’)

  • :tls_client_cert (String)

    The client certificate used to make authenticated requests. Must be in PEM format. (default to ‘null’)

  • :tls_client_key (String)

    The client private key used to make authenticated requests. Must be in PEM format. (default to ‘null’)

  • :tls_cert_hostname (String)

    The hostname used to verify a server&#39;s certificate. It can either be the Common Name (CN) or a Subject Alternative Name (SAN). (default to ‘null’)

  • :use_tls (Integer)

    Whether to use TLS. (default to USE_TLS::no_tls)

  • :created_at (Time)

    Date and time in ISO 8601 format.

  • :deleted_at (Time)

    Date and time in ISO 8601 format.

  • :updated_at (Time)

    Date and time in ISO 8601 format.

  • :service_id (String)
  • :version (String)
  • :name (String)

    Name for the Pool.

  • :shield (String)

    Selected POP to serve as a shield for the servers. Defaults to &#x60;null&#x60; meaning no origin shielding if not set. Refer to the [POPs API endpoint](www.fastly.com/documentation/reference/api/utils/pops/) to get a list of available POPs used for shielding. (default to ‘null’)

  • :request_condition (String)

    Condition which, if met, will select this configuration during a request. Optional.

  • :tls_ciphers (String)

    List of OpenSSL ciphers (see the [openssl.org manpages](www.openssl.org/docs/man1.1.1/man1/ciphers.html) for details). Optional.

  • :tls_sni_hostname (String)

    SNI hostname. Optional.

  • :min_tls_version (Integer)

    Minimum allowed TLS version on connections to this server. Optional.

  • :max_tls_version (Integer)

    Maximum allowed TLS version on connections to this server. Optional.

  • :healthcheck (String)

    Name of the healthcheck to use with this pool. Can be empty and could be reused across multiple backend and pools.

  • :comment (String)

    A freeform descriptive note.

  • :type (String)

    What type of load balance group to use.

  • :override_host (String)

    The hostname to [override the Host header](docs.fastly.com/en/guides/specifying-an-override-host). Defaults to &#x60;null&#x60; meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting. (default to ‘null’)

  • :between_bytes_timeout (Integer)

    Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, the response received so far will be considered complete and the fetch will end. May be set at runtime using &#x60;bereq.between_bytes_timeout&#x60;. (default to 10000)

  • :connect_timeout (Integer)

    How long to wait for a timeout in milliseconds. Optional.

  • :first_byte_timeout (Integer)

    How long to wait for the first byte in milliseconds. Optional.

  • :max_conn_default (Integer)

    Maximum number of connections. Optional. (default to 200)

  • :quorum (Integer)

    Percentage of capacity (&#x60;0-100&#x60;) that needs to be operationally available for a pool to be considered up. (default to 75)

  • :tls_check_cert (Integer)

    Be strict on checking TLS certs. Optional.

Returns:

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

    PoolResponse data, response status code and response headers



487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# File 'lib/fastly/api/pool_api.rb', line 487

def update_server_pool_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PoolApi.update_server_pool ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  pool_name = opts[:'pool_name']
  # 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 PoolApi.update_server_pool"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling PoolApi.update_server_pool"
  end
  # verify the required parameter 'pool_name' is set
  if @api_client.config.client_side_validation && pool_name.nil?
    fail ArgumentError, "Missing the required parameter 'pool_name' when calling PoolApi.update_server_pool"
  end
  allowable_values = [0, 1]
  if @api_client.config.client_side_validation && opts[:'use_tls'] && !allowable_values.include?(opts[:'use_tls'])
    fail ArgumentError, "invalid value for \"use_tls\", must be one of #{allowable_values}"
  end
  allowable_values = ["random", "hash", "client"]
  if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
    fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'quorum'].nil? && opts[:'quorum'] > 100
    fail ArgumentError, 'invalid value for "opts[:"quorum"]" when calling PoolApi.update_server_pool, must be smaller than or equal to 100.'
  end

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

  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/pool/{pool_name}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'pool_name' + '}', CGI.escape(pool_name.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/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['tls_ca_cert'] = opts[:'tls_ca_cert'] if !opts[:'tls_ca_cert'].nil?
  form_params['tls_client_cert'] = opts[:'tls_client_cert'] if !opts[:'tls_client_cert'].nil?
  form_params['tls_client_key'] = opts[:'tls_client_key'] if !opts[:'tls_client_key'].nil?
  form_params['tls_cert_hostname'] = opts[:'tls_cert_hostname'] if !opts[:'tls_cert_hostname'].nil?
  form_params['use_tls'] = opts[:'use_tls'] if !opts[:'use_tls'].nil?
  form_params['created_at'] = opts[:'created_at'] if !opts[:'created_at'].nil?
  form_params['deleted_at'] = opts[:'deleted_at'] if !opts[:'deleted_at'].nil?
  form_params['updated_at'] = opts[:'updated_at'] if !opts[:'updated_at'].nil?
  form_params['service_id'] = opts[:'service_id'] if !opts[:'service_id'].nil?
  form_params['version'] = opts[:'version'] if !opts[:'version'].nil?
  form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
  form_params['shield'] = opts[:'shield'] if !opts[:'shield'].nil?
  form_params['request_condition'] = opts[:'request_condition'] if !opts[:'request_condition'].nil?
  form_params['tls_ciphers'] = opts[:'tls_ciphers'] if !opts[:'tls_ciphers'].nil?
  form_params['tls_sni_hostname'] = opts[:'tls_sni_hostname'] if !opts[:'tls_sni_hostname'].nil?
  form_params['min_tls_version'] = opts[:'min_tls_version'] if !opts[:'min_tls_version'].nil?
  form_params['max_tls_version'] = opts[:'max_tls_version'] if !opts[:'max_tls_version'].nil?
  form_params['healthcheck'] = opts[:'healthcheck'] if !opts[:'healthcheck'].nil?
  form_params['comment'] = opts[:'comment'] if !opts[:'comment'].nil?
  form_params['type'] = opts[:'type'] if !opts[:'type'].nil?
  form_params['override_host'] = opts[:'override_host'] if !opts[:'override_host'].nil?
  form_params['between_bytes_timeout'] = opts[:'between_bytes_timeout'] if !opts[:'between_bytes_timeout'].nil?
  form_params['connect_timeout'] = opts[:'connect_timeout'] if !opts[:'connect_timeout'].nil?
  form_params['first_byte_timeout'] = opts[:'first_byte_timeout'] if !opts[:'first_byte_timeout'].nil?
  form_params['max_conn_default'] = opts[:'max_conn_default'] if !opts[:'max_conn_default'].nil?
  form_params['quorum'] = opts[:'quorum'] if !opts[:'quorum'].nil?
  form_params['tls_check_cert'] = opts[:'tls_check_cert'] if !opts[:'tls_check_cert'].nil?

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

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

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

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