Firewall: update
Updates an existing firewall.
Request
HTTP request
PUT /firewall/v1/<firewallId> HTTP/1.1
or
PATCH /firewall/v1/<firewallId> HTTP/1.1
Parameters
Parameter name | Value | Description |
---|---|---|
Path parameters | ||
firewallId | string | ID of firewall |
Request Body
Property name | Value | Description |
---|---|---|
Required properties | ||
name | string | Name of the firewall |
Optional properties | ||
rules | object | Rule resource |
clouds | object[] | Cloud resources to be connected to the firewall |
cloudIds | string[] | Cloud IDs to be connected to the firewall |
Response
If successful, this method returns a firewall resource in the response body.
Response HTTP status code
HTTP status code | Description |
---|---|
200 | Success |
For more information about HTTP codes, click here.
Rate limit
Detailed information for firewall rate limitation is available on Shardimage developers.
SDK
use shardimage\shardimagephp\auth\Client;
use shardimage\shardimagephp\models\firewall\Firewall;
$client = new Client([
'apiKey' => '<apiKey>',
'apiSecret' => '<apiSecret>',
'imageSecret' => '<imageSecret>',
]);
try {
$firewall = $client->getFirewallService()->view(<firewallId>);
$firewall->name = 'updatedFirewallName';
$firewall->rules->blockIfNotMatchAllow = true;
$firewall->cloudIds = array_merge($firewall->cloudIds, [<cloudId>]);
$result = $client->getFirewallService()->update($firewall);
} catch (\Exception $e) {
// Handling the error
}