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.eyJ1c2VyX2lkIjoidWFhLWlkLTciLCJlbWFpbCI6ImVtYWlsLTdAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ2MDUwNjYzNX0.HNvvU_XY0h1gdEkd7ugf7H4q2J1-dRhbCr68yZwNJms
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/security_groups" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTciLCJlbWFpbCI6ImVtYWlsLTdAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ2MDUwNjYzNX0.HNvvU_XY0h1gdEkd7ugf7H4q2J1-dRhbCr68yZwNJms" \
	-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": "b1af6d7e-0bd6-4c85-bfee-04e414947d7e",
        "url": "/v2/security_groups/b1af6d7e-0bd6-4c85-bfee-04e414947d7e",
        "created_at": "2016-04-06T00:17:14Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy1",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/b1af6d7e-0bd6-4c85-bfee-04e414947d7e/spaces"
      }
    },
    {
      "metadata": {
        "guid": "8f6c6364-8a57-4d57-b5ab-0f4359828668",
        "url": "/v2/security_groups/8f6c6364-8a57-4d57-b5ab-0f4359828668",
        "created_at": "2016-04-06T00:17:14Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy2",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/8f6c6364-8a57-4d57-b5ab-0f4359828668/spaces"
      }
    },
    {
      "metadata": {
        "guid": "69140e51-93b8-4d91-9174-5e1a74f4f1a6",
        "url": "/v2/security_groups/69140e51-93b8-4d91-9174-5e1a74f4f1a6",
        "created_at": "2016-04-06T00:17:15Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-34",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/69140e51-93b8-4d91-9174-5e1a74f4f1a6/spaces"
      }
    },
    {
      "metadata": {
        "guid": "86903477-6c87-4879-881d-d549c4841ddb",
        "url": "/v2/security_groups/86903477-6c87-4879-881d-d549c4841ddb",
        "created_at": "2016-04-06T00:17:15Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-35",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/86903477-6c87-4879-881d-d549c4841ddb/spaces"
      }
    },
    {
      "metadata": {
        "guid": "28cbe684-0ddb-4d84-821b-1848b64c9c34",
        "url": "/v2/security_groups/28cbe684-0ddb-4d84-821b-1848b64c9c34",
        "created_at": "2016-04-06T00:17:15Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-36",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/28cbe684-0ddb-4d84-821b-1848b64c9c34/spaces"
      }
    }
  ]
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 
Content-Length: 2917
X-Content-Type-Options: nosniff