Home
Version 3
Security Groups API

Security Groups API

List all Security Groups

GET /v2/security_groups

Fields

Name Description Default Valid Values Example Values

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

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzMiIsImVtYWlsIjoiZW1haWwtODRAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQxOTk4OTk2Nn0.VETwfe_X3lqXke0B4tUsinH927vcNr5sKWR7SfhZbRo
Host: example.org
Cookie: 

Route

GET /v2/security_groups

cURL

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

Response

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 2f046a2e-cb4f-4cbe-bc9f-202317e255b5
Content-Length: 2948
X-Content-Type-Options: nosniff

Status

200 OK

Body

{
  "total_results": 5,
  "total_pages": 1,
  "prev_url": null,
  "next_url": null,
  "resources": [
    {
      "metadata": {
        "guid": "bb9f52ce-33be-4675-a81c-cb220ef914b2",
        "url": "/v2/security_groups/bb9f52ce-33be-4675-a81c-cb220ef914b2",
        "created_at": "2014-12-24T01:39:20+00:00",
        "updated_at": null
      },
      "entity": {
        "name": "dummy1",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/bb9f52ce-33be-4675-a81c-cb220ef914b2/spaces"
      }
    },
    {
      "metadata": {
        "guid": "9b8a2da7-b314-4d8d-a5f0-40c45587eae4",
        "url": "/v2/security_groups/9b8a2da7-b314-4d8d-a5f0-40c45587eae4",
        "created_at": "2014-12-24T01:39:20+00:00",
        "updated_at": null
      },
      "entity": {
        "name": "dummy2",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/9b8a2da7-b314-4d8d-a5f0-40c45587eae4/spaces"
      }
    },
    {
      "metadata": {
        "guid": "35e74e9c-1f57-4d25-90a9-cffc861c079b",
        "url": "/v2/security_groups/35e74e9c-1f57-4d25-90a9-cffc861c079b",
        "created_at": "2014-12-24T01:39:26+00:00",
        "updated_at": null
      },
      "entity": {
        "name": "name-1030",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/35e74e9c-1f57-4d25-90a9-cffc861c079b/spaces"
      }
    },
    {
      "metadata": {
        "guid": "1caf6895-69d6-4a60-828d-7b10da379d8f",
        "url": "/v2/security_groups/1caf6895-69d6-4a60-828d-7b10da379d8f",
        "created_at": "2014-12-24T01:39:26+00:00",
        "updated_at": null
      },
      "entity": {
        "name": "name-1031",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/1caf6895-69d6-4a60-828d-7b10da379d8f/spaces"
      }
    },
    {
      "metadata": {
        "guid": "ccb025dd-e79e-4806-bbb1-db5527f6019b",
        "url": "/v2/security_groups/ccb025dd-e79e-4806-bbb1-db5527f6019b",
        "created_at": "2014-12-24T01:39:26+00:00",
        "updated_at": null
      },
      "entity": {
        "name": "name-1032",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/ccb025dd-e79e-4806-bbb1-db5527f6019b/spaces"
      }
    }
  ]
}