Scripts

Contents

Scripts

They allow the user to manage the scripts they want to run on the servers.

List Scripts

GET /v3/blueprint/scripts

It lists all available scripts.

Inputs

None

Returns

An array of scripts with the following format:

Field Type Description
id String Identifier of the script.
name String Name of the script.
description String Description of the script's purpose.
code String Code of the script.
parameters Array of strings The names of the parameters the script accepts.
label_ids Array of strings List of ids corresponding to the labels the script has assigned.
resource_type String An identifier for the type of resource, specifically "script".

Back to top

Show Script

GET /v3/blueprint/scripts/:id

It shows information about a specific script.

Inputs

None

Returns

Field Type Description
id String Identifier of the script.
name String Name of the script.
description String Description of the script's purpose.
code String Code of the script.
parameters Array of strings The names of the parameters the script accepts.
label_ids Array of strings List of ids corresponding to the labels the script has assigned.
resource_type String An identifier for the type of resource, specifically "script".

Back to top

Create Script

POST /v3/blueprint/scripts

It creates a new script to be used in the templates.

Inputs

Field Type Description Required
name String Name of the script. Yes
description String Description of the script's purpose. No
code String Code of the script. No
parameters Array of strings The names of the parameters that the script accepts. No
label_ids Array of strings List of ids corresponding to the labels to assign to the script. No

Returns

Field Type Description
id String Identifier of the script.
name String Name of the script.
description String Description of the script's purpose.
code String Code of the script.
parameters Array of strings The names of the parameters the script accepts.
label_ids Array of strings List of ids corresponding to the labels the script has assigned.
resource_type String An identifier for the type of resource, specifically "script".

Back to top

Update Script

PUT /v3/blueprint/scripts/:id

It updates an existing script.

Inputs

Field Type Description Required
name String Name of the script. No
description String Description of the script's purpose. No
code String Code of the script. No
parameters Array of strings The names of the parameters the script accepts. No

Returns

Field Type Description
id String Identifier of the script.
name String Name of the script.
description String Description of the script's purpose.
code String Code of the script.
parameters Array of strings The names of the parameters that the script accepts.
label_ids Array of strings List of ids corresponding to the labels the script has assigned.
resource_type String An identifier for the type of resource, specifically "script".

Back to top

Destroy Script

DELETE /v3/blueprint/scripts/:id

It deletes a script.

Inputs

None

Returns

None

Back to top

List Attachments of a Script

GET /v3/blueprint/scripts/:script_id/attachments

List the attachments a script has

Inputs

None

Returns

An array of attachments, ordered from most to less recent, with the following fields:

Field Type Description
id String Identifier of the attachment
name String Name of the attachment.
is_mock Boolean Indicates whether the attachment is mock or not.

Back to top

Add Attachment to a Script

POST /v3/blueprint/scripts/:script_id/attachments

Adds an attachment to a script.

Inputs

Field Type Description Required
name String Name of the script. Yes
is_mock String Description of the script's purpose. Yes

Returns

Field Type Description
id String Identifier of the attachment
name String Name of the attachment.
is_mock Boolean Indicates whether the attachment is mock or not.
upload_url String URL where the user must upload the attachment contents using a POST request

Back to top