mds_plugin/user.py
def create_user_ui_password(user_name=None, user_id=None, config=None,
                            raise_exceptions=True):
    """Creates or resets the UI password of the user

    Args:
        user_name (str): The name of the user
        user_id (str): The OCID of the user
        config (object): An OCI config object or None.
        raise_exceptions (bool): If set to false exceptions are raised

    Returns:
        The API Keys of the user
    """
    # Get the current config
    try:
        config = configuration.get_current_config(config=config)

        import oci.identity

        # Get the user object
        user = get_user(user_name=user_name, user_id=user_id, config=config)
        if user is None:
            print("User not found. Operation cancelled.")
            return

        # Initialize the identity client
        identity = core.get_oci_identity_client(config=config)

        ui_password = identity.create_or_reset_ui_password(
            user_id=user.id).data

        tenancy = identity.get_tenancy(config.get("tenancy")).data

        print("\nThe OCI UI Console one-time password for user "
              f"'{user.name}' has been created.\n"
              "The user can now log in at the following URL:\n"
              f"    https://console.{config.get('region')}.oraclecloud.com/?"
              f"tenant={tenancy.name}\n\n"
              "Oracle Cloud Infrastructure Login Information:\n\n"
              f"TENANT\n{tenancy.name}\n\n"
              f"USER NAME\n{user.name}\n\n"
              "PASSWORD")

        return ui_password.password

    except oci.exceptions.ServiceError as e:
        if raise_exceptions:
            raise
        print(f'ERROR: {e.message}. (Code: {e.code}; Status: {e.status})')
        return
    except (ValueError, oci.exceptions.ClientError) as e:
        if raise_exceptions:
            raise
        print(f'ERROR: {e}')
Creates or resets the UI password of the user

    Args:
        user_name (str): The name of the user
        user_id (str): The OCID of the user
        config (object): An OCI config object or None.
        raise_exceptions (bool): If set to false exceptions are raised

    Returns:
        The API Keys of the user
    
Creates or resets the UI password of the user
Creates or resets the UI password of the user
def create_user_ui_password(user_name=None, user_id=None, config=None,
                            raise_exceptions=True):
    try:
        config = configuration.get_current_config(config=config)
        import oci.identity
        user = get_user(user_name=user_name, user_id=user_id, config=config)
        if user is None:
            print("User not found. Operation cancelled.")
            return
        identity = core.get_oci_identity_client(config=config)
        ui_password = identity.create_or_reset_ui_password(
            user_id=user.id).data
        tenancy = identity.get_tenancy(config.get("tenancy")).data
        print("\nThe OCI UI Console one-time password for user "
              f"'{user.name}' has been created.\n"
              "The user can now log in at the following URL:\n"
              f"    https://console.{config.get('region')}.oraclecloud.com/?"
              f"tenant={tenancy.name}\n\n"
              "Oracle Cloud Infrastructure Login Information:\n\n"
              f"TENANT\n{tenancy.name}\n\n"
              f"USER NAME\n{user.name}\n\n"
              "PASSWORD")
        return ui_password.password
    except oci.exceptions.ServiceError as e:
        if raise_exceptions:
            raise
        print(f'ERROR: {e.message}. (Code: {e.code}; Status: {e.status})')
        return
    except (ValueError, oci.exceptions.ClientError) as e:
        if raise_exceptions:
            raise
        print(f'ERROR: {e}')
def create_user_ui_password ( user_name = None , user_id = None , config = None , raise_exceptions = True ) : try : config = configuration . get_current_config ( config = config ) import oci . identity user = get_user ( user_name = user_name , user_id = user_id , config = config ) if user is None : print ( "User not found. Operation cancelled." ) return identity = core . get_oci_identity_client ( config = config ) ui_password = identity . create_or_reset_ui_password ( user_id = user . id ) . data tenancy = identity . get_tenancy ( config . get ( "tenancy" ) ) . data print ( "\nThe OCI UI Console one-time password for user " f"'{user.name}' has been created.\n" "The user can now log in at the following URL:\n" f"    https://console.{config.get('region')}.oraclecloud.com/?" f"tenant={tenancy.name}\n\n" "Oracle Cloud Infrastructure Login Information:\n\n" f"TENANT\n{tenancy.name}\n\n" f"USER NAME\n{user.name}\n\n" "PASSWORD" ) return ui_password . password except oci . exceptions . ServiceError as e : if raise_exceptions : raise print ( f'ERROR: {e.message}. (Code: {e.code}; Status: {e.status})' ) return except ( ValueError , oci . exceptions . ClientError ) as e : if raise_exceptions : raise print ( f'ERROR: {e}' )
Creates or resets the UI password of the user
Creates or resets the UI password of the user
"""Creates or resets the UI password of the user

    Args:
        user_name (str): The name of the user
        user_id (str): The OCID of the user
        config (object): An OCI config object or None.
        raise_exceptions (bool): If set to false exceptions are raised

    Returns:
        The API Keys of the user
    """ # Get the current config
 # Get the user object
 # Initialize the identity client

The API Keys of the user
The API Keys of the user
user_name
The name of the user
The name of the user
user_id
The OCID of the user
The OCID of the user
config
An OCI config object or None.
An OCI config object or None .
raise_exceptions
If set to false exceptions are raised
If set to false exceptions are raised