The copy-file command facilitates the duplication of files and folders between different locations.

JSON Input Data Format
{
    "id": string,
    "name": string,
    "source": string,
    "destination": string,
    "cloudid": string
}
id * Specifies the ID of the Block Storage.
name * Specifies the name of the Block Storage.
source * Specifies the originating path of the files or folders that will be duplicated to the designated destination path.

You can also specify a source URL to download from, which can be an HTTP or S3 URL. For example:
  • use "https://mydomain.com/file.zip" to download from an HTTP server
  • use "s3ob://bucketname/file.zip" to download from an Object Storage bucket
  • use "s3mb://bucketname/file.zip" to download from a Magna bucket

Following wildcard rules apply:
  1. If the source is an HTTP URL, no wildcards can be applied.
  2. If the source is a S3 URL (s3ob/s3mb), then only the "--recursive" flag can be applied in front of the URL. For example: "--recursive s3ob://mybucket/myfolder/" will copy all files from "myfolder" to the destination.
  3. If the source is within the Block Storage, the * (asterisk) wildcard can be applied. For example: "/myfiles/*.json" selects and copies all JSON files to the destination.
destination * Specifies the target path where the files and folders from the source will be replicated.

You can also specify an S3 destination URL to store to. For example:
  • use "s3ob://bucketname/file.zip" to store in an Object Storage bucket
  • use "s3mb://bucketname/file.zip" to store in a Magna bucket
cloudid * Specifies the cloud ID hosting the Block Storage.
* Indicates a mandatory field.

Code Snippets
Here are several code snippets provided for your direct use. Simply select your preferred tool/language by clicking on it.


Successful Response
{
    "result": "OK",
    "payload": "The process was successfully completed"
}

Failed Response
{
    "result": "ERR",
    "message": "Error message ..."
}