AssetsApi class reference

All URIs are relative to http://localhost

Method HTTP request Description
create POST /api/assets Method saves new asset on the server and attaches it to a corresponding guide
destroy DELETE /api/assets/{uuid} Method deletes a specific asset from the server
retrieve GET /api/assets/{uuid} Method returns an asset file

create

create( file=None, **kwargs )

Method saves new asset on the server and attaches it to a corresponding guide

Example

from pprint import pprint

from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *

# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
    host = "http://localhost",
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD',
)

with ApiClient(configuration) as api_client:
    file = open('/path/to/file', 'rb') # file_type |  (optional)

    try:
        (data, response) = api_client.assets_api.create(
            file=file,
        )
        pprint(data)
    except exceptions.ApiException as e:
        print("Exception when calling AssetsApi.create(): %s\n" % e)

Parameters

Name Type Description Notes
file file_type [optional]

There are also optional kwargs that control the function invocation behavior. Read more here.

Returned values

Returned type: Tuple[AssetRead, urllib3.HTTPResponse].

Returns a tuple with 2 values: (parsed_response, raw_response).

The first value is a model parsed from the response data. The second value is the raw response, which can be useful to get response parameters, such as status code, headers, or raw response data. Read more about invocation parameters and returned values here.

Authorization

basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/vnd.cvat+json

HTTP response details

Status code Description Response headers
201 -

destroy

destroy( uuid, **kwargs )

Method deletes a specific asset from the server

Example

from pprint import pprint

from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *

# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
    host = "http://localhost",
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD',
)

with ApiClient(configuration) as api_client:
    uuid = "uuid_example" # str | A UUID string identifying this asset.

    try:
        api_client.assets_api.destroy(
            uuid,)
    except exceptions.ApiException as e:
        print("Exception when calling AssetsApi.destroy(): %s\n" % e)

Parameters

Name Type Description Notes
uuid str A UUID string identifying this asset.

There are also optional kwargs that control the function invocation behavior. Read more here.

Returned values

Returned type: Tuple[None, urllib3.HTTPResponse].

Returns a tuple with 2 values: (None, raw_response).

This endpoint does not have any return value, so None is always returned as the first value. The second value is the raw response, which can be useful to get response parameters, such as status code, headers, or raw response data. Read more about invocation parameters and returned values here.

Authorization

basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
204 The asset has been deleted -

retrieve

retrieve( uuid, **kwargs )

Method returns an asset file

Example

from pprint import pprint

from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *

# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
    host = "http://localhost",
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD',
)

with ApiClient(configuration) as api_client:
    uuid = "uuid_example" # str | A UUID string identifying this asset.

    try:
        api_client.assets_api.retrieve(
            uuid,)
    except exceptions.ApiException as e:
        print("Exception when calling AssetsApi.retrieve(): %s\n" % e)

Parameters

Name Type Description Notes
uuid str A UUID string identifying this asset.

There are also optional kwargs that control the function invocation behavior. Read more here.

Returned values

Returned type: Tuple[None, urllib3.HTTPResponse].

Returns a tuple with 2 values: (None, raw_response).

This endpoint does not have any return value, so None is always returned as the first value. The second value is the raw response, which can be useful to get response parameters, such as status code, headers, or raw response data. Read more about invocation parameters and returned values here.

Authorization

basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Asset file -