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

Body

Name Description Default Valid Values Example Values

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE5IiwiZW1haWwiOiJlbWFpbC0xOEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI2NjMzODk0fQ.ddF8HNzFznWo9FPAPQ4jKwZLzOJP_cRn-AG5j8np1II
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/security_groups" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE5IiwiZW1haWwiOiJlbWFpbC0xOEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI2NjMzODk0fQ.ddF8HNzFznWo9FPAPQ4jKwZLzOJP_cRn-AG5j8np1II" \
	-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": "ebbf839d-b248-4e72-95a2-e95988bfc466",
        "url": "/v2/security_groups/ebbf839d-b248-4e72-95a2-e95988bfc466",
        "created_at": "2015-03-10T23:11:30Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy1",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/ebbf839d-b248-4e72-95a2-e95988bfc466/spaces"
      }
    },
    {
      "metadata": {
        "guid": "750af2b6-5752-44cf-bad9-385aa3c5d48b",
        "url": "/v2/security_groups/750af2b6-5752-44cf-bad9-385aa3c5d48b",
        "created_at": "2015-03-10T23:11:30Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy2",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/750af2b6-5752-44cf-bad9-385aa3c5d48b/spaces"
      }
    },
    {
      "metadata": {
        "guid": "1874f9a6-164a-4c4e-b4e8-8249620a0b34",
        "url": "/v2/security_groups/1874f9a6-164a-4c4e-b4e8-8249620a0b34",
        "created_at": "2015-03-10T23:11:34Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-78",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/1874f9a6-164a-4c4e-b4e8-8249620a0b34/spaces"
      }
    },
    {
      "metadata": {
        "guid": "af478593-2caf-49df-8dd8-47e797d22316",
        "url": "/v2/security_groups/af478593-2caf-49df-8dd8-47e797d22316",
        "created_at": "2015-03-10T23:11:34Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-79",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/af478593-2caf-49df-8dd8-47e797d22316/spaces"
      }
    },
    {
      "metadata": {
        "guid": "51442026-b843-48e1-9ab5-348f2b207e8f",
        "url": "/v2/security_groups/51442026-b843-48e1-9ab5-348f2b207e8f",
        "created_at": "2015-03-10T23:11:34Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-80",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/51442026-b843-48e1-9ab5-348f2b207e8f/spaces"
      }
    }
  ]
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 288603ba-33a2-4b61-ac58-5b0850155796
Content-Length: 2917
X-Content-Type-Options: nosniff