CLI: Templates



On This Page


The CLI references “skysync.” This is expected.

Templates

List Templates

parameter

description

required

default

parameter

description

required

default

kind

Job Template Kind

optional



search, q

Search text

optional



active

Only retrieve active job templates

optional



offset

Search offset

optional

0

limit

Search page size

optional

20

Example 1: List all the job templates

In the following example, the authentication parameters are provided within the configuration file.  See the authentication section for more information.  

Command

skysync-cli templates list

Example results

ID Name Kind Enabled 382d78ab17784b6bb14844ba1ea819bc Example template 1 transfer true 8c92e69280b74d1aa8c66e6c992ac475 Example template 2 transfer true

Example results (JSON)

[ { "id": "382d78ab17784b6bb14844ba1ea819bc", "name": "Example template 1", "kind": "transfer", "disabled": false, "schedule": { "mode": "manual" } }, { "id": "8c92e69280b74d1aa8c66e6c992ac475", "name": "Example template 2", "kind": "transfer", "disabled": false, "schedule": { "mode": "manual" } } ]

 

Example 2: List transfer job templates

In the following example, the authentication parameters are provided within the configuration file.  See the authentication section for more information.  

Command

 

Example 3: List active job templates

In the following example, the authentication parameters are provided within the configuration file.  See the authentication section for more information.  

Command

 

Example 4: List job templates with "test" in their name

In the following example, the authentication parameters are provided within the configuration file.  See the authentication section for more information.  

Command

Command

 

Example 5: List the job templates skipping the first 5

In the following example, the authentication parameters are provided within the configuration file.  See the authentication section for more information.  

Command

 

Show a Job Template

This command will show the details of the specified job template.

parameter

description

required

default

parameter

description

required

default

id

The ID of the job template for which details will be shown

required



 

In the following example, the authentication parameters are provided within the configuration file.  See the authentication section for more information.  The parameters within the two curly braces (including the braces) will need to be replaced with valid values.

Command with variables

Command with example values

Example results

Example results (JSON)

 

If the ID entered does not correspond to an existing job template, for example, if the template was already deleted, the expected output is the following.

Expected results

Expected results (JSON)

 

Create a Job Template

This command will create a template.

parameter

description

required

default

parameter

description

required

default

kind

The job template kind

required

transfer

name

The job template name

optional



auto

Schedule the job as automatic

optional

true

manual

Schedule the job as manual

optional

false

options-input, in

Read JSON options from stdin





options-file, file

The options JSON file





 

If both auto and manual are set to true, the job will be created to run manually.

 

To create a job template that imports permissions or metadata, use the below examples in conjunction with the documentation for the permissions import or the metadata import.

 

Example 1: Creating a job template providing the options from the stdin

This feature is available only with scripting such as within a PowerShell or Node script.  In this example, the the template will be created by providing the JSON contents as a parameter and the schedule will be set to manual.  The authentication parameters are provided within the configuration file.  See the authentication section for more information.  


Command with variables (PowerShell)

Sample expected results

 

Example 2: Creating a job template providing the options from a file

In this example, the the template will be created by providing the location of the JSON options file and the schedule will be set to manual.  The authentication parameters are provided within the configuration file.  See the authentication section for more information.  

Command

Contents of templateOptions.json with variables

Contents of templateOptions.json with sample values

Sample expected results

 

Delete a Job Template

This command will delete the specified job template

parameter

description

required

default

parameter

description

required

default

id

The ID of the template to be deleted

required



 

In the following example, the authentication parameters are provided within the configuration file.  See the authentication section for more information.  The parameters within the two curly braces (including the braces) will need to be replaced with valid values.

Command with variables

Command with example values

Expected results

 

If the ID entered does not correspond to an existing template, for example, if the template was already deleted, the expected output is the following.

Expected results

 



DryvIQ Migrate Version: 5.9
Release Date: October 18, 2024