Skip to content

PPRESOURCECTL

The main command to manage your resources

Doc

Check the javadoc for more information :

Synopsis

ppresource -t [TENANT] [COMMAND] [OPTIONS]

Description

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

The different commands are :

  • put : to upload a resource
  • get : to download a resource
  • copy : to duplicate a resource
  • move : to change a resource location
  • delete : to remove 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.

Versioning

The resource manager manage automatically the resource versions. The versioning behavior depends on the user's command :

  • put : automatically uploads the last version of the resource
  • get : automatically downloads the last version of the resource
  • copy : automatically duplicates all the versions of the resource
  • move : automatically moves all the versions of the resource
  • delete : automatically removes all the versions of the resource

But a user may choose to force the version of the resource he wants to upload, download, delete, etc ...

Examples

# upload
ppresourcectl -t mytenant put --name csv/mylogs.csv --input-file /data/original_file.csv
ppresourcectl -t mytenant put -name csv/mylogs.csv --input-file /data/original_file.csv \ 
    --version 42 --property "description=this is a description" --property "owner=bob" --embedded
# download
ppresourcectl -t mytenant get --name csv/mylogs.csv
ppresourcectl -t mytenant get --name csv/mylogs.csv --version 42 --output /data/output_logs.csv
# list
ppresourcectl -t mytenant list
ppresourcectl -t mytenant list --pattern csv/* --filter "owner=bob" --all --simplify --output /tmp/list.json
# remove
ppresourcectl -t mytenant delete --name csv/mylogs.csv
ppresourcectl -t mytenant delete --name csv/mylogs.csv --version 42
# duplicate
ppresourcectl -t mytenant copy --from csv/mylogs.csv --destination copies/mylogs_copy.csv
ppresourcectl -t mytenant copy --from csv/mylogs.csv --destination copies/mylogs_copy.csv --version 42
# move
ppresourcectl -t mytenant move --from csv/mylogs.csv --destination copies/mylogs_copy.csv
ppresourcectl -t mytenant move --from csv/mylogs.csv --destination copies/mylogs_copy.csv --version 42
# register
ppresourcectl -t mytenant register --name csv/mylogs.csv --url /data/original_file.csv
ppresourcectl -t mytenant register --name csv/mylogs.csv --url /data/original_file.csv --version 43 --property "owner=bob"

Options

put

  • --input-file, -if
    Optional
    Path of the source file to upload

  • --input-file, -if
    Optional
    Raw content to upload

  • --name, -n
    Mandatory
    Future name of the uploaded resource inside the storage

  • --property, -p
    Optional
    Custom resource property with value 'prop_key=prop_value'. This option can be repeated.

  • --version, -v
    Optional
    Force a version number to upload

  • --configuration-file, -cf
    Optional
    Path of the resource manager configuration file.
    If none of these two options are used, the resource manager requires PUNCHPLATFORM_RESOURCE_MANAGER_CONFIGURATION environment variable.

  • --configuration-raw, -cr
    Optional
    Raw configuration in JSON string format.
    If none of these two options is used, the resource manager requires PUNCHPLATFORM_RESOURCE_MANAGER_CONFIGURATION environment variable.

  • --embedded
    Optional
    Store the resource content inside the resource metadata. Be aware of the risks about such an operation.

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

get

  • --name, -n
    Mandatory
    The name of the resource to download (Must match the resource name inside the storage).

  • --version, -v
    Optional
    To download a specific version of a resource

  • --output, -o
    Optional
    To download the resource to a dedicated file on the system. Otherwise, the resource content is always inside the result of the command.

  • --configuration-file, -cf
    Optional
    Path of the resource manager configuration file.
    If none of these two options are used, the resource manager requires PUNCHPLATFORM_RESOURCE_MANAGER_CONFIGURATION environment variable.

  • --configuration-raw, -cr
    Optional
    Raw configuration in JSON string format.
    If none of these two options is used, the resource manager requires PUNCHPLATFORM_RESOURCE_MANAGER_CONFIGURATION environment variable.

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

list

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

  • --filter, -f
    Optional
    Filter metadata by properties.
    If a resource metadata contains properties, this option looks for the property key and filter results by value. This option can be repeated.

  • --output, -o
    Optional
    To download the metadata results to a dedicated file on the system.
    Otherwise, metadata are always the result of this command.

  • --simplify, -s
    Optional
    Only returns the resource name, version and the time of the last update.
    Use this option for better 'user-friendly' results.

  • --all, -a
    Optional
    Display all the version metadata for each resource.

  • --configuration-file, -cf
    Optional
    Path of the resource manager configuration file.
    If none of these two options are used, the resource manager requires PUNCHPLATFORM_RESOURCE_MANAGER_CONFIGURATION environment variable.

  • --configuration-raw, -cr
    Optional
    Raw configuration in JSON string format.
    If none of these two options is used, the resource manager requires PUNCHPLATFORM_RESOURCE_MANAGER_CONFIGURATION environment variable.

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

delete

  • --name, -n
    Mandatory
    The name of the resource to delete (Must match the resource name inside the storage).

  • --version, -v
    Optional
    To delete a specific version of a resource

  • --configuration-file, -cf
    Optional
    Path of the resource manager configuration file.
    If none of these two options are used, the resource manager requires PUNCHPLATFORM_RESOURCE_MANAGER_CONFIGURATION environment variable.

  • --configuration-raw, -cr
    Optional
    Raw configuration in JSON string format.
    If none of these two options is used, the resource manager requires PUNCHPLATFORM_RESOURCE_MANAGER_CONFIGURATION environment variable.

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

copy

  • --from, -f
    Mandatory
    The name of the actual resource to copy (Must match the resource name inside the storage).

  • --destination, -d
    Mandatory
    The future name of the future to copy (Must match the resource name inside the storage).

  • --version, -v
    Optional
    To copy a specific version of a resource

  • --embedded
    Optional
    Store the resource content inside the resource metadata. Be aware of the risks about such an operation.

  • --configuration-file, -cf
    Optional
    Path of the resource manager configuration file.
    If none of these two options are used, the resource manager requires PUNCHPLATFORM_RESOURCE_MANAGER_CONFIGURATION environment variable.

  • --configuration-raw, -cr
    Optional
    Raw configuration in JSON string format.
    If none of these two options is used, the resource manager requires PUNCHPLATFORM_RESOURCE_MANAGER_CONFIGURATION environment variable.

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

move

  • --from, -f
    Mandatory
    The name of the actual resource to move (Must match the resource name inside the storage).

  • --destination, -d
    Mandatory
    The future name of the future to move (Must match the resource name inside the storage).

  • --version, -v
    Optional
    To move a specific version of a resource

  • --embedded
    Optional
    Store the resource content inside the resource metadata. Be aware of the risks about such an operation.

  • --configuration-file, -cf
    Optional
    Path of the resource manager configuration file.
    If none of these two options are used, the resource manager requires PUNCHPLATFORM_RESOURCE_MANAGER_CONFIGURATION environment variable.

  • --configuration-raw, -cr
    Optional
    Raw configuration in JSON string format.
    If none of these two options is used, the resource manager requires PUNCHPLATFORM_RESOURCE_MANAGER_CONFIGURATION environment variable.

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

register

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

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

  • --property, -p
    Optional
    Custom resource property with value 'prop_key=prop_value'. This option can be repeated.

  • --version, -v
    Optional
    Force a version number to register

  • --size, -s
    Optional
    The size of the resource content

  • --compression, -c
    Optional
    The compression type of the resource

  • --encoding, -e
    Optional
    The encoding type of the resource

  • --configuration-file, -cf
    Optional
    Path of the resource manager configuration file.
    If none of these two options are used, the resource manager requires PUNCHPLATFORM_RESOURCE_MANAGER_CONFIGURATION environment variable.

  • --configuration-raw, -cr
    Optional
    Raw configuration in JSON string format.
    If none of these two options is used, the resource manager requires PUNCHPLATFORM_RESOURCE_MANAGER_CONFIGURATION environment variable.

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