Hosting Management

Index

Hosting management resources

Webhosting

Databases

Emails

List of all hostings

Available parameters:

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting" -v -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting HTTP/1.1

Accept: application/json

Response 200

{
  "items": [
    {
      "id": 300000,
      "name": "hostingname_1",
      "uuid": "223114ae-7abb-4b9f-8788-0c4795d7257b"
    },
    {
      "id": 400000,
      "name": "hostingname_2",
      "uuid": "d3860eb5-caeb-42d7-a2f4-591f45996fe2"
    }
  ],
  "pager": {
    "page": 1,
    "pagesize": null,
    "items": 2
  }
}

Get a hosting detail

Get hosting by service_id or uuid.

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id-or-uuid" -v -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id-or-uuid HTTP/1.1

Accept: application/json

Response 200

{
  "id": 300000,
  "name": "hostingname_1",
  "uuid": "223114ae-7abb-4b9f-8788-0c4795d7257b"
}

List of all webhosting domains (vhosts)

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/vhost" -v -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/vhost HTTP/1.1

Accept: application/json

Response 200

{
  "items": [
    {
      "id": 114504,
      "domain": "blablabla.com",
      "sub": "ahoj",
      "webOnStorage": "blablabla.com",
      "subOnStorage": "blablabla.com/sub",
      "logsOnStorage": "logs",
      "disabled": false,
      "keepAliveOff": false,
      "phpOpenBaseDir": false,
      "phpOpenBaseDirStorage": false,
      "phpOpenBaseDirAll": false,
      "phpOpenBaseWebInWeb": false,
      "nonExistSubDomainsToWeb": false,
      "phpMysql51Default": true,
      "phpMysql50Default": false,
      "phpMysql55Default": false,
      "phpSafeModeOff": false,
      "phpRegisterGlobalsOff": false,
      "phpUploadMaxFilesize": 48,
      "phpMemoryLimit": 48,
      "phpPostMaxSize": 48,
      "phpMaxExecutionTime": 30
    },
    {
      "id": 114516,
      "domain": "hosting20testtest.sk",
      "sub": "blog",
      "webOnStorage": "hosting20testtest.sk/web",
      "subOnStorage": "hosting20testtest.sk/sub",
      "logsOnStorage": "logs",
      "disabled": false,
      "keepAliveOff": false,
      "phpOpenBaseDir": false,
      "phpOpenBaseDirStorage": false,
      "phpOpenBaseDirAll": false,
      "phpOpenBaseWebInWeb": false,
      "nonExistSubDomainsToWeb": true,
      "phpMysql51Default": true,
      "phpMysql50Default": false,
      "phpMysql55Default": false,
      "phpSafeModeOff": false,
      "phpRegisterGlobalsOff": false,
      "phpUploadMaxFilesize": 48,
      "phpMemoryLimit": 48,
      "phpPostMaxSize": 48,
      "phpMaxExecutionTime": 30
    }
  ],
  "pager": {
    "page": 1,
    "pagesize": null,
    "items": 2
  }
}

Get a webhosting domain (vhost) detail

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/vhost/:id" -v -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/vhost/:id HTTP/1.1

Accept: application/json

Response 200

{
  "id": 114504,
  "domain": "blablabla.com",
  "sub": "ahoj",
  "webOnStorage": "blablabla.com",
  "subOnStorage": "blablabla.com/sub",
  "logsOnStorage": "logs",
  "disabled": false,
  "keepAliveOff": false,
  "phpOpenBaseDir": false,
  "phpOpenBaseDirStorage": false,
  "phpOpenBaseDirAll": false,
  "phpOpenBaseWebInWeb": false,
  "nonExistSubDomainsToWeb": false,
  "phpMysql51Default": true,
  "phpMysql50Default": false,
  "phpMysql55Default": false,
  "phpSafeModeOff": false,
  "phpRegisterGlobalsOff": false,
  "phpUploadMaxFilesize": 48,
  "phpMemoryLimit": 48,
  "phpPostMaxSize": 48,
  "phpMaxExecutionTime": 30
}

List of all databases

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db" -v -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/db HTTP/1.1

Accept: application/json

Response 200

{
    "items": [
        {
            "id": 239365, 
            "dbName": "pm56j8m60i808w", 
            "dbUser": "pm56j8m60i808w", 
            "dbType": "mariadb55", 
            "deleted": false, 
            "disabled": false, 
            "domain": "testingdomain.sk", 
            "note": "wordpress"
        }
    ], 
    "pager": {
        "items": 1, 
        "page": 1, 
        "pagesize": null
    },
    "domains": [
        "testingdomain.sk"
    ]
}

Get database detail

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id" -v -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id HTTP/1.1

Accept: application/json

Response 200

{
    "id": 239365, 
    "dbName": "pm56j8m60i808w", 
    "dbUser": "pm56j8m60i808w", 
    "dbType": "mariadb55", 
    "deleted": false, 
    "disabled": false, 
    "domain": "testingdomain.sk", 
    "note": "wordpress"
}

Response 404

{
    "code": 404,
    "message": "Database not found"
}

Create new database

Parameters:

Name Type Required Comment
domain string yes domain in selected hosting (sometimes not required)
dbName string yes database name
dbUser string yes database user
dbPassword string yes password
dbType string yes choose one from: mariadb101, mysql57, mariadb55, mysql51, mysql50, postgresql90
note string no your note

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db" -v -u key:secret -H "Content-Type: application/json" -X POST \ 
-d '{"domain": "aaa.sk", "dbName": "testdb", "dbType": "mariadb55", "dbUser": "testdb", "note": "test"}'

Request

POST https://rest.websupport.sk/v1/user/:id/hosting/:id/db HTTP/1.1

Accept: application/json
Content-Type: application/json

{
    "domain": "aaa.sk",
    "dbName": "testdb",
    "dbPassword": "testdb",
    "dbType": "mariadb55",
    "dbUser": "testdb",
    "note": "test"
}

Response 200

{
    "item": {
        "id": null, 
        "dbName": "testdb", 
        "dbUser": "testdb", 
        "dbType": "mariadb55", 
        "deleted": false, 
        "disabled": false, 
        "domain": "aaa.sk", 
        "note": "test"
    },
    "errors": {}, 
    "status": "success"
}

Validation error 200

{
    "item": {
        "id": null, 
        "dbName": "testdb", 
        "dbUser": "testdb", 
        "dbType": "mariadb55", 
        "deleted": false, 
        "disabled": false, 
        "domain": "aaa.sk", 
        "note": "test"
    },
    "errors": {
        "dbName": [
            "Db Name cannot be blank."
        ]
    }, 
    "status": "error"
}

Update database

Parameters:

Name Type Required Comment
dbPassword string no password
note string no note

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db" -v -u key:secret -H "Content-Type: application/json" -X PUT \ 
-d '{"dbPassword": "asdf", "note": "test"}'

Request

POST https://rest.websupport.sk/v1/user/:id/hosting/:id/db HTTP/1.1

Accept: application/json
Content-Type: application/json

{
    "dbPassword": "testdb",
    "note": "test"
}

Response 200

{
    "item": {
        "id": 1234, 
        "dbName": "testdb", 
        "dbUser": "testdb", 
        "dbType": "mariadb55", 
        "deleted": false, 
        "disabled": false, 
        "domain": "aaa.sk", 
        "note": "test"
    },
    "errors": {}, 
    "status": "success"
}

Validation error 200

{
    "item": {
        "id": 1234, 
        "dbName": "testdb", 
        "dbUser": "testdb", 
        "dbType": "mariadb55", 
        "deleted": false, 
        "disabled": false, 
        "domain": "aaa.sk", 
        "note": "test"
    },
    "errors": {
        "dbPassword": [
            "Db Password is too short (minimum is 8 characters)."
        ]
    }, 
    "status": "error"
}

Delete a database

No parameters required.

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id" -X DELETE -u key:secret

Request

DELETE https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id HTTP/1.1

Accept: application/json

Response 200

{
    "errors": {}, 
    "item": {
        "id": 1234, 
        "dbName": "testdb", 
        "dbUser": "testdb", 
        "dbType": "mariadb55", 
        "deleted": false, 
        "disabled": false, 
        "domain": "aaa.sk", 
        "note": "test"
    }, 
    "status": "success"
}

DB size

Paramaters for changing time interval and period:

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id/size-stats" -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id/size-stats HTTP/1.1

Accept: application/json

Response 200

{
    "items": [
        {
            "size": 12044, 
            "timestamp": 1428357600
        }, 
        {
            "size": 12544, 
            "timestamp": 1428444000
        },
    ...
    ],
    "range": [
        1428332843, 
        1431011242
    ]
}

DB cpu

Paramaters for changing time interval and period:

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id/cpu-stats" -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id/cpu-stats HTTP/1.1

Accept: application/json

Response 200

{
    "items": [
        {
            "access_denied": 0, 
            "binlog_bytes_written": 0, 
            "busy_time": 0, 
            "bytes_received": 0, 
            "bytes_sent": 0, 
            "commit_transactions": 0, 
            "concurrent_connections": 0, 
            "connected_time": 0, 
            "cpu_time": 10, 
            "denied_connections": 0, 
            "empty_queries": 0, 
            "lost_connections": 0, 
            "other_commands": 0, 
            "rollback_transactions": 0, 
            "rows_fetched": 0, 
            "rows_updated": 0, 
            "select_commands": 0, 
            "table_rows_read": 0, 
            "timestamp": 1428357600, 
            "total_connections": 0, 
            "update_commands": 0
        }, 
    ...
    ],
    "range": [
        1428332843, 
        1431011242
    ]
}

Email size history per hosting

Get email size history per hosting (multiple domains).

Paramaters for changing time interval and period:

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/mail/size-stats" -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/mail/size-stats HTTP/1.1

Accept: application/json

Response 200

{
    "domains": [
        "testdomain1.sk",
        "testdomain2.sk"
    ], 
    "items": [
        {
            "size": 2903830, 
            "timestamp": 1434924000
        }, 
        {
            "size": 2904153, 
            "timestamp": 1435010400
        }, 
    ...
    ],
    "range": [
        1434880348, 
        1437558747
    ]
}

Email size history per domain

Get email size history per domain.

Paramaters for changing time interval and period:

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/mail/:domain/size-stats" -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/mail/:domain/size-stats HTTP/1.1

Accept: application/json

Response 200

{
    "items": [
        {
            "size": 2903830, 
            "timestamp": 1434924000
        }, 
        {
            "size": 2904153, 
            "timestamp": 1435010400
        }, 
    ...
    ],
    "range": [
        1434880348, 
        1437558747
    ]
}
raw