Skip to content

Latest commit

 

History

History
307 lines (227 loc) · 10 KB

DirectUploadsApi.md

File metadata and controls

307 lines (227 loc) · 10 KB

mux_python.DirectUploadsApi

All URIs are relative to https://api.mux.com

Method HTTP request Description
cancel_direct_upload PUT /video/v1/uploads/{UPLOAD_ID}/cancel Cancel a direct upload
create_direct_upload POST /video/v1/uploads Create a new direct upload URL
get_direct_upload GET /video/v1/uploads/{UPLOAD_ID} Retrieve a single direct upload's info
list_direct_uploads GET /video/v1/uploads List direct uploads

cancel_direct_upload

UploadResponse cancel_direct_upload(upload_id)

Cancel a direct upload

Cancels a direct upload and marks it as cancelled. If a pending upload finishes after this request, no asset will be created. This request will only succeed if the upload is still in the waiting state.

Example

  • Basic Authentication (accessToken):
from __future__ import print_function
import time
import mux_python
from mux_python.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mux.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mux_python.Configuration(
    host = "https://api.mux.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: accessToken
configuration = mux_python.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Enter a context with an instance of the API client
with mux_python.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mux_python.DirectUploadsApi(api_client)
    upload_id = 'abcd1234' # str | ID of the Upload

    try:
        # Cancel a direct upload
        api_response = api_instance.cancel_direct_upload(upload_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DirectUploadsApi->cancel_direct_upload: %s\n" % e)

Parameters

Name Type Description Notes
upload_id str ID of the Upload

Return type

UploadResponse

Authorization

accessToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
403 Cancellation no longer possible -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_direct_upload

UploadResponse create_direct_upload(create_upload_request)

Create a new direct upload URL

Creates a new direct upload, through which video content can be uploaded for ingest to Mux.

Example

  • Basic Authentication (accessToken):
from __future__ import print_function
import time
import mux_python
from mux_python.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mux.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mux_python.Configuration(
    host = "https://api.mux.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: accessToken
configuration = mux_python.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Enter a context with an instance of the API client
with mux_python.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mux_python.DirectUploadsApi(api_client)
    create_upload_request = {"cors_origin":"https://example.com/","new_asset_settings":{"playback_policies":["public"]}} # CreateUploadRequest | 

    try:
        # Create a new direct upload URL
        api_response = api_instance.create_direct_upload(create_upload_request)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DirectUploadsApi->create_direct_upload: %s\n" % e)

Parameters

Name Type Description Notes
create_upload_request CreateUploadRequest

Return type

UploadResponse

Authorization

accessToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Created -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_direct_upload

UploadResponse get_direct_upload(upload_id)

Retrieve a single direct upload's info

Fetches information about a single direct upload in the current environment.

Example

  • Basic Authentication (accessToken):
from __future__ import print_function
import time
import mux_python
from mux_python.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mux.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mux_python.Configuration(
    host = "https://api.mux.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: accessToken
configuration = mux_python.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Enter a context with an instance of the API client
with mux_python.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mux_python.DirectUploadsApi(api_client)
    upload_id = 'abcd1234' # str | ID of the Upload

    try:
        # Retrieve a single direct upload's info
        api_response = api_instance.get_direct_upload(upload_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DirectUploadsApi->get_direct_upload: %s\n" % e)

Parameters

Name Type Description Notes
upload_id str ID of the Upload

Return type

UploadResponse

Authorization

accessToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_direct_uploads

ListUploadsResponse list_direct_uploads(limit=limit, page=page)

List direct uploads

Lists direct uploads in the current environment.

Example

  • Basic Authentication (accessToken):
from __future__ import print_function
import time
import mux_python
from mux_python.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mux.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mux_python.Configuration(
    host = "https://api.mux.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: accessToken
configuration = mux_python.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Enter a context with an instance of the API client
with mux_python.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mux_python.DirectUploadsApi(api_client)
    limit = 25 # int | Number of items to include in the response (optional) (default to 25)
page = 1 # int | Offset by this many pages, of the size of `limit` (optional) (default to 1)

    try:
        # List direct uploads
        api_response = api_instance.list_direct_uploads(limit=limit, page=page)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DirectUploadsApi->list_direct_uploads: %s\n" % e)

Parameters

Name Type Description Notes
limit int Number of items to include in the response [optional] [default to 25]
page int Offset by this many pages, of the size of `limit` [optional] [default to 1]

Return type

ListUploadsResponse

Authorization

accessToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]