mds_plugin/object_store.py
def list_buckets(compartment_id=None, config=None, raise_exceptions=False,
                 interactive=True, return_formatted=True):
    """Lists object store buckets

    This function will list all buckets of the compartment with the
    given compartment_id.

    Args:
        compartment_id (str): OCID of the parent compartment.
        config (object): An OCI config object or None.
        raise_exceptions (bool): If set to True exceptions are raised
        interactive (bool): Whether output is more descriptive
        return_formatted (bool): If set to true, a list object is returned.

    Returns:
        A list of dicts representing the compartments
    """

    # 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)
        bucket_name = configuration.get_current_bucket_name(
            config=config)

        import oci.object_storage
        import oci.util

        # Initialize the  Object Store client
        os_client = core.get_oci_object_storage_client(config=config)

        # Get Object Store namespace
        namespace_name = get_object_store_namespace(config)

        # List the buckets
        buckets = os_client.list_buckets(
            namespace_name=namespace_name,
            compartment_id=compartment_id).data

        if len(buckets) < 1 and interactive:
            print("This compartment contains no buckets.")

        if return_formatted:
            return format_buckets_listing(
                buckets=buckets, current_bucket=bucket_name)
        else:
            # return compartments in JSON text output
            return oci.util.to_dict(buckets)
    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}')
Lists object store buckets

    This function will list all buckets of the compartment with the
    given compartment_id.

    Args:
        compartment_id (str): OCID of the parent compartment.
        config (object): An OCI config object or None.
        raise_exceptions (bool): If set to True exceptions are raised
        interactive (bool): Whether output is more descriptive
        return_formatted (bool): If set to true, a list object is returned.

    Returns:
        A list of dicts representing the compartments
    
Lists object store buckets
This function will list all buckets of the compartment with the
given compartment_id.
Lists object store buckets This function will list all buckets of the compartment with the given compartment_id .
def list_buckets(compartment_id=None, config=None, raise_exceptions=False,
                 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)
        bucket_name = configuration.get_current_bucket_name(
            config=config)
        import oci.object_storage
        import oci.util
        os_client = core.get_oci_object_storage_client(config=config)
        namespace_name = get_object_store_namespace(config)
        buckets = os_client.list_buckets(
            namespace_name=namespace_name,
            compartment_id=compartment_id).data
        if len(buckets) < 1 and interactive:
            print("This compartment contains no buckets.")
        if return_formatted:
            return format_buckets_listing(
                buckets=buckets, current_bucket=bucket_name)
        else:
            return oci.util.to_dict(buckets)
    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 list_buckets ( compartment_id = None , config = None , raise_exceptions = False , 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 ) bucket_name = configuration . get_current_bucket_name ( config = config ) import oci . object_storage import oci . util os_client = core . get_oci_object_storage_client ( config = config ) namespace_name = get_object_store_namespace ( config ) buckets = os_client . list_buckets ( namespace_name = namespace_name , compartment_id = compartment_id ) . data if len ( buckets ) < 1 and interactive : print ( "This compartment contains no buckets." ) if return_formatted : return format_buckets_listing ( buckets = buckets , current_bucket = bucket_name ) else : return oci . util . to_dict ( buckets ) 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}' )
Lists object store buckets
This function will list all buckets of the compartment with the
given compartment_id.
Lists object store buckets This function will list all buckets of the compartment with the given compartment_id .
"""Lists object store buckets

    This function will list all buckets of the compartment with the
    given compartment_id.

    Args:
        compartment_id (str): OCID of the parent compartment.
        config (object): An OCI config object or None.
        raise_exceptions (bool): If set to True exceptions are raised
        interactive (bool): Whether output is more descriptive
        return_formatted (bool): If set to true, a list object is returned.

    Returns:
        A list of dicts representing the compartments
    """ # Get the active config and compartment
 # Initialize the  Object Store client
 # Get Object Store namespace
 # List the buckets
 # return compartments in JSON text output

A list of dicts representing the compartments
A list of dicts representing the compartments
compartment_id
OCID of the parent compartment.
OCID of the parent compartment .
config
An OCI config object or None.
An OCI config object or None .
raise_exceptions
If set to True exceptions are raised
If set to True exceptions are raised
interactive
Whether output is more descriptive
Whether output is more descriptive
return_formatted
If set to true, a list object is returned.
If set to true a list object is returned .