Public GPU Servers API Reference

1. Authentication

Endpoint

https://api.leaderssl.com/api/v1/users/signin

Parameters

Method

POST

Return

Success

HTTP code 200, return value is an JSON-encoded object

   {"id": 12345, "auth_token": "kZoG4GMyPzsl_Ei_nZFSqA"}

id - the user's ID, integer

auth_token - Authentication token

Error

Authentication failure

HTTP code 401, return value is an JSON-encoded object

   {"error":"error description"}

Examples

curl -i -H "Accept: application/json" -X POST --data 'login=nosuchuser@example.org&password=j3Sk8nZwp29XpR' 'https://api.leaderssl.com/api/v1/users/signin'

HTTP/1.1 401 Unauthorized
{"error":"Invalid login or password"}


curl -i -H "Accept: application/json" -X POST --data 'login=johndoe@test.com&password=somepassword' 'https://api.leaderssl.com/api/v1/users/signin'

HTTP/1.1 200 OK
{"id":1703,"auth_token":"BUYVWzx7df60ukU9px2-Dg"}

2. Products list and prices

Endpoint

https://api.leaderssl.com/api/v1/users/{user_id}/servers/products

Parameters

Method

GET

Return

Success

HTTP code 200, JSON-encoded array of available for order GPU servers

[
    {
        "code": "GPU:Nvidia:GTX1080:2:Minute",
        "currency": "EUR",
        "free_time": "2017-05-22T21:05:32+03:00",
        "id": 534,
        "name": "2 x GeForce GTX 1080 (per-minute billing)",
        "period_count": 1,
        "period_type": "minute",
        "price": "0.02"
    },
    {
        "code": "GPU:Nvidia:GTX1080:2:Week",
        "currency": "EUR",
        "free_time": "2017-05-22T21:05:32+03:00",
        "id": 543,
        "name": "2 x GeForce GTX 1080 (weekly)",
        "period_count": 1,
        "period_type": "week",
        "price": "91.11"
    },
    {
        "code": "GPU:Nvidia:GTX1080:4:Minute",
        "currency": "EUR",
        "free_time": null,
        "id": 535,
        "name": "4 x GeForce GTX 1080 (per-minute billing)",
        "period_count": 1,
        "period_type": "minute",
        "price": "0.03"
    },

   ...
  ]

Error

http status 401

  {"error":"error description"}

3. Order server

Endpoint

https://api.leaderssl.com/api/v1/servers/order

Parameters

Method

POST

Return

Success

HTTP code 200, JSON object with order ID and proforma invoice token.

  {"order_id":1234,"bill":"aa6e2b2b7eb61ab6af081cc007fd80c87ff49fcb",
  "url":"https://order.leadertelecom.biz/payments/aa6e2b2b7eb61ab6af081cc007fd80c87ff49fcb"}

order_id:integer Order ID
bill:string Proforma invoice token
* url:string URL to pay the order online or download proforma invoice

Error

http status 401

  {"error":["error description", "Another error description"]}

4. Ordered servers

Endpoint

https://api.leaderssl.com/api/v1/users/{user_id}/servers

Parameters

Method

GET

Return

Success

HTTP code 200, JSON-encoded array of ordered GPU servers

[
  {
    "id":228,
    "ip":"217.150.90.19",
    "name":"LTBV19",
    "config":"4 x GeForce GTX 1080TI (per-minute billing)",
    "start_at":"2017-05-28T22:24:34+03:00",
    "end_at":"2017-05-31T11:56:30+03:00",
    "valid_to":"2017-05-28T22:49:58+03:00",
    "status":"busy",
    "username":"root",
    "os_type":"centos",
    "token":"37e67a831cc95792a8a18dac90741053a4a9187b",
    "resume_available":false,
    "suspend_available":false,
    "uptime":221460
  },
  {
    "id":271,
    "ip":"Queued",
    "name":"Queued",
    "config":"2 x GeForce GTX 1080 (per-minute billing)",
    "start_at":null,
    "end_at":null,
    "valid_to":null,
    "status":"queued",
    "username":"root",
    "os_type":"centos",
    "token":"67b0a7586aa37604d42b16aeefc4daba7c62a057",
    "resume_available":false,
    "suspend_available":false,
    "uptime":0
  },
  {
    "id":14,
    "ip":"Queued",
    "name":"Queued",
    "config":"8 x GeForce GTX 1080 (per-minute billing)",
    "start_at":null,
    "end_at":null,
    "valid_to":null,
    "status":"available",
    "username":"Administrator",
    "os_type":"windows",
    "token":"1281a08eb13106647ac2de1d2cd5321a09cc904c",
    "resume_available":false,
    "suspend_available":false,
    "uptime":0
  }
  ]

Error

http status 401

  {"error":"error description"}

5. Start server

Endpoint

https://api.leaderssl.com/api/v1/users/{user_id}/servers/{id}/start

Parameters

Start server call available only if server's status id "available"

Method

POST

Return

Success

HTTP code 200, JSON-encoded object

  {"success":true}

Error

  {"success":"false"}

6. Stop server

Endpoint

https://api.leaderssl.com/api/v1/users/{user_id}/servers/{id}/stop

Parameters

Stop server call available only if server's status id "up"

Method

POST

Return

Success

HTTP code 200, JSON-encoded object

  {"success":true}

Error

  {"success":"false"}

7. Suspend server

Endpoint

https://api.leaderssl.com/api/v1/users/{user_id}/servers/{id}/suspend

Parameters

Stop server call available only if server's status id "up" and "suspend_available" is true.

Method

POST

Return

Success

HTTP code 200, JSON-encoded object

  {"success":true}

Error

  {"success":"false"}

8. Resume server

Endpoint

https://api.leaderssl.com/api/v1/users/{user_id}/servers/{id}/resume

Parameters

Stop server call available only if server's status id "available" and "resume_available" is true.

Method

POST

Return

Success

HTTP code 200, JSON-encoded object

  {"success":true}

Error

  {"success":"false"}