Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
A lightweight API for indexing metadata and links to existing derivatives into Avalon.  
Version
Date
Description
0.1
13 October 2015
Initial Draft
0.2
16 December 2015
API as implemented
0.3
3 January 2020
Authorization scheme enhanced
status_code, percent_complete, percent_succeeded, and percent_failed fields removed from Media Object parameters

Table of Contents 

...

      label (optional),
      title,
      file_location,
      file_checksum,
      file_size,
      duration,
      display_aspect_ratio,
      original_frame_size,
      file_format,
      poster_offset,
      thumbnail_offset,
      date_digitized,
      structure (optional): structure xml as a string,
      captions(optional): captions text from vtt or srt file as a string,
      captions_type (optional): required if captions are present,
      other_identifier (multiple),
      comment (multiple),
      workflow_name,
      date_digitized,
      percent_complete: must be "100.0",
      percent_succeeded: must be "100.0",
      percent_failed: must be "0",
      status_code: must be "COMPLETED",
      files: an array of derivative hashes

...

If true, fields must include value for :bibliographic_id and may include value from controlled vocabulary for :bibliographic_id_label)
Bib import failure will result in a JSON response: {errors: ['Bib import failed', e.message]}, status: 422

replace_masterfiles (boolean):

...

Code Block
languagejs
titleExample Request Data (data.json)
collapsetrue
{
   "fields" : {
      "avalon_uploader" : "srsridh@iu.edu",
      "subject" : [],
      "format" : [
         "video/mp4"
      ],
      "title" : "100_item_8",
      "translated_title" : [],
      "publisher" : [],
      "note_type" : null,
      "alternative_title" : [],
      "duration" : "30101",
      "date_created" : null,
      "related_item_url" : null,
      "related_item_label" : null,
      "genre" : [],
      "contributor" : [],
      "bibliographic_id" : null,
      "uniform_title" : [],
      "topical_subject" : [],
      "note" : null,
      "comment" : [],
      "statement_of_responsibility" : null,
      "temporal_subject" : [],
      "rights_statement" : null,
      "language" : null,
      "date_issued" : "2017",
      "creator" : [],
      "other_identifier" : null,
      "geographic_subject" : [],
      "terms_of_use" : null,
      "abstract" : null,
      "avalon_resource_type" : [
         "moving image"
      ],
      "record_identifier" : [
         "http://127.0.0.1:8984/fedora4/rest/61/08/vb/48/6108vb48x"
      ],
      "identifier" : [],
      "resource_type" : [],
      "bibliographic_id_label" : null,
      "copyright_date" : null,
      "physical_description" : [],
      "table_of_contents" : [],
      "other_identifier_type" : null,
      "avalon_publisher" : "srsridh@iu.edu"
   },
   "publish" : true,
   "collection_id" : "jh343s44s",
   "files" : [
      {
         "file_location" : "/srv/avalon/dropbox/Performance_Testing_100/assets/Popeye_forPresident.mp4",
         "duration" : "30101",
         "files" : [
            {
               "derivativeFile" : "file:///var/avalon/rtmp_streams/3c5ee8d6-dc51-4112-8f60-f4cc36abab5c/5136f7be-1637-4ebf-be5e-35c79df16dac/Popeye_forPresident.mp4",
               "managed" : false,
               "video_bitrate" : "513984.0",
               "duration" : "30102",
               "audio_codec" : "AAC",
               "url" : "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:3c5ee8d6-dc51-4112-8f60-f4cc36abab5c/5136f7be-1637-4ebf-be5e-35c79df16dac/Popeye_forPresident",
               "track_id" : "track-3",
               "id" : "track-3",
               "video_codec" : "AVC",
               "hls_url" : "https://mallorn.dlib.indiana.edu:8980/avalon/3c5ee8d6-dc51-4112-8f60-f4cc36abab5c/5136f7be-1637-4ebf-be5e-35c79df16dac/Popeye_forPresident.mp4/index.m3u8",
               "width" : "320",
               "label" : "quality-high",
               "hls_track_id" : "track-4",
               "location" : "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:3c5ee8d6-dc51-4112-8f60-f4cc36abab5c/5136f7be-1637-4ebf-be5e-35c79df16dac/Popeye_forPresident",
               "height" : "240",
               "mime_type" : "video/mp4",
               "audio_bitrate" : "98902.0"
            }
         ],
         "captions" : "WEBVTT\r\n\r\n1\r\n00:00:00.200 --> 00:00:02.000\r\nTitle frame 1-2 sec\r\n\r\n2\r\n00:00:04.000 --> 00:00:05.000\r\n4 seconds\r\n\r\n3\r\n00:00:10.000 --> 00:00:11.000\r\n10 seconds\r\n\r\n4\r\n00:00:16.000 --> 00:00:16.500\r\n16 seconds\r\n\r\n5\r\n00:00:27.000 --> 00:00:27.800\r\n27 seconds",
         "other_identifier" : [],
         "file_checksum" : null,
         "workflow_name" : "avalon-skip-transcoding",
         "structure" : null,
         "percent_complete" : null,
         "physical_description" : null,
         "file_size" : "2352948",
         "poster_offset" : 2000,
         "display_aspect_ratio" : "1.3333333333333333",
         "height" : 240,
         "comment" : [],
         "thumbnail_offset" : 2000,
         "original_frame_size" : "320x240",
         "date_digitized" : "2018-10-15T18:57:39Z",
         "width" : 320,
         "captions_type" : "text/vtt",
         "status_code" : null,
         "file_format" : "Moving image",
         "label" : "popeye"
      }
   ]
}

...

Code Block
languagejs
titleExample Request Data (data.json)
collapsetrue
{
   "publish" : true,
   "collection_id" : "jh343s44s",
   "fields" : {
      "physical_description" : [],
      "related_item_label" : null,
      "creator" : [],
      "avalon_uploader" : "srsridh@iu.edu",
      "terms_of_use" : null,
      "copyright_date" : null,
      "date_issued" : "2017",
      "note_type" : null,
      "other_identifier" : null,
      "alternative_title" : [],
      "bibliographic_id" : null,
      "date_created" : null,
      "comment" : [],
      "avalon_publisher" : "srsridh@iu.edu",
      "rights_statement" : null,
      "uniform_title" : [],
      "bibliographic_id_label" : null,
      "geographic_subject" : [],
      "translated_title" : [],
      "abstract" : null,
      "note" : null,
      "duration" : "30101",
      "title" : "Ingest API Test",
      "topical_subject" : [],
      "genre" : [],
      "contributor" : [],
      "statement_of_responsibility" : null,
      "publisher" : [],
      "table_of_contents" : [],
      "language" : null,
      "avalon_resource_type" : [
         "moving image"
      ],
      "temporal_subject" : [],
      "record_identifier" : [
         "http://127.0.0.1:8984/fedora4/rest/61/08/vb/48/6108vb48x"
      ],
      "related_item_url" : null,
      "subject" : [],
      "other_identifier_type" : null,
      "resource_type" : [],
      "identifier" : [],
      "format" : [
         "video/mp4"
      ]
   },
   "files" : [
      {
         "width" : 320,
         "thumbnail_offset" : 2000,
         "file_format" : "Moving image",
         "file_checksum" : null,
         "file_size" : "2352948",
         "status_code" : null,
         "percent_complete" : null,
         "poster_offset" : 2000,
         "date_digitized" : "2018-10-15T18:57:39Z",
         "structure" : null,
         "workflow_name" : "avalon-skip-transcoding",
         "comment" : [],
         "other_identifier" : [],
         "display_aspect_ratio" : "1.3333333333333333",
         "captions" : "WEBVTT\r\n\r\n1\r\n00:00:00.200 --> 00:00:02.000\r\nTitle frame 1-2 sec\r\n\r\n2\r\n00:00:04.000 --> 00:00:05.000\r\n4 seconds\r\n\r\n3\r\n00:00:10.000 --> 00:00:11.000\r\n10 seconds\r\n\r\n4\r\n00:00:16.000 --> 00:00:16.500\r\n16 seconds\r\n\r\n5\r\n00:00:27.000 --> 00:00:27.800\r\n27 seconds",
         "file_location" : "/srv/avalon/dropbox/Performance_Testing_100/assets/Popeye_forPresident.mp4",
         "original_frame_size" : "320x240",
         "duration" : "30101",
         "physical_description" : null,
         "height" : 240,
         "files" : [
            {
               "mime_type" : "video/mp4",
               "hls_track_id" : "track-4",
               "duration" : "30102",
               "video_bitrate" : "513984.0",
               "audio_codec" : "AAC",
               "managed" : false,
               "height" : "240",
               "track_id" : "track-3",
               "derivativeFile" : "file:///var/avalon/rtmp_streams/3c5ee8d6-dc51-4112-8f60-f4cc36abab5c/5136f7be-1637-4ebf-be5e-35c79df16dac/Popeye_forPresident.mp4",
               "location" : "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:3c5ee8d6-dc51-4112-8f60-f4cc36abab5c/5136f7be-1637-4ebf-be5e-35c79df16dac/Popeye_forPresident",
               "label" : "quality-high",
               "width" : "320",
               "audio_bitrate" : "98902.0",
               "hls_url" : "https://mallorn.dlib.indiana.edu:8980/avalon/3c5ee8d6-dc51-4112-8f60-f4cc36abab5c/5136f7be-1637-4ebf-be5e-35c79df16dac/Popeye_forPresident.mp4/index.m3u8",
               "video_codec" : "AVC",
               "url" : "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:3c5ee8d6-dc51-4112-8f60-f4cc36abab5c/5136f7be-1637-4ebf-be5e-35c79df16dac/Popeye_forPresident",
               "id" : "track-3"
            }
         ],
         "captions_type" : "text/vtt",
         "label" : "popeye"
      }
   ],
   "replace_masterfiles" : true
}

...