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.eyJ1c2VyX2lkIjoidWFhLWlkLTE0OSIsImVtYWlsIjoiZW1haWwtMTI4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzI3NzQ5ODd9.bVfaaNzGI6sBdjBSYUAvRRYJBJuJAyiit5S0vmTGhLs
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/security_groups" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE0OSIsImVtYWlsIjoiZW1haWwtMTI4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzI3NzQ5ODd9.bVfaaNzGI6sBdjBSYUAvRRYJBJuJAyiit5S0vmTGhLs" \
	-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": "72264b3d-e1cd-45cc-af73-75a7720a0f6a",
        "url": "/v2/security_groups/72264b3d-e1cd-45cc-af73-75a7720a0f6a",
        "created_at": "2015-05-21T01:03:00Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy1",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/72264b3d-e1cd-45cc-af73-75a7720a0f6a/spaces"
      }
    },
    {
      "metadata": {
        "guid": "3f57d1c0-117a-4640-aded-ed427de30b67",
        "url": "/v2/security_groups/3f57d1c0-117a-4640-aded-ed427de30b67",
        "created_at": "2015-05-21T01:03:00Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy2",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/3f57d1c0-117a-4640-aded-ed427de30b67/spaces"
      }
    },
    {
      "metadata": {
        "guid": "01f21e26-1d65-456a-a5fb-d4ac96f1dbf3",
        "url": "/v2/security_groups/01f21e26-1d65-456a-a5fb-d4ac96f1dbf3",
        "created_at": "2015-05-21T01:03:07Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-715",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/01f21e26-1d65-456a-a5fb-d4ac96f1dbf3/spaces"
      }
    },
    {
      "metadata": {
        "guid": "c60adbe3-db71-4e50-b87b-33f0398d7e9a",
        "url": "/v2/security_groups/c60adbe3-db71-4e50-b87b-33f0398d7e9a",
        "created_at": "2015-05-21T01:03:07Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-716",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/c60adbe3-db71-4e50-b87b-33f0398d7e9a/spaces"
      }
    },
    {
      "metadata": {
        "guid": "e0f11916-859d-4b8e-aacb-e32a8f197fff",
        "url": "/v2/security_groups/e0f11916-859d-4b8e-aacb-e32a8f197fff",
        "created_at": "2015-05-21T01:03:07Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-717",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/e0f11916-859d-4b8e-aacb-e32a8f197fff/spaces"
      }
    }
  ]
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: fcc83afc-ece1-42f9-bec9-56236b18b777
Content-Length: 2920
X-Content-Type-Options: nosniff