AssetsApi class reference
All URIs are relative tohttp://localhost
Method | HTTP request | Description |
---|---|---|
create | POST /api/assets | Create an asset |
destroy | DELETE /api/assets/{uuid} | Delete an asset |
retrieve | GET /api/assets/{uuid} | Get an asset |
create
create(guide_id,file,**kwargs)
Create an asset
Example
frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:guide_id=1# int |file=open('/path/to/file','rb')# file_type |try:(data,response)=api_client.assets_api.create(guide_id,file,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling AssetsApi.create():%s\n"%e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
guide_id | int | ||
file | file_type |
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 asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.
Authentication
basicAuth, csrfAuth, csrfHeaderAuth, 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)
Delete an asset
Example
frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:uuid="uuid_example"# str | A UUID string identifying this asset.try:api_client.assets_api.destroy(uuid,)exceptexceptions.ApiExceptionase: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, soNone
is always returned as the first value.The second value is the raw response, which can be useful to get response parameters, such asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.
Authentication
basicAuth, csrfAuth, csrfHeaderAuth, 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)
Get an asset
Example
frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:uuid="uuid_example"# str | A UUID string identifying this asset.try:api_client.assets_api.retrieve(uuid,)exceptexceptions.ApiExceptionase: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, soNone
is always returned as the first value.The second value is the raw response, which can be useful to get response parameters, such asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.
Authentication
basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | Asset file | - |