Class: OracleBMC::LoadBalancer::LoadBalancerClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oraclebmc/load_balancer/load_balancer_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil, region: nil) ⇒ LoadBalancerClient

Creates a new LoadBalancerClient. If a config is not specified, then the global OracleBMC.config will be used.

A region must be specified in either the config or the region parameter. If specified in both, then the region parameter will be used.



32
33
34
35
36
37
38
39
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 32

def initialize(config:nil, region:nil)
  config ||= OracleBMC.config
  signer = Signer.new(config.user, config.fingerprint, config.tenancy, config.key_file, pass_phrase: config.pass_phrase)
  @api_client = ApiClient.new(config, signer)

  region ||= config.region
  self.region = region
end

Instance Attribute Details

#api_clientOracleBMC::ApiClient (readonly)

Client used to make HTTP requests.



12
13
14
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 12

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL



16
17
18
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 16

def endpoint
  @endpoint
end

#regionString

The region, which will usually correspond to a value in Regions::REGION_ENUM.



20
21
22
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 20

def region
  @region
end

Instance Method Details

#create_backend(create_backend_details, load_balancer_id, backend_set_name, opts = {}) ⇒ Response

Adds a backend server to a backend set.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


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
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 75

def create_backend(create_backend_details, load_balancer_id, backend_set_name, opts = {})
  logger.debug "Calling operation LoadBalancerClient#create_backend." if logger

  fail "Missing the required parameter 'create_backend_details' when calling create_backend." if create_backend_details.nil?
  fail "Missing the required parameter 'load_balancer_id' when calling create_backend." if load_balancer_id.nil?
  fail "Missing the required parameter 'backend_set_name' when calling create_backend." if backend_set_name.nil?

  path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends".sub('{loadBalancerId}', load_balancer_id.to_s).sub('{backendSetName}', backend_set_name.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = @api_client.object_to_http_body(create_backend_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#create_backend_set(create_backend_set_details, load_balancer_id, opts = {}) ⇒ Response

Adds a backend set to a load balancer.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


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
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 112

def create_backend_set(create_backend_set_details, load_balancer_id, opts = {})
  logger.debug "Calling operation LoadBalancerClient#create_backend_set." if logger

  fail "Missing the required parameter 'create_backend_set_details' when calling create_backend_set." if create_backend_set_details.nil?
  fail "Missing the required parameter 'load_balancer_id' when calling create_backend_set." if load_balancer_id.nil?

  path = "/loadBalancers/{loadBalancerId}/backendSets".sub('{loadBalancerId}', load_balancer_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = @api_client.object_to_http_body(create_backend_set_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#create_certificate(create_certificate_details, load_balancer_id, opts = {}) ⇒ Response

Creates an asynchronous request to add an SSL certificate.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


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
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 148

def create_certificate(create_certificate_details, load_balancer_id, opts = {})
  logger.debug "Calling operation LoadBalancerClient#create_certificate." if logger

  fail "Missing the required parameter 'create_certificate_details' when calling create_certificate." if create_certificate_details.nil?
  fail "Missing the required parameter 'load_balancer_id' when calling create_certificate." if load_balancer_id.nil?

  path = "/loadBalancers/{loadBalancerId}/certificates".sub('{loadBalancerId}', load_balancer_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = @api_client.object_to_http_body(create_certificate_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#create_listener(create_listener_details, load_balancer_id, opts = {}) ⇒ Response

Adds a listener to a load balancer.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 184

def create_listener(create_listener_details, load_balancer_id, opts = {})
  logger.debug "Calling operation LoadBalancerClient#create_listener." if logger

  fail "Missing the required parameter 'create_listener_details' when calling create_listener." if create_listener_details.nil?
  fail "Missing the required parameter 'load_balancer_id' when calling create_listener." if load_balancer_id.nil?

  path = "/loadBalancers/{loadBalancerId}/listeners".sub('{loadBalancerId}', load_balancer_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = @api_client.object_to_http_body(create_listener_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#create_load_balancer(create_load_balancer_details, opts = {}) ⇒ Response

Creates a new load balancer in the specified compartment. For general information about load balancers, see [Overview of the Load Balancing Service](docs.us-phoenix-1.oraclecloud.com/Content/Balance/Concepts/balanceoverview.htm).

For the purposes of access control, you must provide the OCID of the compartment where you want the load balancer to reside. Notice that the load balancer doesn’t have to be in the same compartment as the VCN or backend set. If you’re not sure which compartment to use, put the load balancer in the same compartment as the VCN. For information about access control and compartments, see [Overview of the IAM Service](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm).

You must specify a display name for the load balancer. It does not have to be unique, and you can change it.

To successfully create a load balancer within your Virtual Cloud Network (VCN), you must specify two subnets. Each subnet must reside in a separate Availability Domain.

For information about Availability Domains, see [Regions and Availability Domains](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). To get a list of Availability Domains, use the ‘ListAvailabilityDomains` operation in the Identity and Access Management Service API.

All Oracle Bare Metal Cloud Services resources, including load balancers, get an Oracle-assigned, unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response. You can also retrieve a resource’s OCID by using a List API operation on that resource type, or by viewing the resource in the Console. Fore more information, see [Resource Identifiers](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).

After you send your request, the new object’s state will temporarily be PROVISIONING. Before using the object, first make sure its state has changed to RUNNING.

When you create a load balancer, the system issues a public IP address. To get the IP address, use the get_load_balancer operation.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 249

def create_load_balancer(create_load_balancer_details, opts = {})
  logger.debug "Calling operation LoadBalancerClient#create_load_balancer." if logger

  fail "Missing the required parameter 'create_load_balancer_details' when calling create_load_balancer." if create_load_balancer_details.nil?

  path = "/loadBalancers"

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = @api_client.object_to_http_body(create_load_balancer_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#delete_backend(load_balancer_id, backend_set_name, backend_name, opts = {}) ⇒ Response

Removes a backend server from a given load balancer and backend set.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


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
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 291

def delete_backend(load_balancer_id, backend_set_name, backend_name, opts = {})
  logger.debug "Calling operation LoadBalancerClient#delete_backend." if logger

  fail "Missing the required parameter 'load_balancer_id' when calling delete_backend." if load_balancer_id.nil?
  fail "Missing the required parameter 'backend_set_name' when calling delete_backend." if backend_set_name.nil?
  fail "Missing the required parameter 'backend_name' when calling delete_backend." if backend_name.nil?

  path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends/{backendName}".sub('{loadBalancerId}', load_balancer_id.to_s).sub('{backendSetName}', backend_set_name.to_s).sub('{backendName}', backend_name.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#delete_backend_set(load_balancer_id, backend_set_name, opts = {}) ⇒ Response

Deletes the specified backend set. Note that deleting a backend set removes its backend servers from the load balancer.

Before you can delete a backend set, you must remove it from any active listeners.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 334

def delete_backend_set(load_balancer_id, backend_set_name, opts = {})
  logger.debug "Calling operation LoadBalancerClient#delete_backend_set." if logger

  fail "Missing the required parameter 'load_balancer_id' when calling delete_backend_set." if load_balancer_id.nil?
  fail "Missing the required parameter 'backend_set_name' when calling delete_backend_set." if backend_set_name.nil?

  path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}".sub('{loadBalancerId}', load_balancer_id.to_s).sub('{backendSetName}', backend_set_name.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#delete_certificate(load_balancer_id, certificate_name, opts = {}) ⇒ Response

Deletes an SSL certificate from a load balancer.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


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/oraclebmc/load_balancer/load_balancer_client.rb', line 373

def delete_certificate(load_balancer_id, certificate_name, opts = {})
  logger.debug "Calling operation LoadBalancerClient#delete_certificate." if logger

  fail "Missing the required parameter 'load_balancer_id' when calling delete_certificate." if load_balancer_id.nil?
  fail "Missing the required parameter 'certificate_name' when calling delete_certificate." if certificate_name.nil?

  path = "/loadBalancers/{loadBalancerId}/certificates/{certificateName}".sub('{loadBalancerId}', load_balancer_id.to_s).sub('{certificateName}', certificate_name.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#delete_listener(load_balancer_id, listener_name, opts = {}) ⇒ Response

Deletes a listener from a load balancer.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 412

def delete_listener(load_balancer_id, listener_name, opts = {})
  logger.debug "Calling operation LoadBalancerClient#delete_listener." if logger

  fail "Missing the required parameter 'load_balancer_id' when calling delete_listener." if load_balancer_id.nil?
  fail "Missing the required parameter 'listener_name' when calling delete_listener." if listener_name.nil?

  path = "/loadBalancers/{loadBalancerId}/listeners/{listenerName}".sub('{loadBalancerId}', load_balancer_id.to_s).sub('{listenerName}', listener_name.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#delete_load_balancer(load_balancer_id, opts = {}) ⇒ Response

Stops a load balancer and removes it from service.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


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
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 447

def delete_load_balancer(load_balancer_id, opts = {})
  logger.debug "Calling operation LoadBalancerClient#delete_load_balancer." if logger

  fail "Missing the required parameter 'load_balancer_id' when calling delete_load_balancer." if load_balancer_id.nil?

  path = "/loadBalancers/{loadBalancerId}".sub('{loadBalancerId}', load_balancer_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#get_backend(load_balancer_id, backend_set_name, backend_name, opts = {}) ⇒ Response

Gets the specified backend server’s configuration information.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


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
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 489

def get_backend(load_balancer_id, backend_set_name, backend_name, opts = {})
  logger.debug "Calling operation LoadBalancerClient#get_backend." if logger

  fail "Missing the required parameter 'load_balancer_id' when calling get_backend." if load_balancer_id.nil?
  fail "Missing the required parameter 'backend_set_name' when calling get_backend." if backend_set_name.nil?
  fail "Missing the required parameter 'backend_name' when calling get_backend." if backend_name.nil?

  path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends/{backendName}".sub('{loadBalancerId}', load_balancer_id.to_s).sub('{backendSetName}', backend_set_name.to_s).sub('{backendName}', backend_name.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::LoadBalancer::Models::Backend')
end

#get_backend_set(load_balancer_id, backend_set_name, opts = {}) ⇒ Response

Gets the specified backend set’s configuration information.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


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
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 530

def get_backend_set(load_balancer_id, backend_set_name, opts = {})
  logger.debug "Calling operation LoadBalancerClient#get_backend_set." if logger

  fail "Missing the required parameter 'load_balancer_id' when calling get_backend_set." if load_balancer_id.nil?
  fail "Missing the required parameter 'backend_set_name' when calling get_backend_set." if backend_set_name.nil?

  path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}".sub('{loadBalancerId}', load_balancer_id.to_s).sub('{backendSetName}', backend_set_name.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::LoadBalancer::Models::BackendSet')
end

#get_health_checker(load_balancer_id, backend_set_name, opts = {}) ⇒ Response

Gets the health check policy information for a given load balancer and backend set.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 570

def get_health_checker(load_balancer_id, backend_set_name, opts = {})
  logger.debug "Calling operation LoadBalancerClient#get_health_checker." if logger

  fail "Missing the required parameter 'load_balancer_id' when calling get_health_checker." if load_balancer_id.nil?
  fail "Missing the required parameter 'backend_set_name' when calling get_health_checker." if backend_set_name.nil?

  path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/healthChecker".sub('{loadBalancerId}', load_balancer_id.to_s).sub('{backendSetName}', backend_set_name.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::LoadBalancer::Models::HealthChecker')
end

#get_load_balancer(load_balancer_id, opts = {}) ⇒ Response

Gets the specified load balancer’s configuration information.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


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
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 606

def get_load_balancer(load_balancer_id, opts = {})
  logger.debug "Calling operation LoadBalancerClient#get_load_balancer." if logger

  fail "Missing the required parameter 'load_balancer_id' when calling get_load_balancer." if load_balancer_id.nil?

  path = "/loadBalancers/{loadBalancerId}".sub('{loadBalancerId}', load_balancer_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::LoadBalancer::Models::LoadBalancer')
end

#get_work_request(work_request_id, opts = {}) ⇒ Response

Gets the details of a work request.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 641

def get_work_request(work_request_id, opts = {})
  logger.debug "Calling operation LoadBalancerClient#get_work_request." if logger

  fail "Missing the required parameter 'work_request_id' when calling get_work_request." if work_request_id.nil?

  path = "/loadBalancerWorkRequests/{workRequestId}".sub('{workRequestId}', work_request_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::LoadBalancer::Models::WorkRequest')
end

#list_backend_sets(load_balancer_id, opts = {}) ⇒ Response

Lists all backend sets associated with a given load balancer.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


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
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 676

def list_backend_sets(load_balancer_id, opts = {})
  logger.debug "Calling operation LoadBalancerClient#list_backend_sets." if logger

  fail "Missing the required parameter 'load_balancer_id' when calling list_backend_sets." if load_balancer_id.nil?

  path = "/loadBalancers/{loadBalancerId}/backendSets".sub('{loadBalancerId}', load_balancer_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::LoadBalancer::Models::BackendSet>')
end

#list_backends(load_balancer_id, backend_set_name, opts = {}) ⇒ Response

Lists the backend servers for a given load balancer and backend set.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 715

def list_backends(load_balancer_id, backend_set_name, opts = {})
  logger.debug "Calling operation LoadBalancerClient#list_backends." if logger

  fail "Missing the required parameter 'load_balancer_id' when calling list_backends." if load_balancer_id.nil?
  fail "Missing the required parameter 'backend_set_name' when calling list_backends." if backend_set_name.nil?

  path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends".sub('{loadBalancerId}', load_balancer_id.to_s).sub('{backendSetName}', backend_set_name.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::LoadBalancer::Models::Backend>')
end

#list_certificates(load_balancer_id, opts = {}) ⇒ Response

Lists all SSL certificates associated with a given load balancer.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


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
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 751

def list_certificates(load_balancer_id, opts = {})
  logger.debug "Calling operation LoadBalancerClient#list_certificates." if logger

  fail "Missing the required parameter 'load_balancer_id' when calling list_certificates." if load_balancer_id.nil?

  path = "/loadBalancers/{loadBalancerId}/certificates".sub('{loadBalancerId}', load_balancer_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::LoadBalancer::Models::Certificate>')
end

#list_load_balancers(compartment_id, opts = {}) ⇒ Response

Lists all load balancers in the specified compartment.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    
  • :limit (Integer)

    The maximum number of items to return in a paginated &quot;List&quot; call.

    Example: ‘500`

    (default to 10)
    
  • :page (String)

    The value of the ‘opc-next-page` response header from the previous &quot;List&quot; call.

    Example: ‘3`

  • :detail (String)

    The level of detail to return for each result. Can be ‘full` or `simple`.

    Example: ‘full`

    (default to full)
    


798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 798

def list_load_balancers(compartment_id, opts = {})
  logger.debug "Calling operation LoadBalancerClient#list_load_balancers." if logger

  fail "Missing the required parameter 'compartment_id' when calling list_load_balancers." if compartment_id.nil?

  path = "/loadBalancers"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'detail'] = opts[:'detail'] if opts[:'detail']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::LoadBalancer::Models::LoadBalancer>')
end

#list_policies(compartment_id, opts = {}) ⇒ Response

Lists the available load balancer policies.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    
  • :limit (Integer)

    The maximum number of items to return in a paginated &quot;List&quot; call.

    Example: ‘500`

    (default to 16)
    
  • :page (String)

    The value of the ‘opc-next-page` response header from the previous &quot;List&quot; call.

    Example: ‘3`



845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 845

def list_policies(compartment_id, opts = {})
  logger.debug "Calling operation LoadBalancerClient#list_policies." if logger

  fail "Missing the required parameter 'compartment_id' when calling list_policies." if compartment_id.nil?

  path = "/loadBalancerPolicies"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::LoadBalancer::Models::LoadBalancerPolicy>')
end

#list_protocols(compartment_id, opts = {}) ⇒ Response

Lists all supported traffic protocols.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    
  • :limit (Integer)

    The maximum number of items to return in a paginated &quot;List&quot; call.

    Example: ‘500`

    (default to 16)
    
  • :page (String)

    The value of the ‘opc-next-page` response header from the previous &quot;List&quot; call.

    Example: ‘3`



891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 891

def list_protocols(compartment_id, opts = {})
  logger.debug "Calling operation LoadBalancerClient#list_protocols." if logger

  fail "Missing the required parameter 'compartment_id' when calling list_protocols." if compartment_id.nil?

  path = "/loadBalancerProtocols"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::LoadBalancer::Models::LoadBalancerProtocol>')
end

#list_shapes(compartment_id, opts = {}) ⇒ Response

Lists the valid load balancer shapes.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    
  • :limit (Integer)

    The maximum number of items to return in a paginated &quot;List&quot; call.

    Example: ‘500`

    (default to 16)
    
  • :page (String)

    The value of the ‘opc-next-page` response header from the previous &quot;List&quot; call.

    Example: ‘3`



937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 937

def list_shapes(compartment_id, opts = {})
  logger.debug "Calling operation LoadBalancerClient#list_shapes." if logger

  fail "Missing the required parameter 'compartment_id' when calling list_shapes." if compartment_id.nil?

  path = "/loadBalancerShapes"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::LoadBalancer::Models::LoadBalancerShape>')
end

#list_work_requests(load_balancer_id, opts = {}) ⇒ Response

Lists the work requests for a given load balancer.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    
  • :limit (Integer)

    The maximum number of items to return in a paginated &quot;List&quot; call.

    Example: ‘500`

    (default to 100)
    
  • :page (String)

    The value of the ‘opc-next-page` response header from the previous &quot;List&quot; call.

    Example: ‘3`



983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 983

def list_work_requests(load_balancer_id, opts = {})
  logger.debug "Calling operation LoadBalancerClient#list_work_requests." if logger

  fail "Missing the required parameter 'load_balancer_id' when calling list_work_requests." if load_balancer_id.nil?

  path = "/loadBalancers/{loadBalancerId}/workRequests".sub('{loadBalancerId}', load_balancer_id.to_s)

  # Query Params
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::LoadBalancer::Models::WorkRequest>')
end

#loggerLogger



58
59
60
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 58

def logger
  @api_client.config.logger
end

#update_backend(update_backend_details, load_balancer_id, backend_set_name, backend_name, opts = {}) ⇒ Response

Updates the configuration of a backend server within the specified backend set.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 1029

def update_backend(update_backend_details, load_balancer_id, backend_set_name, backend_name, opts = {})
  logger.debug "Calling operation LoadBalancerClient#update_backend." if logger

  fail "Missing the required parameter 'update_backend_details' when calling update_backend." if update_backend_details.nil?
  fail "Missing the required parameter 'load_balancer_id' when calling update_backend." if load_balancer_id.nil?
  fail "Missing the required parameter 'backend_set_name' when calling update_backend." if backend_set_name.nil?
  fail "Missing the required parameter 'backend_name' when calling update_backend." if backend_name.nil?

  path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends/{backendName}".sub('{loadBalancerId}', load_balancer_id.to_s).sub('{backendSetName}', backend_set_name.to_s).sub('{backendName}', backend_name.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = @api_client.object_to_http_body(update_backend_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#update_backend_set(update_backend_set_details, load_balancer_id, backend_set_name, opts = {}) ⇒ Response

Updates a backend set.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 1071

def update_backend_set(update_backend_set_details, load_balancer_id, backend_set_name, opts = {})
  logger.debug "Calling operation LoadBalancerClient#update_backend_set." if logger

  fail "Missing the required parameter 'update_backend_set_details' when calling update_backend_set." if update_backend_set_details.nil?
  fail "Missing the required parameter 'load_balancer_id' when calling update_backend_set." if load_balancer_id.nil?
  fail "Missing the required parameter 'backend_set_name' when calling update_backend_set." if backend_set_name.nil?

  path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}".sub('{loadBalancerId}', load_balancer_id.to_s).sub('{backendSetName}', backend_set_name.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = @api_client.object_to_http_body(update_backend_set_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#update_health_checker(health_checker, load_balancer_id, backend_set_name, opts = {}) ⇒ Response

Updates the health check policy for a given load balancer and backend set.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 1112

def update_health_checker(health_checker, load_balancer_id, backend_set_name, opts = {})
  logger.debug "Calling operation LoadBalancerClient#update_health_checker." if logger

  fail "Missing the required parameter 'health_checker' when calling update_health_checker." if health_checker.nil?
  fail "Missing the required parameter 'load_balancer_id' when calling update_health_checker." if load_balancer_id.nil?
  fail "Missing the required parameter 'backend_set_name' when calling update_health_checker." if backend_set_name.nil?

  path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/healthChecker".sub('{loadBalancerId}', load_balancer_id.to_s).sub('{backendSetName}', backend_set_name.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = @api_client.object_to_http_body(health_checker)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#update_listener(update_listener_details, load_balancer_id, listener_name, opts = {}) ⇒ Response

Updates a listener for a given load balancer.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 1153

def update_listener(update_listener_details, load_balancer_id, listener_name, opts = {})
  logger.debug "Calling operation LoadBalancerClient#update_listener." if logger

  fail "Missing the required parameter 'update_listener_details' when calling update_listener." if update_listener_details.nil?
  fail "Missing the required parameter 'load_balancer_id' when calling update_listener." if load_balancer_id.nil?
  fail "Missing the required parameter 'listener_name' when calling update_listener." if listener_name.nil?

  path = "/loadBalancers/{loadBalancerId}/listeners/{listenerName}".sub('{loadBalancerId}', load_balancer_id.to_s).sub('{listenerName}', listener_name.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = @api_client.object_to_http_body(update_listener_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#update_load_balancer(update_load_balancer_details, load_balancer_id, opts = {}) ⇒ Response

Updates a load balancer’s configuration.

Options Hash (opts):

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

    (default to )
    


1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
# File 'lib/oraclebmc/load_balancer/load_balancer_client.rb', line 1190

def update_load_balancer(update_load_balancer_details, load_balancer_id, opts = {})
  logger.debug "Calling operation LoadBalancerClient#update_load_balancer." if logger

  fail "Missing the required parameter 'update_load_balancer_details' when calling update_load_balancer." if update_load_balancer_details.nil?
  fail "Missing the required parameter 'load_balancer_id' when calling update_load_balancer." if load_balancer_id.nil?

  path = "/loadBalancers/{loadBalancerId}".sub('{loadBalancerId}', load_balancer_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']

  post_body = @api_client.object_to_http_body(update_load_balancer_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end