Skip to content

Commit ba50683

Browse files
committed
Fix Listing of MHS instances via OCI SDK
Change-Id: I6283ffc8c96715cae888e0402f790e069dccab54
1 parent 6624313 commit ba50683

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

mds_plugin/mysql_database_service.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def format_mysql_shapes(items) -> str:
109109
items = [items]
110110

111111
# return objects in READABLE text output
112-
out = (core.fixed_len('Shape Name', 32, ' ') +
112+
out = (core.fixed_len('Shape Name', 32, ' ') +
113113
core.fixed_len('CPU Count', 12, ' ', align_right=True) +
114114
core.fixed_len('Memory Size', 12, '\n', align_right=True))
115115
id = 1
@@ -604,9 +604,10 @@ def list_db_systems(**kwargs):
604604

605605
# Get the list of shapes, cSpell:ignore ANALYTICSCLUSTER
606606
all_shapes = mds_client.list_shapes(compartment_id=compartment_id,
607-
is_supported_for=['ANALYTICSCLUSTER','HEATWAVECLUSTER']).data
607+
is_supported_for=['DBSYSTEM','HEATWAVECLUSTER']).data
608608
hw_shapes = [s.name for s in all_shapes if "HEATWAVECLUSTER" in s.is_supported_for]
609-
analytics_shapes = [s.name for s in all_shapes if "ANALYTICSCLUSTER" in s.is_supported_for]
609+
# Support for "ANALYTICSCLUSTER" has been removed from the SDK
610+
analytics_shapes = [] #[s.name for s in all_shapes if "ANALYTICSCLUSTER" in s.is_supported_for]
610611

611612
# Initialize the DbSystem client
612613
db_sys = core.get_oci_db_system_client(config=config)
@@ -826,8 +827,8 @@ def update_db_system(**kwargs):
826827
db_system_id (str): OCID of the DbSystem.
827828
ignore_current (bool): Whether to not default to the current bastion.
828829
new_name (str): The new name
829-
new_description (str): The new description
830-
new_freeform_tags (str): The new freeform_tags formatted as string
830+
new_description (str): The new description
831+
new_freeform_tags (str): The new freeform_tags formatted as string
831832
compartment_id (str): OCID of the parent compartment
832833
config (dict): An OCI config object or None
833834
config_profile (str): The name of an OCI config profile
@@ -1760,7 +1761,7 @@ def change_lifecycle_state(**kwargs):
17601761

17611762
# If the function should wait till the bastion reaches the correct
17621763
# lifecycle state
1763-
1764+
17641765
if await_completion:
17651766
if db_system_action:
17661767
await_lifecycle_state(
@@ -1877,7 +1878,7 @@ def await_hw_cluster_lifecycle_state(db_system_id, action_state, action_name, co
18771878
s = f" {req.percent_complete:.0f}% completed."
18781879
except:
18791880
pass
1880-
1881+
18811882
print(f'Waiting for HeatWave Cluster to {action_name}...{s}')
18821883
time.sleep(5)
18831884
cycles += 1
@@ -1989,7 +1990,7 @@ def create_hw_cluster(**kwargs):
19891990

19901991
if not shape_name and interactive:
19911992
shape = get_db_system_shape(
1992-
is_supported_for="HEATWAVECLUSTER",
1993+
is_supported_for="HEATWAVECLUSTER",
19931994
compartment_id=db_system.compartment_id,
19941995
config=config, config_profile=config_profile,
19951996
interactive=True,
@@ -2013,12 +2014,12 @@ def create_hw_cluster(**kwargs):
20132014

20142015
if await_completion:
20152016
await_hw_cluster_lifecycle_state(db_system_id=db_system.id, action_state='ACTIVE',
2016-
action_name="start", config=config, interactive=interactive,
2017+
action_name="start", config=config, interactive=interactive,
20172018
work_request_id=work_request_id)
20182019
elif interactive:
20192020
print(f"The HeatWave Cluster of the MySQL DB System '{db_system.display_name}' is being "
20202021
"created.")
2021-
2022+
20222023
except oci.exceptions.ServiceError as e:
20232024
if raise_exceptions:
20242025
raise
@@ -2125,7 +2126,7 @@ def update_hw_cluster(**kwargs):
21252126

21262127
if not shape_name and interactive:
21272128
shape = get_db_system_shape(
2128-
is_supported_for="HEATWAVECLUSTER",
2129+
is_supported_for="HEATWAVECLUSTER",
21292130
compartment_id=db_system.compartment_id,
21302131
config=config, config_profile=config_profile,
21312132
interactive=True,

0 commit comments

Comments
 (0)