mds_plugin/user.py
def list_policies(compartment_id=None, config=None, interactive=True,
                  return_formatted=True):
    """Lists policies

    Lists all policies of the given compartment

    Args:
        compartment_id (str): OCID of the compartment
        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 groups
    """

    # Get the active config and compartment
    try:
        config = configuration.get_current_config(config=config)
        compartment_id = configuration.get_current_compartment_id(
            compartment_id=compartment_id, config=config)
    except ValueError as e:
        print(f"ERROR: {str(e)}")
        return

    import oci.identity
    import mysqlsh

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

    try:
        # List the policies
        data = identity.list_policies(compartment_id=compartment_id).data
    except oci.exceptions.ServiceError as e:
        if not interactive:
            raise
        print(f'ERROR: {e.message}. (Code: {e.code}; Status: {e.status})')
        return
    except Exception as e:
        if not interactive:
            raise
        print(f'ERROR: {e}')
        return

    if return_formatted:
        return format_policy_listing(data)
    else:
        return oci.util.to_dict(data)
Lists policies

    Lists all policies of the given compartment

    Args:
        compartment_id (str): OCID of the compartment
        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 groups
    
Lists policies
Lists all policies of the given compartment
Lists policies Lists all policies of the given compartment
def list_policies(compartment_id=None, config=None, interactive=True,
                  return_formatted=True):
    try:
        config = configuration.get_current_config(config=config)
        compartment_id = configuration.get_current_compartment_id(
            compartment_id=compartment_id, config=config)
    except ValueError as e:
        print(f"ERROR: {str(e)}")
        return
    import oci.identity
    import mysqlsh
    identity = core.get_oci_identity_client(config=config)
    try:
        data = identity.list_policies(compartment_id=compartment_id).data
    except oci.exceptions.ServiceError as e:
        if not interactive:
            raise
        print(f'ERROR: {e.message}. (Code: {e.code}; Status: {e.status})')
        return
    except Exception as e:
        if not interactive:
            raise
        print(f'ERROR: {e}')
        return
    if return_formatted:
        return format_policy_listing(data)
    else:
        return oci.util.to_dict(data)
def list_policies ( compartment_id = None , config = None , interactive = True , return_formatted = True ) : try : config = configuration . get_current_config ( config = config ) compartment_id = configuration . get_current_compartment_id ( compartment_id = compartment_id , config = config ) except ValueError as e : print ( f"ERROR: {str(e)}" ) return import oci . identity import mysqlsh identity = core . get_oci_identity_client ( config = config ) try : data = identity . list_policies ( compartment_id = compartment_id ) . data except oci . exceptions . ServiceError as e : if not interactive : raise print ( f'ERROR: {e.message}. (Code: {e.code}; Status: {e.status})' ) return except Exception as e : if not interactive : raise print ( f'ERROR: {e}' ) return if return_formatted : return format_policy_listing ( data ) else : return oci . util . to_dict ( data )
Lists policies
Lists all policies of the given compartment
Lists policies Lists all policies of the given compartment
"""Lists policies

    Lists all policies of the given compartment

    Args:
        compartment_id (str): OCID of the compartment
        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 groups
    """ # Get the active config and compartment
 # Initialize the identity client
 # List the policies

A list of groups
A list of groups
compartment_id
OCID of the compartment
OCID of the compartment
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 .