Using UCC, you can upload or download data from a remote server, or initiate a server-to-server transfer.
Remote locations can be specified in two ways. The first way is to use a URI that includes protocol, storage server and filename, for example
BFT:https://mygateway:8080/SITE/services/StorageManagement?res=default_storage#/file
which specifies a file named "/file" on the storage instance "https://mygateway:8080/SITE/services/StorageManagement?res=default_storage", using the BFT protocol.
This is sometimes inconvenient, so you can use a shorter, more intuitive format. This is also a URI, but you need to know only the site (target system) name, and the storage or job id. For example
unicore6://SITE/Home/file?protocol=PROTOCOL
will resolve the "Home" storage at the target system named "SITE". Note that if you do not specify the protocol, the BFT protocol will be used as default.
You can also refer to a job Uspace (the job's working directory) on a given site. For this, you will need the unique ID of that job, which you can get for example using the 'list-jobs' command. For example,
unicore6://SITE/1f3bc2e2-d814-406e-811d-e533f8f7a93b/outfile
refers to the file "outfile" in the working directory of the given job on the "SITE" target system.
It is also possible to refer to storage services that are registered in the registry using their name, for example
unicore6://SHARE/myfiles/a_file
can be used to refer to the shared storage named "SHARE" if it is registered in the registry.
Note Though convenient, the method using "unicore6://" is much slower, and will generate some network traffic. If you do a lot of operations on the same resource, you might use the 'resolve' command to find out the URI of the resource, and use that later.
Note "u6://" can also be used instead of "unicore6://"
Use 'get-file' to download a remote file to your local machine.
Example
ucc get-file -s u6://DEMO-SITE/Home/test.txt -t test.txt
Use 'put-file' to upload a local file to a remote location.
Example
ucc put-file -s test.txt -t u6://DEMO-SITE/Home/test.txt
This will initiate a server-to-server data transfer. Use the "-a" option to run asynchronously, i.e. ucc will not wait for the transfer to complete. Instead, a file containing the transfer reference will be written, which can be passed to the 'copy-file-status' command for status checking later.
In case the source and target file are on the same storage resource, UCC will issue the remote copy command and return immediately, as there is no need for an asynchronous mode.
Example
ucc copy-file -s u6://OTHER-SITE/Home/test.txt -t u6://DEMO-SITE/Home/test.txt
This will print the status of the given data transfer. As argument, it expects a file name containing the transfer reference, or directly the reference.
Example (for Unix) which captures the reference into a shell variable
export ID=$(ucc copy-file -a -s u6://OTHER-SITE/Home/test.txt -t u6://DEMO-SITE/Home/test.txt) ucc copy-file-status $ID
This will figure out the "real" address for a "unicore6://" URL as defined above.
This will create a directory remotely.
Example
ucc mkdir u6://DEMO-SITE/Home/testdirectory
This will remove a file or directory remotely. By default, UCC will ask for a confirmation. Use the "--quiet" or "-q" option to disable this confirmation (e.g. when using this command in scripts).
Example
ucc rm u6://DEMO-SITE/Home/testdirectory