Class: IbmCloudDatabases::CloudDatabasesV5

Inherits:
IBMCloudSdkCore::BaseService
  • Object
show all
Includes:
Concurrent::Async
Defined in:
lib/ibm_cloud_databases/cloud_databases_v5.rb

Overview

The Cloud Databases V5 service.

Constant Summary collapse

DEFAULT_SERVICE_NAME =
"cloud_databases"
DEFAULT_SERVICE_URL =
"https://api.us-south.databases.cloud.ibm.com/v5/ibm"

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ CloudDatabasesV5

Construct a new client for the Cloud Databases service.

Parameters:

  • args (Hash)

    The args to initialize with

Options Hash (args):

  • service_url (String)

    The base service URL to use when contacting the service. The base service_url may differ between IBM Cloud regions.

  • authenticator (Object)

    The Authenticator instance to be configured for this service.

  • service_name (String)

    The name of the service to configure. Will be used as the key to load any external configuration, if applicable.



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 55

def initialize(args = {})
  @__async_initialized__ = false
  defaults = {}
  defaults[:service_url] = DEFAULT_SERVICE_URL
  defaults[:service_name] = DEFAULT_SERVICE_NAME
  defaults[:authenticator] = nil
  user_service_url = args[:service_url] unless args[:service_url].nil?
  args = defaults.merge(args)
  super
  @service_url = user_service_url unless user_service_url.nil?
end

Instance Method Details

#add_allowlist_entry(id: , ip_address: nil) ⇒ IBMCloudSdkCore::DetailedResponse

Add an address or range to the allowlist for a deployment. Add an address or range to the allowlist for a deployment.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

  • ip_address (AllowlistEntry) (defaults to: nil)

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 894

def add_allowlist_entry(id:, ip_address: nil)
  raise ArgumentError.new("id must be provided") if id.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "add_allowlist_entry")
  headers.merge!(sdk_headers)

  data = {
    "ip_address" => ip_address
  }

  method_url = "/deployments/%s/whitelists/ip_addresses" % [ERB::Util.url_encode(id)]

  response = request(
    method: "POST",
    url: method_url,
    headers: headers,
    json: data,
    accept_json: true
  )
  response
end

#change_user_password(id: , user_type: , username: , user: nil) ⇒ IBMCloudSdkCore::DetailedResponse

Set specified user’s password. Sets the password of a specified user.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

  • user_type (String) (defaults to: )

    User type.

  • username (String) (defaults to: )

    User ID.

  • user (APasswordSettingUser) (defaults to: nil)

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 189

def change_user_password(id:, user_type:, username:, user: nil)
  raise ArgumentError.new("id must be provided") if id.nil?

  raise ArgumentError.new("user_type must be provided") if user_type.nil?

  raise ArgumentError.new("username must be provided") if username.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "change_user_password")
  headers.merge!(sdk_headers)

  data = {
    "user" => user
  }

  method_url = "/deployments/%s/users/%s/%s" % [ERB::Util.url_encode(id), ERB::Util.url_encode(user_type), ERB::Util.url_encode(username)]

  response = request(
    method: "PATCH",
    url: method_url,
    headers: headers,
    json: data,
    accept_json: true
  )
  response
end

#complete_connection(id: , user_type: , user_id: , endpoint_type: , password: nil, certificate_root: nil) ⇒ IBMCloudSdkCore::DetailedResponse

Discover connection information for a deployment for a user with substitutions

and an endpoint type.

Discover connection information for a deployment for a user. Behaves the same as

the GET method but substitutes the provided password parameter into the returned
connection information.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

  • user_type (String) (defaults to: )

    User type of ‘database` is the only currently supported value.

  • user_id (String) (defaults to: )

    User ID.

  • endpoint_type (String) (defaults to: )

    Endpoint Type. The select endpoint must be enabled on the deployment before its connection information can be fetched.

  • password (String) (defaults to: nil)

    Password to be substituted into the response.

  • certificate_root (String) (defaults to: nil)

    Optional certificate root path to prepend certificate names. Certificates would be stored in this directory for use by other commands.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 596

def complete_connection(id:, user_type:, user_id:, endpoint_type:, password: nil, certificate_root: nil)
  raise ArgumentError.new("id must be provided") if id.nil?

  raise ArgumentError.new("user_type must be provided") if user_type.nil?

  raise ArgumentError.new("user_id must be provided") if user_id.nil?

  raise ArgumentError.new("endpoint_type must be provided") if endpoint_type.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "complete_connection")
  headers.merge!(sdk_headers)

  data = {
    "password" => password,
    "certificate_root" => certificate_root
  }

  method_url = "/deployments/%s/users/%s/%s/connections/%s" % [ERB::Util.url_encode(id), ERB::Util.url_encode(user_type), ERB::Util.url_encode(user_id), ERB::Util.url_encode(endpoint_type)]

  response = request(
    method: "POST",
    url: method_url,
    headers: headers,
    json: data,
    accept_json: true
  )
  response
end

#create_database_user(id: , user_type: , user: nil) ⇒ IBMCloudSdkCore::DetailedResponse

Creates a user based on user type. Creates a user in the database that can access the database through a connection.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

  • user_type (String) (defaults to: )

    User type.

  • user (CreateDatabaseUserRequestUser) (defaults to: nil)

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


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
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 154

def create_database_user(id:, user_type:, user: nil)
  raise ArgumentError.new("id must be provided") if id.nil?

  raise ArgumentError.new("user_type must be provided") if user_type.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "create_database_user")
  headers.merge!(sdk_headers)

  data = {
    "user" => user
  }

  method_url = "/deployments/%s/users/%s" % [ERB::Util.url_encode(id), ERB::Util.url_encode(user_type)]

  response = request(
    method: "POST",
    url: method_url,
    headers: headers,
    json: data,
    accept_json: true
  )
  response
end

#delete_allowlist_entry(id: , ipaddress: ) ⇒ IBMCloudSdkCore::DetailedResponse

Delete an address or range from the allowlist of a deployment. Delete an address or range from the allowlist of a deployment.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

  • ipaddress (String) (defaults to: )

    An IPv4 address or a CIDR range (netmasked IPv4 address).

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 925

def delete_allowlist_entry(id:, ipaddress:)
  raise ArgumentError.new("id must be provided") if id.nil?

  raise ArgumentError.new("ipaddress must be provided") if ipaddress.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "delete_allowlist_entry")
  headers.merge!(sdk_headers)

  method_url = "/deployments/%s/whitelists/ip_addresses/%s" % [ERB::Util.url_encode(id), ERB::Util.url_encode(ipaddress)]

  response = request(
    method: "DELETE",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#delete_database_user(id: , user_type: , username: ) ⇒ IBMCloudSdkCore::DetailedResponse

Deletes a user based on user type. Removes a user from the deployment.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

  • user_type (String) (defaults to: )

    User type.

  • username (String) (defaults to: )

    Username.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 225

def delete_database_user(id:, user_type:, username:)
  raise ArgumentError.new("id must be provided") if id.nil?

  raise ArgumentError.new("user_type must be provided") if user_type.nil?

  raise ArgumentError.new("username must be provided") if username.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "delete_database_user")
  headers.merge!(sdk_headers)

  method_url = "/deployments/%s/users/%s/%s" % [ERB::Util.url_encode(id), ERB::Util.url_encode(user_type), ERB::Util.url_encode(username)]

  response = request(
    method: "DELETE",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#get_allowlist(id: ) ⇒ IBMCloudSdkCore::DetailedResponse

Retrieve the allowlisted addresses and ranges for a deployment. Retrieve the allowlisted addresses and ranges for a deployment.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 830

def get_allowlist(id:)
  raise ArgumentError.new("id must be provided") if id.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "get_allowlist")
  headers.merge!(sdk_headers)

  method_url = "/deployments/%s/whitelists/ip_addresses" % [ERB::Util.url_encode(id)]

  response = request(
    method: "GET",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#get_autoscaling_conditions(id: , group_id: ) ⇒ IBMCloudSdkCore::DetailedResponse

Get the autoscaling configuration from a deployment. The Autoscaling configuration represents the various conditions that control

autoscaling for a deployment. This command allows for the retrieval of all
autoscaling conditions for a particular deployment.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

  • group_id (String) (defaults to: )

    Group ID.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 734

def get_autoscaling_conditions(id:, group_id:)
  raise ArgumentError.new("id must be provided") if id.nil?

  raise ArgumentError.new("group_id must be provided") if group_id.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "get_autoscaling_conditions")
  headers.merge!(sdk_headers)

  method_url = "/deployments/%s/groups/%s/autoscaling" % [ERB::Util.url_encode(id), ERB::Util.url_encode(group_id)]

  response = request(
    method: "GET",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#get_backup_info(backup_id: ) ⇒ IBMCloudSdkCore::DetailedResponse

Get information about a backup. Get information about a backup, such as creation date.

Parameters:

  • backup_id (String) (defaults to: )

    Backup ID.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 438

def get_backup_info(backup_id:)
  raise ArgumentError.new("backup_id must be provided") if backup_id.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "get_backup_info")
  headers.merge!(sdk_headers)

  method_url = "/backups/%s" % [ERB::Util.url_encode(backup_id)]

  response = request(
    method: "GET",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#get_connection(id: , user_type: , user_id: , endpoint_type: , certificate_root: nil) ⇒ IBMCloudSdkCore::DetailedResponse

Discover connection information for a deployment for a user with an endpoint

type.

Discover connection information for a deployment for a user with an endpoint type.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

  • user_type (String) (defaults to: )

    User type.

  • user_id (String) (defaults to: )

    User ID.

  • endpoint_type (String) (defaults to: )

    Endpoint Type. The endpoint must be enabled on the deployment before its connection information can be fetched.

  • certificate_root (String) (defaults to: nil)

    Optional certificate root path to prepend certificate names. Certificates would be stored in this directory for use by other commands.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


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
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 550

def get_connection(id:, user_type:, user_id:, endpoint_type:, certificate_root: nil)
  raise ArgumentError.new("id must be provided") if id.nil?

  raise ArgumentError.new("user_type must be provided") if user_type.nil?

  raise ArgumentError.new("user_id must be provided") if user_id.nil?

  raise ArgumentError.new("endpoint_type must be provided") if endpoint_type.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "get_connection")
  headers.merge!(sdk_headers)

  params = {
    "certificate_root" => certificate_root
  }

  method_url = "/deployments/%s/users/%s/%s/connections/%s" % [ERB::Util.url_encode(id), ERB::Util.url_encode(user_type), ERB::Util.url_encode(user_id), ERB::Util.url_encode(endpoint_type)]

  response = request(
    method: "GET",
    url: method_url,
    headers: headers,
    params: params,
    accept_json: true
  )
  response
end

#get_default_scaling_groups(type: ) ⇒ IBMCloudSdkCore::DetailedResponse

Get default scaling groups for a new deployment. Scaling groups represent the various resources allocated to a deployment. When a

new deployment is created, there are a set of defaults for each database type.
This endpoint returns them for a particular database.

Parameters:

  • type (String) (defaults to: )

    Database type name.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 665

def get_default_scaling_groups(type:)
  raise ArgumentError.new("type must be provided") if type.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "get_default_scaling_groups")
  headers.merge!(sdk_headers)

  method_url = "/deployables/%s/groups" % [ERB::Util.url_encode(type)]

  response = request(
    method: "GET",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#get_deployment_info(id: ) ⇒ IBMCloudSdkCore::DetailedResponse

Get deployment information. Gets the full data that is associated with a deployment. This data includes the

ID, name, database type, and version.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 124

def get_deployment_info(id:)
  raise ArgumentError.new("id must be provided") if id.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "get_deployment_info")
  headers.merge!(sdk_headers)

  method_url = "/deployments/%s" % [ERB::Util.url_encode(id)]

  response = request(
    method: "GET",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#get_pit_rdata(id: ) ⇒ IBMCloudSdkCore::DetailedResponse

Get earliest point-in-time-recovery timestamp. Returns the earliest available time for point-in-time-recovery in ISO8601 UTC

format. PostgreSQL and EnterpriseDB only.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 515

def get_pit_rdata(id:)
  raise ArgumentError.new("id must be provided") if id.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "get_pit_rdata")
  headers.merge!(sdk_headers)

  method_url = "/deployments/%s/point_in_time_recovery_data" % [ERB::Util.url_encode(id)]

  response = request(
    method: "GET",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#get_task(id: ) ⇒ IBMCloudSdkCore::DetailedResponse

Get information about a task. Get information about a task and its status. Tasks themselves are persistent so

old tasks can be consulted as well as running tasks.

Parameters:

  • id (String) (defaults to: )

    Task ID.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 410

def get_task(id:)
  raise ArgumentError.new("id must be provided") if id.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "get_task")
  headers.merge!(sdk_headers)

  method_url = "/tasks/%s" % [ERB::Util.url_encode(id)]

  response = request(
    method: "GET",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#kill_connections(id: ) ⇒ IBMCloudSdkCore::DetailedResponse

Kill connections to a PostgreSQL or EnterpriseDB deployment. Closes all the connections on a deployment. Available for PostgreSQL and

EnterpriseDB ONLY.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 802

def kill_connections(id:)
  raise ArgumentError.new("id must be provided") if id.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "kill_connections")
  headers.merge!(sdk_headers)

  method_url = "/deployments/%s/management/database_connections" % [ERB::Util.url_encode(id)]

  response = request(
    method: "DELETE",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#list_deployablesIBMCloudSdkCore::DetailedResponse

List all deployable databases. Returns a list of all the types and associated major versions of database

deployments that can be provisioned.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 77

def list_deployables
  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "list_deployables")
  headers.merge!(sdk_headers)

  method_url = "/deployables"

  response = request(
    method: "GET",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#list_deployment_backups(id: ) ⇒ IBMCloudSdkCore::DetailedResponse

List currently available backups from a deployment. Get details of all currently available backups from a deployment.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 463

def list_deployment_backups(id:)
  raise ArgumentError.new("id must be provided") if id.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "list_deployment_backups")
  headers.merge!(sdk_headers)

  method_url = "/deployments/%s/backups" % [ERB::Util.url_encode(id)]

  response = request(
    method: "GET",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#list_deployment_scaling_groups(id: ) ⇒ IBMCloudSdkCore::DetailedResponse

List currently available scaling groups from a deployment. Scaling groups represent the various resources that are allocated to a deployment.

This command allows for the retrieval of all of the groups for a particular
deployment.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 638

def list_deployment_scaling_groups(id:)
  raise ArgumentError.new("id must be provided") if id.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "list_deployment_scaling_groups")
  headers.merge!(sdk_headers)

  method_url = "/deployments/%s/groups" % [ERB::Util.url_encode(id)]

  response = request(
    method: "GET",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#list_deployment_tasks(id: ) ⇒ IBMCloudSdkCore::DetailedResponse

List currently running tasks on a deployment. Obtain a list of tasks currently running or recently run on a deployment. Tasks

are ephemeral. Records of successful tasks are shown for 24-48 hours, and
unsuccessful tasks are shown for 7-8 days.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 384

def list_deployment_tasks(id:)
  raise ArgumentError.new("id must be provided") if id.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "list_deployment_tasks")
  headers.merge!(sdk_headers)

  method_url = "/deployments/%s/tasks" % [ERB::Util.url_encode(id)]

  response = request(
    method: "GET",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#list_regionsIBMCloudSdkCore::DetailedResponse

List all deployable regions. Returns a list of all the regions that deployments can be provisioned into from

the current region. Used to determine region availability for read-only replicas.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 100

def list_regions
  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "list_regions")
  headers.merge!(sdk_headers)

  method_url = "/regions"

  response = request(
    method: "GET",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#list_remotes(id: ) ⇒ IBMCloudSdkCore::DetailedResponse

List read-only replica information. Get the read-only replicas associated with a deployment. Available for PostgreSQL

and EnterpriseDB ONLY.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 295

def list_remotes(id:)
  raise ArgumentError.new("id must be provided") if id.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "list_remotes")
  headers.merge!(sdk_headers)

  method_url = "/deployments/%s/remotes" % [ERB::Util.url_encode(id)]

  response = request(
    method: "GET",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#resync_replica(id: ) ⇒ IBMCloudSdkCore::DetailedResponse

Resync read-only replica. Reinitialize a read-only replica. Available for PostgreSQL and EnterpriseDB ONLY.

Parameters:

  • id (String) (defaults to: )

    Deployment ID of the read-only replica.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 320

def resync_replica(id:)
  raise ArgumentError.new("id must be provided") if id.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "resync_replica")
  headers.merge!(sdk_headers)

  method_url = "/deployments/%s/remotes/resync" % [ERB::Util.url_encode(id)]

  response = request(
    method: "POST",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#set_allowlist(id: , ip_addresses: nil, if_match: nil) ⇒ IBMCloudSdkCore::DetailedResponse

Set the allowlist for a deployment. Set the allowlist for a deployment. This action overwrites all existing entries,

so when you modify the allowlist via a GET/update/PUT, provide the GET response's
ETag header value in this endpoint's If-Match header to ensure that changes that
are made by other clients are not accidentally overwritten.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

  • ip_addresses (Array[AllowlistEntry]) (defaults to: nil)

    An array of allowlist entries.

  • if_match (String) (defaults to: nil)

    Verify that the current allowlist matches a provided ETag value. Use in conjunction with the GET operation’s ETag header to ensure synchronicity between clients.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 862

def set_allowlist(id:, ip_addresses: nil, if_match: nil)
  raise ArgumentError.new("id must be provided") if id.nil?

  headers = {
    "If-Match" => if_match
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "set_allowlist")
  headers.merge!(sdk_headers)

  data = {
    "ip_addresses" => ip_addresses
  }

  method_url = "/deployments/%s/whitelists/ip_addresses" % [ERB::Util.url_encode(id)]

  response = request(
    method: "PUT",
    url: method_url,
    headers: headers,
    json: data,
    accept_json: true
  )
  response
end

#set_autoscaling_conditions(id: , group_id: , autoscaling: ) ⇒ IBMCloudSdkCore::DetailedResponse

Set the autoscaling configuration from a deployment. Enable, disable, or set the conditions for autoscaling on your deployment. Memory,

disk, and CPU (if available) can be set separately and are not all required.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

  • group_id (String) (defaults to: )

    Group ID.

  • autoscaling (AutoscalingSetGroupAutoscaling) (defaults to: )

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 764

def set_autoscaling_conditions(id:, group_id:, autoscaling:)
  raise ArgumentError.new("id must be provided") if id.nil?

  raise ArgumentError.new("group_id must be provided") if group_id.nil?

  raise ArgumentError.new("autoscaling must be provided") if autoscaling.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "set_autoscaling_conditions")
  headers.merge!(sdk_headers)

  data = {
    "autoscaling" => autoscaling
  }

  method_url = "/deployments/%s/groups/%s/autoscaling" % [ERB::Util.url_encode(id), ERB::Util.url_encode(group_id)]

  response = request(
    method: "PATCH",
    url: method_url,
    headers: headers,
    json: data,
    accept_json: true
  )
  response
end

#set_deployment_scaling_group(id: , group_id: , set_deployment_scaling_group_request: ) ⇒ IBMCloudSdkCore::DetailedResponse

Set scaling values on a specified group. Set scaling value on a specified group. Can only be performed on

is_adjustable=true groups. Values set are for the group as a whole and resources
are distributed amongst the group. Values must be greater than or equal to the
minimum size and must be a multiple of the step size.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

  • group_id (String) (defaults to: )

    Group Id.

  • set_deployment_scaling_group_request (SetDeploymentScalingGroupRequest) (defaults to: )

    Scaling group settings.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 695

def set_deployment_scaling_group(id:, group_id:, set_deployment_scaling_group_request:)
  raise ArgumentError.new("id must be provided") if id.nil?

  raise ArgumentError.new("group_id must be provided") if group_id.nil?

  raise ArgumentError.new("set_deployment_scaling_group_request must be provided") if set_deployment_scaling_group_request.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "set_deployment_scaling_group")
  headers.merge!(sdk_headers)

  data = set_deployment_scaling_group_request
  headers["Content-Type"] = "application/json"

  method_url = "/deployments/%s/groups/%s" % [ERB::Util.url_encode(id), ERB::Util.url_encode(group_id)]

  response = request(
    method: "PATCH",
    url: method_url,
    headers: headers,
    data: data,
    accept_json: true
  )
  response
end

#set_promotion(id: , promotion: ) ⇒ IBMCloudSdkCore::DetailedResponse

Promote read-only replica to a full deployment. Promote a read-only replica or upgrade and promote a read-only replica. Available

for PostgreSQL and EnterpriseDB ONLY.

Parameters:

  • id (String) (defaults to: )

    Deployment ID of the read-only replica to promote.

  • promotion (SetPromotionPromotion) (defaults to: )

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 347

def set_promotion(id:, promotion:)
  raise ArgumentError.new("id must be provided") if id.nil?

  raise ArgumentError.new("promotion must be provided") if promotion.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "set_promotion")
  headers.merge!(sdk_headers)

  data = {
    "Promotion" => promotion
  }

  method_url = "/deployments/%s/remotes/promotion" % [ERB::Util.url_encode(id)]

  response = request(
    method: "POST",
    url: method_url,
    headers: headers,
    json: data,
    accept_json: true
  )
  response
end

#start_ondemand_backup(id: ) ⇒ IBMCloudSdkCore::DetailedResponse

Initiate an on-demand backup. Signal the platform to create an on-demand backup for the specified deployment.

The returned task can be polled to track progress of the backup as it takes place.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 489

def start_ondemand_backup(id:)
  raise ArgumentError.new("id must be provided") if id.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "start_ondemand_backup")
  headers.merge!(sdk_headers)

  method_url = "/deployments/%s/backups" % [ERB::Util.url_encode(id)]

  response = request(
    method: "POST",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end

#update_database_configuration(id: , configuration: ) ⇒ IBMCloudSdkCore::DetailedResponse

Change your database configuration. Change your database configuration. Available for PostgreSQL, EnterpriseDB, and

Redis ONLY.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

  • configuration (SetConfigurationConfiguration) (defaults to: )

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 259

def update_database_configuration(id:, configuration:)
  raise ArgumentError.new("id must be provided") if id.nil?

  raise ArgumentError.new("configuration must be provided") if configuration.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "update_database_configuration")
  headers.merge!(sdk_headers)

  data = {
    "configuration" => configuration
  }

  method_url = "/deployments/%s/configuration" % [ERB::Util.url_encode(id)]

  response = request(
    method: "PATCH",
    url: method_url,
    headers: headers,
    json: data,
    accept_json: true
  )
  response
end