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

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQwOSIsImVtYWlsIjoiZW1haWwtMjcxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjM2MTg3Mjd9.8y70fKW4DhNr78ul23HixC-dU3a0_xKIR9n0pWdLVzc
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/security_groups" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQwOSIsImVtYWlsIjoiZW1haWwtMjcxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjM2MTg3Mjd9.8y70fKW4DhNr78ul23HixC-dU3a0_xKIR9n0pWdLVzc" \
	-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": "260ba675-47b6-4094-be7a-349d58e3d36a",
        "url": "/v2/security_groups/260ba675-47b6-4094-be7a-349d58e3d36a",
        "created_at": "2016-05-12T00:45:10Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy1",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/260ba675-47b6-4094-be7a-349d58e3d36a/spaces"
      }
    },
    {
      "metadata": {
        "guid": "68421ebe-5d7c-4720-8b5e-688e57cab190",
        "url": "/v2/security_groups/68421ebe-5d7c-4720-8b5e-688e57cab190",
        "created_at": "2016-05-12T00:45:10Z",
        "updated_at": null
      },
      "entity": {
        "name": "dummy2",
        "rules": [

        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/68421ebe-5d7c-4720-8b5e-688e57cab190/spaces"
      }
    },
    {
      "metadata": {
        "guid": "fd9bf045-e7bc-4c13-b80b-dd9bbeb677b2",
        "url": "/v2/security_groups/fd9bf045-e7bc-4c13-b80b-dd9bbeb677b2",
        "created_at": "2016-05-12T00:45:27Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-2310",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/fd9bf045-e7bc-4c13-b80b-dd9bbeb677b2/spaces"
      }
    },
    {
      "metadata": {
        "guid": "f820432f-1912-417e-a1af-c7b1271d3704",
        "url": "/v2/security_groups/f820432f-1912-417e-a1af-c7b1271d3704",
        "created_at": "2016-05-12T00:45:27Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-2311",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/f820432f-1912-417e-a1af-c7b1271d3704/spaces"
      }
    },
    {
      "metadata": {
        "guid": "38efbe52-95b0-4e0b-8a6e-e574b3254c92",
        "url": "/v2/security_groups/38efbe52-95b0-4e0b-8a6e-e574b3254c92",
        "created_at": "2016-05-12T00:45:27Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-2312",
        "rules": [
          {
            "protocol": "udp",
            "ports": "8080",
            "destination": "198.41.191.47/1"
          }
        ],
        "running_default": false,
        "staging_default": false,
        "spaces_url": "/v2/security_groups/38efbe52-95b0-4e0b-8a6e-e574b3254c92/spaces"
      }
    }
  ]
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: cb10664d-f17a-4e33-9a75-505cfc3ea875
Content-Length: 2923
X-Content-Type-Options: nosniff