Policy methods

Overview

The XML API uses the policy package to define methods applicable for policies. Methods for policy distribution, setting modes, and synchronizing policies are provided by the policy.PolicyDefinition class. Methods for auditing policies are provided by the policy.Manager class. The most commonly used policy methods are described in the following table. See the XML API Reference for input parameters.

Table 18-8: Policy methods

Method

Description

policy.PolicyDefinition.setConfigurationModeToReleased

Set Configuration Mode Released and distribute the global policy to the local definitions network-wide. It is only applicable for the global policy. See   Figure 18-11, Configuration mode set request example for an example of the method.

policy.PolicyDefinition.setConfigurationModeToDraft

Set Configuration Mode to Draft. It is only applicable for the global policy.

policy.PolicyDefinition.setDistributionModeToSyncWithGlobal

Set Distribution Mode to Sync with Global for local policies on the sites specified by siteIds. It automatically synchronizes local policies with the most recent released global policy. If it is called from the local policy, only that local policy is updated. See Figure 18-12, Distribution mode set request example for an example of the method.

policy.PolicyDefinition.setDistributionModeToLocalEditOnly

Set Distribution Mode to local edit only for local policies on the sites specified by siteIds. If it is called from the local policy, only that local policy is updated. See Figure 18-9, Policy distribution mode request example for an example of the method.

policy.PolicyDefinition.resetToReleasedPolicy

Reset the global policy to the most recent released policy. The local policies aren’t affected. See Figure 18-13, Global policy reset request example for an example of the method.

policy.PolicyDefinition.syncTo

If it is called from global policy, the selected local policy is compied into this global policy. If Configuration Mode isn’t used, the synchronized global policy is distributed to existing local definitions network-wide. If it is called from the local policy, the selected local policy is copied into this local policy, and applied to the network.

The following are the mandatory XML parameter tags to set the configuration mode of a global policy:

The following figure shows a request to set the configuration mode of a global policy.

Figure 18-11: Configuration mode set request example
<policy.PolicyDefinition.setConfigurationModeToReleased xmlns="xmlapi_1.0">
   <deployer>immediate</deployer>
   <instanceFullName>Access Egress:99</instanceFullName>
</policy.PolicyDefinition.setConfigurationModeToReleased>

To set the mode to Draft, you must replace setConfigurationModeToReleased with setConfigurationModeToDraft.

The following are the mandatory XML parameter tags to set the distribution mode of a policy:

The following figure shows a request to set the distribution mode of a policy.

Figure 18-12: Distribution mode set request example
<policy.PolicyDefinition.setDistributionModeToSyncWithGlobal xmlns="xmlapi_1.0">
   <deployer>immediate</deployer>
   <instanceFullName>Access Egress:99</instanceFullName>
   <siteIds>
      <string>198.51.100.55</string>
   </siteIds>
</policy.PolicyDefinition.setDistributionModeToSyncWithGlobal>

The following example shows the minimum XML parameter tags required to reset a global policy to the most recent released.

Policy reset to released parameters

The following figure shows a request to reset a global policy to the most recent released.

Figure 18-13: Global policy reset request example
<policy.PolicyDefinition.resetToReleasedPolicy xmlns="xmlapi_1.0">
   <deployer>immediate</deployer>
   <instanceFullName>Access Egress:99</instanceFullName>
</policy.PolicyDefinition.resetToReleasedPolicy>

© 2023 Nokia. Nokia Confidential Information

Use subject to agreed restrictions on disclosure and use.