DirectoryPolicy#

pydantic model nublado.purger.models.v1.policy.DirectoryPolicy#

Policy for purging objects from a directory and its children.

Parameters:

data (Any)

Show JSON schema
{
   "title": "DirectoryPolicy",
   "description": "Policy for purging objects from a directory and its children.",
   "type": "object",
   "properties": {
      "path": {
         "format": "path",
         "title": "Directory to consider for purging",
         "type": "string"
      },
      "threshold": {
         "title": "Size in bytes demarcating large from small files",
         "type": "integer"
      },
      "intervals": {
         "$ref": "#/$defs/SizedIntervals",
         "title": "Intervals before purging large and small files"
      }
   },
   "$defs": {
      "HumanTimedelta": {
         "format": "duration",
         "type": "string"
      },
      "Intervals": {
         "description": "Intervals specify how long it must have been since a filesystem object\nwas accessed, created, or modified before that object will be considered\nfor purging.  A value of None (or a zero TimeDelta) means the object will\nnot be considered for purging on the given grounds.",
         "properties": {
            "accessInterval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HumanTimedelta"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Maximum time since last file access"
            },
            "creationInterval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HumanTimedelta"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Maximum time since file creation"
            },
            "modificationInterval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HumanTimedelta"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Maximum time since file modification"
            }
         },
         "title": "Intervals",
         "type": "object"
      },
      "SizedIntervals": {
         "description": "Container to hold intervals for purging large and small files.",
         "properties": {
            "large": {
               "$ref": "#/$defs/Intervals",
               "default": {
                  "accessInterval": null,
                  "creationInterval": null,
                  "modificationInterval": null
               },
               "title": "Intervals before purging large files"
            },
            "small": {
               "$ref": "#/$defs/Intervals",
               "default": {
                  "accessInterval": null,
                  "creationInterval": null,
                  "modificationInterval": null
               },
               "title": "Intervals before purging small files"
            }
         },
         "title": "SizedIntervals",
         "type": "object"
      }
   },
   "required": [
      "path",
      "threshold",
      "intervals"
   ]
}

Fields:
field intervals: Annotated[SizedIntervals] [Required]#
field path: Annotated[Path] [Required]#
field threshold: Annotated[int] [Required]#
Constraints:
  • func = <function _validate_human_size_bytes at 0x7fdf862c9d20>

  • json_schema_input_type = PydanticUndefined

to_dict()#
Return type:

dict[str, Union[str, int, dict[str, dict[str, int]]]]