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.eyJ1c2VyX2lkIjoidWFhLWlkLTI1NCIsImVtYWlsIjoiZW1haWwtMTY0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMDV9.JM_GHjx8VdY9abKlmxbR5bq-nKq89XJg83HC7Py2dME
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/security_groups" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI1NCIsImVtYWlsIjoiZW1haWwtMTY0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMDV9.JM_GHjx8VdY9abKlmxbR5bq-nKq89XJg83HC7Py2dME" \
	-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": "12e71bee-8376-43ff-8d29-45e930ad23d8",
        "url": "/v2/security_groups/12e71bee-8376-43ff-8d29-45e930ad23d8",
        "created_at": "2015-08-06T00:36:45Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy1",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/12e71bee-8376-43ff-8d29-45e930ad23d8/spaces"
      }
    },
    {
      "metadata": {
        "guid": "b0708aa6-aee6-4354-ab83-6b9dc282c7fe",
        "url": "/v2/security_groups/b0708aa6-aee6-4354-ab83-6b9dc282c7fe",
        "created_at": "2015-08-06T00:36:45Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy2",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/b0708aa6-aee6-4354-ab83-6b9dc282c7fe/spaces"
      }
    },
    {
      "metadata": {
        "guid": "0c7ec131-3ead-4767-8c6a-e4b46275c509",
        "url": "/v2/security_groups/0c7ec131-3ead-4767-8c6a-e4b46275c509",
        "created_at": "2015-08-06T00:36:45Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-1698",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/0c7ec131-3ead-4767-8c6a-e4b46275c509/spaces"
      }
    },
    {
      "metadata": {
        "guid": "4d749277-a8b7-4ba8-aa33-a193873510f6",
        "url": "/v2/security_groups/4d749277-a8b7-4ba8-aa33-a193873510f6",
        "created_at": "2015-08-06T00:36:45Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-1699",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/4d749277-a8b7-4ba8-aa33-a193873510f6/spaces"
      }
    },
    {
      "metadata": {
        "guid": "f6b0d8b6-3cbf-49f4-a643-4a743a91d3a8",
        "url": "/v2/security_groups/f6b0d8b6-3cbf-49f4-a643-4a743a91d3a8",
        "created_at": "2015-08-06T00:36:45Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-1700",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/f6b0d8b6-3cbf-49f4-a643-4a743a91d3a8/spaces"
      }
    }
  ]
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: b28ff7b9-f089-4f1f-b617-43bb20c68a3b
Content-Length: 2923
X-Content-Type-Options: nosniff