downloads
Creates, updates, deletes, gets or lists a downloads resource.
Overview
| Name | downloads |
| Type | Resource |
| Id | cloudflare.streams.downloads |
Fields
The following fields are returned by SELECT queries:
- list
List downloads response.
| Name | Datatype | Description |
|---|---|---|
audio | object | The audio-only download. Only present if this download type has been created. |
default | object | The default video download. Only present if this download type has been created. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | identifier, account_id | Lists the downloads created for a video. | |
stream_downloads_create_type_specific_downloads | insert | identifier, account_id, download_type | Creates a download for a video of specified type. For backwards-compatibility, POST requests to /downloads will enable the default download. | |
create | insert | identifier, account_id | Creates a download for a video when a video is ready to view. Use /downloads/{download_type} instead for type-specific downloads. Available types are default and audio. | |
stream_downloads_delete_type_specific_downloads | delete | identifier, account_id, download_type | Delete specific type of download. For backwards-compatibility, DELETE requests to /downloads will delete the default download. | |
delete | delete | identifier, account_id | Delete the downloads for a video. Use /downloads/{download_type} instead for type-specific downloads. Available types are default and audio. |
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. |
download_type | string | |
identifier | string | Resource identifier. |
SELECT examples
- list
Lists the downloads created for a video.
SELECT
audio,
default
FROM cloudflare.streams.downloads
WHERE identifier = '{{ identifier }}' -- required
AND account_id = '{{ account_id }}' -- required
;
INSERT examples
- stream_downloads_create_type_specific_downloads
- create
- Manifest
Creates a download for a video of specified type. For backwards-compatibility, POST requests to /downloads will enable the default download.
INSERT INTO cloudflare.streams.downloads (
identifier,
account_id,
download_type
)
SELECT
'{{ identifier }}',
'{{ account_id }}',
'{{ download_type }}'
RETURNING
errors,
messages,
result,
success
;
Creates a download for a video when a video is ready to view. Use /downloads/{download_type} instead for type-specific downloads. Available types are default and audio.
INSERT INTO cloudflare.streams.downloads (
identifier,
account_id
)
SELECT
'{{ identifier }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: downloads
props:
- name: identifier
value: "{{ identifier }}"
description: Required parameter for the downloads resource.
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the downloads resource.
- name: download_type
value: "{{ download_type }}"
description: Required parameter for the downloads resource.
DELETE examples
- stream_downloads_delete_type_specific_downloads
- delete
Delete specific type of download. For backwards-compatibility, DELETE requests to /downloads will delete the default download.
DELETE FROM cloudflare.streams.downloads
WHERE identifier = '{{ identifier }}' --required
AND account_id = '{{ account_id }}' --required
AND download_type = '{{ download_type }}' --required
;
Delete the downloads for a video. Use /downloads/{download_type} instead for type-specific downloads. Available types are default and audio.
DELETE FROM cloudflare.streams.downloads
WHERE identifier = '{{ identifier }}' --required
AND account_id = '{{ account_id }}' --required
;