Lists all firewall rule IDs assigned to a policy.
PolicyFirewallRuleAssignmentsApi.listFirewallRuleIDsOnPolicy([param1, param2, ...])
PolicyFirewallRuleAssignmentsApi.list_firewall_rule_ids_on_policy([param1, param2, ...])
PolicyFirewallRuleAssignmentsApi.listFirewallRuleIDsOnPolicy([param1, param2, ...])
successful operation
Not authorized to view the policy.
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(); } } }
{- "assignedRuleIDs": [
- 0
]
}
Assign firewall rule IDs to a policy.
PolicyFirewallRuleAssignmentsApi.addFirewallRuleIDsToPolicy([param1, param2, ...])
PolicyFirewallRuleAssignmentsApi.add_firewall_rule_ids_to_policy([param1, param2, ...])
PolicyFirewallRuleAssignmentsApi.addFirewallRuleIDsToPolicy([param1, param2, ...])
The ID numbers of the firewall rules to add.
successful operation
Not authorized to modify the policy or the requested modification is not permitted.
The policy does not exist.
{- "ruleIDs": [
- 0
]
}
{- "assignedRuleIDs": [
- 0
]
}
Set firewall rule IDs assigned to a policy.
PolicyFirewallRuleAssignmentsApi.setFirewallRuleIDsOnPolicy([param1, param2, ...])
PolicyFirewallRuleAssignmentsApi.set_firewall_rule_ids_on_policy([param1, param2, ...])
PolicyFirewallRuleAssignmentsApi.setFirewallRuleIDsOnPolicy([param1, param2, ...])
The ID numbers of the firewall rules to set.
successful operation
Not authorized to modify the policy or the requested modification is not permitted.
The policy does not exist.
{- "ruleIDs": [
- 0
]
}
{- "assignedRuleIDs": [
- 0
]
}
Unassign a firewall rule ID from a policy.
PolicyFirewallRuleAssignmentsApi.removeFirewallRuleIDFromPolicy([param1, param2, ...])
PolicyFirewallRuleAssignmentsApi.remove_firewall_rule_id_from_policy([param1, param2, ...])
PolicyFirewallRuleAssignmentsApi.removeFirewallRuleIDFromPolicy([param1, param2, ...])
successful operation
Not authorized to modify the policy or the requested modification is not permitted.
The policy does not exist.
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(); } } }
{- "assignedRuleIDs": [
- 0
]
}