Deleting a Policy with Identifier
This endpoint deletes the specified policy using Policy Identifier Parameters. No exclusion filters are created.
DELETE /openapi/v1/policies/destroy_with_identifier
The query body consists of a JSON body with the following schema:
Name |
Type |
Description |
---|---|---|
application_id |
string |
The ID of the application workspace. |
policy_identifier |
object |
Fields that make up the consistent policy identifier. |
The policy identifier fields are made up using the following schema:
Name |
Type |
Description |
---|---|---|
version |
string |
(optional) 'v' version of the application workspace in which to perform the delete operation; defaults to the latest 'v' version of the workspace when unspecified. |
consumer_consistent_uuid |
string |
Consistent UUID of the consumer or source |
provider_consistent_uuid |
string |
Consistent UUID of the provider or destination |
rank |
string |
Policy rank has to be one of “DEFAULT” or “ABSOUTE” |
action |
string |
Policy action has to be one of “ALLOW” or “DENY” |
priority |
integer |
Priority value for the policy |
protocol |
integer |
IP protocol number (0-255) for the policy |
start_port |
integer |
(optional) Start of port range (0-65535); defaults to 0 when unspecified |
end_port |
integer |
(optional) End of port range (0-65535); defaults to 65535 if start_port is 0 or else to the start_prot |
Sample Python code
application_id = '5f88ca1e755f0222f85ce85c'
consumer_id = '5f88ca1e755f0222f85ce85d'
provider_id = '5f88ca1e755f0222f85ce85d'
action = 'ALLOW'
rank = 'DEFAULT'
protocol = 6
start_port = 80
priority = 100
version = '5'
req_body = f'''
{{
"application_id": "{application_id}",
"policy_identifier": {{
"consumer_consistent_uuid": "{consumer_id}",
"provider_consistent_uuid": "{provider_id}",
"rank": "{rank}",
"priority": {priority},
"action": "{action}",
"protocol": "{protocol}",
"start_port": "{start_port}",
"version": "{version}"
}}
}}'''
restclient.delete('/policies/destroy_with_identifier', json_body=req_body)