Home
Version 3
Security Groups API

Security Groups API

Updating a Security Group

PUT /v2/security_groups/:guid

Fields

Name Description Default Valid Values Example Values
name The name of the security group.
  • my_super_sec_group
rules The egress rules for apps that belong to this security group. A rule consists of a protocol (tcp,icmp,udp,all), destination CIDR or destination range, port or port range (tcp,udp,all), type (control signal for icmp), code (control signal for icmp), log (enables logging for the egress rule)
  • [
      {
        "protocol": "icmp",
        "destination": "0.0.0.0/0",
        "type": 0,
        "code": 1
      },
      {
        "protocol": "tcp",
        "destination": "0.0.0.0/0",
        "ports": "2048-3000",
        "log": true
      },
      {
        "protocol": "udp",
        "destination": "0.0.0.0/0",
        "ports": "53, 5353"
      },
      {
        "protocol": "all",
        "destination": "0.0.0.0/0"
      }
    ]
space_guids The list of associated spaces.

Parameters

Name Description Valid Values Example Values
guid The guid of the Security Group

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTExNCIsImVtYWlsIjoiZW1haWwtNzZAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNDQ3MTY5MH0.FB_mdndFvxofyEKq674hR3dDX1mJr0r8fhCYVVP4Rww
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

PUT /v2/security_groups/6c2b3e58-20d9-4c14-9810-bebd95a7090a

Body

{
  "name": "new_name",
  "rules": [

  ]
}

cURL

curl "https://api.[your-domain.com]/v2/security_groups/6c2b3e58-20d9-4c14-9810-bebd95a7090a" -d '{
  "name": "new_name",
  "rules": [

  ]
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTExNCIsImVtYWlsIjoiZW1haWwtNzZAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNDQ3MTY5MH0.FB_mdndFvxofyEKq674hR3dDX1mJr0r8fhCYVVP4Rww" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: cf3f7965-03b8-4a73-9a47-17f240b129d1
Content-Length: 439
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "6c2b3e58-20d9-4c14-9810-bebd95a7090a",
    "url": "/v2/security_groups/6c2b3e58-20d9-4c14-9810-bebd95a7090a",
    "created_at": "2015-02-13T22:34:45Z",
    "updated_at": "2015-02-13T22:34:50Z"
  },
  "entity": {
    "name": "new_name",
    "rules": [

    ],
    "running_default": false,
    "staging_default": false,
    "spaces_url": "/v2/security_groups/6c2b3e58-20d9-4c14-9810-bebd95a7090a/spaces"
  }
}