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.eyJ1c2VyX2lkIjoidWFhLWlkLTM5NyIsImVtYWlsIjoiZW1haWwtMjk3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjk2NjQxNTN9.EfdCis1keuWppPDDMvTLsHHbBpj4J3RxueEZqRAt16Q
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/security_groups" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM5NyIsImVtYWlsIjoiZW1haWwtMjk3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjk2NjQxNTN9.EfdCis1keuWppPDDMvTLsHHbBpj4J3RxueEZqRAt16Q" \
	-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": "22677b6c-47a3-48a1-96e7-6dd74467ea94",
        "url": "/v2/security_groups/22677b6c-47a3-48a1-96e7-6dd74467ea94",
        "created_at": "2015-04-15T00:55:46Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy1",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/22677b6c-47a3-48a1-96e7-6dd74467ea94/spaces"
      }
    },
    {
      "metadata": {
        "guid": "22c45cac-cc50-4910-b987-378a7270334a",
        "url": "/v2/security_groups/22c45cac-cc50-4910-b987-378a7270334a",
        "created_at": "2015-04-15T00:55:46Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy2",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/22c45cac-cc50-4910-b987-378a7270334a/spaces"
      }
    },
    {
      "metadata": {
        "guid": "3c2ca93e-fa23-4909-88e3-7ca7a197f70e",
        "url": "/v2/security_groups/3c2ca93e-fa23-4909-88e3-7ca7a197f70e",
        "created_at": "2015-04-15T00:55:53Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-2154",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/3c2ca93e-fa23-4909-88e3-7ca7a197f70e/spaces"
      }
    },
    {
      "metadata": {
        "guid": "22a95eb8-85cd-4cba-b67b-bd0647a4a725",
        "url": "/v2/security_groups/22a95eb8-85cd-4cba-b67b-bd0647a4a725",
        "created_at": "2015-04-15T00:55:53Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-2155",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/22a95eb8-85cd-4cba-b67b-bd0647a4a725/spaces"
      }
    },
    {
      "metadata": {
        "guid": "004d8aa8-0a66-44d5-a7aa-112544b1ef05",
        "url": "/v2/security_groups/004d8aa8-0a66-44d5-a7aa-112544b1ef05",
        "created_at": "2015-04-15T00:55:53Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-2156",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/004d8aa8-0a66-44d5-a7aa-112544b1ef05/spaces"
      }
    }
  ]
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 701b66d9-4110-4688-a083-fca00fbfe894
Content-Length: 2923
X-Content-Type-Options: nosniff