Resource URL: /platform/<<version=1>>/worm/domains

    Overview: This resource applies the standard collection pattern for OneFS
              WORM domains.

     Methods: GET, POST

********************************************************************************

Method GET: List all WORM domains.

       URL: GET /platform/<<version=1>>/worm/domains

Query arguments:
  sort=<string> The field that will be used for sorting.
limit=<integer> Return no more than this many results at once (see resume).
     dir=<enum> Where <enum> is one of ASC, DESC.  The direction of the sort.
resume=<string> Continue returning results from previous call using this token
                (token should come from the previous call, resume cannot be
                used with other options).

GET response body schema:
{
  "type": [
    {
      "additionalProperties": false, 
      "type": "object", 
      "description": "A list of errors that may be returned.", 
      "properties": {
        "errors": {
          "items": {
            "additionalProperties": false, 
            "type": "object", 
            "description": "An object describing a single error.", 
            "properties": {
              "field": {
                "type": "string", 
                "description": "The field with the error if applicable."
              }, 
              "message": {
                "type": "string", 
                "description": "The error message."
              }, 
              "code": {
                "type": "string", 
                "description": "The error code."
              }
            }
          }, 
          "type": "array"
        }
      }
    }, 
    {
      "additionalProperties": false, 
      "type": "object", 
      "properties": {
        "domains": {
          "minItems": 0, 
          "items": {
            "type": "object", 
            "properties": {
              "override_date": {
                "minimum": 0, 
                "type": [
                  "integer", 
                  "null"
                ], 
                "description": "Specifies the override retention date for the domain. If this date is later than the retention date for any committed file, the file will remain protected until the override retention date.", 
                "required": true
              }, 
              "lin": {
                "required": true, 
                "type": "integer", 
                "description": "Specifies the logical inode number (LIN) for the root of this domain."
              }, 
              "max_modifies": {
                "required": true, 
                "type": "integer", 
                "description": "Specifies the maximum amount of time, in seconds, that a file in this domain will be protected. This setting will override the retention period of any file committed with a longer retention period. If this parameter is set to null, an infinite length retention period is set."
              }, 
              "total_modifies": {
                "required": true, 
                "type": "integer", 
                "description": "Specifies the number of times this domain has been modified and the number of times the attributes for the domain have changed. A SmartLock domain can be modified a fixed number of times as defined by the 'max_modifies' parameter."
              }, 
              "autocommit_offset": {
                "minimum": 0, 
                "type": [
                  "integer", 
                  "null"
                ], 
                "description": "Specifies the autocommit time period for the domain in seconds.  After a file is in the domain without being modified for the specified time period, the file is automatically committed. If this parameter is set to null, there is no autocommit time, and files must be committed manually.", 
                "required": true
              }, 
              "privileged_delete": {
                "enum": [
                  "on", 
                  "off", 
                  "disabled"
                ], 
                "type": "string", 
                "description": "When this value is set to 'on', files in this domain can be deleted through the privileged delete feature. If this value is set to 'disabled', privileged file deletes are permanently disabled and cannot be turned on again.", 
                "required": true
              }, 
              "max_retention": {
                "minimum": 0, 
                "type": [
                  "integer", 
                  "null", 
                  {
                    "enum": [
                      "forever"
                    ], 
                    "type": "string"
                  }
                ], 
                "description": "Specifies the maximum amount of time, in seconds, that a file in this domain will be protected. This setting will override the retention period of any file committed with a longer retention period. If this parameter is set to null, an infinite length retention period is set.", 
                "required": true
              }, 
              "default_retention": {
                "minimum": 0, 
                "type": [
                  "integer", 
                  "null", 
                  {
                    "enum": [
                      "use_min", 
                      "use_max", 
                      "forever"
                    ], 
                    "type": "string"
                  }
                ], 
                "description": "Specifies the default amount of time, in seconds, that a file in this domain will be protected for. The default retention period is applied if no retention date is manually set on the file. This parameter can also be set to 'forever', 'use_min' (which applies the 'min_retention' option), or 'use_max' (which applies the 'max_retention' option).", 
                "required": true
              }, 
              "min_retention": {
                "minimum": 0, 
                "type": [
                  "integer", 
                  "null", 
                  {
                    "enum": [
                      "forever"
                    ], 
                    "type": "string"
                  }
                ], 
                "description": "Specifies the minimum amount of time, in seconds, that a file in this domain will be protected. This setting will override the retention period of any file committed with a shorter retention period. If this parameter is set to null, this minimum value is not enforced. This parameter can also be set to 'forever'.", 
                "required": true
              }, 
              "path": {
                "required": true, 
                "type": "string", 
                "description": "Specifies the root path of this domain. Files in this directory and all sub-directories will be protected."
              }, 
              "type": {
                "enum": [
                  "enterprise", 
                  "compliance", 
                  "compliance (legacy)"
                ], 
                "type": "string", 
                "description": "Specifies whether the domain is an enterprise domain or a compliance domain. Compliance domains can not be created on enterprise clusters. Enterprise and compliance domains can be created on compliance clusters.", 
                "required": true
              }, 
              "id": {
                "required": true, 
                "type": "integer", 
                "description": "Specifies the system-assigned ID for the protection domain."
              }, 
              "incomplete": {
                "required": true, 
                "type": "boolean", 
                "description": "True if OneFS is still in the process of creating this domain and is unable to prevent files from being modified or deleted. If false, indicates that the domain is fully created and is able to prevent files from being modified or deleted."
              }
            }
          }, 
          "type": "array", 
          "maxItems": 4294967295
        }, 
        "total": {
          "minimum": 0, 
          "type": "integer", 
          "description": "Total number of items available.", 
          "maximum": 4294967295
        }, 
        "resume": {
          "minLength": 0, 
          "type": [
            "string", 
            "null"
          ], 
          "description": "Continue returning results from previous call using this token (token should come from the previous call, resume cannot be used with other options)."
        }
      }
    }
  ]
}

********************************************************************************

Method POST: Create a WORM domain.

        URL: POST /platform/<<version=1>>/worm/domains

There are no query arguments for this method.

Required POST request body fields:
path

POST request body schema:
{
  "type": "object", 
  "properties": {
    "override_date": {
      "minimum": 0, 
      "type": [
        "integer", 
        "null"
      ], 
      "description": "Specifies the override retention date for the domain. If this date is later than the retention date for any committed file, the file will remain protected until the override retention date."
    }, 
    "min_retention": {
      "minimum": 0, 
      "type": [
        "integer", 
        "null", 
        {
          "enum": [
            "forever"
          ], 
          "type": "string"
        }
      ], 
      "description": "Specifies the minimum amount of time, in seconds, that a file in this domain will be protected. This setting will override the retention period of any file committed with a shorter retention period. If this parameter is set to null, this minimum value is not enforced. This parameter can also be set to 'forever'."
    }, 
    "autocommit_offset": {
      "minimum": 0, 
      "type": [
        "integer", 
        "null"
      ], 
      "description": "Specifies the autocommit time period for the domain in seconds.  After a file is in the domain without being modified for the specified time period, the file is automatically committed. If this parameter is set to null, there is no autocommit time, and files must be committed manually."
    }, 
    "privileged_delete": {
      "enum": [
        "on", 
        "off", 
        "disabled"
      ], 
      "type": "string", 
      "description": "When this value is set to 'on', files in this domain can be deleted through the privileged delete feature. If this value is set to 'disabled', privileged file deletes are permanently disabled and cannot be turned on again."
    }, 
    "max_retention": {
      "minimum": 0, 
      "type": [
        "integer", 
        "null", 
        {
          "enum": [
            "forever"
          ], 
          "type": "string"
        }
      ], 
      "description": "Specifies the maximum amount of time, in seconds, that a file in this domain will be protected. This setting will override the retention period of any file committed with a longer retention period. If this parameter is set to null, an infinite length retention period is set."
    }, 
    "default_retention": {
      "minimum": 0, 
      "type": [
        "integer", 
        "null", 
        {
          "enum": [
            "use_min", 
            "use_max", 
            "forever"
          ], 
          "type": "string"
        }
      ], 
      "description": "Specifies the default amount of time, in seconds, that a file in this domain will be protected for. The default retention period is applied if no retention date is manually set on the file. This parameter can also be set to 'forever', 'use_min' (which applies the 'min_retention' option), or 'use_max' (which applies the 'max_retention' option)."
    }, 
    "path": {
      "required": true, 
      "type": "string", 
      "description": "Specifies the root path of this domain. Files in this directory and all sub-directories will be protected."
    }, 
    "type": {
      "enum": [
        "enterprise", 
        "compliance", 
        "compliance (legacy)"
      ], 
      "type": "string", 
      "description": "Specifies whether the domain is an enterprise domain or a compliance domain. Compliance domains can not be created on enterprise clusters. Enterprise and compliance domains can be created on compliance clusters."
    }
  }
}

POST response body schema:
{
  "type": [
    {
      "additionalProperties": false, 
      "type": "object", 
      "description": "A list of errors that may be returned.", 
      "properties": {
        "errors": {
          "items": {
            "additionalProperties": false, 
            "type": "object", 
            "description": "An object describing a single error.", 
            "properties": {
              "field": {
                "type": "string", 
                "description": "The field with the error if applicable."
              }, 
              "message": {
                "type": "string", 
                "description": "The error message."
              }, 
              "code": {
                "type": "string", 
                "description": "The error code."
              }
            }
          }, 
          "type": "array"
        }
      }
    }, 
    {
      "type": "object", 
      "properties": {
        "override_date": {
          "minimum": 0, 
          "type": [
            "integer", 
            "null"
          ], 
          "description": "Specifies the override retention date for the domain. If this date is later than the retention date for any committed file, the file will remain protected until the override retention date.", 
          "required": true
        }, 
        "lin": {
          "required": true, 
          "type": "integer", 
          "description": "Specifies the logical inode number (LIN) for the root of this domain."
        }, 
        "max_modifies": {
          "required": true, 
          "type": "integer", 
          "description": "Specifies the maximum amount of time, in seconds, that a file in this domain will be protected. This setting will override the retention period of any file committed with a longer retention period. If this parameter is set to null, an infinite length retention period is set."
        }, 
        "total_modifies": {
          "required": true, 
          "type": "integer", 
          "description": "Specifies the number of times this domain has been modified and the number of times the attributes for the domain have changed. A SmartLock domain can be modified a fixed number of times as defined by the 'max_modifies' parameter."
        }, 
        "autocommit_offset": {
          "minimum": 0, 
          "type": [
            "integer", 
            "null"
          ], 
          "description": "Specifies the autocommit time period for the domain in seconds.  After a file is in the domain without being modified for the specified time period, the file is automatically committed. If this parameter is set to null, there is no autocommit time, and files must be committed manually.", 
          "required": true
        }, 
        "privileged_delete": {
          "enum": [
            "on", 
            "off", 
            "disabled"
          ], 
          "type": "string", 
          "description": "When this value is set to 'on', files in this domain can be deleted through the privileged delete feature. If this value is set to 'disabled', privileged file deletes are permanently disabled and cannot be turned on again.", 
          "required": true
        }, 
        "max_retention": {
          "minimum": 0, 
          "type": [
            "integer", 
            "null", 
            {
              "enum": [
                "forever"
              ], 
              "type": "string"
            }
          ], 
          "description": "Specifies the maximum amount of time, in seconds, that a file in this domain will be protected. This setting will override the retention period of any file committed with a longer retention period. If this parameter is set to null, an infinite length retention period is set.", 
          "required": true
        }, 
        "default_retention": {
          "minimum": 0, 
          "type": [
            "integer", 
            "null", 
            {
              "enum": [
                "use_min", 
                "use_max", 
                "forever"
              ], 
              "type": "string"
            }
          ], 
          "description": "Specifies the default amount of time, in seconds, that a file in this domain will be protected for. The default retention period is applied if no retention date is manually set on the file. This parameter can also be set to 'forever', 'use_min' (which applies the 'min_retention' option), or 'use_max' (which applies the 'max_retention' option).", 
          "required": true
        }, 
        "min_retention": {
          "minimum": 0, 
          "type": [
            "integer", 
            "null", 
            {
              "enum": [
                "forever"
              ], 
              "type": "string"
            }
          ], 
          "description": "Specifies the minimum amount of time, in seconds, that a file in this domain will be protected. This setting will override the retention period of any file committed with a shorter retention period. If this parameter is set to null, this minimum value is not enforced. This parameter can also be set to 'forever'.", 
          "required": true
        }, 
        "path": {
          "required": true, 
          "type": "string", 
          "description": "Specifies the root path of this domain. Files in this directory and all sub-directories will be protected."
        }, 
        "type": {
          "enum": [
            "enterprise", 
            "compliance", 
            "compliance (legacy)"
          ], 
          "type": "string", 
          "description": "Specifies whether the domain is an enterprise domain or a compliance domain. Compliance domains can not be created on enterprise clusters. Enterprise and compliance domains can be created on compliance clusters.", 
          "required": true
        }, 
        "id": {
          "required": true, 
          "type": "integer", 
          "description": "Specifies the system-assigned ID for the protection domain."
        }, 
        "incomplete": {
          "required": true, 
          "type": "boolean", 
          "description": "True if OneFS is still in the process of creating this domain and is unable to prevent files from being modified or deleted. If false, indicates that the domain is fully created and is able to prevent files from being modified or deleted."
        }
      }
    }
  ]
}
