Asset management

Functions of asset management allow you to upload files for slyft processing, as well as list them and download result files.

$ slyft asset --help

Usage: Slyft asset COMMAND [arg...]

Asset management

Commands:
  add, a       Add asset to a project
  list, ls     List your assets
  delete, d    Remove and asset from a project

Run 'Slyft asset COMMAND --help' for more information on a command.

Add

Adding assets means uploading a local file to the Slyft API. At present, files <20KB in YAML or JSON format are allowed.

$ slyft asset add --help

Usage: slyft asset add --project --file

Add asset to a project

Options:
  --project, -p=""   Name (or part of it) of a project
  --file, -f=""      path to the file which you want as an asset

I.e.

$ slyft asset add --project "First Sample" --file first_coap_api.raml

---- Asset Details ----
      KEY     |                                  VALUE
+-------------+-------------------------------------------------------+
  Name        | first_coap_api.raml
  ProjectId   |                                                                                                                                                                                                                                                                                                                                                                                    6
  ProjectName | First Sample
  CreatedAt   | 2017-01-11 10:55:52 +0000 UTC
  UpdatedAt   | 2017-01-11 10:55:52 +0000 UTC

List

The List subcommand returns all asset that are stored for a given project.

$ slyft asset list --project "First Sample"

  NUMBER |             NAME              | PROJECT NAME |  ORIGIN
+--------+-------------------------------+--------------+----------+
       1 | blinkr-schema.json            | slyft-tut-1  | user
       2 | c99-arduino-coap-msgpack.json | slyft-tut-1  | user
       3 | api.raml                      | slyft-tut-1  | user
       4 | all.tar                       | slyft-tut-1  | slyftlet
       5 | c99-generic-msgpack.json      | slyft-tut-1  | user

Get

Using the get subcommand, you can download any file that has been uploaded or that has been generated by the slyft backend.

$ slyft asset get --help

Usage: slyft asset get --project --file

Download a single asset

Options:
  --project, -p=""   Name (or part of it) of a project
  --file, -f=""      name of the asset to be downloaded

I.e.

$ slyft a get --project 'FirstSample' --file 'all.tar'
Downloaded all.tar

Delete

You can delete any asset that has been uploaded or created.This command is interactive. If there are more than one asset, the command asks for the asset number to be deleted.

$ slyft asset delete --project "First Sample"

---- Asset Details ----
      KEY     |                                                                                                                                                                                        VALUE
+-------------+---------------------
 Name        | first_coap_api.raml
  ProjectId   |                                                                                                                                                                                                                                                                                                                                                                                    6
  ProjectName | First Sample
  CreatedAt   | 2017-01-11 10:55:52 +0000 UTC
  UpdatedAt   | 2017-01-11 10:55:52 +0000 UTC
  Url         | https://slyftassets.s3-eu-west-1.amazonaws

Are you sure? [no]: <ENTER Y or N>