Skip to content

Instantly share code, notes, and snippets.

@pikesley
Created December 16, 2015 10:38
Show Gist options
  • Save pikesley/47ba9894d3a4922acaac to your computer and use it in GitHub Desktop.
Save pikesley/47ba9894d3a4922acaac to your computer and use it in GitHub Desktop.

Get token

POST to https://identity.api.rackspacecloud.com/v2.0/tokens

with headers

Content-Type: application/json

and body

{
  "auth": {
    "RAX-KSKEY:apiKeyCredentials": {
      "username": "USERNAME",
      "apiKey": "APIKEY"
    }
  }
}

Extract

{
  "access": {
    "token": {
      "id": "REMEMBER_THIS_NUMBER"
    }
  }
}

Get load-balancer

GET https://lon.loadbalancers.api.rackspacecloud.com/v2.0/RACKSPACE_CUSTOMER_ID/loadbalancers

with headers

Content-Type: application/json
X-Auth-Token: REMEMBER_THIS_NUMBER

Rummage through the JSON until you find the one you're after, extract its id and REMEMBER_ALSO_THIS_NUMBER

Modify load-balancer

PUT to https://lon.loadbalancers.api.rackspacecloud.com/v1.0/RACKSPACE_CUSTOMER_ID/loadbalancers/REMEMBER_ALSO_THIS_NUMBER

with headers

Content-Type: application/json
X-Auth-Token: REMEMBER_THIS_NUMBER

and body

{
  "loadBalancer": {
    "timeout": "TIMEOUT_IN_SECONDS"
  }
}

You should get a 202 Accepted, and if you do the GET again you will see the new timeout value there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment