Create CSL

Create CSL Slicer

Prerequisites

Before creating a CSL slicer, you must first perform the following steps:

  1. Identify the region where your CSL slicer will be created. Use the Get CSL Slicer Regions endpoint to retrieve a list of regions and their system-defined IDs.
  2. Identify the streaming protocol through which your feed will be published to a CSL slicer. Use the Get CSL Slicer Protocols endpoint to view the available streaming protocols.
  3. Identify the region-specific version of the Slicer software that the CSL slicer will run. Use the Get CSL Slicer Versions endpoint to retrieve a list of the available versions for the desired region.
  4. Create an ingest point within the region identified in step 1 through the Create Ingest Point endpoint. Note the system-defined ID assigned to this ingest point.

Use the above information to create a CSL slicer through this endpoint.

After you have created a CSL slicer, find out its current status through the Get CSL Slicer endpoint. Wait until the CSL slicer's status is RUNNING.

Request

Request syntax:

POST /managed-slicer/slicers

Request body parameters:

Pass the following request body parameters:

NameData TypeDescription
configurationStringDefines the slicer's configuration. Specify each setting as a key-value pair. Use a new line character (\n) to delimit each setting. Example: 'configuration': 'slicerID:basketballSlicer\nremote:1\nmeta:event=March Madness'
default_slicer_config RequiredBooleanDetermines whether the slicer will use a default Live Slicer configuration.
ingest_point_id RequiredStringIdentifies an ingest point by its system-defined ID. Use the Get All Ingest Points endpoint to retrieve a list of ingest points and their system-defined IDs.
notesStringDefines the slicer's notes.
profile_idStringIdentifies an encoding profile by its system-defined ID. Use the Get Encoding Profiles endpoint to retrieve a list of encoding profiles and their system-defined IDs. Default value: Our service assigns a default encoding profile to the slicer when this property is omitted.
server_region_id RequiredStringIdentifies the slicer's region by its system-defined ID. You must specify a region that matches the one assigned to this slicer's ingest point (ingest_point_id property). Use the Get CSL Regions endpoint to retrieve a list of regions and their system-defined IDs.
slicer_idStringSets the slicer's ID. This ID must be unique across all slicers. Use this ID to identify this slicer when setting up a live channel or a live event.
source_ip RequiredStringUDP Only Identifies the IP address of the computer generating the UDP multicast stream.
stream_type_name RequiredStringIdentifies the protocol for the feed that will be ingested by this slicer.
version_idStringIdentifies a slicer version by its system-defined ID. This slicer runs on this slicer version. You must specify a slicer version that is specific to the region defined within this slicer's ingest point (reserved_endpoint_id property).

Response

The response for a successful request contains the following properties:

NameData TypeDescription
@idStringIndicates the relative path that returns this resource.
@typeStringReturns ManagedSlicer.
mss_server_idStringIndicates the slicer's system-defined ID.
slicerDictionaryContains information that describes this slicer.
taskDictionaryDescribes the task associated with this request to create a slicer.
server_region_idStringIndicates the slicer's region by its system-defined ID. Use the Get CSL Regions endpoint to retrieve a list of regions and their system-defined IDs.

slicer Dictionary

The slicer dictionary describes a slicer through the following properties:

NameData TypeDescription
creation_timeStringIndicates the timestamp (UTC) at which the slicer was created. Example: Sep 28, 2023 9:21:36 PM
docker_tagStringReserved for future use.
ingest_point_idStringIndicates an ingest point by its system-defined ID. Use the Get Ingest Point endpoint to retrieve an ingest point by its system-defined ID.
isolation_requiredBooleanIndicates whether the slicer will run on a private host.
profileStringProvides basic information about the slicer's encoding profile. Specifically, it indicates the encoding profile's ID, frames per second, and maximum height. Example: 'profile': '{"max_bframes": 3, "profile": "high", "aoKbps": null, "skipF": 0, "fps": 30, "vKbps": 2400, "aKbps": 128, "aMaxChannels": 2, "maxW": 1280, "isHD": false, "maxH": 720, "preset": "veryfast", "threads": 4, "vPasses": 2, "EncryptionKey": 1, "id": 4}',
server_regionStringIndicates the slicer's region by its name.
slicer_api_urlStringIndicates the URL that accepts Live Slicer API requests for this slicer.
slicer_configStringIndicates this slicer's slicer configuration. Example: 'slicer_config': 'slicerID:slicer_abc338_fgad12_28Sep2022_1664400095\nusername:[email protected]\napikey:*****\ninput:rtmp\nport:47965\nssl_port:47968\napi_port:47966\nmanual_ip:ingest-prod-1-us-east-1.mss.aws.oath.cloud\nrtmp_url:rtmp://0.0.0.0:47965/mss/d7182b4c-9b72-465d-b218-9c5e1e0fe3gf\n',
slicer_domain_nameStringIndicates the domain assigned to the slicer.
slicer_idStringIndicates the slicer's ID. Use this ID to identify this slicer when setting up a live channel or a live event.
slicer_portsDictionaryContains the slicer's ports.
slicer_secure_stream_urlStringIndicates the encrypted URL to which you may push your feed. This slicer will ingest the content that is pushed to this URL.
slicer_software_versionStringIndicates the slicer software version.
slicer_stream_keyStringRTMP or RTMPS Indicates the slicer's stream key.
slicer_stream_urlStringIndicates the URL to which you may push your feed. This slicer will ingest the content that is pushed to this URL.
slicer_versionStringIndicates a slicer version by its system-defined ID. This slicer runs on this slicer version.
source_ip_addressStringIndicates the IP address of the computer generating the UDP multicast stream.
statusStringIndicates the slicer's status (e.g., INITIALIZING). Learn more.
slicer_ports Dictionary

The slicer_ports dictionary describes each port associated with this slicer through the following properties:

NameData TypeDescription
portNumberUDP Only Indicates the port on which the slicer will listen for the UDP stream.
api_portNumberIndicates the port on which the slicer will listen for API calls.
ssl_portNumberIndicates the port on which the slicer will expose the authenticated API over TLS. Use this parameter to allow the slicer to communicate with the Live Events Dashboard without causing mixed content blocking. Learn more.

task Dictionary

The task dictionary describes the task associated with this request to create a slicer through the following properties:

NameData TypeDescription
idStringIndicates the task's system-defined ID.
stateStringIndicates the task's current state. Learn more.
operationStringIndicates the type of operation that was performed.

Sample Request/Response

Call the create_csl_slicer module (Python 3) to create a CSL slicer. This module imports names from the api_auth module.

import json, requests, datetime, time
from api_auth import APICredentials, APIParams

class CSLSlicer:
    def __init__(self):
        self.host = "https://services.uplynk.com"

    def run(self):
        """
        Create a CSL slicer.
        """
        self._create_csl_slicer()

    def _create_csl_slicer(self):
        url = "{}{}".format(self.host, "/api/v4/managed-slicer/slicers")

        ingest_point_id = 'f0a214a437024a9c85c59f6f1bd55b3e' # Replace with the desired ingest point's ID.
        region_id = 'e1d9f8f3c9a24be68177654ded5b2912'  # Replace with the desired region's ID.

        payload = {
            'slicer_id': 'basketball_slicer', # Replace with the CSL slicer's Slicer ID.
            'ingest_point_id': ingest_point_id,
            'server_region_id': region_id,
            'default_slicer_config': False,
            'stream_type_name': "RTMP",
            'configuration': 'remote:on\ndescription:Sports\ninput:rtmp\nautoexpire_age:3'
        }

        headers = {'Content-Type': 'application/json'}

        response = requests.post(
            url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers
        )

        print(response.json())

CSLSlicer().run()

Response:

{
	'@id': '/api/v4/managed-slicer/slicers',
	'@type': 'ManagedSlicer',
	'mss_server_id': '2803da54cb8e47668f36908bef564fee',
	'slicer': {
		'slicer_id': 'basketball_slicer',
		'status': 'INITIALIZING',
		'server_region': 'us-east-2',
		'slicer_version': 'STABLE',
		'source_ip_address': '0.0.0.0',
		'slicer_api_url': 'https://ingest-stage-1-us-east-2.mss-develop.aws.oath.cloud:46213',
		'slicer_config': 'slicerID:basketball_slicer\nusername:[email protected]\napikey:*****\ninput:rtmp\nremote:on\ndescription:Sports\nautoexpire_age:3\nport:46210\nssl_port:46213\napi_port:46211\nmanual_ip:ingest-stage-1-us-east-2.mss-develop.aws.oath.cloud\nrtmp_url:rtmp://0.0.0.0:46210/mss/6c03c9bd-78d7-4a93-aebb-74802392fdad\n',
		'creation_time': 'Mar 15, 2022 5:03:39 PM',
		'slicer_domain_name': 'ingest-stage-1-us-east-2.mss-develop.aws.oath.cloud',
		'slicer_ports': {
			'port': 46210,
			'api_port': 46211,
			'ssl_port': 46213
		},
		'slicer_stream_url': 'rtmp://ingest-stage-1-us-east-2.mss-develop.aws.oath.cloud/slicer46210',
		'slicer_stream_key': '6c03c9bd-78d7-4a93-aebb-74802392fdad',
		'slicer_secure_stream_url': 'rtmps://ingest-stage-1-us-east-2.mss-develop.aws.oath.cloud:4935/slicer46210',
		'ingest_point_id': '23b43aec-db87-4d31-8466-3ff67dafa8d9',
		'profile': '{"max_bframes": 3, "profile": "high", "aoKbps": null, "skipF": 0, "fps": 30, "vKbps": 2400, "aKbps": 128, "aMaxChannels": 2, "maxW": 1280, "isHD": false, "maxH": 720, "preset": "veryfast", "threads": 4, "vPasses": 2, "EncryptionKey": 2, "id": 4}',
		'isolation_required': True,
		'slicer_software_version': '21061800',
		'docker_tag': '0.7.21061800'
	},
	'task': {
		'id': '56bb9b87-6167-4345-b530-3fc4d45be1ea',
		'state': 'IN_PROGRESS',
		'operation': 'CREATE'
	},
	'server_region_id': '4ae28f7a33c44473861b40d1c7e3072e'
}