Home
Version 3
Security Groups API

Security Groups API

List all Security Groups

GET /v2/security_groups

Request

Route

GET /v2/security_groups

Parameters

Name Description Valid Values Example Values
q Parameters used to filter the result set.
Format queries as <filter><op><value>
Valid ops: : >= <= < > IN
Valid filters: name
  • q=filter:value
  • q=filter>value
  • q=filter IN a,b,c
page Page of results to fetch
results-per-page Number of results per page
order-direction Order of the results: asc (default) or desc
inline-relations-depth 0 - don't inline any relations and return URLs. Otherwise, inline to depth N.
orphan-relations 0 - de-duplicate object entries in response
exclude-relations comma-delimited list of relations to drop from response
include-relations comma-delimited list of the only relations to include in response

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE5NyIsImVtYWlsIjoiZW1haWwtMTYwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDcxMTY4NDF9.0bl2oWbvqt4TKiBarzXUOk8G2-E43H0BeEKDnQ9O81g
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/security_groups" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE5NyIsImVtYWlsIjoiZW1haWwtMTYwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDcxMTY4NDF9.0bl2oWbvqt4TKiBarzXUOk8G2-E43H0BeEKDnQ9O81g" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "total_results": 5,
  "total_pages": 1,
  "prev_url": null,
  "next_url": null,
  "resources": [
    {
      "metadata": {
        "guid": "f331aa11-b39e-4577-8c80-59d374f28364",
        "url": "/v2/security_groups/f331aa11-b39e-4577-8c80-59d374f28364",
        "created_at": "2015-11-03T00:53:43Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy1",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/f331aa11-b39e-4577-8c80-59d374f28364/spaces"
      }
    },
    {
      "metadata": {
        "guid": "686679fc-6993-468d-bd3d-bc167af78dec",
        "url": "/v2/security_groups/686679fc-6993-468d-bd3d-bc167af78dec",
        "created_at": "2015-11-03T00:53:43Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy2",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/686679fc-6993-468d-bd3d-bc167af78dec/spaces"
      }
    },
    {
      "metadata": {
        "guid": "22a50df8-8700-41b7-b697-121d50edd75f",
        "url": "/v2/security_groups/22a50df8-8700-41b7-b697-121d50edd75f",
        "created_at": "2015-11-03T00:54:01Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-939",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/22a50df8-8700-41b7-b697-121d50edd75f/spaces"
      }
    },
    {
      "metadata": {
        "guid": "6ba1d8da-06fe-4f8d-8646-23f8bca37f0b",
        "url": "/v2/security_groups/6ba1d8da-06fe-4f8d-8646-23f8bca37f0b",
        "created_at": "2015-11-03T00:54:01Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-940",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/6ba1d8da-06fe-4f8d-8646-23f8bca37f0b/spaces"
      }
    },
    {
      "metadata": {
        "guid": "9bb3b3bc-9d99-4d57-80ac-68a4664e17d1",
        "url": "/v2/security_groups/9bb3b3bc-9d99-4d57-80ac-68a4664e17d1",
        "created_at": "2015-11-03T00:54:01Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-941",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/9bb3b3bc-9d99-4d57-80ac-68a4664e17d1/spaces"
      }
    }
  ]
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 38d799a9-991e-415b-bd02-26f778f428b3
Content-Length: 2920
X-Content-Type-Options: nosniff