LambdaApi class reference

All URIs are relative tohttp://localhost

MethodHTTP requestDescription
create_functionsPOST /api/lambda/functions/{func_id}
create_requestsPOST /api/lambda/requestsMethod calls the function
delete_requestsDELETE /api/lambda/requests/{id}Method cancels the request
list_functionsGET /api/lambda/functionsMethod returns a list of functions
list_requestsGET /api/lambda/requestsMethod returns a list of requests
retrieve_functionsGET /api/lambda/functions/{func_id}Method returns the information about the function
retrieve_requestsGET /api/lambda/requests/{id}Method returns the status of the request

create_functions

create_functions(func_id,online_function_call_request=None,**kwargs)

Allows to execute a function for immediate computation. Intended for short-lived executions, useful for interactive calls. When executed for interactive annotation, the job id must be specified in the ‘job’ input field. The task id is not required in this case, but if it is specified, it must match the job task id.

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:func_id="2"# str |online_function_call_request=OnlineFunctionCallRequest(job=1,task=1,)# OnlineFunctionCallRequest |  (optional)try:api_client.lambda_api.create_functions(func_id,online_function_call_request=online_function_call_request,)exceptexceptions.ApiExceptionase:print("Exception when calling LambdaApi.create_functions():%s\n"%e)

Parameters

NameTypeDescriptionNotes
func_idstr
online_function_call_requestOnlineFunctionCallRequest[optional]

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: application/json
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
200Returns function invocation results-

create_requests

create_requests(function_call_request,x_organization=None,org=None,org_id=None,**kwargs)

Method calls the function

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:function_call_request=FunctionCallRequest(function="function_example",task=1,job=1,max_distance=1,threshold=3.14,cleanup=False,conv_mask_to_poly=True,conv_mask_to_poly=True,mapping={"key":LabelMappingEntryRequest(name="name_example",attributes={"key":"key_example",},sublabels={"key":SublabelMappingEntryRequest(name="name_example",attributes={"key":"key_example",},),},),},)# FunctionCallRequest |x_organization="X-Organization_example"# str | Organization unique slug (optional)org="org_example"# str | Organization unique slug (optional)org_id=1# int | Organization identifier (optional)try:(data,response)=api_client.lambda_api.create_requests(function_call_request,x_organization=x_organization,org=org,org_id=org_id,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling LambdaApi.create_requests():%s\n"%e)

Parameters

NameTypeDescriptionNotes
function_call_requestFunctionCallRequest
x_organizationstrOrganization unique slug[optional]
orgstrOrganization unique slug[optional]
org_idintOrganization identifier[optional]

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

Returned values

Returned type:Tuple[FunctionCall, 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: application/json
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse headers
200-

delete_requests

delete_requests(id,**kwargs)

Method cancels the request

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:id="id_example"# str | Request idtry:api_client.lambda_api.delete_requests(id,)exceptexceptions.ApiExceptionase:print("Exception when calling LambdaApi.delete_requests():%s\n"%e)

Parameters

NameTypeDescriptionNotes
idstrRequest id

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 codeDescriptionResponse headers
204No response body-

list_functions

list_functions(**kwargs)

Method returns a list of functions

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:try:api_client.lambda_api.list_functions()exceptexceptions.ApiExceptionase:print("Exception when calling LambdaApi.list_functions():%s\n"%e)

Parameters

This endpoint does not need any parameter.

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 codeDescriptionResponse headers
200No response body-

list_requests

list_requests(**kwargs)

Method returns a list of requests

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:try:(data,response)=api_client.lambda_api.list_requests()pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling LambdaApi.list_requests():%s\n"%e)

Parameters

This endpoint does not need any parameter.

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

Returned values

Returned type:Tuple[list[FunctionCall], 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: Not defined
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse headers
200-

retrieve_functions

retrieve_functions(func_id,**kwargs)

Method returns the information about the function

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:func_id="2"# str |try:(data,response)=api_client.lambda_api.retrieve_functions(func_id,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling LambdaApi.retrieve_functions():%s\n"%e)

Parameters

NameTypeDescriptionNotes
func_idstr

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

Returned values

Returned type:Tuple[dict[str, typing.Union[typing.Any, none_type]], 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: Not defined
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse headers
200Information about the function-

retrieve_requests

retrieve_requests(id,**kwargs)

Method returns the status of the request

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:id="id_example"# str | Request idtry:(data,response)=api_client.lambda_api.retrieve_requests(id,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling LambdaApi.retrieve_requests():%s\n"%e)

Parameters

NameTypeDescriptionNotes
idstrRequest id

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

Returned values

Returned type:Tuple[FunctionCall, 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: Not defined
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse headers
200-