Tape File Requests

class nla_control.views.TapeFileView(**kwargs)

:rest-api

Requests to resources which return information about the TapeFiles in the NLA system.

get(request, *args, **kwargs)

:rest-api

GET /nla_control/api/v1/files

Get a list of TapeFiles, optionally matching by a substring and by the stage of the file.

Query Parameters
  • match (string) -- (optional) Substring to match against in the name of the TapeFile.

  • stages (string) -- (optional) String containing any combination of UDTAR, to match only those files at a particular stage in the NLA system:

  • U: UNVERIFIED

  • D: ONDISK

  • T: ONTAPE

  • A: RESTORING

  • R: RESTORED

Query Parameters
  • spot-name (string) -- (optional) String containing true`|`false. If true then will return the name of the spot in the JSON.

Response JSON Array of Objects
  • count (integer) -- Number of files matching request.

  • files (List[Dictionary]) -- Details of the files returned, each dictionary contains:

  • path (string): logical path to the file.

  • spot-name (string): name of the spot where the file was originally held.

  • stage (char): current stage of the file, one of UDTAR as above.

  • verified (DateTime): the date and time the file was verified on.

  • size (integer): the size of the file in bytes.

Status Codes
  • 200 OK -- request completed successfully.

Example request

GET /nla_control/api/v1/files?match=L1C_MSI/2016/09/05&stages=R HTTP/1.1
Host: nla.ceda.ac.uk
Accept: application/json

Example response

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
    "count": 3,
    "files": [
               {
                 "path": "/neodc/sentinel2a/data/L1C_MSI/2016/09/05/S2A_OPER_PRD_MSIL1C_PDMC_20160907T072856_R008_V20160905T104022_20160905T104021.zip",
                 "stage": "R",
                 "verified": "2017-01-18T16:59:05.244150",
                 "size": 7781712577
               },
               {
                 "path": "/neodc/sentinel2a/data/L1C_MSI/2016/09/05/S2A_OPER_PRD_MSIL1C_PDMC_20160907T074525_R008_V20160905T104022_20160905T104021.zip",
                 "stage": "R",
                 "verified": "2017-01-18T16:59:05.244150",
                 "size": 7184875123
               },
               {
                 "path": "/neodc/sentinel2a/data/L1C_MSI/2016/09/05/S2A_OPER_PRD_MSIL1C_PDMC_20160907T061411_R008_V20160905T104022_20160905T104021.zip",
                 "stage": "R",
                 "verified": "2017-01-18T16:59:05.244150",
                 "size": 8545489398
               }
            ]
  }
]