Follow

How can I test the API connectivity?

Once you have got your API Keys you can try accessing the ComputeNext API. One of the simplest requests is to list something:

C:\>curl -i http://cws.computenext.com/api/instance -u {apikey}:{apiseckey} HTTP/1.1 200 OK Content-Length: 1035 Content-Type: application/json; charset=utf-8 ETag: "850414544" Server: Microsoft-IIS/7.5 X-Powered-By: Express X-Powered-By: ASP.NET X-Powered-By: ARR/2.5 X-Powered-By: ASP.NET Date: Thu, 09 Oct 2014 20:54:38 GMT

[
    {
        "instanceId": "0118b161-d4e1-4eaa-8acd-e236009d491d", 
        "originated": "2014-05-06T21:25:04.723Z", 
        "created": "2014-05-06T21:25:06.547Z", 
        "completed": "2014-05-06T21:25:06.547Z", 
        "updated": "2014-05-06T21:25:15.132Z", 
        "ownerId": "7cb358f9-6779-448d-b3c1-97eb87a23857", 
        "resourceUri": "sg/pcextreme/ams/standard", 
        "resourceType": "sg", 
        "provider": "pcextreme", 
        "region": "ams", 
        "providerResourceId": "standard", 
        "attributes": {
            "providerInstanceId": "0118b161-d4e1-4eaa-8acd-e236009d491d", 
            "instanceStatus": "created", 
            "transientStatus": false, 
            "rules": [
                {
                    "protocol": "tcp", 
                    "from-port": 22, 
                    "to-port": 22, 
                    "cidr-ip": [
                        "0.0.0.0/0"
                    ], 
                    "added": true
                }, 
                {
                    "protocol": "tcp", 
                    "from-port": 3389, 
                    "to-port": 3389, 
                    "cidr-ip": [
                        "0.0.0.0/0"
                    ], 
                    "added": true
                }, 
                {
                    "protocol": "icmp", 
                    "from-port": -1, 
                    "to-port": -1, 
                    "cidr-ip": [
                        "0.0.0.0/0"
                    ], 
                    "added": true
                }
            ]
        }, 
        "attributeTimestamps": {
            "instanceStatus": "2014-05-06T21:25:15.117Z", 
            "rules": "2014-05-06T21:25:15.120Z"
        }, 
        "metadata": {
            "name": "MyDefault", 
            "transactionId": "cc9b2eae-2517-44b7-b749-bb2684cd6fe4"
        }, 
        "parameters": {
            "sg_providerResourceId": "standard", 
            "zone": "AMS"
        }
    }
]

This returns all the details pertaining to all the instances belonging to the user. Note that output from our API is always in JSON format.

The ComputeNext API is organized according to the different resource types, and also includes workloads and transactions. For more information see the API Documentation.

 
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments