mds_plugin/user.py
def list_users(config=None, interactive=True, return_formatted=True):
    """Lists users

    Lists all users of a given compartment.

    Args:
        config (object): An OCI config object or None.
        interactive (bool): If set to false exceptions are raised
        return_formatted (bool): If set to true, a list object is returned.

    Returns:
        A list of users
    """

    # Get the current config
    try:
        config = configuration.get_current_config(config=config)
    except ValueError as e:
        print(e)
        return

    import oci.identity

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

    # List the users
    try:
        # Users are always on the tenancy level
        data = identity.list_users(compartment_id=config.get("tenancy")).data

    except oci.exceptions.ServiceError as e:
        if not interactive:
            raise
        if e.code == "NotAuthorizedOrNotFound":
            print(f'You do not have privileges to list users.')
        print(f'ERROR: {e.message}. (Code: {e.code}; Status: {e.status})')
        return
    except (ValueError, oci.exceptions.ClientError) as e:
        if not interactive:
            raise
        print(f'ERROR: {e}')
        return

    if return_formatted:
        return format_user_listing(data)
    else:
        return oci.util.to_dict(data)
Lists users

    Lists all users of a given compartment.

    Args:
        config (object): An OCI config object or None.
        interactive (bool): If set to false exceptions are raised
        return_formatted (bool): If set to true, a list object is returned.

    Returns:
        A list of users
    
Lists users
Lists all users of a given compartment.
Lists users Lists all users of a given compartment .
def list_users(config=None, interactive=True, return_formatted=True):
    try:
        config = configuration.get_current_config(config=config)
    except ValueError as e:
        print(e)
        return
    import oci.identity
    identity = core.get_oci_identity_client(config=config)
    try:
        data = identity.list_users(compartment_id=config.get("tenancy")).data
    except oci.exceptions.ServiceError as e:
        if not interactive:
            raise
        if e.code == "NotAuthorizedOrNotFound":
            print(f'You do not have privileges to list users.')
        print(f'ERROR: {e.message}. (Code: {e.code}; Status: {e.status})')
        return
    except (ValueError, oci.exceptions.ClientError) as e:
        if not interactive:
            raise
        print(f'ERROR: {e}')
        return
    if return_formatted:
        return format_user_listing(data)
    else:
        return oci.util.to_dict(data)
def list_users ( config = None , interactive = True , return_formatted = True ) : try : config = configuration . get_current_config ( config = config ) except ValueError as e : print ( e ) return import oci . identity identity = core . get_oci_identity_client ( config = config ) try : data = identity . list_users ( compartment_id = config . get ( "tenancy" ) ) . data except oci . exceptions . ServiceError as e : if not interactive : raise if e . code == "NotAuthorizedOrNotFound" : print ( f'You do not have privileges to list users.' ) print ( f'ERROR: {e.message}. (Code: {e.code}; Status: {e.status})' ) return except ( ValueError , oci . exceptions . ClientError ) as e : if not interactive : raise print ( f'ERROR: {e}' ) return if return_formatted : return format_user_listing ( data ) else : return oci . util . to_dict ( data )
Lists users
Lists all users of a given compartment.
Lists users Lists all users of a given compartment .
"""Lists users

    Lists all users of a given compartment.

    Args:
        config (object): An OCI config object or None.
        interactive (bool): If set to false exceptions are raised
        return_formatted (bool): If set to true, a list object is returned.

    Returns:
        A list of users
    """ # Get the current config
 # Initialize the identity client
 # List the users
 # Users are always on the tenancy level

A list of users
A list of users
config
An OCI config object or None.
An OCI config object or None .
interactive
If set to false exceptions are raised
If set to false exceptions are raised
return_formatted
If set to true, a list object is returned.
If set to true a list object is returned .