Skip to main content

Check out Interactive Visual Stories to gain hands-on experience with the SSE product features. Click here.

Skyhigh Security

Working with files uploaded for troubleshooting

You can use the REST interface to work with files that have been uploaded to an appliance for troubleshooting. On the standard Web Gateway interface, you can perform this upload using the Troubleshooting top-level menu.

When working with uploaded files on the REST interface, you identify an appliance and append the files parameter.
With files uploaded for troubleshooting, you can:

  • Retrieve a list of uploaded files
  • Download an uploaded file
  • Add a file to the uploaded files
  • Modify an uploaded file
  • Delete an uploaded file
Retrieving a list of uploaded files

Request formats
<URL>/appliances/<UUID>/files
<URL>/appliances/<UUID>/files?page=<int>&pageSize=<int> 

You can retrieve a list of uploaded files on an appliance in a cluster that includes the appliance where you are currently working.

You can request a particular page of the feed that contains the list and specify the page size.

Sample commands

Retrieve a list of uploaded files from an appliance:

curl -i -b cookies.txt -X GET "$REST/appliances/081EEDBC-7978-4611-9B96-CB388EEFC4BC
/files"

Request a particular page of the feed with the list and specify the page size:

curl -i -b cookies.txt -X GET "$REST/appliances/081EEDBC-7978-4611-9B96-CB388EEFC4BC
/files?page=4&pageSize=1"

Variable request parameters

Parameter Type Description
UUID String Universally unique identifier for an appliance
Default: None
page Integer Number of a page in a feed with uploaded files
Default: 1
pageSize Integer Size of a page in a feed
Default: –1
Downloading an uploaded file

Request format
<URL>/appliances/<UUID>/files/<filename>

You can download an uploaded file from an appliance in a cluster that includes the appliance where you are currently working.

When downloading an uploaded file, you specify an Accept header. Using the -O parameter, you can store the downloaded data in a local file under its name on the appliance where you downloaded it from.

Sample command

Download an uploaded file from an appliance:

curl -b cookies.txt -H "Accept: application/x-download" -X GET "$REST/appliances
/081EEDBC-7978-4611-9B96-CB388EEFC4BC/files/troubleshooting.zip" -O

Variable request parameters

Parameter Type Description
UUID String Universally unique identifier for an appliance
Default: None
filename String Name of an uploaded file
Default: None
Adding a file to the uploaded files

Request format
<URL>/appliances/<UUID>/files/<filename>

You can add a file to the uploaded files on an appliance in a cluster that includes the appliance where you are currently working.

When adding a file, you provide its name and append the file in binary format as the request body.

You must also specify a Content-Type header. Do not specify application/x-www-form-urlencoded, as the curl tool already appends this type.

Sample command

Add a file to the uploaded files on an appliance:

curl -i -b cookies.txt -H "Content-Type: */*" -X POST "$REST/appliances
/081EEDBC-7978-4611-9B96-CB388EEFC4BC/files/moreTroubleshooting.zip"
--data-binary @moreTroubleshooting.zip  

Variable request parameters

Parameter Type Description
UUID String Universally unique identifier for an appliance
Default: None
filename String Name of a file that is added to the uploaded files on an appliance
Default: None
Modifying an uploaded file

Request format
<URL>/appliances/<UUID>/files/<filename>

You can modify an uploaded file on an appliance in a cluster that includes the appliance where you are currently working.

When modifying an uploaded file, you provide its name and append the file it in binary format with the data required for the modification as the request body.

You must also specify a Content-Type header. Do not specify application/x-www-form-urlencoded, as the curl tool already appends this type.

Sample command

Modify an uploaded file on an appliance:

curl -i -b cookies.txt -H "Content-Type: */*" -X PUT "$REST/appliances
/081EEDBC-7978-4611-9B96-CB388EEFC4BC/files/moreTroubleshooting.zip"
--data-binary @modificationData.zip

Variable request parameters

Parameter Type Description
UUID String Universally unique identifier for an appliance
Default: None
filename String Name of a file that is modified
Default: None
Deleting an uploaded file

Request format
<URL>/appliances/<UUID>/files/<filename>

You can delete an uploaded file on an appliance in a cluster that includes the appliance where you are currently working.

When deleting an uploaded file, you provide its name. 

Sample command

Delete an uploaded file on an appliance:

curl -i -b cookies.txt -X DELETE "$REST/appliances/081EEDBC-7978-4611-9B96-CB388EEFC4BC
/files/troubleshooting.zip"

 Variable request parameters

Parameter Type Description
UUID String Universally unique identifier for an appliance
Default: None
filename String Name of a file that is deleted
Default: None
Sample script for working with uploaded files

The following bash script modifies an uploaded file on an appliance.
Before performing this operation, the script sets a URL variable for accessing the REST interface. 

#!/bin/bash
## Set URL variable for accessing REST interface
REST=http://localhost:4711/Konfigurator/REST
## Log on and authenticate
curl -i -c cookies.txt -X POST "$REST/login?userName=myUserName&pass=myPassword"
## Modify uploaded file
curl -i -b cookies.txt -H "Content-Type:*/*" -X PUT "$REST/appliances
/081EEDBC-7978-4611-9B96-CB388EEFC4BC/files/moreTroubleshooting.zip"
--data-binary @modificationData.zip
## Log off
curl -b cookies.txt -X POST "$REST/logout"
  • Was this article helpful?