• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Neutron
  5. Firewall as a Service
  6. Insert firewall rule in firewall policy

Insert firewall rule in firewall policy

Function Description

This interface is used to insert a firewall rule into a firewall policy.

Interface Format

Method

URI

Description

PUT

/v2.0/fwaas/firewall_policies/{firewall_policy_id}/insert_rule

Inserts a firewall rule into the specified firewall policy.

Restrictions

N/A

Request Parameter

Parameter

Type

Mandatory

Description

firewall_policy_id

String

Yes

Specifies the firewall policy ID.

firewall_rule_id

String

Yes

Specifies the firewall rule ID.

insert_after

String

No

Specifies a rule that is associated with a firewall policy. The new rule is inserted after the rule specified by the parameter. If both insert_after and insert_before are set, insert_before prevails.

insert_before

String

No

Specifies a rule that is associated with a firewall policy. The new rule is inserted before the rule specified by the parameter. If both insert_after and insert_before are set, insert_before prevails.

Response Parameter

Parameter

Type

Mandatory

Description

description

String

Yes

Specifies the policy description.

audited

Boolean

Yes

This parameter is set to False once the policy or related rule changes.

firewall_rules

List

Yes

Specifies the list of IDs of rules associated with the policy.

id

String

Yes

Specifies the policy ID.

name

String

Yes

Specifies the policy name.

public

Boolean

Yes

If this parameter is set to True, firewall policies for other items are available. By default, the value is False.

tenant_id

String

Yes

Specifies the tenant ID.

Request Example

PUT /v2.0/fwaas/firewall_policies/afc52ce9-5305-4ec9-9feb-44feb8330341/insert_rule 

{

"insert_after": "b8243448-cb3c-496e-851c-dadade4c161b",

"firewall_rule_id": "0f82b221-8cd6-44bd-9dfc-0e118fa7b6b1",

"insert_before": ""

}

Response Example

{
    "description": "",
    "firewall_rules": [
        "b8243448-cb3c-496e-851c-dadade4c161b",
        "0f82b221-8cd6-44bd-9dfc-0e118fa7b6b1"
    ],
    "tenant_id": "23c8a121505047b6869edf39f3062712",
    "public": false,
    "id": "afc52ce9-5305-4ec9-9feb-44feb8330341",
    "audited": false,
    "name": "test-policy"
}

Error Code

For details, see section Return Code Processing.