live_inputs
Creates, updates, deletes, gets or lists a live_inputs resource.
Overview
| Name | live_inputs |
| Type | Resource |
| Id | cloudflare.streams.live_inputs |
Fields
The following fields are returned by SELECT queries:
- get
- list
Retrieve a live input response.
| Name | Datatype | Description |
|---|---|---|
created | string (date-time) | The date and time the live input was created. (example: 2014-01-02T02:20:00Z) |
deleteRecordingAfterDays | number | Indicates the number of days after which the live inputs recordings will be deleted. When a stream completes and the recording is ready, the value is used to calculate a scheduled deletion date for that recording. Omit the field to indicate no change, or include with a null value to remove an existing scheduled deletion. |
enabled | boolean | Indicates whether the live input is enabled and can accept streams. |
meta | object | A user modifiable key-value store used to reference other systems of record for managing live inputs. |
modified | string (date-time) | The date and time the live input was last modified. (example: 2014-01-02T02:20:00Z) |
recording | object | Records the input to a Cloudflare Stream video. Behavior depends on the mode. In most cases, the video will initially be viewable as a live video and transition to on-demand after a condition is satisfied. |
rtmps | object | Details for streaming to an live input using RTMPS. |
rtmpsPlayback | object | Details for playback from an live input using RTMPS. |
srt | object | Details for streaming to a live input using SRT. |
srtPlayback | object | Details for playback from an live input using SRT. |
status | string | The connection status of a live input. (, connected, reconnected, reconnecting, client_disconnect, ttl_exceeded, failed_to_connect, failed_to_reconnect, new_configuration_accepted) |
uid | string | A unique identifier for a live input. (example: 66be4bf738797e01e1fca35a7bdecdcd) |
webRTC | object | Details for streaming to a live input using WebRTC. |
webRTCPlayback | object | Details for playback from a live input using WebRTC. |
List live inputs response.
| Name | Datatype | Description |
|---|---|---|
liveInputs | array | |
range | integer | The total number of remaining live inputs based on cursor position. |
total | integer | The total number of live inputs that match the provided filters. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | live_input_identifier, account_id | Retrieves details of an existing live input. | |
list | select | account_id | include_counts | Lists the live inputs created for an account. To get the credentials needed to stream to a specific live input, request a single live input. |
create | insert | account_id | Creates a live input, and returns credentials that you or your users can use to stream live video to Cloudflare Stream. | |
update | replace | live_input_identifier, account_id | Updates a specified live input. | |
delete | delete | live_input_identifier, account_id | Prevents a live input from being streamed to and makes the live input inaccessible to any future API calls. | |
disable | exec | live_input_identifier, account_id | Prevents a live input from being streamed to and makes the live input inaccessible to any future API calls until enabled. | |
enable | exec | live_input_identifier, account_id | Allows a live input to be streamed to and makes the live input accessible to any future API calls. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
live_input_identifier | string | |
include_counts | boolean |
SELECT examples
- get
- list
Retrieves details of an existing live input.
SELECT
created,
deleteRecordingAfterDays,
enabled,
meta,
modified,
recording,
rtmps,
rtmpsPlayback,
srt,
srtPlayback,
status,
uid,
webRTC,
webRTCPlayback
FROM cloudflare.streams.live_inputs
WHERE live_input_identifier = '{{ live_input_identifier }}' -- required
AND account_id = '{{ account_id }}' -- required
;
Lists the live inputs created for an account. To get the credentials needed to stream to a specific live input, request a single live input.
SELECT
liveInputs,
range,
total
FROM cloudflare.streams.live_inputs
WHERE account_id = '{{ account_id }}' -- required
AND include_counts = '{{ include_counts }}'
;
INSERT examples
- create
- Manifest
Creates a live input, and returns credentials that you or your users can use to stream live video to Cloudflare Stream.
INSERT INTO cloudflare.streams.live_inputs (
defaultCreator,
deleteRecordingAfterDays,
enabled,
meta,
recording,
account_id
)
SELECT
'{{ defaultCreator }}',
{{ deleteRecordingAfterDays }},
{{ enabled }},
'{{ meta }}',
'{{ recording }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: live_inputs
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the live_inputs resource.
- name: defaultCreator
value: "{{ defaultCreator }}"
description: |
Sets the creator ID asssociated with this live input.
- name: deleteRecordingAfterDays
value: {{ deleteRecordingAfterDays }}
description: |
Indicates the number of days after which the live inputs recordings will be deleted. When a stream completes and the recording is ready, the value is used to calculate a scheduled deletion date for that recording. Omit the field to indicate no change, or include with a `null` value to remove an existing scheduled deletion.
- name: enabled
value: {{ enabled }}
description: |
Indicates whether the live input is enabled and can accept streams.
default: true
- name: meta
value: "{{ meta }}"
description: |
A user modifiable key-value store used to reference other systems of record for managing live inputs.
- name: recording
description: |
Records the input to a Cloudflare Stream video. Behavior depends on the mode. In most cases, the video will initially be viewable as a live video and transition to on-demand after a condition is satisfied.
value:
allowedOrigins:
- "{{ allowedOrigins }}"
hideLiveViewerCount: {{ hideLiveViewerCount }}
mode: "{{ mode }}"
requireSignedURLs: {{ requireSignedURLs }}
timeoutSeconds: {{ timeoutSeconds }}
REPLACE examples
- update
Updates a specified live input.
REPLACE cloudflare.streams.live_inputs
SET
defaultCreator = '{{ defaultCreator }}',
deleteRecordingAfterDays = {{ deleteRecordingAfterDays }},
enabled = {{ enabled }},
meta = '{{ meta }}',
recording = '{{ recording }}'
WHERE
live_input_identifier = '{{ live_input_identifier }}' --required
AND account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Prevents a live input from being streamed to and makes the live input inaccessible to any future API calls.
DELETE FROM cloudflare.streams.live_inputs
WHERE live_input_identifier = '{{ live_input_identifier }}' --required
AND account_id = '{{ account_id }}' --required
;
Lifecycle Methods
- disable
- enable
Prevents a live input from being streamed to and makes the live input inaccessible to any future API calls until enabled.
EXEC cloudflare.streams.live_inputs.disable
@live_input_identifier='{{ live_input_identifier }}' --required,
@account_id='{{ account_id }}' --required
;
Allows a live input to be streamed to and makes the live input accessible to any future API calls.
EXEC cloudflare.streams.live_inputs.enable
@live_input_identifier='{{ live_input_identifier }}' --required,
@account_id='{{ account_id }}' --required
;