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.eyJ1c2VyX2lkIjoidWFhLWlkLTY2IiwiZW1haWwiOiJlbWFpbC01OUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE2NTI2Njk5fQ.PxfeUZal_I4AQ5p8isjtWMXeTutpzs3EtIIDMAeBn1w
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.eyJ1c2VyX2lkIjoidWFhLWlkLTY2IiwiZW1haWwiOiJlbWFpbC01OUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE2NTI2Njk5fQ.PxfeUZal_I4AQ5p8isjtWMXeTutpzs3EtIIDMAeBn1w" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 71347424-24c6-4701-9b36-be59f807ae4a
Content-Length: 2945
X-Content-Type-Options: nosniff

Status

200 OK

Body

{
  "total_results": 5,
  "total_pages": 1,
  "prev_url": null,
  "next_url": null,
  "resources": [
    {
      "metadata": {
        "guid": "3a35e0ac-8f4b-4988-8355-9a2eb4566dd7",
        "url": "/v2/security_groups/3a35e0ac-8f4b-4988-8355-9a2eb4566dd7",
        "created_at": "2014-11-13T23:38:13+00:00",
        "updated_at": null
      },
      "entity": {
        "name": "dummy1",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/3a35e0ac-8f4b-4988-8355-9a2eb4566dd7/spaces"
      }
    },
    {
      "metadata": {
        "guid": "705f16e1-fd69-403f-b051-1fe6bbae8442",
        "url": "/v2/security_groups/705f16e1-fd69-403f-b051-1fe6bbae8442",
        "created_at": "2014-11-13T23:38:13+00:00",
        "updated_at": null
      },
      "entity": {
        "name": "dummy2",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/705f16e1-fd69-403f-b051-1fe6bbae8442/spaces"
      }
    },
    {
      "metadata": {
        "guid": "6b448b85-2fa2-474c-b497-e791180fd656",
        "url": "/v2/security_groups/6b448b85-2fa2-474c-b497-e791180fd656",
        "created_at": "2014-11-13T23:38:19+00:00",
        "updated_at": null
      },
      "entity": {
        "name": "name-398",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/6b448b85-2fa2-474c-b497-e791180fd656/spaces"
      }
    },
    {
      "metadata": {
        "guid": "9349d924-d52a-463c-a562-8d7ec8e12350",
        "url": "/v2/security_groups/9349d924-d52a-463c-a562-8d7ec8e12350",
        "created_at": "2014-11-13T23:38:19+00:00",
        "updated_at": null
      },
      "entity": {
        "name": "name-399",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/9349d924-d52a-463c-a562-8d7ec8e12350/spaces"
      }
    },
    {
      "metadata": {
        "guid": "a61cd8b1-8a26-4ea9-87f7-97ced9dc9090",
        "url": "/v2/security_groups/a61cd8b1-8a26-4ea9-87f7-97ced9dc9090",
        "created_at": "2014-11-13T23:38:19+00:00",
        "updated_at": null
      },
      "entity": {
        "name": "name-400",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/a61cd8b1-8a26-4ea9-87f7-97ced9dc9090/spaces"
      }
    }
  ]
}