HDDS-469. Rename 'ozone oz' to 'ozone sh'. Contributed by Arpit Agarwal.

This commit is contained in:
Arpit Agarwal 2018-09-15 22:12:47 -07:00
parent 87e2c0f425
commit 82fbbd546c
7 changed files with 62 additions and 62 deletions

View File

@ -48,39 +48,39 @@ RpcClient without scheme
*** Keywords ***
Test ozone shell
[arguments] ${protocol} ${server} ${volume}
${result} = Execute on datanode ozone oz volume create ${protocol}${server}/${volume} --user bilbo --quota 100TB --root
${result} = Execute on datanode ozone sh volume create ${protocol}${server}/${volume} --user bilbo --quota 100TB --root
Should not contain ${result} Failed
Should contain ${result} Creating Volume: ${volume}
${result} = Execute on datanode ozone oz volume list ${protocol}${server}/ --user bilbo | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[] | select(.volumeName=="${volume}")'
${result} = Execute on datanode ozone sh volume list ${protocol}${server}/ --user bilbo | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[] | select(.volumeName=="${volume}")'
Should contain ${result} createdOn
${result} = Execute on datanode ozone oz volume list --user bilbo | grep -Ev 'Removed|DEBUG|ERROR|INFO|TRACE|WARN' | jq -r '.[] | select(.volumeName=="${volume}")'
${result} = Execute on datanode ozone sh volume list --user bilbo | grep -Ev 'Removed|DEBUG|ERROR|INFO|TRACE|WARN' | jq -r '.[] | select(.volumeName=="${volume}")'
Should contain ${result} createdOn
Execute on datanode ozone oz volume update ${protocol}${server}/${volume} --user bill --quota 10TB
${result} = Execute on datanode ozone oz volume info ${protocol}${server}/${volume} | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.volumeName=="${volume}") | .owner | .name'
Execute on datanode ozone sh volume update ${protocol}${server}/${volume} --user bill --quota 10TB
${result} = Execute on datanode ozone sh volume info ${protocol}${server}/${volume} | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.volumeName=="${volume}") | .owner | .name'
Should Be Equal ${result} bill
${result} = Execute on datanode ozone oz volume info ${protocol}${server}/${volume} | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.volumeName=="${volume}") | .quota | .size'
${result} = Execute on datanode ozone sh volume info ${protocol}${server}/${volume} | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.volumeName=="${volume}") | .quota | .size'
Should Be Equal ${result} 10
Execute on datanode ozone oz bucket create ${protocol}${server}/${volume}/bb1
${result} = Execute on datanode ozone oz bucket info ${protocol}${server}/${volume}/bb1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.bucketName=="bb1") | .storageType'
Execute on datanode ozone sh bucket create ${protocol}${server}/${volume}/bb1
${result} = Execute on datanode ozone sh bucket info ${protocol}${server}/${volume}/bb1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.bucketName=="bb1") | .storageType'
Should Be Equal ${result} DISK
${result} = Execute on datanode ozone oz bucket update ${protocol}${server}/${volume}/bb1 --addAcl user:frodo:rw,group:samwise:r | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.bucketName=="bb1") | .acls | .[] | select(.name=="samwise") | .type'
${result} = Execute on datanode ozone sh bucket update ${protocol}${server}/${volume}/bb1 --addAcl user:frodo:rw,group:samwise:r | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.bucketName=="bb1") | .acls | .[] | select(.name=="samwise") | .type'
Should Be Equal ${result} GROUP
${result} = Execute on datanode ozone oz bucket update ${protocol}${server}/${volume}/bb1 --removeAcl group:samwise:r | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.bucketName=="bb1") | .acls | .[] | select(.name=="frodo") | .type'
${result} = Execute on datanode ozone sh bucket update ${protocol}${server}/${volume}/bb1 --removeAcl group:samwise:r | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.bucketName=="bb1") | .acls | .[] | select(.name=="frodo") | .type'
Should Be Equal ${result} USER
${result} = Execute on datanode ozone oz bucket list ${protocol}${server}/${volume}/ | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[] | select(.bucketName=="bb1") | .volumeName'
${result} = Execute on datanode ozone sh bucket list ${protocol}${server}/${volume}/ | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[] | select(.bucketName=="bb1") | .volumeName'
Should Be Equal ${result} ${volume}
Run Keyword Test key handling ${protocol} ${server} ${volume}
Execute on datanode ozone oz bucket delete ${protocol}${server}/${volume}/bb1
Execute on datanode ozone oz volume delete ${protocol}${server}/${volume} --user bilbo
Execute on datanode ozone sh bucket delete ${protocol}${server}/${volume}/bb1
Execute on datanode ozone sh volume delete ${protocol}${server}/${volume} --user bilbo
Test key handling
[arguments] ${protocol} ${server} ${volume}
Execute on datanode ozone oz key put ${protocol}${server}/${volume}/bb1/key1 NOTICE.txt
Execute on datanode ozone sh key put ${protocol}${server}/${volume}/bb1/key1 NOTICE.txt
Execute on datanode rm -f NOTICE.txt.1
Execute on datanode ozone oz key get ${protocol}${server}/${volume}/bb1/key1 NOTICE.txt.1
Execute on datanode ozone sh key get ${protocol}${server}/${volume}/bb1/key1 NOTICE.txt.1
Execute on datanode ls -l NOTICE.txt.1
${result} = Execute on datanode ozone oz key info ${protocol}${server}/${volume}/bb1/key1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.keyName=="key1")'
${result} = Execute on datanode ozone sh key info ${protocol}${server}/${volume}/bb1/key1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.keyName=="key1")'
Should contain ${result} createdOn
${result} = Execute on datanode ozone oz key list ${protocol}${server}/${volume}/bb1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[] | select(.keyName=="key1") | .keyName'
${result} = Execute on datanode ozone sh key list ${protocol}${server}/${volume}/bb1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[] | select(.keyName=="key1") | .keyName'
Should Be Equal ${result} key1
Execute on datanode ozone oz key delete ${protocol}${server}/${volume}/bb1/key1
Execute on datanode ozone sh key delete ${protocol}${server}/${volume}/bb1/key1

View File

@ -27,13 +27,13 @@ ${PROJECTDIR} ${CURDIR}/../../../../../..
*** Test Cases ***
Create volume and bucket
Execute on datanode ozone oz volume create http://ozoneManager/fstest --user bilbo --quota 100TB --root
Execute on datanode ozone oz bucket create http://ozoneManager/fstest/bucket1
Execute on datanode ozone sh volume create http://ozoneManager/fstest --user bilbo --quota 100TB --root
Execute on datanode ozone sh bucket create http://ozoneManager/fstest/bucket1
Check volume from ozonefs
${result} = Execute on datanode ozone fs -ls o3://bucket1.fstest/
Create directory from ozonefs
Execute on datanode ozone fs -mkdir -p o3://bucket1.fstest/testdir/deep
${result} = Execute on ozoneManager ozone oz key list o3://ozoneManager/fstest/bucket1 | grep -v WARN | jq -r '.[].keyName'
${result} = Execute on ozoneManager ozone sh key list o3://ozoneManager/fstest/bucket1 | grep -v WARN | jq -r '.[].keyName'
Should contain ${result} testdir/deep

View File

@ -27,23 +27,23 @@ ${PROJECTDIR} ${CURDIR}/../../../../../..
*** Test Cases ***
Create volume and bucket
Execute on datanode ozone oz -createVolume http://ozoneManager/fstest -user bilbo -quota 100TB -root
Execute on datanode ozone oz -createBucket http://ozoneManager/fstest/bucket1
Execute on datanode ozone sh -createVolume http://ozoneManager/fstest -user bilbo -quota 100TB -root
Execute on datanode ozone sh -createBucket http://ozoneManager/fstest/bucket1
Check volume from ozonefs
${result} = Execute on datanode ozone fs -ls o3://bucket1.fstest/
Create directory from ozonefs
Execute on datanode ozone fs -mkdir -p o3://bucket1.fstest/testdir/deep
${result} = Execute on ozoneManager ozone oz -listKey o3://ozoneManager/fstest/bucket1 | grep -v WARN | jq -r '.[].keyName'
${result} = Execute on ozoneManager ozone sh -listKey o3://ozoneManager/fstest/bucket1 | grep -v WARN | jq -r '.[].keyName'
Should contain ${result} testdir/deep
Test key handling
Execute on datanode ozone oz -putKey o3://ozoneManager/fstest/bucket1/key1 -file NOTICE.txt -replicationFactor 1
Execute on datanode ozone sh -putKey o3://ozoneManager/fstest/bucket1/key1 -file NOTICE.txt -replicationFactor 1
Execute on datanode rm -f NOTICE.txt.1
Execute on datanode ozone oz -getKey o3://ozoneManager/fstest/bucket1/key1 -file NOTICE.txt.1
Execute on datanode ozone sh -getKey o3://ozoneManager/fstest/bucket1/key1 -file NOTICE.txt.1
Execute on datanode ls -l NOTICE.txt.1
${result} = Execute on datanode ozone oz -infoKey o3://ozoneManager/fstest/bucket1/key1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.keyName=="key1")'
${result} = Execute on datanode ozone sh -infoKey o3://ozoneManager/fstest/bucket1/key1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.keyName=="key1")'
Should contain ${result} createdOn
${result} = Execute on datanode ozone oz -listKey o3://ozoneManager/fstest/bucket1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[] | select(.keyName=="key1") | .keyName'
${result} = Execute on datanode ozone sh -listKey o3://ozoneManager/fstest/bucket1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[] | select(.keyName=="key1") | .keyName'
Should Be Equal ${result} key1
Execute on datanode ozone oz -deleteKey o3://ozoneManager/fstest/bucket1/key1 -v
Execute on datanode ozone sh -deleteKey o3://ozoneManager/fstest/bucket1/key1 -v

View File

@ -28,26 +28,26 @@ function hadoop_usage
hadoop_add_option "--buildpaths" "attempt to add class files from build tree"
hadoop_add_option "--daemon (start|status|stop)" "operate on a daemon"
hadoop_add_option "--hostnames list[,of,host,names]" "hosts to use in worker mode"
hadoop_add_option "--loglevel level" "set the log4j level for this command"
hadoop_add_option "--hosts filename" "list of hosts to use in worker mode"
hadoop_add_option "--loglevel level" "set the log4j level for this command"
hadoop_add_option "--workers" "turn on worker mode"
hadoop_add_subcommand "classpath" client "prints the class path needed to get the hadoop jar and the required libraries"
hadoop_add_subcommand "fs" client "run a filesystem command on ozone file system"
hadoop_add_subcommand "datanode" daemon "run a HDDS datanode"
hadoop_add_subcommand "envvars" client "display computed Hadoop environment variables"
hadoop_add_subcommand "freon" client "runs an ozone data generator"
hadoop_add_subcommand "fs" client "run a filesystem command on Ozone file system. Equivalent to 'hadoop fs'"
hadoop_add_subcommand "genconf" client "generate minimally required ozone configs and output to ozone-site.xml in specified path"
hadoop_add_subcommand "genesis" client "runs a collection of ozone benchmarks to help with tuning."
hadoop_add_subcommand "getozoneconf" client "get ozone config values from configuration"
hadoop_add_subcommand "jmxget" admin "get JMX exported values from NameNode or DataNode."
hadoop_add_subcommand "om" daemon "Ozone Manager"
hadoop_add_subcommand "oz" client "command line interface for ozone"
hadoop_add_subcommand "noz" client "ozone debug tool, convert ozone metadata into relational data"
hadoop_add_subcommand "om" daemon "Ozone Manager"
hadoop_add_subcommand "scm" daemon "run the Storage Container Manager service"
hadoop_add_subcommand "scmcli" client "run the CLI of the Storage Container Manager"
hadoop_add_subcommand "sh" client "command line interface for object store operations"
hadoop_add_subcommand "version" client "print the version"
hadoop_add_subcommand "genconf" client "generate minimally required ozone configs and output to ozone-site.xml in specified path"
hadoop_generate_usage "${HADOOP_SHELL_EXECNAME}" false
}
@ -100,7 +100,7 @@ function ozonecmd_case
HDFS_OM_OPTS="${HDFS_OM_OPTS} -Dlog4j.configurationFile=${HADOOP_CONF_DIR}/om-audit-log4j2.properties"
HADOOP_OPTS="${HADOOP_OPTS} ${HDFS_OM_OPTS}"
;;
oz)
sh | shell)
HADOOP_CLASSNAME=org.apache.hadoop.ozone.web.ozShell.Shell
;;
noz)

View File

@ -24,14 +24,14 @@ with simple authentication.
The Ozone commands take the following format.
```
ozone oz --command_ /volume/bucket/key -user <username> [-root]
ozone sh --command_ /volume/bucket/key -user <username> [-root]
```
The `port` specified in command should match the port mentioned in the config
property `hdds.rest.http-address`. This property can be set in `ozone-site.xml`.
The default value for the port is `9880` and is used in below commands.
The `-root` option is a command line short cut that allows *ozone oz*
The `-root` option is a command line short cut that allows *ozone fs*
commands to be run as the user that started the cluster. This is useful to
indicate that you want the commands to be run as some admin user. The only
reason for this option is that it makes the life of a lazy developer more
@ -46,7 +46,7 @@ ozone cluster.
### Create Volume
Volumes can be created only by administrators. Here is an example of creating a volume.
```
ozone oz -createVolume hive -user bilbo -quota 100TB -root
ozone sh -createVolume hive -user bilbo -quota 100TB -root
```
The above command creates a volume called `hive` owned by user `bilbo`. The
`-root` option allows the command to be executed as user `hdfs` which is an
@ -55,7 +55,7 @@ admin in the cluster.
### Update Volume
Updates information like ownership and quota on an existing volume.
```
ozone oz -updateVolume hive -quota 500TB -root
ozone sh -updateVolume hive -quota 500TB -root
```
The above command changes the volume quota of hive from 100TB to 500TB.
@ -63,21 +63,21 @@ The above command changes the volume quota of hive from 100TB to 500TB.
### Delete Volume
Deletes a Volume if it is empty.
```
ozone oz -deleteVolume /hive -root
ozone sh -deleteVolume /hive -root
```
### Info Volume
Info volume command allows the owner or the administrator of the cluster
to read meta-data about a specific volume.
```
ozone oz -infoVolume /hive -root
ozone sh -infoVolume /hive -root
```
### List Volumes
List volume command can be used by administrator to list volumes of any
user. It can also be used by any user to list their own volumes.
```
ozone oz -listVolume / -user bilbo
ozone sh -listVolume / -user bilbo
```
The above command lists all volumes owned by user bilbo.
@ -92,7 +92,7 @@ volume or bucket.
### Create Bucket
Create bucket call allows the owner of a volume to create a bucket.
```
ozone oz -createBucket /hive/january
ozone sh -createBucket /hive/january
```
This call creates a bucket called `january` in the volume called `hive`. If
@ -101,24 +101,24 @@ the volume does not exist, then this call will fail.
### Update Bucket
Updates bucket meta-data, like ACLs.
```
ozone oz -updateBucket /hive/january -addAcl user:spark:rw
ozone sh -updateBucket /hive/january -addAcl user:spark:rw
```
### Delete Bucket
Deletes a bucket if it is empty.
```
ozone oz -deleteBucket /hive/january
ozone sh -deleteBucket /hive/january
```
### Info Bucket
Returns information about a given bucket.
```
ozone oz -infoBucket /hive/january
ozone sh -infoBucket /hive/january
```
### List Buckets
List buckets in a given volume.
```
ozone oz -listBucket /hive
ozone sh -listBucket /hive
```
## Ozone Key Commands
@ -129,30 +129,30 @@ Ozone key commands allows users to put, delete and get keys from Ozone buckets.
Creates or overwrites a key in Ozone store, -file points to the file you want
to upload.
```
ozone oz -putKey /hive/january/processed.orc -file processed.orc
ozone sh -putKey /hive/january/processed.orc -file processed.orc
```
### Get Key
Downloads a file from the Ozone bucket.
```
ozone oz -getKey /hive/january/processed.orc -file processed.orc.copy
ozone sh -getKey /hive/january/processed.orc -file processed.orc.copy
```
### Delete Key
Deletes a key from the Ozone store.
```
ozone oz -deleteKey /hive/january/processed.orc
ozone sh -deleteKey /hive/january/processed.orc
```
### Info Key
Reads key metadata from the Ozone store.
```
ozone oz -infoKey /hive/january/processed.orc
ozone sh -infoKey /hive/january/processed.orc
```
### List Keys
List all keys in an Ozone bucket.
```
ozone oz -listKey /hive/january
ozone sh -listKey /hive/january
```

View File

@ -314,23 +314,23 @@ public class TestOzoneShell {
public void testShellIncompleteCommand() throws Exception {
LOG.info("Running testShellIncompleteCommand");
String expectedError = "Incomplete command";
String[] args = new String[] {}; //executing 'ozone oz'
String[] args = new String[] {}; //executing 'ozone sh'
executeWithError(shell, args, expectedError,
"Usage: ozone oz [-hV] [--verbose] [-D=<String=String>]..." +
"Usage: ozone sh [-hV] [--verbose] [-D=<String=String>]..." +
" [COMMAND]");
args = new String[] {"volume"}; //executing 'ozone oz volume'
args = new String[] {"volume"}; //executing 'ozone sh volume'
executeWithError(shell, args, expectedError,
"Usage: ozone oz volume [-hV] [COMMAND]");
"Usage: ozone sh volume [-hV] [COMMAND]");
args = new String[] {"bucket"}; //executing 'ozone oz bucket'
args = new String[] {"bucket"}; //executing 'ozone sh bucket'
executeWithError(shell, args, expectedError,
"Usage: ozone oz bucket [-hV] [COMMAND]");
"Usage: ozone sh bucket [-hV] [COMMAND]");
args = new String[] {"key"}; //executing 'ozone oz key'
args = new String[] {"key"}; //executing 'ozone sh key'
executeWithError(shell, args, expectedError,
"Usage: ozone oz key [-hV] [COMMAND]");
"Usage: ozone sh key [-hV] [COMMAND]");
}
@Test

View File

@ -34,8 +34,8 @@ import picocli.CommandLine.Command;
* This class uses dispatch method to make calls
* to appropriate handlers that execute the ozone functions.
*/
@Command(name = "ozone oz",
description = "Client for the Ozone object store",
@Command(name = "ozone sh",
description = "Shell for Ozone object store",
subcommands = {
VolumeCommands.class,
BucketCommands.class,