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.eyJ1c2VyX2lkIjoidWFhLWlkLTI3NSIsImVtYWlsIjoiZW1haWwtMTkyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzY4Mjk3OTF9.dOenp2axpymeApirzfJ5iluU61no7Bg84_j_kMwM99k
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/security_groups" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3NSIsImVtYWlsIjoiZW1haWwtMTkyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzY4Mjk3OTF9.dOenp2axpymeApirzfJ5iluU61no7Bg84_j_kMwM99k" \
	-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": "dbc8b22c-6beb-4e3f-aa02-760b3943746f",
        "url": "/v2/security_groups/dbc8b22c-6beb-4e3f-aa02-760b3943746f",
        "created_at": "2015-07-06T23:23:06Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy1",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/dbc8b22c-6beb-4e3f-aa02-760b3943746f/spaces"
      }
    },
    {
      "metadata": {
        "guid": "6dea74db-c8f0-4655-924c-0cc2519b31c6",
        "url": "/v2/security_groups/6dea74db-c8f0-4655-924c-0cc2519b31c6",
        "created_at": "2015-07-06T23:23:06Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy2",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/6dea74db-c8f0-4655-924c-0cc2519b31c6/spaces"
      }
    },
    {
      "metadata": {
        "guid": "80045d9c-3026-479f-aca8-3be446db17e4",
        "url": "/v2/security_groups/80045d9c-3026-479f-aca8-3be446db17e4",
        "created_at": "2015-07-06T23:23:11Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-1705",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/80045d9c-3026-479f-aca8-3be446db17e4/spaces"
      }
    },
    {
      "metadata": {
        "guid": "27c64861-bf77-41de-9791-3bc34cacf456",
        "url": "/v2/security_groups/27c64861-bf77-41de-9791-3bc34cacf456",
        "created_at": "2015-07-06T23:23:11Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-1706",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/27c64861-bf77-41de-9791-3bc34cacf456/spaces"
      }
    },
    {
      "metadata": {
        "guid": "bbe0d40c-799c-489d-8961-d5da4df242a7",
        "url": "/v2/security_groups/bbe0d40c-799c-489d-8961-d5da4df242a7",
        "created_at": "2015-07-06T23:23:11Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-1707",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/bbe0d40c-799c-489d-8961-d5da4df242a7/spaces"
      }
    }
  ]
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: c8c969ca-1f97-4fda-be8d-a9994b633f2a
Content-Length: 2923
X-Content-Type-Options: nosniff