Policy Firewall Rule Assignments

List Firewall Rule IDs

get/policies/{policyID}/firewall/assignments

Lists all firewall rule IDs assigned to a policy.

Related SDK Methods:
Java

PolicyFirewallRuleAssignmentsApi.listFirewallRuleIDsOnPolicy([param1, param2, ...])

Python

PolicyFirewallRuleAssignmentsApi.list_firewall_rule_ids_on_policy([param1, param2, ...])

JavaScript

PolicyFirewallRuleAssignmentsApi.listFirewallRuleIDsOnPolicy([param1, param2, ...])

Request
path Parameters
policyID
required
integer <int32> \d+

The ID number of the policy.

Example: 1
query Parameters
overrides
boolean

Return only rule IDs assigned directly to the current policy.

header Parameters
api-version
required
string

The version of the api being called.

Example: YOUR VERSION
Responses
200

successful operation

403

Not authorized to view the policy.

Request samples
import com.trendmicro.deepsecurity.ApiClient;
import com.trendmicro.deepsecurity.Configuration;
import com.trendmicro.deepsecurity.auth.ApiKeyAuth;
import com.trendmicro.deepsecurity.ApiException;
import com.trendmicro.deepsecurity.api.PolicyFirewallRuleAssignmentsApi;
import com.trendmicro.deepsecurity.model.FirewallAssignments;


public class ListFirewallRuleIDsOnPolicyExample {
	
	public static void main(String[] args) {
		// Setup
		ApiClient defaultClient = Configuration.getDefaultApiClient();
		defaultClient.setBasePath("YOUR HOST");

		// Authentication
		ApiKeyAuth DefaultAuthentication = (ApiKeyAuth) defaultClient.getAuthentication("DefaultAuthentication");
		DefaultAuthentication.setApiKey("YOUR API KEY");
		try {
			defaultClient.trustAllCertificates(false);
		} catch (Exception e) {
			System.err.println("An exception occurred when calling ApiClient.trustAllCertificates");
			e.printStackTrace();
		}
		
		// Initialization
		// Set Any Required Values
		PolicyFirewallRuleAssignmentsApi instance = new PolicyFirewallRuleAssignmentsApi();
		Integer policyID = 1;
		Boolean overrides = false;
		String apiVersion = "YOUR VERSION";
		try {
			// Please replace the parameter values with yours
			FirewallAssignments result = instance.listFirewallRuleIDsOnPolicy(policyID, overrides, apiVersion);
			System.out.println(result);
		} catch (ApiException e) {
			System.err.println("An exception occurred when calling PolicyFirewallRuleAssignmentsApi.listFirewallRuleIDsOnPolicy");
			e.printStackTrace();
		}
	}
}

Response samples
application/json
{
  • "assignedRuleIDs": [
    ]
}

Add Firewall Rule IDs

post/policies/{policyID}/firewall/assignments

Assign firewall rule IDs to a policy.

Related SDK Methods:
Java

PolicyFirewallRuleAssignmentsApi.addFirewallRuleIDsToPolicy([param1, param2, ...])

Python

PolicyFirewallRuleAssignmentsApi.add_firewall_rule_ids_to_policy([param1, param2, ...])

JavaScript

PolicyFirewallRuleAssignmentsApi.addFirewallRuleIDsToPolicy([param1, param2, ...])

Request
path Parameters
policyID
required
integer <int32> \d+

The ID number of the policy.

Example: 1
query Parameters
overrides
boolean

Return only rule IDs assigned directly to the current policy.

header Parameters
api-version
required
string

The version of the api being called.

Example: YOUR VERSION
Request Body schema: application/json

The ID numbers of the firewall rules to add.

ruleIDs
Array of integers <int32>
Responses
200

successful operation

403

Not authorized to modify the policy or the requested modification is not permitted.

404

The policy does not exist.

Request samples
application/json
{
  • "ruleIDs": [
    ]
}
Response samples
application/json
{
  • "assignedRuleIDs": [
    ]
}

Set Firewall Rule IDs

put/policies/{policyID}/firewall/assignments

Set firewall rule IDs assigned to a policy.

Related SDK Methods:
Java

PolicyFirewallRuleAssignmentsApi.setFirewallRuleIDsOnPolicy([param1, param2, ...])

Python

PolicyFirewallRuleAssignmentsApi.set_firewall_rule_ids_on_policy([param1, param2, ...])

JavaScript

PolicyFirewallRuleAssignmentsApi.setFirewallRuleIDsOnPolicy([param1, param2, ...])

Request
path Parameters
policyID
required
integer <int32> \d+

The ID number of the policy.

Example: 1
query Parameters
overrides
boolean

Return only rule IDs assigned directly to the current policy.

header Parameters
api-version
required
string

The version of the api being called.

Example: YOUR VERSION
Request Body schema: application/json

The ID numbers of the firewall rules to set.

ruleIDs
Array of integers <int32>
Responses
200

successful operation

403

Not authorized to modify the policy or the requested modification is not permitted.

404

The policy does not exist.

Request samples
application/json
{
  • "ruleIDs": [
    ]
}
Response samples
application/json
{
  • "assignedRuleIDs": [
    ]
}

Remove a Firewall Rule ID

delete/policies/{policyID}/firewall/assignments/{firewallRuleID}

Unassign a firewall rule ID from a policy.

Related SDK Methods:
Java

PolicyFirewallRuleAssignmentsApi.removeFirewallRuleIDFromPolicy([param1, param2, ...])

Python

PolicyFirewallRuleAssignmentsApi.remove_firewall_rule_id_from_policy([param1, param2, ...])

JavaScript

PolicyFirewallRuleAssignmentsApi.removeFirewallRuleIDFromPolicy([param1, param2, ...])

Request
path Parameters
firewallRuleID
required
integer <int32> \d+

The ID number of the firewall rule to delete.

Example: 1
policyID
required
integer <int32> \d+

The ID number of the policy.

Example: 1
query Parameters
overrides
boolean

Return only rule IDs assigned directly to the current policy.

header Parameters
api-version
required
string

The version of the api being called.

Example: YOUR VERSION
Responses
200

successful operation

403

Not authorized to modify the policy or the requested modification is not permitted.

404

The policy does not exist.

Request samples
import com.trendmicro.deepsecurity.ApiClient;
import com.trendmicro.deepsecurity.Configuration;
import com.trendmicro.deepsecurity.auth.ApiKeyAuth;
import com.trendmicro.deepsecurity.ApiException;
import com.trendmicro.deepsecurity.api.PolicyFirewallRuleAssignmentsApi;
import com.trendmicro.deepsecurity.model.FirewallAssignments;


public class RemoveFirewallRuleIDFromPolicyExample {
	
	public static void main(String[] args) {
		// Setup
		ApiClient defaultClient = Configuration.getDefaultApiClient();
		defaultClient.setBasePath("YOUR HOST");

		// Authentication
		ApiKeyAuth DefaultAuthentication = (ApiKeyAuth) defaultClient.getAuthentication("DefaultAuthentication");
		DefaultAuthentication.setApiKey("YOUR API KEY");
		try {
			defaultClient.trustAllCertificates(false);
		} catch (Exception e) {
			System.err.println("An exception occurred when calling ApiClient.trustAllCertificates");
			e.printStackTrace();
		}
		
		// Initialization
		// Set Any Required Values
		PolicyFirewallRuleAssignmentsApi instance = new PolicyFirewallRuleAssignmentsApi();
		Integer policyID = 1;
		Integer firewallRuleID = 1;
		Boolean overrides = false;
		String apiVersion = "YOUR VERSION";
		try {
			// Please replace the parameter values with yours
			FirewallAssignments result = instance.removeFirewallRuleIDFromPolicy(policyID, firewallRuleID, overrides, apiVersion);
			System.out.println(result);
		} catch (ApiException e) {
			System.err.println("An exception occurred when calling PolicyFirewallRuleAssignmentsApi.removeFirewallRuleIDFromPolicy");
			e.printStackTrace();
		}
	}
}

Response samples
application/json
{
  • "assignedRuleIDs": [
    ]
}