vidispine 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/Gemfile +11 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +296 -0
  6. data/Rakefile +2 -0
  7. data/bin/vidispine +7 -0
  8. data/bin/vidispine-notification-handler +339 -0
  9. data/bin/vidispine-utilities-http-server +13 -0
  10. data/dist/vidispine-1.4.0.gem +0 -0
  11. data/lib/vidispine.rb +5 -0
  12. data/lib/vidispine/api/client.rb +981 -0
  13. data/lib/vidispine/api/client/http_client.rb +291 -0
  14. data/lib/vidispine/api/client/requests.rb +27 -0
  15. data/lib/vidispine/api/client/requests/base_request.rb +234 -0
  16. data/lib/vidispine/api/client/requests/collection_access_add.rb +30 -0
  17. data/lib/vidispine/api/client/requests/collection_access_delete.rb +26 -0
  18. data/lib/vidispine/api/client/requests/collection_metadata_set.rb +24 -0
  19. data/lib/vidispine/api/client/requests/import_placeholder.rb +36 -0
  20. data/lib/vidispine/api/client/requests/import_placeholder_item.rb +38 -0
  21. data/lib/vidispine/api/client/requests/import_sidecar_file.rb +28 -0
  22. data/lib/vidispine/api/client/requests/import_using_uri.rb +44 -0
  23. data/lib/vidispine/api/client/requests/item_access_add.rb +30 -0
  24. data/lib/vidispine/api/client/requests/item_access_delete.rb +26 -0
  25. data/lib/vidispine/api/client/requests/item_delete.rb +17 -0
  26. data/lib/vidispine/api/client/requests/item_export.rb +44 -0
  27. data/lib/vidispine/api/client/requests/item_metadata_get.rb +37 -0
  28. data/lib/vidispine/api/client/requests/item_metadata_set.rb +29 -0
  29. data/lib/vidispine/api/client/requests/item_search.rb +0 -0
  30. data/lib/vidispine/api/client/requests/item_transcode.rb +23 -0
  31. data/lib/vidispine/api/client/requests/items_search.rb +40 -0
  32. data/lib/vidispine/api/client/requests/search.rb +59 -0
  33. data/lib/vidispine/api/client/requests/storage_file_create.rb +23 -0
  34. data/lib/vidispine/api/client/requests/storage_file_get.rb +40 -0
  35. data/lib/vidispine/api/client/requests/storage_files_get.rb +42 -0
  36. data/lib/vidispine/api/utilities.rb +1608 -0
  37. data/lib/vidispine/api/utilities/cli.rb +168 -0
  38. data/lib/vidispine/api/utilities/http_server.rb +230 -0
  39. data/lib/vidispine/api/utilities/http_server/cli.rb +77 -0
  40. data/lib/vidispine/cli.rb +174 -0
  41. data/lib/vidispine/version.rb +3 -0
  42. data/resources/postman/Vidispine API (From WADL v4.11).postman_collection.json +47437 -0
  43. data/vidispine.gemspec +26 -0
  44. metadata +117 -0
@@ -0,0 +1,30 @@
1
+ module Vidispine::API::Client::Requests
2
+
3
+ # @see http://apidoc.vidispine.com/latest/ref/access-control.html#add-a-new-entry-access-control-entry
4
+ # @see http://apidoc.vidispine.com/latest/ref/access-control.html#add-access-control-entries-to-all-items
5
+ class CollectionAccessAdd < BaseRequest
6
+
7
+ HTTP_METHOD = :post
8
+ HTTP_PATH = '/collection/#{path_arguments[:collection_id] ? "#{path_arguments[:collection_id]}/" : ""}access'
9
+
10
+ PARAMETERS = [
11
+ { :name => :collection_id, :send_in => :path },
12
+ { :name => :access_control_document, :required => true, :send_in => :body },
13
+ { :name => :allow_all_collections, :aliases => [ :all_collections ], :send_in => :none }
14
+ ]
15
+
16
+ def after_process_parameters
17
+ _collection_id = arguments[:collection_id]
18
+ unless (arguments[:allow_all_collections] == true) || (_collection_id && !_collection_id.empty?)
19
+ raise ArgumentError, 'Collection ID is required unless :allow_all_collections parameter is set to true.'
20
+ end
21
+ end
22
+
23
+ def body
24
+ body_arguments[:access_control_document]
25
+ end
26
+
27
+ end
28
+
29
+ end
30
+
@@ -0,0 +1,26 @@
1
+ module Vidispine::API::Client::Requests
2
+
3
+ # @see http://apidoc.vidispine.com/latest/ref/access-control.html#delete--collection-(collection-id)-access-(access-id)
4
+ # @see http://apidoc.vidispine.com/latest/ref/access-control.html#remove-all-access-control-entries-from-all-collections
5
+ class CollectionAccessDelete < BaseRequest
6
+
7
+ HTTP_METHOD = :delete
8
+ HTTP_PATH = '/collection/#{path_arguments[:collection_id] ? "#{path_arguments[:collection_id]}/" : ""}access/#{path_arguments[:access_id]}'
9
+
10
+ PARAMETERS = [
11
+ { :name => :collection_id, :send_in => :path },
12
+ { :name => :access_id, :send_in => :path, :required => true },
13
+ { :name => :allow_all_collections, :aliases => [ :all_collections ], :send_in => :none }
14
+ ]
15
+
16
+ def after_process_parameters
17
+ _collection_id = arguments[:collection_id]
18
+ unless (arguments[:allow_all_collections] == true) || (_collection_id && !_collection_id.empty?)
19
+ raise ArgumentError, 'Collection ID is required unless :allow_all_collections parameter is set to true.'
20
+ end
21
+ end
22
+
23
+ end
24
+
25
+ end
26
+
@@ -0,0 +1,24 @@
1
+ module Vidispine::API::Client::Requests
2
+
3
+
4
+ # @see http://apidoc.vidispine.com/4.2/ref/collection.html#update-collection-metadata
5
+ class CollectionMetadataSet < BaseRequest
6
+
7
+ HTTP_METHOD = :put
8
+ HTTP_PATH = 'collection/#{path_arguments[:collection_id]}/metadata'
9
+
10
+ PARAMETERS = [
11
+ { :name => :collection_id, :aliases => [ :id ], :required => true, :send_in => :path },
12
+
13
+ { :name => :MetadataDocument, :aliases => [ :body ], :send_in => :body, :default_value => { } }
14
+ ]
15
+
16
+ def body
17
+ @body ||= body_arguments[:MetadataDocument]
18
+ end
19
+
20
+ end
21
+
22
+
23
+ end
24
+
@@ -0,0 +1,36 @@
1
+ module Vidispine::API::Client::Requests
2
+
3
+ class ImportPlaceholder < BaseRequest
4
+
5
+ HTTP_METHOD = :post
6
+ HTTP_PATH = '/import/placeholder'
7
+
8
+ PARAMETERS = [
9
+ { :name => :container },
10
+ { :name => :audio },
11
+ { :name => :video },
12
+ :type,
13
+ :frameDuration,
14
+ :notification,
15
+ :notificationData,
16
+ :priority,
17
+ :jobmetadata,
18
+ 'no-transcode',
19
+ { :name => :MetadataDocument, :aliases => [ :metadata ], :default_value => { }, :send_in => :body },
20
+ ]
21
+
22
+ def body
23
+ @body ||= arguments[:MetadataDocument]
24
+ end
25
+
26
+ def body_as_xml
27
+ <<-XML
28
+ <MetadataDocument xmlns="http://xml.vidispine.com/schema/vidispine">
29
+ </MetadataDocument>
30
+ XML
31
+ end
32
+
33
+ end
34
+
35
+ end
36
+
@@ -0,0 +1,38 @@
1
+ module Vidispine::API::Client::Requests
2
+
3
+ # @see http://apidoc.vidispine.com/latest/ref/item/import.html#import-to-a-placeholder-item
4
+ class ImportPlaceholderItem < BaseRequest
5
+
6
+ HTTP_METHOD = :post
7
+ HTTP_PATH = '/import/placeholder/#{path_arguments[:item_id]}/#{path_arguments[:item_type]}'
8
+
9
+ PARAMETERS = [
10
+ { :name => :item_id, :required => true, :send_in => :path },
11
+ { :name => :item_type, :required => true, :send_in => :path },
12
+ :uri,
13
+ :fileId,
14
+ :tag,
15
+ :original,
16
+ :createThumbnails,
17
+ :overrideFastStart,
18
+ :requireFastStart,
19
+ :fastStartLength,
20
+ :growing,
21
+ :notification,
22
+ :notificationDta,
23
+ :priority,
24
+ :jobmetadata,
25
+ :settings,
26
+ :index
27
+ ]
28
+
29
+ def after_process_parameters
30
+ # URI Needs to be escaped twice, so we do it once here and then again when the query is built
31
+ _uri = arguments[:uri]
32
+ arguments[:uri] = CGI.escape(_uri) if _uri
33
+ end
34
+
35
+ end
36
+
37
+ end
38
+
@@ -0,0 +1,28 @@
1
+ module Vidispine::API::Client::Requests
2
+
3
+ # @see http://apidoc.vidispine.com/latest/ref/item/import.html#import-a-sidecar-file
4
+ # @see http://vidispine.com/partner/vidiwiki/RestItemImport#Syntax:_Starting_a_sidecar_import_job
5
+ class ImportSidecarFile < BaseRequest
6
+
7
+ HTTP_METHOD = :post
8
+ HTTP_PATH = '/import/sidecar/#{path_arguments[:item_id]}'
9
+
10
+ PARAMETERS = [
11
+ { :name => :item_id, :required => true, :send_in => :path },
12
+ :sidecar,
13
+ :notification,
14
+ :notificationDta,
15
+ :priority,
16
+ :jobmetadata,
17
+ ]
18
+
19
+ def after_process_parameters
20
+ # URI Needs to be escaped twice, so we do it once here and then again when the query is built
21
+ sidecar = arguments[:sidecar]
22
+ arguments[:sidecar] = CGI.escape(sidecar) if sidecar and sidecar.start_with?('file://')
23
+ end
24
+
25
+ end
26
+
27
+ end
28
+
@@ -0,0 +1,44 @@
1
+ module Vidispine::API::Client::Requests
2
+
3
+ # @see http://apidoc.vidispine.com/4.2/ref/item/import.html#import-using-a-uri
4
+ class ImportUsingURI < BaseRequest
5
+
6
+ HTTP_METHOD = :post
7
+ HTTP_PATH = '/import'
8
+
9
+ PARAMETERS = [
10
+ { :name => :uri, :aliases => [ :url ], :required => true },
11
+ :tag,
12
+ :original,
13
+ :thumbnails,
14
+ :thumbnailService,
15
+ :createPosers,
16
+ :overrideFastStart,
17
+ :requireFastStart,
18
+ :fastStartLength,
19
+ :storageId,
20
+ :filename,
21
+ :growing,
22
+ :xmpfile,
23
+ :sidecar,
24
+ 'no-transcode',
25
+ :notification,
26
+ :notificationData,
27
+ :priority,
28
+ :jobmetadata,
29
+ { :name => :MetadataDocument, :aliases => [ :metadata ], :default_value => { }, :send_in => :body },
30
+ ]
31
+
32
+ # def after_process_parameters
33
+ # # URI Needs to be escaped twice, so we do it once here and then again when the query is built
34
+ # _uri = arguments[:uri]
35
+ # arguments[:uri] = CGI.escape(_uri) if _uri
36
+ # end
37
+
38
+ def body
39
+ @body ||= arguments[:MetadataDocument]
40
+ end
41
+
42
+ end
43
+
44
+ end
@@ -0,0 +1,30 @@
1
+ module Vidispine::API::Client::Requests
2
+
3
+ # @see http://apidoc.vidispine.com/latest/ref/access-control.html#add-a-new-entry-access-control-entry
4
+ # @see http://apidoc.vidispine.com/latest/ref/access-control.html#add-access-control-entries-to-all-items
5
+ class ItemAccessAdd < BaseRequest
6
+
7
+ HTTP_METHOD = :post
8
+ HTTP_PATH = '/item/#{path_arguments[:item_id] ? "#{path_arguments[:item_id]}/" : ""}access'
9
+
10
+ PARAMETERS = [
11
+ { :name => :item_id, :send_in => :path },
12
+ { :name => :access_control_document, :required => true, :send_in => :body },
13
+ { :name => :allow_all_items, :aliases => [ :all_items ], :send_in => :none }
14
+ ]
15
+
16
+ def after_process_parameters
17
+ _item_id = arguments[:item_id]
18
+ unless (arguments[:allow_all_items] == true) || (_item_id && !_item_id.empty?)
19
+ raise ArgumentError, 'Item ID is required unless :allow_all_items parameter is set to true.'
20
+ end
21
+ end
22
+
23
+ def body
24
+ body_arguments[:access_control_document]
25
+ end
26
+
27
+ end
28
+
29
+ end
30
+
@@ -0,0 +1,26 @@
1
+ module Vidispine::API::Client::Requests
2
+
3
+ # @see http://apidoc.vidispine.com/latest/ref/access-control.html#delete--item-(item-id)-access-(access-id)
4
+ # @see http://apidoc.vidispine.com/latest/ref/access-control.html#remove-all-access-control-entries-from-all-items
5
+ class ItemAccessDelete < BaseRequest
6
+
7
+ HTTP_METHOD = :delete
8
+ HTTP_PATH = '/item/#{path_arguments[:item_id] ? "#{path_arguments[:item_id]}/" : ""}access/#{path_arguments[:access_id]}'
9
+
10
+ PARAMETERS = [
11
+ { :name => :item_id, :send_in => :path },
12
+ { :name => :access_id, :send_in => :path, :required => true },
13
+ { :name => :allow_all_items, :aliases => [ :all_items ], :send_in => :none }
14
+ ]
15
+
16
+ def after_process_parameters
17
+ _item_id = arguments[:item_id]
18
+ unless (arguments[:allow_all_items] == true) || (_item_id && !_item_id.empty?)
19
+ raise ArgumentError, 'Item ID is required unless :allow_all_items parameter is set to true.'
20
+ end
21
+ end
22
+
23
+ end
24
+
25
+ end
26
+
@@ -0,0 +1,17 @@
1
+ module Vidispine::API::Client::Requests
2
+
3
+ class ItemDelete < BaseRequest
4
+
5
+ HTTP_METHOD = :delete
6
+ HTTP_PATH = '/item/#{path_arguments[:item_id]}'
7
+
8
+ PARAMETERS = [
9
+ { :name => :item_id, :aliases => [ :id ], :required => true, :send_in => :path },
10
+ :keepShapeTagMedia,
11
+ :keepShapeTagStorage,
12
+ ]
13
+
14
+ end
15
+
16
+ end
17
+
@@ -0,0 +1,44 @@
1
+ module Vidispine::API::Client::Requests
2
+
3
+ # @see http://apidoc.vidispine.com/latest/ref/item/export.html#item-export
4
+ class ItemExport < BaseRequest
5
+
6
+ HTTP_METHOD = :post
7
+ HTTP_PATH = '/item/#{path_arguments[:item_id]}/export'
8
+ DEFAULT_PARAMETER_SEND_IN_VALUE = :query
9
+
10
+ PARAMETERS = [
11
+ { :name => :item_id, :send_in => :path },
12
+
13
+ :uri,
14
+ :locationName,
15
+ :tag,
16
+ :metadata,
17
+ :projection,
18
+ :start,
19
+ :end,
20
+ :notification,
21
+ :notificationData,
22
+ :priority,
23
+ :jobmetadata,
24
+ :useOriginalFilename,
25
+ :template,
26
+ :allowMissing,
27
+
28
+ { :name => :body, :send_in => :body }
29
+ ]
30
+
31
+ def body
32
+ @body ||= arguments[:body]
33
+ end
34
+
35
+ def body_as_xml
36
+ <<-XML
37
+ <empty/>
38
+ XML
39
+ end
40
+
41
+ end
42
+
43
+ end
44
+
@@ -0,0 +1,37 @@
1
+ module Vidispine::API::Client::Requests
2
+
3
+
4
+ # @see http://apidoc.vidispine.com/4.2/ref/metadata/metadata.html#get--item-(id)-metadata
5
+ class ItemMetadataGet < BaseRequest
6
+
7
+ HTTP_METHOD = :get
8
+ HTTP_PATH = '/item/#{path_arguments[:item_id]}/metadata'
9
+
10
+ DEFAULT_PARAMETER_SEND_IN_VALUE = :matrix
11
+
12
+ PARAMETERS = [
13
+ { :name => :item_id, :aliases => [ :id ], :required => true, :send_in => :path },
14
+
15
+ :projection,
16
+ :interval,
17
+ :startc,
18
+ :field,
19
+ :group,
20
+ :track,
21
+ :language,
22
+ :conflict,
23
+ :samplerate,
24
+ :revision,
25
+ :terse,
26
+ :include,
27
+ :defaultValue,
28
+ :from,
29
+ :to,
30
+
31
+ { :name => :includeTransientMetadata, :send_in => :query },
32
+ ]
33
+
34
+ end
35
+
36
+ end
37
+
@@ -0,0 +1,29 @@
1
+ module Vidispine::API::Client::Requests
2
+
3
+
4
+ # @see http://apidoc.vidispine.com/4.2/ref/metadata/metadata.html#set--item-(id)-metadata
5
+ class ItemMetadataSet < BaseRequest
6
+
7
+ HTTP_METHOD = :put
8
+ HTTP_PATH = '/item/#{path_arguments[:item_id]}/metadata'
9
+
10
+ PARAMETERS = [
11
+ { :name => :item_id, :aliases => [ :id ], :required => true, :send_in => :path },
12
+
13
+ { :name => :projection, :send_in => :matrix },
14
+ { :name => 'output-project', :send_in => :matrix },
15
+
16
+ :revision,
17
+
18
+ { :name => :MetadataDocument, :send_in => :body, :default_value => { } }
19
+ ]
20
+
21
+ def body
22
+ @body ||= body_arguments[:MetadataDocument]
23
+ end
24
+
25
+ end
26
+
27
+
28
+ end
29
+
File without changes
@@ -0,0 +1,23 @@
1
+ module Vidispine::API::Client::Requests
2
+
3
+ class ItemTranscode < BaseRequest
4
+
5
+ HTTP_METHOD = :post
6
+ HTTP_PATH = '/item/#{path_arguments[:item_id]}/transcode'
7
+
8
+ PARAMETERS = [
9
+ { :name => :item_id, :aliases => [ :id ], :send_in => :path, :required => true },
10
+
11
+ { :name => :tag, :required => true },
12
+ :createThumbnails,
13
+ :createPosters,
14
+ :notification,
15
+ :notificationData,
16
+ :priority,
17
+ :jobmetadata
18
+ ]
19
+
20
+ end
21
+
22
+ end
23
+