Create Asset

Creates an asset from your media.

Similar to the Slicebot, the Cloud Slicer
will take advantage of ttml and configuration file if they are provided alongside your content.

View example.

In this example, you have requested that the Cloud Slicer process the following URL:

http://www.example.com/file.mp4

Prior to processing, the Cloud Slicer will check for subtitles and configuration settings via the following URLs:

http://www.example.com/file.mp4.cfg

http://www.example.com/file.mp4.ttml

Request

Request syntax:

/jobs/create

Request parameters:

Pass the following parameters through the msg parameter:

NameData TypeDescription
argsDictionaryContains Slicebot configuration settings that configure how the Cloud Slicer will process your media.
sourceDictionaryContains properties that identify the media that will be sliced. The Cloud Slicer may only process files that are smaller than 90 GBs. Please use a local slicer for larger files. HTTP URL Set the url parameter to the URL where the media that will be sliced may be found. Example: {'source':{'url':'http://myserver.com/path/to/myfile.mp4'}} Amazon S3 (Private) URL Set the following parameters: + url: Identifies the location of the media using the following syntax: s3://S3 Endpoint/Bucket/Key Name Example: s3://s3.eu-west-1.amazonaws.com/videos/nature.mp4 + api_key: Identifies your AWS access key. + api_secret: Identifies your AWS secret access key. If your AWS S3 content is publicly accessible, then you should use an HTTP URL instead of an S3 URL.

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following parameter.

NameData TypeDescription
jobDictionaryDescribes the Cloud Slicer job that was created.

Sample Request/Response

A sample request/response is provided below. The Call() function, which is imported from uplynk_api2_auth module, prepares the message body and digital signature.

from uplynk_api2_auth import Call

print(Call('/api2/cloudslicer/jobs/create', args=dict(trim='5000,10000', description='My file description'),
                source=dict(url='http://www.myserver.com/videos/test.mp4')))

{
    "job": {
        "state": "waiting",
        "last_error": "",
        "args": {
            "trim": "5000,10000",
            "desc": "My file description"
        },
        "attempts": 0,
        "source": {
            "url": "http://www.myserver.com/videos/test.mp4"
        },
        "finished": 0,
        "last_start": 0,
        "owner": "a735c56ea4014685bc74c0a375236cc5",
        "progress": "",
        "id": "0dce9166be404672a7dd0d28d7257587"
    },
    "error": 0
}

A sample response when an invalid Slicer argument has been passed is provided below.

{
    "job": {...},
    "illegal_slicer_args": [
        "bad_arg1",
        "bad_arg2"
    ],
    "error": 0
}

Invalid arguments are ignored. Your media will be processed without it.