Skip to content

Instantly share code, notes, and snippets.

@sevein
Last active May 12, 2024 04:58
Show Gist options
  • Save sevein/379f101ab9305235844c1e5101eeba04 to your computer and use it in GitHub Desktop.
Save sevein/379f101ab9305235844c1e5101eeba04 to your computer and use it in GitHub Desktop.
Archivematica Storage Service API - TastyPie schema
{
"async": {
"list_endpoint": "/api/v2/async/",
"schema": {
"allowed_detail_http_methods": [
"get"
],
"allowed_list_http_methods": [
"get",
"post",
"put",
"delete",
"patch"
],
"default_format": "application/json",
"default_limit": 20,
"fields": {
"completed": {
"blank": false,
"default": false,
"help_text": "True if this task has finished.",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "boolean",
"unique": false,
"verbose_name": "Completed"
},
"completed_time": {
"blank": false,
"default": "No default provided.",
"help_text": "A date & time as a string. Ex: \"2010-11-10T03:07:43\"",
"nullable": true,
"primary_key": false,
"readonly": false,
"type": "datetime",
"unique": false,
"verbose_name": "completed time"
},
"created_time": {
"blank": true,
"default": true,
"help_text": "A date & time as a string. Ex: \"2010-11-10T03:07:43\"",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "datetime",
"unique": false,
"verbose_name": "created time"
},
"id": {
"blank": true,
"default": "",
"help_text": "Integer data. Ex: 2673",
"nullable": false,
"primary_key": true,
"readonly": false,
"type": "integer",
"unique": true,
"verbose_name": "ID"
},
"resource_uri": {
"blank": false,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"primary_key": false,
"readonly": true,
"type": "string",
"unique": false,
"verbose_name": "resource uri"
},
"updated_time": {
"blank": true,
"default": true,
"help_text": "A date & time as a string. Ex: \"2010-11-10T03:07:43\"",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "datetime",
"unique": false,
"verbose_name": "updated time"
},
"was_error": {
"blank": false,
"default": false,
"help_text": "True if this task threw an exception.",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "boolean",
"unique": false,
"verbose_name": "Was there an exception?"
}
}
}
},
"file": {
"list_endpoint": "/api/v2/file/",
"schema": {
"allowed_detail_http_methods": [
"get",
"put",
"patch"
],
"allowed_list_http_methods": [
"get",
"post"
],
"default_format": "application/json",
"default_limit": 20,
"fields": {
"current_full_path": {
"blank": false,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"primary_key": false,
"readonly": true,
"type": "string",
"unique": false,
"verbose_name": "current full path"
},
"current_location": {
"blank": false,
"default": "No default provided.",
"help_text": "A single related resource. Can be either a URI or set of nested resource data.",
"nullable": false,
"primary_key": false,
"readonly": false,
"related_schema": "/api/v2/location/schema/",
"related_type": "to_one",
"type": "related",
"unique": false,
"verbose_name": "current location"
},
"current_path": {
"blank": false,
"default": "",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "current path"
},
"misc_attributes": {
"blank": false,
"default": {},
"help_text": "For storing flexible, often Space-specific, attributes",
"nullable": true,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "misc attributes"
},
"origin_location": {
"blank": false,
"default": "No default provided.",
"help_text": "A single related resource. Can be either a URI or set of nested resource data.",
"nullable": false,
"primary_key": false,
"readonly": false,
"related_schema": "/api/v2/location/schema/",
"related_type": "to_one",
"type": "related",
"unique": false,
"verbose_name": "origin location"
},
"origin_path": {
"blank": false,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "origin path"
},
"origin_pipeline": {
"blank": false,
"default": "No default provided.",
"help_text": "A single related resource. Can be either a URI or set of nested resource data.",
"nullable": false,
"primary_key": false,
"readonly": false,
"related_schema": "/api/v2/pipeline/schema/",
"related_type": "to_one",
"type": "related",
"unique": false,
"verbose_name": "origin pipeline"
},
"package_type": {
"blank": false,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "package type"
},
"related_packages": {
"blank": false,
"default": "No default provided.",
"help_text": "Many related resources. Can be either a list of URIs or list of individually nested resource data.",
"nullable": true,
"primary_key": false,
"readonly": false,
"related_schema": "/api/v2/file/schema/",
"related_type": "to_many",
"type": "related",
"unique": false,
"verbose_name": "related packages"
},
"replicas": {
"blank": true,
"default": "No default provided.",
"help_text": "Many related resources. Can be either a list of URIs or list of individually nested resource data.",
"nullable": true,
"primary_key": false,
"readonly": true,
"related_schema": "/api/v2/file/schema/",
"related_type": "to_many",
"type": "related",
"unique": false,
"verbose_name": "replicas"
},
"replicated_package": {
"blank": true,
"default": "No default provided.",
"help_text": "A single related resource. Can be either a URI or set of nested resource data.",
"nullable": true,
"primary_key": false,
"readonly": true,
"related_schema": "/api/v2/file/schema/",
"related_type": "to_one",
"type": "related",
"unique": false,
"verbose_name": "replicated package"
},
"resource_uri": {
"blank": false,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"primary_key": false,
"readonly": true,
"type": "string",
"unique": false,
"verbose_name": "resource uri"
},
"size": {
"blank": false,
"default": 0,
"help_text": "Size in bytes of the package",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "integer",
"unique": false,
"verbose_name": "size"
},
"status": {
"blank": false,
"default": "FAIL",
"help_text": "Status of the package in the storage service.",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "status"
},
"stored_date": {
"blank": false,
"default": null,
"help_text": "Datetime when package is successfully stored",
"nullable": true,
"primary_key": false,
"readonly": false,
"type": "datetime",
"unique": false,
"verbose_name": "stored date"
},
"uuid": {
"blank": false,
"default": "3d9bf978-89dc-437f-97cc-269eb3fec947",
"help_text": "Unique identifier",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": true,
"verbose_name": "uuid"
}
},
"filtering": {
"current_location": 2,
"package_type": 1,
"path": 1,
"related_packages": 2,
"status": 1,
"stored_date": 1,
"uuid": 1
}
}
},
"location": {
"list_endpoint": "/api/v2/location/",
"schema": {
"allowed_detail_http_methods": [
"get",
"post"
],
"allowed_list_http_methods": [
"get",
"post"
],
"default_format": "application/json",
"default_limit": 20,
"fields": {
"description": {
"blank": false,
"default": null,
"help_text": "Human-readable description.",
"nullable": true,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "Description"
},
"enabled": {
"blank": false,
"default": true,
"help_text": "True if space can be accessed.",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "boolean",
"unique": false,
"verbose_name": "Enabled"
},
"path": {
"blank": false,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"primary_key": false,
"readonly": true,
"type": "string",
"unique": false,
"verbose_name": "path"
},
"pipeline": {
"blank": false,
"default": "No default provided.",
"help_text": "Many related resources. Can be either a list of URIs or list of individually nested resource data.",
"nullable": false,
"primary_key": false,
"readonly": false,
"related_schema": "/api/v2/pipeline/schema/",
"related_type": "to_many",
"type": "related",
"unique": false,
"verbose_name": "pipeline"
},
"purpose": {
"blank": false,
"default": "No default provided.",
"help_text": "Purpose of the space. Eg. AIP storage, Transfer source",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "Purpose"
},
"quota": {
"blank": false,
"default": null,
"help_text": "Size, in bytes (optional)",
"nullable": true,
"primary_key": false,
"readonly": false,
"type": "integer",
"unique": false,
"verbose_name": "Quota"
},
"relative_path": {
"blank": false,
"default": "",
"help_text": "Path to location, relative to the storage space's path.",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "Relative Path"
},
"resource_uri": {
"blank": false,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"primary_key": false,
"readonly": true,
"type": "string",
"unique": false,
"verbose_name": "resource uri"
},
"space": {
"blank": false,
"default": "No default provided.",
"help_text": "A single related resource. Can be either a URI or set of nested resource data.",
"nullable": false,
"primary_key": false,
"readonly": false,
"related_schema": "/api/v2/space/schema/",
"related_type": "to_one",
"type": "related",
"unique": false,
"verbose_name": "space"
},
"used": {
"blank": false,
"default": 0,
"help_text": "Amount used, in bytes.",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "integer",
"unique": false,
"verbose_name": "Used"
},
"uuid": {
"blank": false,
"default": "589906e2-b404-4247-85e7-6bf4021824ae",
"help_text": "Unique identifier",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": true,
"verbose_name": "uuid"
}
},
"filtering": {
"description": 1,
"pipeline": 2,
"purpose": 1,
"quota": 1,
"relative_path": 1,
"space": 2,
"used": 1,
"uuid": 1
}
}
},
"pipeline": {
"list_endpoint": "/api/v2/pipeline/",
"schema": {
"allowed_detail_http_methods": [
"get"
],
"allowed_list_http_methods": [
"get",
"post"
],
"default_format": "application/json",
"default_limit": 20,
"fields": {
"api_key": {
"blank": false,
"default": null,
"help_text": "API key to use when making API calls to the pipeline.",
"nullable": true,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "API key"
},
"api_username": {
"blank": false,
"default": null,
"help_text": "Username to use when making API calls to the pipeline.",
"nullable": true,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "API username"
},
"create_default_locations": {
"blank": false,
"default": "No default provided.",
"help_text": "Boolean data. Ex: True",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "boolean",
"unique": false,
"verbose_name": "create default locations"
},
"description": {
"blank": false,
"default": null,
"help_text": "Human readable description of the Archivematica instance.",
"nullable": true,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "Description"
},
"remote_name": {
"blank": false,
"default": null,
"help_text": "Base URL of the pipeline server for making API calls.",
"nullable": true,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "Remote name"
},
"resource_uri": {
"blank": false,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"primary_key": false,
"readonly": true,
"type": "string",
"unique": false,
"verbose_name": "resource uri"
},
"shared_path": {
"blank": false,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "shared path"
},
"uuid": {
"blank": false,
"default": "9db44cd4-a528-4736-a60b-c44f36536826",
"help_text": "Identifier for the Archivematica pipeline",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": true,
"verbose_name": "UUID"
}
},
"filtering": {
"description": 1,
"uuid": 1
}
}
},
"space": {
"list_endpoint": "/api/v2/space/",
"schema": {
"allowed_detail_http_methods": [
"get"
],
"allowed_list_http_methods": [
"get",
"post"
],
"default_format": "application/json",
"default_limit": 20,
"fields": {
"access_protocol": {
"blank": false,
"default": "No default provided.",
"help_text": "How the space can be accessed.",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "Access protocol"
},
"last_verified": {
"blank": false,
"default": null,
"help_text": "Time this location was last verified to be accessible.",
"nullable": true,
"primary_key": false,
"readonly": false,
"type": "datetime",
"unique": false,
"verbose_name": "Last verified"
},
"path": {
"blank": true,
"default": "",
"help_text": "Absolute path to the space on the storage service machine.",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "Path"
},
"resource_uri": {
"blank": false,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"primary_key": false,
"readonly": true,
"type": "string",
"unique": false,
"verbose_name": "resource uri"
},
"size": {
"blank": false,
"default": null,
"help_text": "Size in bytes (optional)",
"nullable": true,
"primary_key": false,
"readonly": false,
"type": "integer",
"unique": false,
"verbose_name": "Size"
},
"staging_path": {
"blank": false,
"default": "",
"help_text": "Absolute path to a staging area. Must be UNIX filesystem compatible, preferably on the same filesystem as the path.",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": false,
"verbose_name": "Staging path"
},
"used": {
"blank": false,
"default": 0,
"help_text": "Amount used in bytes",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "integer",
"unique": false,
"verbose_name": "Used"
},
"uuid": {
"blank": false,
"default": "12666dd9-18fb-4fc9-936e-acab52ebb25a",
"help_text": "Unique identifier",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "string",
"unique": true,
"verbose_name": "uuid"
},
"verified": {
"blank": false,
"default": false,
"help_text": "Whether or not the space has been verified to be accessible.",
"nullable": false,
"primary_key": false,
"readonly": false,
"type": "boolean",
"unique": false,
"verbose_name": "Verified"
}
},
"filtering": {
"access_protocol": 1,
"path": 1,
"size": 1,
"staging_path": 1,
"used": 1,
"uuid": 1,
"verified": 1
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment