REST API Guide for OpenStack Flex

A brief introduction in how to use cURL and the API for OpenStack Flex

Prerequisites

Endpoints

You'll need to know the following Keystone endpoints is so you can make your API call with your credentials to then obtain your authentication token. The Keystone endpoint requires you to pass your project name, so you'll need to obtain that ahead of time.

NOTE: Project Name and Project ID are not the same thing. See our guide here where it shows you how to find both.

Placeholders Used in Documentation

Placeholders are denoted by a dollar sign ($) and then all capital lettering. The following are placeholders used in the documentation, and would need to be replaced with your own information or set as variables prior to issuing the API calls that use them:

  • $USERNAME - Your username that you authenticate with.
  • $API_KEY - Your user's API key.
  • $PROJECT_NAME - Your OpenStack Flex Project Name.
  • $TOKEN - Your API Token returned by Identity.

Obtaining a Token

A key difference from Rackspace Cloud's API is that the authentication token is not in the body, but rather is in the header. In our examples below, we're using a method that allows the token to be captured and sent to a text file called flextoken.txt, but also is called and returned below the normal body output so you can see both.

NOTE: OpenStack Flex Auth Tokens are valid for 12 hours.

Issue the following API call after replacing the placeholders with your own information.

curl -s -D flextoken.txt -X POST https://keystone.api.dfw3.rackspacecloud.com/v3/auth/tokens -H "Content-Type: application/json" -d '{  
    "auth": {  
      "identity": {  
        "methods": ["password"],  
        "password": {  
          "user": {  
            "name": "$USERNAME",  
            "domain": { "name": "rackspace_cloud_domain" },  
            "password": "$API_KEY"  
          }  
        }  
      },  
      "scope": {  
        "project": {  
          "name": "$PROJECT_NAME",  
          "domain": { "name": "rackspace_cloud_domain" }  
        }  
      }  
    }  
  }' | python -m json.tool && grep -i x-subject-token flextoken.txt
 

Endpoints

You'll notice that when running the authentication command above you'll see a long list of available endpoints for each of the available services. There are endpoint URLs for each service. You'd really only need to be concerned with the Public endpoint as admin is not accessible for general users.

Endpoint TypeAccessible ByNetwork LocationPurpose
publicEnd-users, automation toolsInternet / DMZGeneral API use
internalOpenStack services, internal nodesPrivate networkService-to-service communication
adminAdministrators onlyAdmin networkPrivileged operations

Below is an example of the endpoints listed out for the Neutron networking service. All services will have their endpoints listed in a similar fashion. Be aware that some endpoints, like Swift Object Storage, will have additional unique identifiers appended which are specific to an OpenStack Flex Project.

            {
                "endpoints": [
                    {
                        "id": "12345678987654321321abcandabc123",
                        "interface": "public",
                        "region": "DFW3",
                        "region_id": "DFW3",
                        "url": "https://neutron.api.dfw3.rackspacecloud.com"
                    },
                    {
                        "id": "21321abcandabc123123456789876543",
                        "interface": "internal",
                        "region": "DFW3",
                        "region_id": "DFW3",
                        "url": "http://neutron-server.openstack.svc.cluster.local:9696"
                    },
                    {
                        "id": "21321abcandabc123123456789876543",
                        "interface": "admin",
                        "region": "DFW3",
                        "region_id": "DFW3",
                        "url": "http://neutron-server.openstack.svc.cluster.local:9696"
                    }
                ],

With this list of endpoints you can now communicate to the neutron endpoint using your token.

Making a Request

Below, is an example of us using our token and the endpoint in the previous step to create a basic neutron network. $TOKEN is a variable that's been set ahead of time with our actual token we obtained in our original authentication step.

curl -s -X POST \
>   https://neutron.api.dfw3.rackspacecloud.com/v2.0/networks \
>   -H "Content-Type: application/json" \
>   -H "X-Auth-Token: $TOKEN" \
>   -d '{
>         "network": {
>           "name": "example-network",
>           "admin_state_up": true
>         }
>       }' \
>   | python -m json.tool

Below you'll see example output from the creation command we passed above. This provides details about the network that we created within our project.

{
    "network": {
        "admin_state_up": true,
        "availability_zone_hints": [
            "az1"
        ],
        "availability_zones": [],
        "created_at": "2025-12-02T17:14:54Z",
        "description": "",
        "id": "12345678-9876-5432-1321-abcandabc123",
        "ipv4_address_scope": null,
        "ipv6_address_scope": null,
        "is_default": false,
        "l2_adjacency": true,
        "mtu": 3942,
        "name": "example-network",
        "port_security_enabled": true,
        "project_id": "12345678987654321321abcandabc123",
        "qos_policy_id": null,
        "revision_number": 1,
        "router:external": false,
        "shared": false,
        "status": "ACTIVE",
        "subnets": [],
        "tags": [],
        "tenant_id": "12345678987654321321abcandabc123",
        "updated_at": "2025-12-02T17:14:54Z"
    }
}

What’s Next

Because Rackspace OpenStack Flex is based on vanilla OpenStack you can use the official OpenStack API cURL documentation linked below for more information and in-depth documentation.