mds_plugin/mysql_database_service.py
def delete_db_system(**kwargs):
    """Updates the DbSystem with the given id

    If no id is given, it will prompt the user for the id.

    Args:
        **kwargs: Optional parameters

    Keyword Args:
        db_system_name (str): The name of the DB System.
        db_system_id (str): OCID of the DbSystem.
        await_completion (bool): Whether to wait till the DbSystem reaches
            the desired lifecycle state
        ignore_current (bool): Whether to not default to the current bastion.
        compartment_id (str): OCID of the parent compartment
        config (dict): An OCI config object or None
        config_profile (str): The name of an OCI config profile
        interactive (bool): Indicates whether to execute in interactive mode
        raise_exceptions (bool): If true exceptions are raised


    Returns:
       None
    """

    db_system_name = kwargs.get("db_system_name")
    db_system_id = kwargs.get("db_system_id")
    await_completion = kwargs.get("await_completion")
    ignore_current = kwargs.get("ignore_current", False)

    compartment_id = kwargs.get("compartment_id")
    config = kwargs.get("config")
    config_profile = kwargs.get("config_profile")

    interactive = kwargs.get("interactive", core.get_interactive_default())
    raise_exceptions = kwargs.get("raise_exceptions", not interactive)

    # Get the active config and compartment
    try:
        config = configuration.get_current_config(
            config=config, config_profile=config_profile,
            interactive=interactive)
        compartment_id = configuration.get_current_compartment_id(
            compartment_id=compartment_id, config=config)

        # Get the active config and compartment
        try:
            import oci.mysql
            import mysqlsh

            db_system = get_db_system(
                db_system_name=db_system_name, db_system_id=db_system_id,
                compartment_id=compartment_id, config=config,
                interactive=interactive, raise_exceptions=raise_exceptions,
                ignore_current=ignore_current,
                return_python_object=True)
            if db_system is None:
                if db_system_name or db_system_id:
                    raise ValueError("DB System not found.")
                else:
                    raise Exception("Cancelling operation.")

            if interactive:
                # Prompt the user for specifying a compartment
                prompt = mysqlsh.globals.shell.prompt(
                    f"Are you sure you want to delete the MySQL DB System "
                    f"{db_system.display_name} [yes/NO]: ",
                    {'defaultValue': 'no'}).strip().lower()

                if prompt != "yes":
                    print("Deletion aborted.\n")
                    return

            # Get DbSystem Client
            db_sys = core.get_oci_db_system_client(config=config)

            # Delete the DB System
            db_sys.delete_db_system(db_system.id)

            # If the function should wait till the bastion reaches the correct
            # lifecycle state
            if await_completion:
                await_lifecycle_state(
                    db_system.id, "DELETED", "complete the deletion process", 
                    config, interactive)
            elif interactive:
                print(f"MySQL DB System '{db_system.display_name}' is being "
                      "deleted.")
        except oci.exceptions.ServiceError as e:
            if interactive:
                raise
            print(f'ERROR: {e.message}. (Code: {e.code}; Status: {e.status})')
            return
    except Exception as e:
        if raise_exceptions:
            raise
        print(f'ERROR: {e}')
Updates the DbSystem with the given id

    If no id is given, it will prompt the user for the id.

    Args:
        **kwargs: Optional parameters

    Keyword Args:
        db_system_name (str): The name of the DB System.
        db_system_id (str): OCID of the DbSystem.
        await_completion (bool): Whether to wait till the DbSystem reaches
            the desired lifecycle state
        ignore_current (bool): Whether to not default to the current bastion.
        compartment_id (str): OCID of the parent compartment
        config (dict): An OCI config object or None
        config_profile (str): The name of an OCI config profile
        interactive (bool): Indicates whether to execute in interactive mode
        raise_exceptions (bool): If true exceptions are raised


    Returns:
       None
    
Updates the DbSystem with the given id
If no id is given, it will prompt the user for the id.
Updates the DbSystem with the given id If no id is given it will prompt the user for the id .
def delete_db_system(**kwargs):
    db_system_name = kwargs.get("db_system_name")
    db_system_id = kwargs.get("db_system_id")
    await_completion = kwargs.get("await_completion")
    ignore_current = kwargs.get("ignore_current", False)
    compartment_id = kwargs.get("compartment_id")
    config = kwargs.get("config")
    config_profile = kwargs.get("config_profile")
    interactive = kwargs.get("interactive", core.get_interactive_default())
    raise_exceptions = kwargs.get("raise_exceptions", not interactive)
    try:
        config = configuration.get_current_config(
            config=config, config_profile=config_profile,
            interactive=interactive)
        compartment_id = configuration.get_current_compartment_id(
            compartment_id=compartment_id, config=config)
        try:
            import oci.mysql
            import mysqlsh
            db_system = get_db_system(
                db_system_name=db_system_name, db_system_id=db_system_id,
                compartment_id=compartment_id, config=config,
                interactive=interactive, raise_exceptions=raise_exceptions,
                ignore_current=ignore_current,
                return_python_object=True)
            if db_system is None:
                if db_system_name or db_system_id:
                    raise ValueError("DB System not found.")
                else:
                    raise Exception("Cancelling operation.")
            if interactive:
                prompt = mysqlsh.globals.shell.prompt(
                    f"Are you sure you want to delete the MySQL DB System "
                    f"{db_system.display_name} [yes/NO]: ",
                    {'defaultValue': 'no'}).strip().lower()
                if prompt != "yes":
                    print("Deletion aborted.\n")
                    return
            db_sys = core.get_oci_db_system_client(config=config)
            db_sys.delete_db_system(db_system.id)
            if await_completion:
                await_lifecycle_state(
                    db_system.id, "DELETED", "complete the deletion process", 
                    config, interactive)
            elif interactive:
                print(f"MySQL DB System '{db_system.display_name}' is being "
                      "deleted.")
        except oci.exceptions.ServiceError as e:
            if interactive:
                raise
            print(f'ERROR: {e.message}. (Code: {e.code}; Status: {e.status})')
            return
    except Exception as e:
        if raise_exceptions:
            raise
        print(f'ERROR: {e}')
def delete_db_system ( ** kwargs ) : db_system_name = kwargs . get ( "db_system_name" ) db_system_id = kwargs . get ( "db_system_id" ) await_completion = kwargs . get ( "await_completion" ) ignore_current = kwargs . get ( "ignore_current" , False ) compartment_id = kwargs . get ( "compartment_id" ) config = kwargs . get ( "config" ) config_profile = kwargs . get ( "config_profile" ) interactive = kwargs . get ( "interactive" , core . get_interactive_default ( ) ) raise_exceptions = kwargs . get ( "raise_exceptions" , not interactive ) try : config = configuration . get_current_config ( config = config , config_profile = config_profile , interactive = interactive ) compartment_id = configuration . get_current_compartment_id ( compartment_id = compartment_id , config = config ) try : import oci . mysql import mysqlsh db_system = get_db_system ( db_system_name = db_system_name , db_system_id = db_system_id , compartment_id = compartment_id , config = config , interactive = interactive , raise_exceptions = raise_exceptions , ignore_current = ignore_current , return_python_object = True ) if db_system is None : if db_system_name or db_system_id : raise ValueError ( "DB System not found." ) else : raise Exception ( "Cancelling operation." ) if interactive : prompt = mysqlsh . globals . shell . prompt ( f"Are you sure you want to delete the MySQL DB System " f"{db_system.display_name} [yes/NO]: " , { 'defaultValue' : 'no' } ) . strip ( ) . lower ( ) if prompt != "yes" : print ( "Deletion aborted.\n" ) return db_sys = core . get_oci_db_system_client ( config = config ) db_sys . delete_db_system ( db_system . id ) if await_completion : await_lifecycle_state ( db_system . id , "DELETED" , "complete the deletion process" , config , interactive ) elif interactive : print ( f"MySQL DB System '{db_system.display_name}' is being " "deleted." ) except oci . exceptions . ServiceError as e : if interactive : raise print ( f'ERROR: {e.message}. (Code: {e.code}; Status: {e.status})' ) return except Exception as e : if raise_exceptions : raise print ( f'ERROR: {e}' )
Updates the DbSystem with the given id
If no id is given, it will prompt the user for the id.
Updates the DbSystem with the given id If no id is given it will prompt the user for the id .
"""Updates the DbSystem with the given id

    If no id is given, it will prompt the user for the id.

    Args:
        **kwargs: Optional parameters

    Keyword Args:
        db_system_name (str): The name of the DB System.
        db_system_id (str): OCID of the DbSystem.
        await_completion (bool): Whether to wait till the DbSystem reaches
            the desired lifecycle state
        ignore_current (bool): Whether to not default to the current bastion.
        compartment_id (str): OCID of the parent compartment
        config (dict): An OCI config object or None
        config_profile (str): The name of an OCI config profile
        interactive (bool): Indicates whether to execute in interactive mode
        raise_exceptions (bool): If true exceptions are raised


    Returns:
       None
    """ # Get the active config and compartment
 # Get the active config and compartment
 # Prompt the user for specifying a compartment
 # Get DbSystem Client
 # Delete the DB System
 # If the function should wait till the bastion reaches the correct
 # lifecycle state

None
**kwargs
None