Custom rules and policies are defined in a file of XML format. Using this file, you can define how a particular conflict or all conflicts of a particular type should be resolved. The XML file contains two main sections: for policies and (optionally) for rules. The format of each section is described below.

Policies

The file should be structured as follows.

image 62549

  • conflict-resolution-rules Required. Document root element.
  • policy
  • Required. Contains the policy descriptions. Child elements, if present, must be placed in the order shown on the scheme.
    • timing Optional. Contains a description of the policy on resolving timing conflicts. See the structure below. Must be present in the document if a timing policy should be used during the restore. May not be present in the document if no policy is required for timing conflicts.
    • resource-usage Optional. Contains a description of the policy on resolving resource usage conflicts. See the structure below. Must be present in the document if a resource usage policy should be used during the restore. May not be present in the document if no policy is required for resource usage conflicts.
    • configuration Optional. Contains a description of the policy on resolving configuration conflicts. See the structure below. Must be present in the document if a configuration policy should be used during the restore. May not be present in the document if no policy is required for configuration conflicts.
  • rule Optional. Contains the rule descriptions. For details on the node structure, refer to the Rules section below.

The policy elements have the same structure:

image 62551 image 62553 image 62552

  • resolution
    Required. Contains a definition of conflict resolution. Structured as follows:

    image 62555

The resolution element must not be empty, it is required that it contains one, and only one of its child elements:

  • do-not-restore Sets the Do Not Restore resolution, empty value.
  • proceed-with-current Sets the Proceed With Current resolution, empty value.
  • automatic Sets the Automatic resolution, empty value.
  • overuse Sets the Overuse resolution, empty value.
  • overwrite Sets the Overwrite resolution, empty value.
  • rename Sets the Rename resolution, empty value.
    • new-name Required. Makes sense only if defined for configuration conflicts. Specifies the name of a new configuration that should be assigned to all conflict objects. The value must be a string.

The samples of policy description can be found here.

Rules

The file should be structured as follows.

image 63394

  • conflict-resolution-rules Required. Document root element.

    • policy Required. Contains the policy descriptions. For details on the node format, refer to the Policies section above. The element content must reflect the conditions under which the conflicts were detected.

    • rule
      Optional. Contains a rule description.
      Must be present in the document when defining conflict resolution rules. Should be present as many times as the number of unresolved conflicts.

      At least one of the attributes (conflict-id, conflict-guid) MUST be present.

      • conflict-id Optional. Defines the ID of the conflict being resolved. Value is an integer. The ID should be obtained from the conflict description returned by pleskrestore (the “/conflicts-description/conflict[@id]” attribute value)
      • conflict-guid Optional. Defines the global ID of the conflict being resolved. Value is a string. The GUID should be obtained from the conflict description returned by pleskrestore (the “/conflicts-description/conflict[@guid]” attribute value). If omitted, the conflict for resolution is identified by ID.
      • dump-objects Optional. Holds a collection of descriptions of backup objects involved in the conflict and having the same conflict resolution Must be present in the document in case when different objects involved in the same conflict should be resolved in different ways. May not be present in the document in cases when all objects involved in the conflict should be resolved the same way. See the structure below.
      • resolution Required. Contains a definition of the resolution of the conflict. See the structure below.

dump-objects structure:

image 62558

  • node
    Required. Contains a description of the backup object involved in the conflict.
    The element contents must be taken from the conflict description returned by pleskrestore (the “/conflicts-description/conflict/conflicting-objects/node” element).
    Structured as follows:

    image 62561

  • name Required. Specifies the object type. Value must be a string.

  • context Optional. Holds a collection of data specifying the object position in the backup.

    • path Required if the context element is present in the document. Specifies the location of the object definition in the backup metadata. Value must be a string conforming to the XPath notation.
  • attributes Required, holds a collection of the object properties.

    • attribute Required. Specifies a particular property of the object (e.g., login, ID, GUID, etc.), empty value.
      • name Required. Specifies the property name. Value must be a string.
      • value Required. Specifies the property value. Value must be a string.

resolution structure:

image 62555

The resolution element must not be empty. It is required that it contains one, and only one of its child elements:

  • do-not-restore Sets the Do Not Restore resolution for the conflict, empty value.
  • proceed-with-current Sets the Proceed With Current resolution for the conflict, empty value.
  • automatic Sets the Automatic resolution for the conflict, empty value.
  • overuse Sets the Overuse resolution for the conflict, empty value.
  • overwrite Sets the Overwrite resolution for the conflict, empty value.
  • rename Sets the Rename resolution for the conflict, empty value.
    • new-name Required. Specifies the name of a unique resource that should be assigned to the conflicting objects. Value must be a string. Makes sense only for unique resource usage conflicts (mapping of IP, database server, object owner).