Class: Kaltura::Service::BulkUploadService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/kaltura/service/bulk_upload_service.rb

Overview

The Bulk upload service is used to upload and manage bulk uploads using CSV files. This service is available through the KMC and typically would be a one-off, though you could choose to use it with a web application.

Examples:

Create a new bulk upload job:

csv_file = File.open('/path/to/csv_file/')
client.bulk_upload_service.add('12141313',csv_file)

Retrieve a bulk upload status:

status = client.bulk_upload_service.get('124').status

List all bulk upload jobs:

pager = Kaltura::FilterPager.new
pager.page_size = 100000000
client.bulk_upload_service.list(pager)

Instance Attribute Summary

Attributes inherited from BaseService

#client

Instance Method Summary collapse

Methods inherited from BaseService

#initialize, #perform_request

Constructor Details

This class inherits a constructor from Kaltura::Service::BaseService

Instance Method Details

#add(conversion_profile_id, csv_file_data) ⇒ Kaltura::BulkUpload

Adds a new bulk upload batch job. The conversion profile ID can be either specified in the API or in the CSV file itself. The attribute in the CSV overrides the API ID. The partner’s default conversion profile will be used if no ID is provided.

Parameters:

  • conversion_profile_id (Integer)

    This is the conversion profile to create flavors for each entry from. If there is a conversion profile defined in the file, this paramter will be overriden.

  • csv_file_data (File)

    The CSV file used to batch upload.

Returns:

  • (Kaltura::BulkUpload)

    A Bulk upload object contains useful information regarding the batch upload status. It would be advised you store the ID of this object somewhere for later retrieval.

Raises:



37
38
39
40
41
42
# File 'lib/kaltura/service/bulk_upload_service.rb', line 37

def add(conversion_profile_id, csv_file_data)
	kparams = {}
	client.add_param(kparams, 'conversionProfileId', conversion_profile_id)
	client.add_param(kparams, 'csvFileData', csv_file_data)
	perform_request('bulkUpload','add',kparams,false)
end

#get(id) ⇒ Kaltura::BulkUpload

Retrieves a BulkUpload object.

Parameters:

  • id (Integer)

    The ID of the BulkUpload object.

Returns:

Raises:



53
54
55
56
57
# File 'lib/kaltura/service/bulk_upload_service.rb', line 53

def get(id)
	kparams = {}
	client.add_param(kparams, 'id', id)
	perform_request('bulkUpload','get',kparams,false)
end

#list(pager = nil) ⇒ Kaltura::Response::BulkUploadListResponse, Kaltura::APIError

Lists bulk upload batch jobs given a pager index and size.

Parameters:

Returns:



68
69
70
71
72
# File 'lib/kaltura/service/bulk_upload_service.rb', line 68

def list(pager=nil)
	kparams = {}
	client.add_param(kparams, 'pager', pager)
	perform_request('bulkUpload','list',kparams,false)
end