Skip to content

Commit de0ce54

Browse files
committed
Update SecurityGroup
1 parent b64254c commit de0ce54

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

src/Networking/v2/Extensions/SecurityGroups/Api.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,25 @@ public function postSecurityGroups()
4646
];
4747
}
4848

49+
/**
50+
* Returns information about PUT security-groups HTTP operation
51+
*
52+
* @return array
53+
*/
54+
public function putSecurityGroups()
55+
{
56+
return [
57+
'method' => 'PUT',
58+
'path' => $this->pathPrefix . 'security-groups/{id}',
59+
'jsonKey' => 'security_group',
60+
'params' => [
61+
'id' => $this->params->idPath(),
62+
'description' => $this->params->descriptionJson(),
63+
'name' => $this->params->nameJson(),
64+
],
65+
];
66+
}
67+
4968
/**
5069
* Returns information about GET security-groups/{security_group_id} HTTP
5170
* operation

src/Networking/v2/Extensions/SecurityGroups/Models/SecurityGroup.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
use OpenCloud\Common\Resource\Deletable;
88
use OpenCloud\Common\Resource\Listable;
99
use OpenCloud\Common\Resource\Retrievable;
10+
use OpenCloud\Common\Resource\Updateable;
1011

1112
/**
1213
* Represents a SecurityGroup resource in the Network v2 service
1314
*
1415
* @property \OpenStack\Networking\v2\Extensions\SecurityGroups\Api $api
1516
*/
16-
class SecurityGroup extends OperatorResource implements Creatable, Listable, Deletable, Retrievable
17+
class SecurityGroup extends OperatorResource implements Creatable, Listable, Deletable, Retrievable, Updateable
1718
{
1819
/**
1920
* @var string
@@ -74,4 +75,10 @@ public function retrieve()
7475
$response = $this->executeWithState($this->api->getSecurityGroup());
7576
$this->populateFromResponse($response);
7677
}
78+
79+
public function update()
80+
{
81+
$response = $this->executeWithState($this->api->putSecurityGroups());
82+
$this->populateFromResponse($response);
83+
}
7784
}

0 commit comments

Comments
 (0)