Command Line Interface

    There are some functionality which couldn’t be accessed without using commands. For example:

    1. Creating volumes with quota
    2. Managing internal ACLs
    3. Creating buckets with encryption key

    All of these are one-time, administration tasks. Applications can use Ozone without this CLI using other interface like Hadoop Compatible File System (o3fs or ofs) or S3 interface.

    Ozone shell help can be invoked at object level or at action level.

    For example:

    will show all possible actions for volumes.

    Or it can be invoked to explain a specific action like:

    1. ozone sh volume create --help

    which will print the command line options of the create command for volumes.

    ozone script is used to invoke all Ozone sub-commands. The ozone shell is invoked via sh command.

    Object can be volume, bucket or key. Actions are various verbs like create, list, delete etc.

    Depending on the action, Ozone URL can point to a volume, bucket or key in the following format:

    [schema][server:port]/volume/bucket/key

    Where,

    1. Schema - This should be o3 which is the native RPC protocol to access Ozone API. The usage of the schema is optional.

    Please see volume commands, bucket commands, and key commands section for more detail.

    Volume is the top level element of the hierarchy, managed only by administrators. Optionally, quota and the owner user can be specified.

    Example commands:

    1. $ ozone sh volume create /vol1
    1. $ ozone sh volume list /
    2. {
    3. "metadata" : { },
    4. "name" : "s3v",
    5. "admin" : "hadoop",
    6. "owner" : "hadoop",
    7. "modificationTime" : "2020-07-27T11:32:22.314Z",
    8. "acls" : [ {
    9. "type" : "USER",
    10. "name" : "hadoop",
    11. "aclList" : [ "ALL" ]
    12. }, {
    13. "type" : "GROUP",
    14. "name" : "users",
    15. "aclScope" : "ACCESS",
    16. "aclList" : [ "ALL" ]
    17. } ],
    18. "quota" : 1152921504606846976
    19. }
    20. ....

    Bucket is the second level of the object hierarchy, and is similar to AWS S3 buckets. Users can create buckets in volumes, if they have the necessary permissions.

    Command examples:

    1. $ ozone sh bucket create /vol1/bucket1

    Transparent Data Encryption can be enabled at the bucket level.

    Key is the object which can store the data.

    1. $ ozone sh key put /vol1/bucket1/README.md README.md
    1. "volumeName" : "vol1",
    2. "bucketName" : "bucket1",
    3. "name" : "README.md",
    4. "dataSize" : 3841,
    5. "creationTime" : "2020-07-28T13:17:20.749Z",
    6. "modificationTime" : "2020-07-28T13:17:21.979Z",
    7. "replicationType" : "RATIS",
    8. "replicationFactor" : 1,
    9. "ozoneKeyLocations" : [ {
    10. "containerID" : 1,
    11. "localID" : 104591670688743424,
    12. "length" : 3841,
    13. "offset" : 0
    14. } ],
    15. "metadata" : { },
    16. "fileEncryptionInfo" : null