Servers

Add #

Parameters


string name required


Example: data-recovery-linux


string ssh_host required


Example: 134.122.124.252


string ssh_port required


Example: 22


string ssh_user required


Example: root


int ssh_key required

SSH Key ID
Example: 5246747

                            POST
                            /v1/servers
                        
                           
curl https://api.snapshooter.com/v1/servers \
-X POST \
--header 'Authorization: Bearer API_TOKEN_HERE' \
-d name="data-recovery-linux" \
-d ssh_host="134.122.124.252" \
-d ssh_port="22" \
-d ssh_user="root" \
-d ssh_key="5246747"
HTTP/2 200
{
"data": {
"id": 15,
"host": "134.122.124.252",
"user": "root",
"port": 22,
"name": "data-recovery-linux",
"created_at": "2021-04-26T10:38:16.000000Z",
"last_used": null,
"status": "success",
"key": {
"id": 5246747,
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDtLD3o2UrudUORSUdT7I6Lta5M2wmfJJ+TZvTexrVayCXeBYTOb1wgo+OqP7JqSgtyLwon7JlJSzU4s/53CSySrq/4jTSt100GAaDrfIKIYw4s6IY8wLaPdJXcIgMem/mTsow1oUSi65wMoVrJYyhBkGIzDidzsmwLdDrVrueSyRt/srPjusPNvX7JVOeljK6hQnlVprxJLGi/Do52qG+jD+09W1y7O9vTGrbM6WCtGGg8+sdpaUijl+Aag5xnnKQZRXusnQtzMB2Tl8ltNGv3T2555k34OIWSTW5oO0D5sWTkLF/bJgTDIB/W8krZldp5B7iF33z7F4ul2dnJIhfV0RylRshKOLQoLHl1qb0M/j7LyDIUr2Jf33U5+tm8gGa1/qQIxqqGbpVsMSEEjW5e1EbJTDFQDVleovK9UKv8uY3HlngDrDbzBL4abVKRt+5tDKMxIXY9g7qTyRC9FyDBKKaqanxe7ue5doWhkE+K2KvxwXCQUvq87FRjzHkkFQghBdXAbB07AwfKPUCpAhKy2xBP4t1KqHFQHKXmd3q4HKKOVFMX9NvROPro//YRYltDzWHGee0flgW+j8LgBr0hfdtYWf4r1ChlhDMh8XjmcU3ACUNDE4sL1xXV18BKog0kyg0xAgtcETXDKZ2FPKVMGK8HzI8PwxMLHVD8wifBQ== bot@snapshooter.com",
"name": "SnapShooter 2021-04-23 14:36:20",
"created_at": "2021-04-23T14:36:20.000000Z",
"last_used": null
}
}
}

Examples

curl -X POST https://api.snapshooter.com/v1/servers \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data-binary @- <<DATA
{
"name": "Production Server",
"ssh_host": "134.122.124.252",
"ssh_port": "22",
"ssh_user": "root",
"ssh_key": 5246747
}
DATA

Errors


Get Code Script #

URL Parameters


string key_id

SSH Key you want to import on server
Example: 5246742

                            GET
                            /v1/servers/code
                        
                           
curl https://api.snapshooter.com/v1/servers/code \
-X GET \
--header 'Authorization: Bearer API_TOKEN_HERE' \
-d key_id="5246742"
HTTP/2 200
{
"code": "curl -sSL \"snapshooter.com/api/server/add?token=eyJpdiI6IkFJK0lTc0JsdWRkejYzOUU2VTlvaUasdaPSIsInZhbHVlIjoid0pKYnVQMjJkcGlaWHg3dDAvK3dNUT09IiwibWFjIjoiZmZiYjliNzRiMTA2MDk1MmQyZTY4ZDJhNjA4MzMwZjBjZDYxMGZiMTliZTZiNGE1ZjI4N2MxZGZjYzZmMzc0ZCJ9&key=5246742\" | bash"
}

Examples

curl -X POST https://api.snapshooter.com/v1/servers/code \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data-binary @- <<DATA
{
"key_id": 7092
}
DATA

Errors


List #

URL Parameters


string name (optional)

Filter servers by similar name property


string host (optional)

Filter servers by host address


string sort (optional)

Parameter to sort by. Must be one of the following: id, host, name, created_at, last_used_at. Default direction is ascending, to request a descending order you can prefix the parameter value with a dash: sort=-last_used_at.


datetime modified_since (optional)

Filter servers that have only been modified after the given date time.


integer page_size (optional)

Amount of results to display per page. Must be betwen 15 and 100.

                            GET
                            /v1/servers
                        
                           
curl https://api.snapshooter.com/v1/servers \
-X GET \
--header 'Authorization: Bearer API_TOKEN_HERE' \
HTTP/2 200
{
"data": [
{
"id": 15,
"host": "134.122.124.252",
"user": "root",
"port": 22,
"name": "data-recovery-linux",
"created_at": "2021-04-26T10:38:16.000000Z",
"last_used": null,
"status": "success",
"key": {
"id": 5246747,
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDtLD3o2UrudUORSUdT7I6Lta5M2wmfJJ+TZvTexrVayCXeBYTOb1wgo+OqP7JqSgtyLwon7JlJSzU4s/53CSySrq/4jTSt100GAaDrfIKIYw4s6IY8wLaPdJXcIgMem/mTsow1oUSi65wMoVrJYyhBkGIzDidzsmwLdDrVrueSyRt/srPjusPNvX7JVOeljK6hQnlVprxJLGi/Do52qG+jD+09W1y7O9vTGrbM6WCtGGg8+sdpaUijl+Aag5xnnKQZRXusnQtzMB2Tl8ltNGv3T2555k34OIWSTW5oO0D5sWTkLF/bJgTDIB/W8krZldp5B7iF33z7F4ul2dnJIhfV0RylRshKOLQoLHl1qb0M/j7LyDIUr2Jf33U5+tm8gGa1/qQIxqqGbpVsMSEEjW5e1EbJTDFQDVleovK9UKv8uY3HlngDrDbzBL4abVKRt+5tDKMxIXY9g7qTyRC9FyDBKKaqanxe7ue5doWhkE+K2KvxwXCQUvq87FRjzHkkFQghBdXAbB07AwfKPUCpAhKy2xBP4t1KqHFQHKXmd3q43HKKOVFMX9NvROPro//YRYltDzWHGee0flgW+j8LgBr0hfdtYWf4r1ChlhDMh8XjmcU3ACUNDE4sL1xXV18BKog0kyg0xAgtcETXDKZ2FPKVMGK8HzI8PwxMLHVD8wifBQ== bot@snapshooter.com",
"name": "SnapShooter 2021-04-23 14:36:20",
"created_at": "2021-04-23T14:36:20.000000Z",
"last_used": null
}
}
],
"links": "...",
"meta": "..."
}

Was this page helpful?

Thank you for helping us improve!