POST /v1/spaces/:space_id/ssh/actions
HTTP Verb: POST
Available statuses: 201 Created, 404 Not Found, 422 Unprocessable Entity
Object: SSHAction
Location: available
Formats: XML, JSON
Create a SSH action object, returns the newly created SSH action body and its location
Params
To create a SSH action, a data body must be provided. Data can be provided in three formats: XML, JSON and query string. To specify data type of XML or JSON add the Content-type: application/(json|xml) header to request headers, if you want to provide query string simply skip the Content-type header.
All params should be sent in the ssh_action namespace, e.g.:
XML
<ssh_action>
<name>name</name>
...
</ssh_action>
JSON
{"ssh_action":{"name":"name",...}}
Query string
ssh_action[name]=name&...
Check the full list of available params on SSH Action object fields reference
Examples
Request XML, using cURL utility:
curl -i -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"ssh_action":{"name":"name", "username":"user", "command":"command", "ssh_tool_server_id":1}}' https://api.assembla.com/v1/spaces/[space_id]/ssh/actions.xml
Response:
HTTP/1.1 201 Created
Date: Tue, 21 May 2013 16:01:14 GMT
Server: Apache
Location: https://titas293583.m-stage.assembla.cc/v1/spaces/titas-bobo-fork/ssh/actions/1
Status: 201
Vary: Accept-Encoding
Content-Length: 489
Content-Type: application/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<ssh-tool-action>
<id type="integer">1</id>
<command>command</command>
<description nil="true"></description>
<frequency type="integer">0</frequency>
<name>name</name>
<repo-tool-id nil="true"></repo-tool-id>
<username>user</username>
<status type="integer">0</status>
<space-tool-id>cUIsBcWu0r4P_ceJe9agRk</space-tool-id>
<position nil="true"></position>
<ssh-tool-server-id type="integer">1</ssh-tool-server-id>
</ssh-tool-action>
Request JSON, using cURL utility:
curl -i -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"ssh_action":{"name":"name", "username":"user", "command":"command", "ssh_tool_server_id":1}}' https://api.assembla.com/v1/spaces/[space_id]/ssh/actions.json
Response:
HTTP/1.1 201 Created
Date: Tue, 21 May 2013 16:05:05 GMT
Server: Apache
Location: https://titas293583.m-stage.assembla.cc/v1/spaces/titas-bobo-fork/ssh/actions/1
Status: 201
Content-Length: 207
Content-Type: application/json; charset=utf-8
{
"id":1,
"command":"command",
"description":null,
"frequency":0,
"name":"name",
"repo_tool_id":null,
"username":"user",
"status":0,
"space_tool_id":"cUIsBcWu0r4P_ceJe9agRk",
"position":null,
"ssh_tool_server_id":1
}
JSON is formatted here for readability, in a real response JSON body is inline with no indentation.
Note: pay attention to Location header, this is the URL where newly created resource is located, you can GET on this URL to access this resource.
Description for each field: SSH Action object fields reference