DCImanager 6
en En
es Es
Your feedback is an opportunity for improvement!
Take part in the survey and contribute to the development of the ISPsystem ecosystem.
Take the survey

Examples of API use

API functions of DCImanager 6 can be used for integration with the billing system. Before use, log in to DCImanager 6 and get the code of the current user session. Read more in API guide.

To access API, use the URL in the form: https://domain.com/api/dci/v3/function/ 

Comments on URL

Information about servers

Number of free servers and their configuration

curl -X GET 'https://domain.com/api/dci/v3/server/configuration'-H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7' -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true'| jq

JSON object in the following form will be delivered in return:

{
  "list": [
    {
      "configuration": "i9-9900K-64Gb-2x1024NVMe",
      "free_server_count": 42
    }
  ]
}
Comments

List of servers

curl -X GET 'https://domain.com/api/dci/v3/server' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7' -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true'| jq

JSON object in the following form will be delivered in return:

Response in JSON
Comments

Server info by ID

curl -X GET 'https://domain.com/api/dci/v3/server/server_id' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7'  -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true'| jq
Comments

JSON object in the following form will be delivered in return:

Response in JSON
Comments

Operations with users

List of all users

curl -X GET 'https://domain.com/api/dci/v3/user' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7'  -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true'| jq

JSON object in the following form will be delivered in return:

{
  "list": [
    {
      "id": 0,
      "email": "string",
      "server_count": 0,
      "roles": "[@user]",
      "vlans_per_user": 5
    }
  ]
}
Comments

Adding a user

curl -X POST 'https://domain.com/api/dci/v3/user' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7' -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true' -d '{"email":"admin@example.com","full_name":"name","password":"pass","phone_number":"phone","role":"level"}' | jq
Comments

JSON object in the following form will be delivered in return:

{
  "id": 0
}

User assignment as server owner

curl -X POST 'https://domain.com/api/dci/v3/server/server_id/owner' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7' -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true' -d '{"owner":user_id}' | jq
Comments

JSON object in the following form will be delivered in return:

{
  "id": 0
}

Server release

curl -X DELETE 'https://domain.com/api/dci/v3/server/server_id/owner' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7' -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true'| jq
Comments

JSON object in the following form will be delivered in return:

{
  "id": 0
}

Operations with switch ports

Activate server connection ports

curl -X POST 'https://domain.com/api/dci/v3/server/server_id/resume' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7' -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true' -d '{}'| jq
Comments

JSON object in the following form will be delivered in return:

{
  "id": 0,
  "task": 0
}

Deactivate server connection ports

curl -X POST 'https://domain.com/api/dci/v3/server/server_id/suspend' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7' -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true' -d '{}'| jq
Comments

JSON object in the following form will be delivered in return:

{
  "id": 0,
  "task": 0
}

Operations with server power

Power on

curl -X POST 'https://domain.com/api/dci/v3/server/server_id/power_on' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7' -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true' -d '{}'| jq
Comments

JSON object in the following form will be delivered in return:

{
  "id": 0,
  "task": 0
}

Power off

curl -X POST 'https://domain.com/api/dci/v3/server/server_id/power_off' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7' -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true' -d '{}'| jq
Comments

JSON object in the following form will be delivered in return:

{
  "id": 0,
  "task": 0
}

Reboot

curl -X POST 'https://domain.com/api/dci/v3/server/server_id/power_reset' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7' -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true' -d '{}'| jq
Comments

JSON object in the following form will be delivered in return:

{
  "id": 0,
  "task": 0
}

Operations with IP addresses

Getting IP addresses list

curl -X GET 'https://domain.com/api/dci/v3/ip' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7'  -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true'| jq


JSON object in the following form will be delivered in return:

{
  "list": [
    {
      "domain": "string",
      "family": "ipv4",
      "gateway": "string",
      "id": 0,
      "name": "string",
      "network": "string",
      "server": "string",
      "status": "allocating",
      "status_info": {}
    }
  ]
}
Comments

Getting server IP addresses

curl -X GET 'https://domain.com/api/dci/v3/server/server_id/ip' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7'  -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true'| jq
Comments

JSON object in the following form will be delivered in return:

{
  "list": [
    {
      "domain": "string",
      "family": "ipv4",
      "gateway": "string",
      "id": 0,
      "name": "string",
      "network": "string",
      "server": "string",
      "status": "allocating",
      "status_info": {}
    }
  ]
}
Comments

Getting networks list

curl -X GET 'https://domain.com/api/ip/v3/ipnet' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7'  -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true'| jq

JSON object in the following form will be delivered in return:

{
  "list": [
    {
      "id": 0,
      "name": "string",
      "family": 2,
      "mask": 0,
      "gateway": "string",
      "userspace": 0,
      "vlan": "string",
      "note": "string",
      "size": "string",
      "using_ip": "string",
      "total_ip": "string"
    }
  ]
}
Comments

Getting pools list

curl -X GET 'https://domain.com/api/ip/v3/ippool' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7'  -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true'| jq

JSON object in the following form will be delivered in return:

{
  "list": [
    {
      "id": 0,
      "name": "string",
      "userspace": 0,
      "note": "string",
      "is_public": "string",
      "using_ip": "string",
      "using_ipv4": "string",
      "using_ipv6": "string",
      "total_ip": "string",
      "total_ipv4": "string",
      "total_ipv6": "string"
    }
  ]
}
Comments

IP address allocation to server

curl -X POST 'https://domain.com/api/dci/v3/server/server_id/ip' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7' -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true' -d '{"domain":"domain_name","family":"version","ip_name":"address","ip_net":net,"ip_pool":pool,"set_as_main_ipv4":main_ipv4,"userspace":userspace_id}" | jq
Comments

JSON object in the following form will be delivered in return:

{
  "id": 0,
  "task": 0
}

Deleting IP address from server

curl -X POST 'https://domain.com/api/dci/v3/server/server_id/ip/ip_id' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7' -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true' -d '{}'| jq
Comments

JSON object in the following form will be delivered in return:

{
  "id": 0,
  "task": 0
}

Operations with server

Server diagnostics

curl -X POST 'https://domain.com/api/dci/v3/server/server_id/operation_diag' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7' -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true' -d '{"setup_ipmi":false,"ipmi_pool":0,"os_template_id":0,"clear_hdd":"none"}' | jq
Comments

JSON object in the following form will be delivered in return:

{
  "id": 0,
  "task": 0
}

Server disks clearing

curl -X POST 'https://domain.com/api/dci/v3/server/server_id/operation_clear_hdd' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7' -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true' -d '{"clear_hdd":"none"}' | jq
Comments

JSON object in the following form will be delivered in return:

{
  "id": 0,
  "task": 0
}

OS installation

curl -X POST 'https://domain.com/api/dci/v3/server/server_id/operation_os' -H 'Cookie: ses6=E6900A56BE7DF0FB28ED7BE7' -H 'x-xsrf-token: E6900A56BE7DF0FB28ED7BE7' -H 'isp-box-instance: true' -d '{"hdd_raid":"raid","os_template_id":template_id,"password":"pass","ssh_pub_keys":["ssh_keys"]}' | jq
Comments

JSON object in the following form will be delivered in return:

{
  "id": 0,
  "task": 0
}


Related topics

The article was last updated on 05.30.2023. The article was prepared by technical writers of ISPsystem.