TritonDataCenter / java-manta

Java Manta Client SDK
Mozilla Public License 2.0
16 stars 26 forks source link

MANTA-5153 Update MantaCLI Commands #566

Closed indianwhocodes closed 4 years ago

indianwhocodes commented 4 years ago

The following list of commands that have been offered by java-manta's MantaCLI package that will enable the customer to leverage basic Manta operations. The operations introduced with #566 are enumerated below:

Get-File:

java -jar ./java-manta-cli/target/java-manta-cli-3.4.3-SNAPSHOT-jar-with-dependencies.jar get-file -cse -o {path-to-local-file-in-disk} {path-to-file-in-Manta}
java -jar ./java-manta-cli/target/java-manta-cli-3.4.3-SNAPSHOT-jar-with-dependencies.jar get-file -cse --start-bytes=0 --end-bytes=465615 -o {path-to-local-file-in-disk} {path-to-file-in-Manta}

Note: The PR introduces --cse/ --using-encryption to enable client-side encryption for java-manta.

Put-File

java -jar ./java-manta-cli/target/java-manta-cli-3.4.3-SNAPSHOT-jar-with-dependencies.jar put-file -cse {path-to-local-file-in-disk} {path-to-file-in-Manta}

Creating new connection object
  com.joyent.manta.client.MantaClient@6bedbc4d
Attempting PUT request to: /Users/ashwinnair/test/header-error-logs-1.txt
com.joyent.manta.client.MantaObjectResponse{path='ashwin.nair/stor/test', contentLength=null, Request was successful

Note: The PR introduces --cse/ --using-encryption to enable client-side encryption for java-manta.

Delete-File

java -jar ./java-manta-cli/target/java-manta-cli-3.4.3-SNAPSHOT-jar-with-dependencies.jar rm -d=-1 {path-to-file-in-Manta} 
Creating connection configuration
Creating new connection object
  com.joyent.manta.client.MantaClient@31e5415e
Attempting DELETE request to: ashwin.nair/stor/MANTA-5143
Request was successful
java -jar ./java-manta-cli/target/java-manta-cli-3.4.3-SNAPSHOT-jar-with-dependencies.jar rm -r  {path-to-file-in-Manta} 
Creating connection configuration
Creating new connection object
  com.joyent.manta.client.MantaClient@31e5415e
Attempting DELETE request to: ashwin.nair/stor/MANTA-5143
Request was successful

Listing Command:

java -jar java-manta-cli-3.4.3-SNAPSHOT-jar-with-dependencies.jar ls ashwin.nair/stor/
  ashwin.nair/stor/.joyent
  ashwin.nair/stor/{object-uuid-1}
  ashwin.nair/stor/books
  ashwin.nair/stor/{object-uuid-2}
  ashwin.nair/stor/foo.txt
  ashwin.nair/stor/manta-monitor-data
  ashwin.nair/stor/name.txt
  ashwin.nair/stor/test
  ashwin.nair/stor/test-configuration.json

Encryption-Config

java -jar ./java-manta-cli/target/java-manta-cli-3.4.3-SNAPSHOT-jar-with-dependencies.jar cse-config                  
BaseChainedConfigContext{mantaURL='https://us-east.manta.joyent.com', user='ashwin.nair', mantaKeyId=$mantaKeyId, mantaKeyPath='/Users/ashwinnair/.ssh/id_rsa', timeout=4000, retries=3, maxConnections=24, httpBufferSize='4096', httpsProtocols='TLSv1.2', httpsCiphers='TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA256', tlsInsecure=false, noAuth=false, disableNativeSignatures=false, tcpSocketTimeout=20000, connectionRequestTimeout=1000, verifyUploads=true, uploadBufferSize=16384, skipDirectoryDepth=null, pruneEmptyParentDepth=null, downloadContinuations=0, metricReporterMode=null, metricReporterOutputInterval=null, clientEncryptionEnabled=true, contentTypeDetectionEnabled=false, permitUnencryptedDownloads=true, encryptionAuthenticationMode=Optional, encryptionKeyId=manta-cli-encryption-key, encryptionAlgorithm=AES128/CTR/NoPadding, encryptionPrivateKeyPath=null, encryptionPrivateKeyBytesLength=32}
indianwhocodes commented 4 years ago

Successfully executed range-download using MantaCLI:

java -jar ./java-manta-cli/target/java-manta-cli-3.4.3-SNAPSHOT-jar-with-dependencies.jar get-file --start-bytes=0 --end-bytes=465615 -o 5153b-test.out ashwin.nair/stor/MANTA-5143b
indianwhocodes commented 4 years ago

Successfully executed the following features incorporated in this PR within MantaCLI#SubCommand:

Encryption-Config Command

java -jar ./java-manta-cli/target/java-manta-cli-3.4.3-SNAPSHOT-jar-with-dependencies.jar cse-config                  
BaseChainedConfigContext{mantaURL='https://us-east.manta.joyent.com', user='ashwin.nair', mantaKeyId=$mantaKeyId, mantaKeyPath='/Users/ashwinnair/.ssh/id_rsa', timeout=4000, retries=3, maxConnections=24, httpBufferSize='4096', httpsProtocols='TLSv1.2', httpsCiphers='TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA256', tlsInsecure=false, noAuth=false, disableNativeSignatures=false, tcpSocketTimeout=20000, connectionRequestTimeout=1000, verifyUploads=true, uploadBufferSize=16384, skipDirectoryDepth=null, pruneEmptyParentDepth=null, downloadContinuations=0, metricReporterMode=null, metricReporterOutputInterval=null, clientEncryptionEnabled=true, contentTypeDetectionEnabled=true, permitUnencryptedDownloads=false, encryptionAuthenticationMode=Optional, encryptionKeyId=manta-cli-encryption-key, encryptionAlgorithm=AES256/CTR/NoPadding, encryptionPrivateKeyPath=null, encryptionPrivateKeyBytesLength=32}

DELETE (rm) Command

java -jar ./java-manta-cli/target/java-manta-cli-3.4.3-SNAPSHOT-jar-with-dependencies.jar rm -d=0 ashwin.nair/stor/MANTA-5143
Creating connection configuration
Creating new connection object
  com.joyent.manta.client.MantaClient@31e5415e
Attempting DELETE request to: ashwin.nair/stor/MANTA-5143
Request was successful
indianwhocodes commented 4 years ago

Thanks, squashed and merged into master