class Vidispine::API::Client

Attributes

api_endpoint_prefix[RW]
api_noauth_endpoint_prefix[RW]
http_client[RW]
logger[RW]
request[RW]
response[RW]

Public Class Methods

new(args = { }) click to toggle source
# File lib/vidispine/api/client.rb, line 14
def initialize(args = { })

  # API Path
  @api_endpoint_prefix = args.fetch(:api_endpoint_prefix, 'API')

  # APInoAuth Path
  @api_noauth_endpoint_prefix = args.fetch(:api_noauth_endpoint_prefix, 'APInoauth')

  # Default useragent but only if it is not set
  args[:user_agent] ||= args.fetch(:user_agent, "Vidispine Ruby SDK v#{Vidispine::VERSION}")

  @http_client = HTTPClient.new(args)
  @logger = http_client.logger
end

Public Instance Methods

collection(args = { }, options = { })
Alias for: collection_get
collection_access_add(args = { }, options = { }) click to toggle source

############################################################################################################## # @!group API Endpoints

# File lib/vidispine/api/client.rb, line 112
def collection_access_add(args = { }, options = { })
  process_request_using_class(Requests::CollectionAccessAdd, args, options)
end
collection_access_delete(args = { }, options = { }) click to toggle source
# File lib/vidispine/api/client.rb, line 116
def collection_access_delete(args = { }, options = { })
  process_request_using_class(Requests::CollectionAccessDelete, args, options)
end
collection_access_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/latest/ref/access-control.html#retrieve-a-specific-access-control-entry

# File lib/vidispine/api/client.rb, line 121
def collection_access_get(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'collection/#{path_arguments[:collection_id]}/access/#{path_arguments[:access_id]}',
      :parameters => [
        { :name => :collection_id, :aliases => [ :id ], :send_in => :path, :required => true },
        { :name => :access_id, :send_in => :path },
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
collection_create(args = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/collection.html#create-a-collection

# File lib/vidispine/api/client.rb, line 136
def collection_create(args = { })
  collection_name = args.is_a?(String) ? args : begin
    _data = Requests::BaseRequest.process_parameters([ { :name => :name, :aliases => [ :collection_name ], :send_in => :query } ], args)
    _args = _data[:arguments_out]
    _args[:name]
  end
  path = File.join(api_endpoint_prefix, '/collection')
  http(:post, path, '{}', :query => { :name => collection_name })
end
collection_delete(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/collection.html#delete-a-collection

# File lib/vidispine/api/client.rb, line 147
def collection_delete(args = { }, options = { })
  collection_id = args.is_a?(String) ? args : begin
    _data = Requests::BaseRequest.process_parameters([ { :name => :collection_id, :aliases => [ :id ] } ], args)
    _args = _data[:arguments_out]
    _args[:collection_id]
  end
  path = File.join(api_endpoint_prefix, "/collection/#{collection_id}")
  http(:delete, path)
end
collection_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/collection.html#retrieve-the-contents-of-a-collection

# File lib/vidispine/api/client.rb, line 158
def collection_get(args = { }, options = { })
  collection_id = args.is_a?(String) ? args : begin
    _data = Requests::BaseRequest.process_parameters([ { :name => :collection_id, :aliases => [ :id ] } ], args)
    _args = _data[:arguments_out]
    _args[:collection_id]
  end
  path = File.join(api_endpoint_prefix, "/collection/#{collection_id}")
  http(:get, path)
end
Also aliased as: collection
collection_item_add(args = { }, options = { })
collection_item_remove(args = { }, options = { })
collection_items(args = { }, options = { })
collection_items_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/collection.html#retrieve-the-items-of-a-collection

# File lib/vidispine/api/client.rb, line 170
def collection_items_get(args = { }, options = { })
  collection_id = args.is_a?(String) ? args : begin
    _data = Requests::BaseRequest.process_parameters([ { :name => :collection_id, :aliases => [ :id ] } ], args)
    _args = _data[:arguments_out]
    _args[:collection_id]
  end
  path = File.join(api_endpoint_prefix, "collection/#{collection_id}/item")
  http(:get, path)
end
Also aliased as: collection_items
collection_metadata_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/collection.html#retrieve-collection-metadata

# File lib/vidispine/api/client.rb, line 183
def collection_metadata_get(args = { }, options = { })
  collection_id = args.is_a?(String) ? args : begin
    _data = Requests::BaseRequest.process_parameters([ { :name => :collection_id, :aliases => [ :id ] } ], args)
    _args = _data[:arguments_out]
    _args[:collection_id]
  end
  path = File.join(api_endpoint_prefix, "/collection/#{collection_id}/metadata")
  http(:get, path)
end
collection_metadata_set(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/collection.html#update-collection-metadata

# File lib/vidispine/api/client.rb, line 194
def collection_metadata_set(args = { }, options = { })
  process_request_using_class(Requests::CollectionMetadataSet, args, options)
end
Also aliased as: collection_metadata_update
collection_metadata_update(args = { }, options = { })
collection_object_add(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/collection.html#add-an-item-library-or-collection-to-a-collection

# File lib/vidispine/api/client.rb, line 200
def collection_object_add(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'collection/#{path_arguments[:collection_id]}/#{path_arguments[:object_id]}',
      :http_method => :put,
      :parameters => [
        { :name => :collection_id, :required => true, :send_in => :path },
        { :name => :object_id,
          :aliases => [ :item_id, :library_id, :collection_to_add_id ], :required => true, :send_in => :path },
        { :name => :type, :aliases => [ :object_type ], :default_value => 'item' }, # The documentation states that item is the default, but we get a 'Type is missing error if this is not passed'
        :addItems
      ],
    }.merge(options)
  )
  process_request(_request, options)
end
Also aliased as: collection_item_add
collection_object_remove(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/collection.html#remove-an-item-library-or-collection-from-a-collection

# File lib/vidispine/api/client.rb, line 220
def collection_object_remove(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'collection/#{path_arguments[:collection_id]}/#{path_arguments[:object_id]}',
      :http_method => :delete,
      :parameters => [
        { :name => :collection_id, :required => true, :send_in => :path },
        { :name => :object_id,
          :aliases => [ :item_id, :library_id, :collection_to_add_id ], :required => true, :send_in => :path },
        { :name => :type, :aliases => [ :object_type ] },
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
Also aliased as: collection_item_remove
collection_rename(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/collection.html#rename-a-collection @param [Hash] args @option args [String] :collection_id

# File lib/vidispine/api/client.rb, line 241
def collection_rename(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_method => :put,
      :http_path => 'collection/#{arguments[:collection_id]}/rename',
      :parameters => [
        { :name => :collection_id, :aliases => [ :id ], :send_in => :path },
        { :name => :name, :aliases => [ :collection_name ] },
      ]
    }.merge(options)
  )
  return http(:put, _request.path, '', :query => _request.query_arguments, :headers => { 'Content-Type' => 'text/plain' } )
end
collections(args = { }, options = { })
Alias for: collections_get
collections_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/collection.html#retrieve-a-list-of-all-collections

# File lib/vidispine/api/client.rb, line 257
def collections_get(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_method => :get,
      :http_path => 'collection',
      :parameters => [
        { :name => :first, :send_in => :matrix },
        { :name => :number, :send_in => :matrix },
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
Also aliased as: collections
error() click to toggle source

Will try to return the most concise error message possible

Example: {

"invalidInput": {
    "id": "portal_mf734147",
    "context": "metadata-field",
    "value": null,
"explanation": "The metadata value is invalid"
},
"conflict": null,
"notAuthorized": null,
"fileAlreadyExists": null,
"licenseFault": null,
"notFound": null,
"internalServer": null,
"forbidden": null,
"notYetImplemented": null

}

will become

{

"invalidInput"=> {
  "id"=>"portal_mf734147",
  "context"=>"metadata-field",
  "value"=>nil,
  "explanation"=>"The metadata value is invalid"
}

}

# File lib/vidispine/api/client.rb, line 98
def error
  _response_parsed = http_client.response_parsed
  if _response_parsed.is_a?(Hash)
    _error = _response_parsed.delete_if { |k,v| v.nil? }
    _error
  else
    _response = http_client.response
    _response.body if _response.respond_to?(:body)
  end
end
http(method, *args) click to toggle source

Exposes HTTP Methods @example http(:get, '/')

# File lib/vidispine/api/client.rb, line 46
def http(method, *args)
  @request = nil
  @response = http_client.send(method, *args)
  @request = http_client.request
  response
end
import(args = { }, options = { })
Alias for: import_using_uri
import_placeholder(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/latest/ref/item/import.html#create-a-placeholder-item

# File lib/vidispine/api/client.rb, line 274
def import_placeholder(args = { }, options = { })
  #query = options[:query] || { }
  # http(:post, '/import/placeholder', :query => query)
  process_request_using_class(Requests::ImportPlaceholder, args, options)
end
Also aliased as: placeholder_create
import_placeholder_item(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/latest/ref/item/import.html#import-to-a-placeholder-item

# File lib/vidispine/api/client.rb, line 282
def import_placeholder_item(args = { }, options = { })
  process_request_using_class(Requests::ImportPlaceholderItem, args, options)
end
import_using_uri(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/item/import.html#import-using-a-uri

# File lib/vidispine/api/client.rb, line 287
def import_using_uri(args = { }, options = { })
  process_request_using_class(Requests::ImportUsingURI, args, options)
end
Also aliased as: import
item(args = { }, options = { })
Alias for: item_get
item_access_add(args = { }, options = { }) click to toggle source
# File lib/vidispine/api/client.rb, line 292
def item_access_add(args = { }, options = { })
  process_request_using_class(Requests::ItemAccessAdd, args, options)
end
item_access_delete(args = { }, options = { }) click to toggle source
# File lib/vidispine/api/client.rb, line 296
def item_access_delete(args = { }, options = { })
  process_request_using_class(Requests::ItemAccessDelete, args, options)
end
item_access_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/latest/ref/access-control.html#retrieve-a-specific-access-control-entry

# File lib/vidispine/api/client.rb, line 301
def item_access_get(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'item/#{path_arguments[:item_id]}/access/#{path_arguments[:access_id]}',
      :parameters => [
        { :name => :item_id, :aliases => [ :id ], :send_in => :path, :required => true },
        { :name => :access_id, :send_in => :path },
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
item_access_list(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/latest/ref/access-control.html#retrieve-access-control-list-for-an-item

# File lib/vidispine/api/client.rb, line 316
def item_access_list(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'item/#{path_arguments[:item_id]}/access',
      :parameters => [
        { :name => :item_id, :aliases => [ :id ], :send_in => :path, :required => true },
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
item_collections(args = { }, options = { })
item_collections_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/item/item.html#list-collections-that-contain-an-item

# File lib/vidispine/api/client.rb, line 331
def item_collections_get(args = { }, options = { })
  item_id = args.is_a?(String) ? args : begin
    _data = Requests::BaseRequest.process_parameters([ { :name => :item_id, :aliases => [ :id ] } ], args)
    _args = _data[:arguments_out]
    _args[:item_id]
  end
  path = File.join(api_endpoint_prefix, "/item/#{item_id}/collections")
  http(:get, path)
end
Also aliased as: item_collections
item_create_thumbnail(args = { }, options = { })
Alias for: item_transcode
item_delete(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/latest/ref/item/item.html#delete-a-single-item

# File lib/vidispine/api/client.rb, line 343
def item_delete(args = { }, options = { })
  process_request_using_class(Requests::ItemDelete, args, options)
end
item_export(args = { }, options = { }) click to toggle source

apidoc.vidispine.com/latest/ref/item/export.html#item-export

# File lib/vidispine/api/client.rb, line 348
def item_export(args = { }, options = { })
  process_request_using_class(Requests::ItemExport, args, options)
end
item_field_group_get(args = { }, options = { }) click to toggle source

Gets the field group of an item Undocumented endpoint

# File lib/vidispine/api/client.rb, line 354
def item_field_group_get(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path   => '/item/#{path_arguments[:item_id]}/field-group',
      :http_method => :get,
      :parameters  => [
        { :name => :item_id, :send_in => :path, :required => true },
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
item_field_group_set(args = { }, options = { }) click to toggle source

Sets the field group of an item Undocumented endpoint

# File lib/vidispine/api/client.rb, line 370
def item_field_group_set(args = { }, options = { })
  _request = Requests::BaseRequest.new(
      args,
      {
        :http_path => '/item/#{path_arguments[:item_id]}/field-group/#{path_arguments[:field_group]}',
        :http_method => :put,
        :default_parameter_send_in_value => :path,
        :parameters => [
          { :name => :item_id, :required => true },
          { :name => :field_group, :required => true }
        ]
      }.merge(options)
  )
  process_request(_request, options)
end
item_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/latest/ref/item/item.html#get-information-about-a-single-item

# File lib/vidispine/api/client.rb, line 387
def item_get(args = { }, options = { })
  # item_id = args.is_a?(String) ? args : begin
  #   _data = Requests::BaseRequest.process_parameters([ { :name => :item_id, :aliases => [ :id ] } ], args)
  #   _args = _data[:arguments_out]
  #   _args[:item_id]
  # end
  # http(:get, "/item/#{item_id}")

  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'item/#{path_arguments[:item_id]}',
      :parameters => [
        { :name => :item_id, :aliases => [ :id ], :send_in => :path, :required => true },
        { :name => :starttc, :send_in => :matrix },

        'noauth-url',
        'baseURI'
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
Also aliased as: item
item_metadata(args = { }, options = { })
Alias for: item_metadata_get
item_metadata_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/metadata/metadata.html#get–item-(id)-metadata

# File lib/vidispine/api/client.rb, line 417
def item_metadata_get(args = { }, options = { })
  process_request_using_class(Requests::ItemMetadataGet, args, options)
end
Also aliased as: item_metadata
item_metadata_set(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/metadata/metadata.html#add-a-metadata-change-set

# File lib/vidispine/api/client.rb, line 423
def item_metadata_set(args = { }, options = { })
  process_request_using_class(Requests::ItemMetadataSet, args, options)
end
item_notifications_delete() click to toggle source
# File lib/vidispine/api/client.rb, line 412
def item_notifications_delete
  http(:delete, '/item/notification')
end
item_shape_files(args = { }, options = { })
item_shape_files_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/item/shape.html#get-files-for-shape

# File lib/vidispine/api/client.rb, line 428
def item_shape_files_get(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => '/item/#{path_arguments[:item_id]}/shape/#{path_arguments[:shape_id]}/file',
      :default_parameter_send_in_value => :path,
      :parameters => [
        { :name => :item_id, :required => true },
        { :name => :shape_id, :required => true }
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
Also aliased as: item_shape_files
item_shape_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2.6/ref/item/shape.html#get-shape

# File lib/vidispine/api/client.rb, line 445
def item_shape_get(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => '/item/#{path_arguments[:item_id]}/shape/#{path_arguments[:shape_id]}',
      :default_parameter_send_in_value => :path,
      :parameters => [
        { :name => :item_id, :required => true },
        { :name => :shape_id },
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
item_shape_import(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/item/shape.html#import-a-shape-using-a-uri-or-an-existing-file

# File lib/vidispine/api/client.rb, line 502
def item_shape_import(args = { }, options = { })
  # _request = Requests::BaseRequest.new(
  #   args,
  #   {
  #     :http_path => '"/item/#{item_id}/shape"',
  #     :parameters => [
  #       { :name => :item_id, :aliases => [ :id ], :send_in => :path },
  #       :uri,
  #       :fileId,
  #       { :name => :tag, :aliases => [ :tags ] },
  #       :settings,
  #       :notification,
  #       :notificationData,
  #       :priority,
  #       :jobmetadata
  #     ],
  #   }.merge(options)
  # )
  # process_request(_request, options)

  _data = Requests::BaseRequest.process_parameters(
    [
      { :name => :item_id, :aliases => [ :id ], :send_in => :path },
      :uri,
      :fileId,
      { :name => :tag, :aliases => [ :tags ] },
      :settings,
      :notification,
      :notificationData,
      :priority,
      :jobmetadata
    ],
    args
  )
  _args = _data[:arguments_out]

  item_id = _args[:item_id]
  uri = _args[:uri]
  file_id = _args[:fileId]
  tag = _args[:tag]
  tag = tag.join(',') if tag.is_a?(Array)
  settings = _args[:settings]
  notification = _args[:notification]
  notification_data = _args[:notificationData]
  priority = _args[:priority]
  job_metadata = _args[:jobmetadata]

  query = { }
  query[:uri] = uri if uri
  query[:fileId] = file_id if file_id
  query[:tag] = tag if tag
  query[:settings] = settings if settings
  query[:notification] = notification if notification
  query[:notificationData] = notification_data if notification_data
  query[:priority] = priority if priority
  query[:jobmetadata] = job_metadata if job_metadata

  path = File.join(api_endpoint_prefix, "/item/#{item_id}/shape")
  http(:post, path, '', :query => query)
end
item_shape_placholder_create(args = { }, options = { }) click to toggle source

Create a placeholder shape @see apidoc.vidispine.com/latest/ref/item/shape.html#create-a-placeholder-shape

# File lib/vidispine/api/client.rb, line 462
def item_shape_placholder_create(args = { }, options = { })
  _request = Requests::BaseRequest.new(
      args,
      {
          :http_path => '/item/#{path_arguments[:item_id]}/shape/placeholder',
          :default_parameter_send_in_value => :query,
          :parameters => [
              { :name => :item_id, :required => true, :type => :path },
              { :name => :tag },
              { :name => :container },
              { :name => :audio },
              { :name => :video },
              { :name => :frameDuration },
          ]
      }.merge(options)
  )
  process_request(_request, options)
end
item_shapes_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2.6/ref/item/shape.html#get-list-of-shapes

# File lib/vidispine/api/client.rb, line 482
def item_shapes_get(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => '/item/#{path_arguments[:item_id]}/shape',
      :default_parameter_send_in_value => :path,
      :parameters => [
        { :name => :item_id, :required => true },
        { :name => :uri, :send_in => :query },
        { :name => :placeholder, :send_in => :query },
        { :name => :tag, :send_in => :query }, # Not Documented
        { :name => :version, :send_in => :matrix }
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
item_sidecar_import(args = { }, options = { }) click to toggle source
# File lib/vidispine/api/client.rb, line 563
def item_sidecar_import(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'import/sidecar/#{path_arguments[:item_id]}',
      :http_method => :post,
      :parameters => [
        { :name => :item_id, :send_in => :path, :required => true },

        :sidecar,
        :notification,
        :notificationData,
        :priority,
        :jobmetadata,
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
item_thumbnail(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/latest/ref/item/thumbnail.html#start-a-thumbnail-job

# File lib/vidispine/api/client.rb, line 584
def item_thumbnail(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'item/#{path_arguments[:item_id]}/thumbnail',
      :http_method => :post,
      :parameters => [
        { :name => :item_id, :send_in => :path, :required => true },

        :createThumbnails,
        :createPosters,
        :thumbnailWidth,
        :thumbnailHeight,
        :thumbnailPeriod,
        :posterWidth,
        :posterHeight,
        :postFormat,
        :notification,
        :notificationData,
        :priority,
        :jobmetadata,
        :version,
        :sourceTag
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
item_transcode(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/item/transcode.html#start-an-item-transcode-job

# File lib/vidispine/api/client.rb, line 614
def item_transcode(args = { }, options = { })
  process_request_using_class(Requests::ItemTranscode, args, options)
end
Also aliased as: item_create_thumbnail
item_uri(args = { }, options = { })
Alias for: item_uris_get
item_uri_get(args = { }, options = { })
Alias for: item_uris_get
item_uris(args = { }, options = { })
Alias for: item_uris_get
item_uris_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/item-content.html#get–item-(item-id)-uri

# File lib/vidispine/api/client.rb, line 620
def item_uris_get(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => '/item/#{arguments[:item_id]}/uri',
      :parameters => [
        { :name => :item_id, :aliases => [ :id ], :required => true, :send_in => :path },
        :type,
        { :name => :tag, :aliases => [ :tags ] },
        :scheme,
        :closedFiles
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
Also aliased as: item_uri_get, item_uris, item_uri
items(args = { }, options = { })
Alias for: items_get
items_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/latest/ref/item/item.html#retrieve-a-list-of-all-items

# File lib/vidispine/api/client.rb, line 641
def items_get(args = { }, options = { })
  #http(:get, 'item')
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'item',
      :default_parameter_send_in_value => :matrix,
      :parameters => [
        { :name => :result, :send_in => :query },
        { :name => :q, :send_in => :query },

        :library,
        :first,
        :number,
        :libraryId,
        :autoRefresh,
        :updateMode,
        :updateFrequency
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
Also aliased as: items
job_abort(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/job.html#delete–job-(job-id)

# File lib/vidispine/api/client.rb, line 673
def job_abort(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'job/#{arguments[:job_id]}',
      :http_method => :delete,
      :parameters => [
        { :name => :job_id, :aliases => [ :id ], :send_in => :path },
        :reason
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
job_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/job.html#get-job-information

# File lib/vidispine/api/client.rb, line 689
def job_get(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'job/#{arguments[:job_id]}',
      :parameters => [
        { :name => :job_id, :aliases => [ :id ], :send_in => :path },
        :metadata
      ]
    }
  )
  process_request(_request, options)
end
jobs(args = { }, options = { })
Alias for: jobs_get
jobs_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/job.html#get-list-of-jobs

# File lib/vidispine/api/client.rb, line 704
def jobs_get(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'job',
      :parameters => [
        { :name => :jobmetadata, :send_in => :query },
        { :name => :metadata, :send_in => :query },
        { :name => :idOnly, :send_in => :query },
        { :name => 'starttime-from', :send_in => :query },
        { :name => 'starttime-to', :send_in => :qeury },
        { :name => :step, :send_in => :query },

        { :name => :type, :send_in => :matrix },
        { :name => :state, :send_in => :matrix },
        { :name => :first, :send_in => :matrix },
        { :name => :number, :send_in => :matrix },
        { :name => :sort, :send_in => :matrix },
        { :name => :user, :send_in => :matrix }
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
Also aliased as: jobs
metadata_field_delete(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/metadata/field.html#delete–metadata-field-(field-name)

# File lib/vidispine/api/client.rb, line 731
def metadata_field_delete(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'metadata/#{arguments[:field_name]}',
      :http_method => :delete,
      :parameters => [
        { :name => :field_name, :aliases => [ :name ], :send_in => :path }
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
metadata_field_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/metadata/field.html#get–metadata-field-(field-name)

# File lib/vidispine/api/client.rb, line 746
def metadata_field_get(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'metadata/#{arguments[:field_name]}',
      :parameters => [
        { :name => :field_name, :aliases => [ :name ], :send_in => :path }
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
metadata_field_group_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/latest/ref/metadata/field-group.html#retrieving-the-fields-of-a-group

# File lib/vidispine/api/client.rb, line 760
def metadata_field_group_get(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'metadata-field/field-group/#{path_arguments[:group_name]}',
      :parameters => [
        { :name => :group_name, :aliases => [ :name ], :send_in => :path },
        :include_values,
        :traverse,
        :data
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
metadata_field_groups_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2.3/ref/metadata/field-group.html#get-a-list-of-known-groups

# File lib/vidispine/api/client.rb, line 777
def metadata_field_groups_get(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'metadata-field/field-group',
      :parameters => [
        :content,
        :traverse,
        :data
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
metadata_field_terse_schema(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/metadata/field.html#retrieve-terse-metadata-schema

# File lib/vidispine/api/client.rb, line 793
def metadata_field_terse_schema(args = { }, options = { })
  default_options = { :headers => { 'accept' => '*/*' } }
  _options = default_options.merge(options)
  path = File.join(api_endpoint_prefix, 'metadata-field/terse-schema')
  http(:get, path, _options)
end
metadata_fields(args = { }, options = { })
Alias for: metadata_fields_get
metadata_fields_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/metadata/field.html#get–metadata-field

# File lib/vidispine/api/client.rb, line 801
def metadata_fields_get(args = { }, options = { })
  path = File.join(api_endpoint_prefix, 'metadata-field')
  http(:get, path, options)
end
Also aliased as: metadata_fields
placeholder_create(args = { }, options = { })
Alias for: import_placeholder
process_request(request, options = nil) click to toggle source
# File lib/vidispine/api/client.rb, line 29
def process_request(request, options = nil)
  @response = nil
  @request = request
  request.client = self unless request.client
  options ||= request.options
  logger.warn { "Request is Missing Required Arguments: #{request.missing_required_arguments.inspect}" } unless request.missing_required_arguments.empty?
  @response = http_client.build_and_send_request(request.http_method, { :path => request.path, :query => request.query, :body => request.body }, options)
end
process_request_using_class(request_class, args, options = { }) click to toggle source
# File lib/vidispine/api/client.rb, line 38
def process_request_using_class(request_class, args, options = { })
  @response = nil
  @request = request_class.new(args, options.merge(:client => self))
  process_request(request, options)
end
search_browse(args = { }, options = { }) click to toggle source
# File lib/vidispine/api/client.rb, line 813
def search_browse(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'search',
      :parameters => [
        :content,
        :interval,
        :field,
        :group,
        :language,
        :samplerate,
        :track,
        :terse,
        :include,
        :type,
        :tag,
        :scheme,
        :closedFiles,
        'noauth-url',
        :defaultValue,
        :methodType,
        :version,
        :revision,

        { :name => :first, :send_in => :matrix },

        { :name => :ItemSearchDocument, :send_in => :body }
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
storage(args = { }, options = { })
Alias for: storage_get
storage_delete(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/storage/storage.html#delete–storage-(storage-id)

# File lib/vidispine/api/client.rb, line 848
def storage_delete(args = { }, options = { })
  args = { :storage_id => args } if args.is_a?(String)
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'storage/#{path_arguments[:storage_id]}',
      :http_method => :delete,
      :parameters => [
        { :name => :storage_id, :aliases => [ :id ], :send_in => :path, :required => true },
        :safe
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
storage_file_copy(args = { }, options = { }) click to toggle source
# File lib/vidispine/api/client.rb, line 865
def storage_file_copy(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args, 
    {
      :http_path => 'storage/#{path_arguments[:source_storage_id]}/file/#{path_argumetns[:file_id]}/storage/#{path_arguments[:target_source_id]}',
      :http_method => :post,
      :parameters => [
        { :name => :file_id, :send_in => :path, :required => true },
        { :name => :source_storage_id, :send_in => :path, :required => true },
        { :name => :target_storage_id, :send_in => :path, :required => true },
        
        :move,
        :filename,
        :timeDependency,
        :limitRate,
        :notification,
        :notificationData,
        :priority,
        :jobmetadata,
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
storage_file_create(args = { }, options = { }) click to toggle source

@param [Hash] args @option args [String] :storage_id (Required) @option args [String] :path (Required) @option args [Boolean] :create_only @option args [String] :state

@see apidoc.vidispine.com/latest/ref/storage/file.html#create-a-file-entity-in-the-database

# File lib/vidispine/api/client.rb, line 897
def storage_file_create(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'storage/#{path_arguments[:storage_id]}/file',
      :http_method => :post,
      :default_parameter_send_in_value => :body,
      :parameters => [
        { :name => :storage_id, :send_in => :path, :required => true },
        { :name => :createOnly, :send_in => :query },
        :path,
        :state,
        :uri,
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
storage_file_get(args = { }, options = { }) click to toggle source

Exposes two functions

1. Get status of file in storage
  @see http://apidoc.vidispine.com/4.2.3/ref/storage/file.html#get-status-of-file-in-storage

2. Get direct download access to file in storage
  @see http://apidoc.vidispine.com/4.2.3/ref/storage/file.html#get-direct-download-access-to-file-in-storage
# File lib/vidispine/api/client.rb, line 940
def storage_file_get(args = { }, options = { })
  process_request_using_class(Requests::StorageFileGet, args, options)
end
storage_file_item_get(args = { }, options = { }) click to toggle source
# File lib/vidispine/api/client.rb, line 916
def storage_file_item_get(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'storage/#{path_arguments[:storage_id]}/file/#{path_arguments[:file_id]}/item',
      :http_method => :get,
      :parameters => [
        { :name => :storage_id, :send_in => :path, :required => true },
        { :name => :file_id, :send_in => :path, :required => true },

        { :name => :uri, :send_in => :matrix },
        { :name => :path, :send_in => :matrix }
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
storage_file_state_set(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/latest/ref/storage/file.html#set-file-state

# File lib/vidispine/api/client.rb, line 945
def storage_file_state_set(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'storage/file/#{path_arguments[:file_id]}/state/#{path_arguments[:state]}',
      :http_method => :put,
      :default_parameter_send_in_value => :path,
      :parameters => [
        { :name => :file_id, :required => true },
        { :name => :state, :required => true },
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
storage_files_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/storage/file.html#list-files-in-storage

# File lib/vidispine/api/client.rb, line 962
def storage_files_get(args = { }, options = { })
  process_request_using_class(Requests::StorageFilesGet, args, options)
end
storage_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/storage/storage.html#get–storage-(storage-id)

# File lib/vidispine/api/client.rb, line 967
def storage_get(args = { }, options = { })
  args = { :storage_id => args } if args.is_a?(String)
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'storage/#{path_arguments[:storage_id]}',
      :parameters => [
        { :name => :storage_id, :aliases => [ :id ], :send_in => :path, :required => true },
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
Also aliased as: storage
storage_method_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/storage/storage.html#storage-methods

# File lib/vidispine/api/client.rb, line 983
def storage_method_get(args = { }, options = { })
  args = { :storage_id => args } if args.is_a?(String)
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'storage/#{path_arguments[:storage_id]}/method',
      :parameters => [
        { :name => :storage_id, :aliases => [ :id ], :send_in => :path, :required => true },

        { :name => :read, :send_in => :matrix },
        { :name => :write, :send_in => :matrix },
        { :name => :browse, :send_in => :matrix },

        :url,
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
storage_rescan(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/storage/storage.html#rescanning @param [String|Hash] args @option args [String] :storage_id

# File lib/vidispine/api/client.rb, line 1006
def storage_rescan(args = { }, options = { })
  storage_id = args.is_a?(String) ? args : begin
    _data = Requests::BaseRequest.process_parameters([ { :name => :storage_id, :aliases => [ :id ] } ], args)
    _args = _data[:arguments_out]
    _args[:storage_id]
  end
  path = File.join(api_endpoint_prefix, "storage/#{storage_id ? "#{storage_id}/" : ''}rescan")
  http(:post, path, '')
end
storages(args = { }, options = { })
Alias for: storages_get
storages_get(args = { }, options = { }) click to toggle source

@see apidoc.vidispine.com/4.2/ref/storage/storage.html#retrieve-list-of-storages

# File lib/vidispine/api/client.rb, line 1017
def storages_get(args = { }, options = { })
  _request = Requests::BaseRequest.new(
    args,
    {
      :http_path => 'storage',
      :parameters => [
        :size,
        :freebytes,
        :usedbytes,
        :freeamount,
        :files,
        :storagegroup,
        :status
      ]
    }.merge(options)
  )
  process_request(_request, options)
end
Also aliased as: storages
success?() click to toggle source

Tries to determine if the last request got a successful response

# File lib/vidispine/api/client.rb, line 54
def success?
  return unless @request
  if @request.respond_to?(:success?)
    @request.success?
  else
    _response = http_client.response
    _response && _response.code.start_with?('2')
  end
end
version(args = { }, options = { }) click to toggle source
# File lib/vidispine/api/client.rb, line 1037
def version(args = { }, options = { })
  http(:get, File.join(api_endpoint_prefix, 'version'))
end