News: Bitcoin is now accepted as payment method!

Cloud API

Learn more about getting started using the Cloud API.

Get Started Now
Home Features Pricing Locations Docs Status Company
Login Sign Up

API Documentation

Introduction

The DevCapsule API provides a bunch of features and possibilities for accomplishing advanced setups and advanced usage of the DevCapsule cloud. In the below lines, we'll explain you further how you can make use of the API.

Account

/account/profile ( GET )

> curl https://api.devcapsule.com/account/profile -H 'X-API-Key:<API-KEY>'

{
    "statusCode": 200,
    "responseData": {
        "id": "100",
        "name": "John Doe",
        "email": "john@doe.com",
        "country": "UK"
    }
}

/account/ssh_keys/list ( GET )

> curl https://api.devcapsule.com/account/ssh_keys/list -H 'X-API-Key:<API-KEY>'

{
    "statusCode": 200,
    "responseData": [
        {
            "id": "59",
            "key": {
                "name": "Work PC",
                "base64": "...",
                "type": "..."
            },
            "added": "01-01-2017 10:00"
        }
    ]
}

/account/ssh_keys/add ( POST )

> curl -X POST https://api.devcapsule.com/account/ssh_keys/add -H 'X-API-Key:<API-KEY>' --data 'name=Work PC' --data 'key=ssh-rsa ...'

{
    "statusCode": 200,
    "responseData": {
        "status": "SSH Key successfully added"
    }
}

/account/ssh_keys/delete ( POST )

> curl -X POST https://api.devcapsule.com/account/ssh_keys/delete -H 'X-API-Key:<API-KEY>' --data 'id=<SSH-KEY-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "SSH Key successfully deleted"
    }
}

BGP

/bgp_sessions/list ( GET )

> curl https://api.devcapsule.com/bgp_sessions/list -H 'X-API-Key:<API-KEY>'

{
    "statusCode": 200,
    "responseData": [
        {
            "id": "69f9d1b2",
            "server": {
                "id": "18a9a537"
            },
            "endpoint": {
                "ipv4": "192.168.1.1",
                "ipv6": "2001:db8:1000:1000::ffff"
            },
            "md5": "184cf1af993b8d72d5cc64ce107a31e4",
            "status": "configured"
        }
    ]
}

/bgp_sessions/add ( POST )

> curl -X POST https://api.devcapsule.com/bgp_sessions/add -H 'X-API-Key:<API-KEY>' --data 'serverID=<SERVER-ID>' --data 'asn=<ASN>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Session created successfully",
        "id": "a5cd8282"
    }
}

Required Parameters:

  • serverID
  • asn

/bgp_sessions/delete ( POST )

> curl -X POST https://api.devcapsule.com/bgp_sessions/add -H 'X-API-Key:<API-KEY>' --data 'sessionID=<BGP-SESSION-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Session deleted successfully",
    }
}

Required Parameters:

  • sessionID

/bgp_prefixes/list ( GET )

> curl https://api.devcapsule.com/bgp_prefixes/list -H 'X-API-Key:<API-KEY>'

{
    "statusCode": 200,
    "responseData": [
        {
            "id": "0e05118b",
            "prefix": {
                "subnet": "2001:db8::\/48",
                "type": "ipv6"
            },
            "added": "2017-01-01 10:00 AM",
            "status": "accepted"
        },
    ]
}

/bgp_prefixes/add ( POST )

> curl -X POST https://api.devcapsule.com/bgp_prefixes/add -H 'X-API-Key:<API-KEY>' --data 'prefix=<IPV4-OR-IPV6-PREFIX>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Prefix created successfully",
        "id": "38a693fb"
    }
}

Required Parameters:

  • prefix

Firewalls

/firewalls/list ( GET )

> curl https://api.devcapsule.com/firewalls/list -H 'X-API-Key:<API-KEY>'

{
    "statusCode": 200,
    "responseData": [
        {
            "id": "a75c2fcc",
            "name": "Web Servers",
            "rules": 10,
            "members": [
                "ae439499"
                "c4ac91b1"
            ]
        }
    ]
}

/firewalls/create ( POST )

> curl -X POST https://api.devcapsule.com/firewalls/create -H 'X-API-Key:<API-KEY>' --data 'name=<FIREWALL-NAME>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Firewall successfully created",
        "id": "e3cc94da"
    }
}

Required Parameters:

  • name

Firewall

/firewall/details ( POST )

> curl -X POST https://api.devcapsule.com/firewall/details -H 'X-API-Key:<API-KEY>' --data 'firewallID=<FIREWALL-ID>'

{
    "statusCode": 200,
    "responseData": {
        "id": "17cade0d",
        "name": "test1",
        "rules": 2,
        "members": []
    }
}

Required Parameters:

  • firewallID

/firewall/rules/list ( POST )

> curl -X POST https://api.devcapsule.com/firewall/rules/list -H 'X-API-Key:<API-KEY>' --data 'firewallID=<FIREWALL-ID>'

{
    "statusCode": 200,
    "responseData": [
        {
            "id": "0682f254a2a6",
            "addressFamily": "ipv4",
            "source": "0.0.0.0\/0",
            "protocol": "ANY",
            "ports": "ANY",
            "action": "DROP"
        },
        {
            "id": "6d334b420d78",
            "addressFamily": "ipv6",
            "source": "::\/0",
            "protocol": "ANY",
            "ports": "ANY",
            "action": "DROP"
        }
    ]
}

Required Parameters:

  • firewallID

/firewall/rules/create ( POST )

> curl -X POST https://api.devcapsule.com/firewall/rules/create -H 'X-API-Key:<API-KEY>' --data 'firewallID=17cade0d' --data 'protocol=TCP' --data 'ports=80' --data 'source=0.0.0.0/0' --data 'policy=ACCEPT'

{
    "statusCode": 200,
    "responseData": {
        "status": "Firewall rule successfully created",
        "id": "bcac45b1c2ef"
    }
}

Required Parameters:

  • firewallID
  • protocol
  • ports
  • source
  • policy

/firewall/rules/delete ( POST )

> curl -X POST https://api.devcapsule.com/firewall/rules/delete -H 'X-API-Key:<API-KEY>' --data 'ruleID=<RULE-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Firewall rule successfully deleted"
    }
}

Required Parameters:

  • ruleID

/firewall/rules/commit ( POST )

> curl -X POST https://api.devcapsule.com/firewall/rules/commit -H 'X-API-Key:<API-KEY>' --data 'firewallID=<FIREWALL-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Firewall rules successfully committed"
    }
}

Required Parameters:

  • firewallID

/firewall/delete ( POST )

> curl -X POST https://api.devcapsule.com/firewall/delete -H 'X-API-Key:<API-KEY>' --data 'firewallID=<FIREWALL-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Firewall successfully deleted"
    }
}

Required Parameters:

  • firewallID

Private Networks

/private_networks/list ( GET )

> curl https://api.devcapsule.com/private_networks/list -H 'X-API-Key:<API-KEY>'

{
    "statusCode": 200,
    "responseData": [
        {
            "id": "2642e8f7",
            "description": "Development",
            "members": [
              "c49b14a3"
            ],
            "status": "configured"
        }
    ]
}

/private_networks/create ( POST )

> curl https://api.devcapsule.com/private_networks/create -H 'X-API-Key:<API-KEY>' --data 'description=<DESCRIPTION>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Private network successfully created",
        "id": "9088e516"
    }
}

Required Parameters:

  • description

Private Network

/private_network/details ( POST )

> curl -X POST https://api.devcapsule.com/private_network/details -H 'X-API-Key:<API-KEY>' --data 'networkID=<PRIVATE-NETWORK-ID>'

{
    "statusCode": 200,
    "responseData": [
        {
            "id": "2642e8f7",
            "description": "Development",
            "members": [
              "c49b14a3"
            ],
            "status": "configured"
        }
    ]
}

Required Parameters:

  • networkID

/private_network/delete ( POST )

> curl -X POST https://api.devcapsule.com/private_network/delete -H 'X-API-Key:<API-KEY>' --data 'networkID=<PRIVATE-NETWORK-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Private network successfully deleted"
    }
}

Required Parameters:

  • networkID

Servers

/servers/list ( GET )

> curl https://api.devcapsule.com/servers/list -H 'X-API-Key:<API-KEY>'

{
    "statusCode": 200,
    "responseData": [
        {
            "id": "1875eef2",
            "hostname": "my.server.com",
            "osCode": "stretch",
            "location": "Amsterdam",
            "network": {
                "ipv4": {
                    "addresses": [
                        "192.168.1.100"
                    ],
                    "netmask": "255.255.255.0",
                    "gateway": "192.168.1.1"
                },
                "ipv6": {
                    "assigned": "2001:db8:1000:1000::1",
                    "subnet": "2001:db8:1000:1000::",
                    "netmask": "64",
                    "gateway": "2001:db8:1000:1000::ffff"
                },
                "private_network": "NONE",
                "firewall": "NONE",
                "billing": {
                    "plan": "medium",
                    "charges": "2.000",
                    "running_hours": "200"
                },
                "authentication": {
                    "preInstalledPassword": "..."
                },
                "iso": "NONE",
                "status": "built"
            }
        }
    ]
}

/servers/create ( POST )

> curl https://api.devcapsule.com/servers/create -H 'X-API-Key:<API-KEY>' --data 'hostname=<SERVER-HOSTNAME>' --data 'operating_system=<IMAGE-ID-OR-CODENAME>' --data 'region=<REGION-ID>' --data 'plan=<PLAN-ID>' --data 'ssh_key=<OPTIONAL-SSH-KEY-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Server successfully created",
        "id": "a2fe7db6"
    }
}

Required Parameters:

  • hostname
  • operating_system
  • region
  • plan
  • ssh_key ( optional )

Server

/server/details ( POST )

> curl -X POST https://api.devcapsule.com/server/details -H 'X-API-Key:<API-KEY>' --data 'serverID=<SERVER-ID>'

{
    "statusCode": 200,
    "responseData": [
        {
            "id": "1875eef2",
            "hostname": "my.server.com",
            "osCode": "stretch",
            "location": "Amsterdam",
            "network": {
                "ipv4": {
                    "addresses": [
                        "192.168.1.100"
                    ],
                    "netmask": "255.255.255.0",
                    "gateway": "192.168.1.1"
                },
                "ipv6": {
                    "assigned": "2001:db8:1000:1000::1",
                    "subnet": "2001:db8:1000:1000::",
                    "netmask": "64",
                    "gateway": "2001:db8:1000:1000::ffff"
                },
                "private_network": "NONE",
                "firewall": "NONE",
                "billing": {
                    "plan": "medium",
                    "charges": "2.000",
                    "running_hours": "200"
                },
                "authentication": {
                    "preInstalledPassword": "..."
                },
                "iso": "NONE",
                "status": "built"
            }
        }
    ]
}

Note: The difference between server/details and servers/list is, that server/details passes on the details for one single specified server only, while servers/list shows all active servers.

/server/ptr ( GET )

> curl https://api.devcapsule.com/server/ptr -H 'X-API-Key:<API-KEY>' --data 'serverID=<SERVER-ID>'

{
    "statusCode": 200,
    "responseData": [
        {
            "id": "7a25befe70f0",
            "record": {
                "ipAddress": "192.168.1.1",
                "content": "my.server.com",
                "type": "ipv4"
            },
            "server_id": "266486c4"
        }
    ]
}

/server/ptr/add ( POST )

> curl -X POST https://api.devcapsule.com/server/ptr/add -H 'X-API-Key:<API-KEY>' --data 'ipAddress=<SERVER-IP>' --data 'hostname=<PTR-CONTENT>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Record successfully created",
        "id": "7a25befe70f0"
    }
}

Required Parameters:

  • ipAddress
  • hostname

/server/ptr/delete ( POST )

> curl -X POST https://api.devcapsule.com/server/ptr/delete -H 'X-API-Key:<API-KEY>' --data 'recordID=<RECORD-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Record successfully deleted"
    }
}

Required Parameters:

  • recordID

/server/status/stop ( POST )

> curl -X POST https://api.devcapsule.com/server/status/stop -H 'X-API-Key:<API-KEY>' --data 'serverID=<SERVER-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Server successfully stopped"
    }
}

Required Parameters:

  • serverID

/server/status/reboot ( POST )

> curl -X POST https://api.devcapsule.com/server/status/reboot -H 'X-API-Key:<API-KEY>' --data 'serverID=<SERVER-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Server successfully rebooted"
    }
}

Required Parameters:

  • serverID

/server/private_network/attach ( POST )

> curl -X POST https://api.devcapsule.com/server/private_network/attach -H 'X-API-Key:<API-KEY>' --data 'serverID=<SERVER-ID>' --data 'networkID=<NETWORK-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Private network successfully attached"
    }
}

Required Parameters:

  • serverID
  • networkID

/server/private_network/deattach ( POST )

> curl -X POST https://api.devcapsule.com/server/private_network/deattach -H 'X-API-Key:<API-KEY>' --data 'serverID=<SERVER-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Private network successfully de-attached"
    }
}

Required Parameters:

  • serverID

/server/firewall/attach ( POST )

> curl -X POST https://api.devcapsule.com/server/firewall/attach -H 'X-API-Key:<API-KEY>' --data 'serverID=<SERVER-ID>' --data 'serverID=<SERVER-ID>' --data 'firewallID=<FIREWALL-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Firewall successfully attached"
    }
}

Required Parameters:

  • serverID
  • firewallID

/server/firewall/deattach ( POST )

> curl -X POST https://api.devcapsule.com/server/firewall/deattach -H 'X-API-Key:<API-KEY>' --data 'serverID=<SERVER-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Firewall successfully de-attached"
    }
}

Required Parameters:

  • serverID

/server/ddos_attacks ( GET )

> curl https://api.devcapsule.com/server/ddos_attacks -H 'X-API-Key:<API-KEY>' --data 'serverID=<SERVER-ID>'

{
    "statusCode": 200,
    "responseData": [
        {
            "id": "0308B5A058BB",
            "start": "2017-08-08 11:19 AM",
            "density": {
                "pps": "26196",
                "mbps": "89"
            },
            "protocol": "UDP",
            "duration": 225
        }
    ]
}

Required Parameters:

  • serverID

/server/iso/attach ( POST )

> curl -X POST https://api.devcapsule.com/server/iso/attach -H 'X-API-Key:<API-KEY>' --data 'serverID=<SERVER-ID>' --data 'isoUrl=<ISO-URL>'

{
    "statusCode": 200,
    "responseData": {
        "status": "ISO successfully attached"
    }
}

Required Parameters:

  • serverID
  • isoUrl

/server/iso/deattach ( POST )

> curl -X POST https://api.devcapsule.com/server/iso/deattach -H 'X-API-Key:<API-KEY>' --data 'serverID=<SERVER-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "ISO successfully de-attached"
    }
}

Required Parameters:

  • serverID

/server/rebuild ( POST )

> curl -X POST https://api.devcapsule.com/server/rebuild -H 'X-API-Key:<API-KEY>' --data 'serverID=<SERVER-ID>' --data 'imageID=<IMAGE-ID-OR-CODENAME>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Server successfully rebuilt"
    }
}

Required Parameters:

  • serverID
  • imageID

/server/delete ( POST )

> curl -X POST https://api.devcapsule.com/server/delete -H 'X-API-Key:<API-KEY>' --data 'serverID=<SERVER-ID>'

{
    "statusCode": 200,
    "responseData": {
        "status": "Server successfully deleted"
    }
}

Required Parameters:

  • serverID

Operating Systems

/os ( GET )

> curl https://api.devcapsule.com/os -H 'X-API-Key:<API-KEY>'

{
    "statusCode": 200,
    "responseData": [
        {
            "id": "1",
            "codename": "trusty",
            "distribution": "ubuntu"
        },
        {
            "id": "2",
            "codename": "xenial",
            "distribution": "ubuntu"
        },
        {
            "id": "3",
            "codename": "yakkety",
            "distribution": "ubuntu"
        },
        {
            "id": "4",
            "codename": "zesty",
            "distribution": "ubuntu"
        },
        {
            "id": "5",
            "codename": "jessie",
            "distribution": "debian"
        },
        {
            "id": "9",
            "codename": "centos7",
            "distribution": "centos"
        },
        {
            "id": "10",
            "codename": "fedora26",
            "distribution": "fedora"
        },
        {
            "id": "11",
            "codename": "fedora25",
            "distribution": "fedora"
        },
        {
            "id": "13",
            "codename": "stretch",
            "distribution": "debian"
        },
        {
            "id": "14",
            "codename": "centos6",
            "distribution": "centos"
        },
        {
            "id": "15",
            "codename": "fedora24",
            "distribution": "fedora"
        }
    ]
}

Regions

/regions ( GET )

> curl https://api.devcapsule.com/regions -H 'X-API-Key:<API-KEY>'

{
    "statusCode": 200,
    "responseData": [
        {
            "id": "2",
            "city": "Manchester",
            "country": "United-Kingdom",
            "availability": "OK"
        },
        {
            "id": "3",
            "city": "Amsterdam",
            "country": "Netherlands",
            "availability": "OK"
        },
        {
            "id": "4",
            "city": "Los Angeles",
            "country": "United States",
            "availability": "OK"
        }
    ]
}

Plans

/plans ( GET )

> curl https://api.devcapsule.com/plans -H 'X-API-Key:<API-KEY>'

{
    "statusCode": 200,
    "responseData": [
        {
            "id": "1",
            "name": "small",
            "resources": {
                "cores": "1",
                "memory": "768",
                "disk": "10",
                "bandwidth": "1000"
            },
            "price": {
                "hourly": 0.005
            }
        },
        {
            "id": "2",
            "name": "medium",
            "resources": {
                "cores": "1",
                "memory": "1024",
                "disk": "15",
                "bandwidth": "1500"
            },
            "price": {
                "hourly": 0.01
            }
        },
        {
            "id": "3",
            "name": "large",
            "resources": {
                "cores": "2",
                "memory": "2048",
                "disk": "20",
                "bandwidth": "2000"
            },
            "price": {
                "hourly": 0.019
            }
        },
        {
            "id": "4",
            "name": "enterprise",
            "resources": {
                "cores": "4",
                "memory": "4096",
                "disk": "25",
                "bandwidth": "5000"
            },
            "price": {
                "hourly": 0.033
            }
        },
        {
            "id": "5",
            "name": "mega",
            "resources": {
                "cores": "6",
                "memory": "8192",
                "disk": "75",
                "bandwidth": "10000"
            },
            "price": {
                "hourly": 0.067
            }
        },
        {
            "id": "6",
            "name": "giga",
            "resources": {
                "cores": "8",
                "memory": "16384",
                "disk": "100",
                "bandwidth": "10000"
            },
            "price": {
                "hourly": 0.133
            }
        },
        {
            "id": "7",
            "name": "tera",
            "resources": {
                "cores": "12",
                "memory": "24576",
                "disk": "150",
                "bandwidth": "10000"
            },
            "price": {
                "hourly": 0.2
            }
        },
        {
            "id": "8",
            "name": "peta",
            "resources": {
                "cores": "16",
                "memory": "32768",
                "disk": "200",
                "bandwidth": "10000"
            },
            "price": {
                "hourly": 0.267
            }
        }
    ]
}