Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

On This Page

Table of Contents

...

Templates

List Templates

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

Code Block
titlecommand
skysync-cli templates list

Example results

example
Code Block
titleexample results
ID                               Name                                      Kind     Enabled
382d78ab17784b6bb14844ba1ea819bc Example template 1						   transfer true
8c92e69280b74d1aa8c66e6c992ac475 Example template 2						   transfer true
Code Block
title

Example results (JSON)

Code Block
[
  {
    "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

title
Code Block
command
skysync-cli templates list --kind transfer

...

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

command
Code Block
title
skysync-cli templates list --active

...

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
Code Block
title
skysync-cli templates list --search test

Command

command
Code Block
title
skysync-cli templates list -q "test"

...

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

title
Code Block
command
skysync-cli templates list --offset=5

...

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

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
Code Block
skysync-cli templates show {{id}}
Code Block
title

Command with example values

Code Block
skysync-cli templates show 382d78ab17784b6bb14844ba1ea819bc

Example results

example resultsexample
Code Block
title
ID      382d78ab17784b6bb14844ba1ea819bc
Name    Example template 1
Kind    transfer
Enabled true
Code Block
title

Example results (JSON)

Code Block
[
  {
    "id": "382d78ab17784b6bb14844ba1ea819bc",
    "name": "Example template 1",
    "kind": "transfer",
    "disabled": false,
    "schedule": {
      "mode": "manual"
    },
    "transfer": {
      "source": {
        "options": null,
        "connection": {
          "id": "df48c59e4bb54a66bccf2270b316bd71",
          "name": "Box Connection",
          "platform": {
            "id": "box",
            "type": "platform"
          },
          "disabled": true,
          "type": "connection"
        },
        "target": {
          "item": {
            "parent": {
              "root": true,
              "name": "Libraries"
            },
            "name": "Documents"
          }
        }
      },
      "destination": {
        "options": null,
        "connection": {
          "id": "df48c59e4bb54a66bccf2270b316bd71",
          "name": "Box Connection",
          "platform": {
            "id": "box",
            "type": "platform"
          },
          "disabled": true,
          "type": "connection"
        },
        "target": {
          "item": {
            "root": true,
            "name": "transfer_destination"
          }
        }
      },
      "transfer_type": "copy",
      "audit_level": "trace",
      "type": "transfer"
    }
  }
]

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 resultsexpected
Code Block
title
ID
Name
Kind
Enabled true
Code Block
title

Expected results (JSON)

Code Block
null

Create a Job Template

This command will create a template.

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



Panel
bgColor#FFFACD

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

Panel
bgColor#FFFACD

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   The authentication parameters are provided within the configuration file.  See the authentication section for more information.  

command
Panel
bgColor#FFFACD

This feature is not supported from a standard terminal such as a command line; however, piping may be utilized to pass in the json option block via Node or PowerShell. See example below.

Code Block
title


Command with variables (PowerShell)

sample
Code Block
'{"source": {"connection": {"id": "{{sourceConnectionId"}, "target": {"path": "{{sourcePath}}"}}, "destination": {"connection": {"id": "{{destinationConnectionId"}, "target": {"path": "{{destinationPath}}"}}}' | skysync-cli templates add --manual --in --name="Example Template"
Code Block
title

Sample expected results

Code Block
ID      8b9ea3d812e24d7892d88d63acb40402
Name    :  to
Kind    transfer
Enabled true

...

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   The authentication parameters are provided within the configuration file.  See the authentication section for more information.  

Command

commandcontents
Code Block
title
skysync-cli templates add --name="Example Template" --manual --options-file=templateOptions.JSON
Code Block
title

Contents of templateOptions.json with variables

contents
Code Block
{
	"source": 
	{
		"connection": 
		{
			"id": "{{sourceConnectionId}}"
		}, 
		"target": 
		{
			"path": "{{sourcePath}}"
		}
	},
	"destination": 
	{
		"connection": 
		{
			"id": "{{destinationConnectionId}}"
		}, 
		"target": 
		{
			"path": "{{destinationPath}}"
		}
	}
}
Code Block
title

Contents of templateOptions.json with sample values

sample
Code Block
{
	"source": 
	{
		"connection": 
		{
			"id": "490d8c2eba054392bde988a548d88354"
		}, 
		"target": 
		{
			"path": "/source"
		}
	},
	"destination": 
	{
		"connection": 
		{
			"id": "fbc78a0fa9074d20b778e6e6fc1bd898"
		}, 
		"target": 
		{
			"path": "/destination"
		}
	}
}
Code Block
title

Sample expected results

Code Block
ID      8b9ea3d812e24d7892d88d63acb40402
Name    Example Tempalte
Kind    transfer
Enabled true

...

This command will delete the specified job template

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
Code Block
skysync-cli templates delete {{id}}
Code Block
title

Command with example values

Code Block
skysync-cli templates delete 5dc531df34554edd96c31272262ad950
Expected results
expected results
Code Block
title
The template was deleted successfully.

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

expected results
Code Block
title
The template could not be deleted.

Panel

(info) The response is only available in the default format.  If JSON output is specified, no output will be provided.