Common Examples

Commonly used "getting started" examples to test and learn the Nova API.

Update the servers in a Backend

Below is an example snippet which will set the servers of IP-based backend ID 10005 to 10.0.0.1:80 and 10.0.0.2:80

curl --request PATCH \
     --url https://nova.snapt.net/api/v2/backends/10005 \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer X' \
     --header 'Content-Type: application/json' \
     --data '
{
     "config": {
          "servers": [
               {
                    "type": "primary",
                    "weight": 10,
                    "address": "10.0.0.1:80"
               },
               {
                    "type": "primary",
                    "weight": 10,
                    "address": "10.0.0.2:80"
               }
          ]
     }
}
'

Once updating this, it's important to deploy any affected ADCs. Below you can see us calling a deploy for ADC ID 100

curl --request POST \
     --url https://nova.snapt.net/api/v2/adcs/100/deployments \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer X'

Get list of online Nodes

A simple query that will return all your Nodes, their statuses, and their compute and resource information.

curl --request GET \
     --url https://nova.snapt.net/api/v2/nodes \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer X'