CloudShell Sandbox API Version 2 Reference Guide

In this article:

login blueprint sandbox execution
login blueprints blueprint start execution id
  blueprint identifier blueprint start persistent execution stop
 

 

sandboxes  
 

 

sandbox identifier  
 

 

sandbox commands  
 

 

sandbox command name  
 

 

sandbox command start  
 

 

sandbox components  
 

 

sandbox component id  
 

 

sandbox component commands  
 

 

component command name  
 

 

component command start  
 

 

sandbox activity  
 

 

sandbox extend  
 

 

sandbox output  
 

 

sandbox stop  

 

 

sandbox owner identifier

 

To use the live documentation pages, log in to the Authentication API page using your user credentials and the name of the appropriate CloudShell domain. Then, access the Sandbox API page to execute its methods on the public blueprints and sandboxes in the domain.

Note: Sandbox API can be configured to run in secure mode. See Configuring Sandbox API to Work in HTTPS Mode.

login

Description

Logs the user in to CloudShell, authenticates the user’s credentials and domain, and returns an authorization token to be used with all subsequent requests. Requests that contain this token return information relevant for the specified domain, per the user's permissions.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/login

HTTP method

PUT

Request

Response

blueprints

Description

Gets a list of all the public blueprints associated with the user's domain. Returns blueprint details related to the user's domain and permissions, such as the blueprint GUID and the actions that can be performed on each blueprint.

Note: In CloudShell Portal, make sure to set the blueprints to "Public" as the API does not work with private blueprints.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/blueprints

HTTP method

GET

Request

Response

blueprint identifier

Description

Gets details and available actions for a particular public blueprint associated with the user's domain.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/blueprints/{blueprint_identifier}

HTTP method

GET

Request

Response

blueprint start

Description

Creates a new sandbox from a specific public blueprint associated with the user's domain. Returns details about the sandbox such as ID and the actions that can be performed on the sandbox. (After the sandbox is created, you can view it in the Sandboxes dashboard in CloudShell Portal.)

Notes:
  • You cannot reserve blueprints if there are conflicts with the reservation timeslot. For additional information see Creating Sandboxes.
  • This method does not support persistent sandboxes. As such, starting a persistent sandbox will deploy a regular sandbox.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/blueprints/{blueprint_identifier}/start

HTTP method

POST

Request

Response

blueprint start persistent

Description

Creates a new persistent sandbox from a specific public persistent blueprint associated with the user's domain. Returns details about the persistent sandbox such as ID and the actions that can be performed on the sandbox. (After the sandbox is created, you can view it in the Sandboxes dashboard in CloudShell Portal.)

Notes:
  • You cannot reserve blueprints if there are conflicts with the reservation timeslot. For additional information see Creating Sandboxes.
  • This method does not support regular sandboxes. As such, attempting to start a regular blueprint will end in error.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/blueprints/{blueprint_identifier}/start-persistent

HTTP method

POST

Request

Response

sandboxes

Description

Gets a list of all the running and pending sandboxes (regular and persistent sandboxes) associated with the user's domain, as well as each sandbox's details, including the sandbox ID and the available actions that can be performed on it. It can also show completed sandboxes related to the user's domain.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/sandboxes

HTTP method

GET

Request

Response

sandbox identifier

Description

Gets details and available actions for a particular sandbox.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/sandboxes/{sandbox_identifier}

HTTP method

GET

Request

Response

sandbox components

Description

Gets details about the components (resources, services, and Apps) of a particular sandbox.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/sandboxes/{sandbox_identifier}/components

HTTP method

GET

Request

Response

sandbox component id

Description

Gets details and available actions for a particular component (resource, service, or App) in a specific sandbox.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/sandboxes/{sandbox_identifier}/components/{component_id}

HTTP method

GET

Request

Response

sandbox component commands

Description

Gets details about all the commands and connected commands provided for a particular component (resource, service, or App) in a specific sandbox.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/sandboxes/{sandbox_identifier}/components/{component_id}/commands

HTTP method

GET

Request

Response

component command name

Description

Gets details about a particular command for a specific component (resource, service, or App) in a sandbox.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/sandboxes/{sandbox_identifier}/components/{component_id}/commands/{command_name}

HTTP method

GET

Request

Response

component command start

Description

Executes a particular command or connected command for a specific component (resource, service, or App) in a sandbox.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/sandboxes/{sandbox_identifier}/components/{component_id}/commands/{command_name}/start

HTTP method

POST

Request

Response

sandbox activity

Description

Gets the content of CloudShell Portal's Activity Feed for a particular sandbox. This displays information about actions performed in the sandbox by the user and automation process.

The maximum number of entries in the response is configured by the administrator. If this number of entries is exceeded, the response will include multiple pages. For more information, see Setting the response page size for the Sandbox API live documentation pages.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/sandboxes/{sandbox_identifier}/activity?tail=100&from_event_id

HTTP method

GET

Request

Response

sandbox output

Description

Gets the content of CloudShell Portal's Output console for a particular ACTIVE sandbox. This displays execution information related to running blueprint and resource commands.

The maximum number of entries in the response is configured by the administrator. If this number of entries is exceeded, the response will include multiple pages. For more information, see Setting the response page size for the Sandbox API live documentation pages.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/sandboxes/{sandbox_identifier}/output

HTTP method

GET

Request

Response

sandbox extend

Description

Extends the duration of a particular sandbox by a specified timeframe.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/sandboxes/{sandbox_identifier}/extend

HTTP method

POST

Request

Response

sandbox stop

Description

Ends a sandbox per specified sandbox ID. Returns a successful response when the sandbox is stopped.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/sandboxes/{sandbox_identifier}/stop

HTTP method

POST

Request

Response

sandbox commands

Description

Gets details for all the blueprint commands in the sandbox.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/sandboxes/{sandbox_identifier}/commands

HTTP method

GET

Request

Response

sandbox command name

Description

Gets details about a particular blueprint command in a specific sandbox.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/sandboxes/{sandbox_identifier}/commands/{command_name}

HTTP method

GET

Request

Response

sandbox command start

Description

Executes a particular command for a specific sandbox.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/sandboxes/{sandbox_identifier}/components/{component_id}/commands/{command_name}/start

HTTP method

POST

Request

Response

execution id

Description

Gets details about a specific execution of a sandbox or component command, per specified execution ID.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/executions/{execution_id}

HTTP method

GET

Request

Response

execution stop

Description

Ends an execution of a component or sandbox command, per specified execution ID. Returns a successful response when the execution is stopped.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/executions/{execution_id}

HTTP method

DELETE

Request

Response


sandbox owner identifier

Description

.

URL

http://{CloudShell Sandbox API Gateway IP address}:{port#}/api/v2/sandboxes/owners/{owner_identifier}

HTTP method

GET

Request

Response

jh