Firewall: create
Request
HTTP request
POST /firewall/v1 HTTP/1.1
Parameters
This method does not support path parameters.
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;
use shardimage\shardimagephp\models\firewall\Rules;
$client = new Client([
'apiKey' => '<apiKey>',
'apiSecret' => '<apiSecret>',
'imageSecret' => '<imageSecret>',
]);
$rules = new Rules();
$rules->continentAccept = "EU\nNA";
$firewall = new Firewall();
$firewall->name = 'myFirstFirewall';
$firewall->rules = $rules;
$result = $client->getFirewallService()->create($firewall);