Skip to content

Latest commit

 

History

History
184 lines (153 loc) · 6.48 KB

File metadata and controls

184 lines (153 loc) · 6.48 KB
sidebar_position 4

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.)

:::note 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/v1/blueprints/{blueprint_identifier}/start

Parameter Description/Comments
blueprint_identifier The name or id of the blueprint (string). Can be retrieved via blueprints.

HTTP method

POST

Request

Headers

Example header format for the blueprint start method:

Authorization: Basic <authorization token returned from the login method>

Content-Type: application/json

Request body

The scheduling and input parameters of the sandbox in JSON format. The elements of the blueprint start method include:

Parameter Description/Comments
name The name of the sandbox. (string)
If you do not specify a name, you will get the following error message: "Reservation name and duration must be specified in request body".
duration The duration for this sandbox. Time must be specified in ISO 8601 format (for example PT23H). (string)
If you do not specify the duration, you will get the following error message: "Duration format must be a valid 'ISO 8601' (e.g 'PT23H' or 'PT4H2M')".
start_time Optional parameter, if not provided the sandbox will start immediately. Must conform to ISO 8601 standard, which means that a timezone offset is passed with the value. For UTC: 2039-09-07T15:50+00Z. For UTC+2: 2039-09-26T07:58:30.996+0200".
params Any published input parameters defined for the blueprint and its abstract resources. Input parameters that have no default must be included in the request. Abstract resource input parameters must be associated to global inputs (specify the global inputs in the request). (Array)
If you do not specify the input parameters, you will get the following error message: "Blueprint has invalid inputs".
permitted_users Users permitted to use the sandbox. Permitted users must have access to the logged-in domain.
Request example
{
   "name":"testbp-sndbx",
   "duration":"PT2H5M",
   "params":[
      {
         "name":"global1",
         "value":"value1"
      },
      {
         "name":"abstract resource 1.attribute4",
         "value":"some value"
      },
      {
         "name":"abstract resource 1/sub resource.attribute4",
         "value":"some value"
      }
   ],
   "permitted_users":[
      "john.s",
      "emily.b",
      "lucas.w"
   ]
}

Response

Response example

The blueprint start method returns details about the new sandbox. The output includes details about the sandbox ID and the actions that can be performed on the sandbox:

{
   "name":"Test Blprnt2",
   "id":"994bd534-740a-45f5-851f-ff452f2a17a2",
   "state":"Ready",
   "type":"Sandbox",
   "components":[
      {
         "name":"MySwitch",
         "type":"Resource",
         "component_type":"Generic Switch Model",
         "description":"",
         "attributes":[
            {
               "type":"string",
               "name":"vendor",
               "value":""
            }
         ],
         "connection_interfaces":[
            {
               "name":"Telnet",
               "url":""
            }
         ],
      }
   ],
   "apps":[
      {
         "name":"MyApp",
         "type":"Application",
         "description":""
      }
   ],
   "_links":{
      "self":{
         "href":"/sandboxes/994bd534-740a-45f5-851f-ff452f2a17a2",
         "method":"GET",
         "name":"get a sandbox' details",
         "templated":true
      },
      "stop":{
         "href":"/sandboxes/994bd534-740a-45f5-851f-ff452f2a17a2/stop",
         "method":"POST",
         "name":"stop a sandbox",
         "templated":true
      },
      "all":{
         "href":"/sandboxes",
         "method":"GET",
         "name":"get all sandboxes"
      }
   }
}
Response summary

The response output properties of the blueprint start method are described in the following table.

Property Sub Property Description/Comments
name   The name of the sandbox. (string)
id   The ID of the sandbox. (string)
state   The current state of the sandbox. Possible values: Pending, Setup, Ready, Teardown, Error, Ended. (string)
type   The sandbox type ("Sandbox"). (string)
components   The resource model of the sandbox. (array)
  name The name of the component. (string)
  type The component ("resource", "application", or "service"). (string)
  component_type The resource model. (string)
  description A short description of the resource.
  attributes The attributes of the resource model. (array)
  type The attribute type. (string)
  name The attribute name. (string)
  value The attribute value. (string)
  connection_interfaces The connection interfaces of the resource. (array)
  name The name of the connection interface. (string)
  url The URL of the connection interface of the resource. (string)
apps   The Apps of the sandbox. (string)
  type The App type ("Application"). (string)
  name The name of the App (for example, App1). (string)
  description A short description of the App. (string)
_links   The actions that can be performed on the sandbox in the user's domain:
  self Provides a link to get the details for the sandbox via a GET request.
  stop Provides a link to get stop the sandbox via a POST request.
  all Provides a link to get all available sandboxes according to the user's domain via a GET request.