snabbare Created with Sketch.
cloud Created with Sketch.
Fill 2 Copy 5 Created with Sketch.
cloud Created with Sketch.

Dokumentation API

API

Här finns en snabbdokumentation över hur API hos Cloudnet fungerar. Dokumentationen är inte komplett utan bara en delmängd.

Anslutning

API:et är REST med json. Meningen är att det ska vara enkelt att prata med. Alla anrop sker över https. Den URL som ska anropas är:

https://api.cloudnet.se/api/v2

Autentisering

Varje användare har en unik API-nyckel. För att få din nyckel så måste du kontakta support. När du har nyckeln så anger du den som en extra ”Header” i anropen. Se exemplet nedan med Curl:

$ curl --header "api_key: <api-nyckel>" https://api.cloudnet.se/api/v2/instance/
[
  {
    "name": "c1234",
    "hostname": "",
    "description": "Webshop produktion",
    "instance_size": "Large",
    "instance_type": "Magento",
    "ip": "121.226.229.12",
    "ipv6": "2b53:7f02::f05c:ae45:feae:4334"
  },
  {
    "name": "c5555",
    "hostname": ""
    "description": "Webshop stage",
    "instance_size": "Medium",
    "instance_type": "Magento",
    "ip": "121.45.221.32",
    "ipv6": "2b53:7f02::f05c:ae45:feae:456e"
  }
]

Endpoints

Här är en lista med alla endpoints med parametrar.

/instance/

Returnerar en lista med alla servrar du har tillgång till, antingen som ägare eller teknisk kontakt.

Metod: GET

Response:

[{
    name (string): Name of server,
    hostname (string): Hostname of server. If left blank, name is used.,
    description (string): Description of server,
    instance_size (integer),
    instance_type (string),
    ip (string),
    ipv6 (string)
}]

JSON Schema:

{
  "$schema": "http://json-schema.org/schema#",

  "title": "https://api.cloudnet.se/api/v2/instance/",
  "description": "Returnerar en lista med alla servrar du har tillgång till, antingen som ägare eller teknisk kontakt.",
  "type": "array",

  "examples": [
    [
      {
        "name": "c1234",
        "hostname": "webshop-prod",
        "description": "Webshop produktion",
        "instance_size": "Large (2 GB)",
        "instance_type": "Magento",
        "ip": "121.226.229.12",
        "ipv6": "2b53:7f02::f05c:ae45:feae:4334"
      },
      {
        "name": "c5555",
        "hostname": "webshop-stage",
        "description": "Webshop stage",
        "instance_size": "Medium (1 GB)",
        "instance_type": "Magento",
        "ip": "121.45.221.32",
        "ipv6": "2b53:7f02::f05c:ae45:feae:456e"
      }
    ]
  ],

  "items": {
    "title": "Instance Small Serialization",
    "type": "object",
    "properties": {
      "name": { "type":  "string", "description": "Name of server" },
      "hostname": { "type":  "string", "description": "Hostname of server." },
      "description": { "type":  "string", "description": "Description of server purpose" },
      "instance_type": { "type":  "string", "description": "Type of server" },
      "instance_size": { "type":  "string", "description": "Size of the virtual instance the server is running on." },
      "ip": { "type":  "string", "description": "Public IPv4 address of the server" },
      "ipv6": { "type":  "string", "description": "Public IPv6 address of the server" }
    }
  }
}

/instance/{name}/

Returnerar mer detaljerad information om en server.

Metod: GET

Response:

{
    applications (string),
    cores (string),
    customers (array)
    [{
        name (string): Name of customer,
        contact_name (string): Contact reference name
    }],
    description (string): Description of server,
    disks (array)
    [{
        mountpoint (string): Mountpoint, i.e. /mnt/persist,
        name (string): Name of disk partition,
        path (string): Path to device to attach, i.e. /dev/vg00/cloudnet-3000,
        hd (integer): Harddisk
    }],
    domain (string): Domainname for server (only used in rare cases).,
    hostname (string): Hostname of server. If left blank, name is used.,
    instance_type (string),
    instance_size (integer),
    invoice_contact (array)
    {
        name (string): Name of customer,
        contact_name (string): Contact reference name
    },
    ip (string),
    ipv6 (string),
    memory (string),
    name (string),
    networks (array)
    [{
        interface (choice) = ['lan' or 'dmz' or 'wan' or 'eth0' or 'eth1' or 'eth2' or 'eth0:1' or 'eth0:2' or 'eth0:3' or 'venet0']: Local interface,
        ip (string): IP address on interface,   
        ipv6 (string): IPv6 address on interface.,
        gateway (string): Default gateway,
        netmask (string): Netmask
    }],
    technical_contact (string): Name / company that's technical contact
}

HJÄLP

Om du har frågor eller behöver hjälp, posta ditt ärende på [email protected]. Du kan även ringa oss under kontorstid på 08-123 500 50.