Cloud Management API 1.5
RightScripts
A RightScript is an executable piece of code that can be run on a server during the boot, operational, or decommission phases.
All revisions of a RightScript belong to a RightScript lineage that is exposed by the "lineage" attribute (NOTE: This attribute is merely a string to locate all revisions of a RightScript and NOT a working URL).
Actions
index
Lists RightScripts.
- URLs
- GET /api/right_scripts
- HTTP response code
- 200 OK
- Content-type
- application/vnd.rightscale.right_script;type=collection
Required roles
- observer
Parameters
name | required | type | values | regexp | blank? | description |
---|---|---|---|---|---|---|
filter | no | Array | * | * | no | See below for valid filter parameters. |
latest_only | no | String | true, false | * | no | Whether or not to return only the latest version for each lineage. |
view | no | String | default | * | no | Specifies how many attributes and/or expanded nested relationships to include. |
Filters
name | partial_match? | description |
---|---|---|
lineage | no | Lineage of the RightScript to filter on (this attribute is simply a string and not a working URL). |
name | yes | Name of the RightScript to filter on. |
Example Responses
Click on a format below to see an example response:
JSON XML[{
"id": "2",
"revision": 0,
"created_at": "2023/10/09 11:06:02 +0000",
"updated_at": "2023/10/09 11:06:02 +0000",
"links": [
{"rel":"self","href":"/api/right_scripts/2"},
{"rel":"source","href":"/api/right_scripts/2/source"}
],
"name": "NAME_2608224321",
"description": "DESCRIPTION_2723417177",
"lineage": "https://testscale_1/api/acct/560182816/right_scripts/2"
},{
"id": "4",
"revision": 0,
"created_at": "2023/10/09 11:06:03 +0000",
"updated_at": "2023/10/09 11:06:03 +0000",
"links": [
{"rel":"self","href":"/api/right_scripts/4"},
{"rel":"source","href":"/api/right_scripts/4/source"}
],
"name": "NAME_3674629575",
"description": "DESCRIPTION_2192471048",
"lineage": "https://testscale_1/api/acct/560182816/right_scripts/4"
}]
<?xml version="1.0" encoding="UTF-8"?>
<right_scripts>
<right_script>
<id>2</id>
<revision>0</revision>
<created_at>2023/10/09 11:06:02 +0000</created_at>
<updated_at>2023/10/09 11:06:02 +0000</updated_at>
<links>
<link rel="self" href="/api/right_scripts/2"/>
<link rel="source" href="/api/right_scripts/2/source"/>
</links>
<name>NAME_2608224321</name>
<description>DESCRIPTION_2723417177</description>
<lineage>https://testscale_1/api/acct/560182816/right_scripts/2</lineage>
</right_script>
<right_script>
<id>4</id>
<revision>0</revision>
<created_at>2023/10/09 11:06:03 +0000</created_at>
<updated_at>2023/10/09 11:06:03 +0000</updated_at>
<links>
<link rel="self" href="/api/right_scripts/4"/>
<link rel="source" href="/api/right_scripts/4/source"/>
</links>
<name>NAME_3674629575</name>
<description>DESCRIPTION_2192471048</description>
<lineage>https://testscale_1/api/acct/560182816/right_scripts/4</lineage>
</right_script>
</right_scripts>
show
Displays information about a single RightScript.
- URLs
- GET /api/right_scripts/:id
- HTTP response code
- 200 OK
- Content-type
- application/vnd.rightscale.right_script
Required roles
- observer
Parameters
name | required | type | values | regexp | blank? | description |
---|---|---|---|---|---|---|
view | no | String | default, inputs_2_0 | * | no | Specifies how many attributes and/or expanded nested relationships to include. |
Example Responses
Click on a format below to see an example response for the 'default' view:
JSON XML{
"id": "2",
"revision": 0,
"created_at": "2023/10/09 11:06:02 +0000",
"updated_at": "2023/10/09 11:06:02 +0000",
"links": [
{"rel":"self","href":"/api/right_scripts/2"},
{"rel":"source","href":"/api/right_scripts/2/source"}
],
"name": "NAME_2608224321",
"description": "DESCRIPTION_2723417177",
"lineage": "https://testscale_1/api/acct/560182816/right_scripts/2"
}
<?xml version="1.0" encoding="UTF-8"?>
<right_script>
<id>2</id>
<revision>0</revision>
<created_at>2023/10/09 11:06:02 +0000</created_at>
<updated_at>2023/10/09 11:06:02 +0000</updated_at>
<links>
<link rel="self" href="/api/right_scripts/2"/>
<link rel="source" href="/api/right_scripts/2/source"/>
</links>
<name>NAME_2608224321</name>
<description>DESCRIPTION_2723417177</description>
<lineage>https://testscale_1/api/acct/560182816/right_scripts/2</lineage>
</right_script>
Click on a format below to see an example response for the 'inputs_2_0' view:
JSON XML{
"id": "2",
"revision": 0,
"created_at": "2023/10/09 11:06:02 +0000",
"updated_at": "2023/10/09 11:06:02 +0000",
"links": [
{"rel":"self","href":"/api/right_scripts/2"},
{"rel":"source","href":"/api/right_scripts/2/source"}
],
"inputs": [
{"name":"FOO","category_name":"Uncategorized","description":"DESCRIPTION_4101486239","required":false,"advanced":false,"kind":"string","default_value":"text:foo_value","possible_values":[]}
],
"name": "NAME_2608224321",
"description": "DESCRIPTION_2723417177",
"lineage": "https://testscale_1/api/acct/560182816/right_scripts/2"
}
<?xml version="1.0" encoding="UTF-8"?>
<right_script>
<id>2</id>
<revision>0</revision>
<created_at>2023/10/09 11:06:02 +0000</created_at>
<updated_at>2023/10/09 11:06:02 +0000</updated_at>
<links>
<link rel="self" href="/api/right_scripts/2"/>
<link rel="source" href="/api/right_scripts/2/source"/>
</links>
<inputs>
<input>
<name>FOO</name>
<category_name>Uncategorized</category_name>
<description>DESCRIPTION_4101486239</description>
<required>false</required>
<advanced>false</advanced>
<kind>string</kind>
<default_value>text:foo_value</default_value>
<possible_values/>
</input>
</inputs>
<name>NAME_2608224321</name>
<description>DESCRIPTION_2723417177</description>
<lineage>https://testscale_1/api/acct/560182816/right_scripts/2</lineage>
</right_script>
create
- URLs
- POST /api/right_scripts
- HTTP response code
- 201 Created
Required roles
- designer
Parameters
name | required | type | values | regexp | blank? | description |
---|---|---|---|---|---|---|
right_script | yes | Hash | * | * | no | |
right_script[description] | no | String | * | * | no | The description of the RightScript to be created. |
right_script[name] | yes | String | * | * | no | The name of the RightScript to be created. |
right_script[packages] | no | String | * | * | no | Space-separated list of package names needed in order to successfully run the script. |
right_script[source] | yes | String | * | * | no | The script source to be created. |
update
Updates RightScript name/description
- URLs
- PUT /api/right_scripts/:id
- HTTP response code
- 204 No Content
Required roles
- designer
Parameters
name | required | type | values | regexp | blank? | description |
---|---|---|---|---|---|---|
right_script | yes | Hash | * | * | no | |
right_script[description] | no | String | * | * | no | The new description for the RightScript |
right_script[name] | no | String | * | * | no | The new name for the RightScript |
right_script[packages] | no | String | * | * | no | The new list of packages for the RightScript |
right_script[source] | no | String | * | * | no | The script source to be updated. |
destroy
- URLs
- DELETE /api/right_scripts/:id
- HTTP response code
- 204 No Content
Required roles
- designer
commit
Commits the given RightScript. Only HEAD revisions (revision 0) can be committed.
- URLs
- POST /api/right_scripts/:id/commit
- HTTP response code
- 201 Created
- Location
- Location of the committed RightScript.
Required roles
- designer
Parameters
name | required | type | values | regexp | blank? | description |
---|---|---|---|---|---|---|
right_script | yes | Hash | * | * | no | |
right_script[commit_message] | yes | String | * | * | no | The message to be included with the requested commit |
show_source
Returns the script source for a RightScript
- URLs
- GET /api/right_scripts/:id/source
- HTTP response code
- 200 OK
Required roles
- observer
update_source
Updates the source of the given RightScript
- URLs
- PUT /api/right_scripts/:id/source
- HTTP response code
- 204 No Content
Required roles
- designer