Skip to content

Latest commit

 

History

History
214 lines (135 loc) · 9.87 KB

README.md

File metadata and controls

214 lines (135 loc) · 9.87 KB

Multistream

(multistream)

Overview

Operations related to multistream api

Available Operations

  • get_all - Retrieve Multistream Targets
  • create - Create a multistream target
  • get - Retrieve a multistream target
  • update - Update Multistream Target
  • delete - Delete a multistream target

get_all

Retrieve Multistream Targets

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.multistream.get_all()

if res.data is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetMultistreamTargetsResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

create

Create a multistream target

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.multistream.create(request={
    "url": "rtmps://live.my-service.tv/channel/secretKey",
})

if res.multistream_target is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
request components.MultistreamTargetInput ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.CreateMultistreamTargetResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

get

Retrieve a multistream target

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.multistream.get(id="<id>")

if res.multistream_target is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
id str ✔️ ID of the multistream target
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetMultistreamTargetResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

update

Update Multistream Target

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.multistream.update(id="<id>", multistream_target_patch_payload={
    "url": "rtmps://live.my-service.tv/channel/secretKey",
})

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
id str ✔️ ID of the multistream target
multistream_target_patch_payload components.MultistreamTargetPatchPayload ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.UpdateMultistreamTargetResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

delete

Make sure to remove any references to the target on existing streams before actually deleting it from the API.

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.multistream.delete(id="<id>")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
id str ✔️ ID of the multistream target
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteMultistreamTargetResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /