Skip to content

RESOURCECTL

The main command to manage your resources

DOCUMENTATION

Check the javadoc for more information :

SYNOPSIS

resourcectl -t [TENANT] [COMMAND] [OPTIONS]

DESCRIPTION

The resourcectl command allows you to manage your resources to a backend storage for a dedicated tenant.

The different commands are :

  • upload : to upload a resource
  • download : to download a resource
  • list : to display resources information
  • register : to push a resource information only

Metadata

Each resource is related to a metadata, stored inside a different kind of backend service. A metadata is basically all the information about everything that is not the resource itself, but what is related to, such as the creation time, the name, the url, the size, etc ...

When a resource is created, updated, deleted, moved or copied, a metadata is also automatically generated to describe this resource and is always returned as the command result.
To fetch the metadata, a user can execute the list command. To push a resource metadata only, a user can execute the register command.

Resource list file

To download multiple files at the same time, you can use a file that describe all resources to download. This file is JSON or YAML formatted and should contains a key "resources" containing a list of resource details (path in the resource manager, output on the file system)

resources:
  - path: punchlets/demo/punchlet.json
    name: punchlet.json
  - path: additional_jars/demo/test.jar?version=2
    name: demo.jar

EXAMPLES

# upload a single file
resourcectl -t mytenant upload --name punchlets/my_punchet --file /tmp/my_punchlet

# upload multiple file
resourcectl -t mytenant upload --name punchlets/ --directory /tmp/punchlets/

# download single file
resourcectl -t mytenant download --name csv/mylogs.csv --file /data/original_file.csv --type csv

# download multiple file
resourcectl -t mytenant download --resources-list /tmp/resource_list.json --output /tmp/myresources/

# list
resourcectl -t mytenant list

OPTIONS

Upload

  • --file Optional
    Path of the source file to upload

  • --directory Optional Path of the directory to upload

  • --name
    Mandatory
    Future name of the uploaded resource inside the storage. If uploading a directory, this option should be used as a prefix.

  • --type
    Optional
    Resource type when uploading a single file.

  • --help, -h
    Optional
    Display a command usage summary

Download

  • --name, -n The path of the resource to download.

  • --resources-list A file containing a resources list to download.

  • --version, -v
    Optional
    To download a specific version of a resource. Only compatible with --name option.

  • --output, -o
    Optional
    Output file on the file system.

  • --help, -h
    Optional
    Display a command usage summary

List

  • --name
    Optional , default is '*'
    Filter metadata by name.
    The pattern can contain wildcards.

  • --type Optional
    Filter metadata by file type.

  • --help
    Optional
    Display a command usage summary

  • --all
    Optional
    List all version of each resource

Register

  • --name, -n
    Mandatory
    Name of the resource to register inside the storage

  • --path
    Mandatory
    Real location of the resource to register

  • --type Optional Type of the resource

  • --help, -h
    Optional
    Display a command usage summary