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.eyJ1c2VyX2lkIjoidWFhLWlkLTIxNSIsImVtYWlsIjoiZW1haWwtMTU2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjI5OTA4NzV9.4GNFfD1lKWTkvgPxg7XFUMutiy0IWm5UO3WM4j3Iy3w
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.eyJ1c2VyX2lkIjoidWFhLWlkLTIxNSIsImVtYWlsIjoiZW1haWwtMTU2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjI5OTA4NzV9.4GNFfD1lKWTkvgPxg7XFUMutiy0IWm5UO3WM4j3Iy3w" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 044be420-f0da-45c9-8d0b-2389613bee14
Content-Length: 2923
X-Content-Type-Options: nosniff

Status

200 OK

Body

{
  "total_results": 5,
  "total_pages": 1,
  "prev_url": null,
  "next_url": null,
  "resources": [
    {
      "metadata": {
        "guid": "32b8532a-ec24-434a-9ea9-3e5a6db66327",
        "url": "/v2/security_groups/32b8532a-ec24-434a-9ea9-3e5a6db66327",
        "created_at": "2015-01-27T19:14:28Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy1",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/32b8532a-ec24-434a-9ea9-3e5a6db66327/spaces"
      }
    },
    {
      "metadata": {
        "guid": "8917b729-1509-44eb-a2f6-80bb690e3d26",
        "url": "/v2/security_groups/8917b729-1509-44eb-a2f6-80bb690e3d26",
        "created_at": "2015-01-27T19:14:28Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy2",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/8917b729-1509-44eb-a2f6-80bb690e3d26/spaces"
      }
    },
    {
      "metadata": {
        "guid": "eef81cff-7e48-426a-8b4b-e12226e6240b",
        "url": "/v2/security_groups/eef81cff-7e48-426a-8b4b-e12226e6240b",
        "created_at": "2015-01-27T19:14:35Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-1390",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/eef81cff-7e48-426a-8b4b-e12226e6240b/spaces"
      }
    },
    {
      "metadata": {
        "guid": "dcedc3b2-1a92-4f8c-94ab-76252af25f90",
        "url": "/v2/security_groups/dcedc3b2-1a92-4f8c-94ab-76252af25f90",
        "created_at": "2015-01-27T19:14:35Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-1391",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/dcedc3b2-1a92-4f8c-94ab-76252af25f90/spaces"
      }
    },
    {
      "metadata": {
        "guid": "628da07b-3ac4-4e4b-b038-a27d694ccd4f",
        "url": "/v2/security_groups/628da07b-3ac4-4e4b-b038-a27d694ccd4f",
        "created_at": "2015-01-27T19:14:35Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-1392",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/628da07b-3ac4-4e4b-b038-a27d694ccd4f/spaces"
      }
    }
  ]
}