Hacarus.SpectroSdk.ModelsApi
All URIs are relative to https://sdd-api-staging.hacarus.com
Method | HTTP request | Description |
---|---|---|
delete_models | DELETE /api/v1/models/ | Delete Models |
export_models_with_id | POST /api/v1/models/export | Export models |
get_model_by_id | GET /api/v1/models/{model_id} | Get Model by ID |
get_models | GET /api/v1/models/ | Get List of Models |
import_models | POST /api/v1/models/import | Import models |
predict_items | POST /api/v1/models/{model_id}/predict | Predict Items |
set_model_predict_callback | POST /api/v1/models/{model_id}/update_predict_callback | Set Prediction Callback URL |
set_model_predict_parameters | POST /api/v1/models/{model_id}/update_predict_parameters | Set Prediction Parameters |
delete_models
ModelIdsQueryWrapper delete_models()
Delete Models
Delete models by id (list)
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import models_api
from Hacarus.SpectroSdk.model.base_error import BaseError
from Hacarus.SpectroSdk.model.model_ids_query_wrapper import ModelIdsQueryWrapper
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.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 Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = models_api.ModelsApi(api_client)
model_ids = [
"model_ids_example",
] # [str] | (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
# Delete Models
api_response = api_instance.delete_models(model_ids=model_ids)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ModelsApi->delete_models: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
model_ids | [str] | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
422 | Unprocessable Entity | - |
200 | OK | - |
0 | Default error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
export_models_with_id
file_type export_models_with_id(model_ids_query)
Export models
Export models given the Id
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import models_api
from Hacarus.SpectroSdk.model.model_ids_query import ModelIdsQuery
from Hacarus.SpectroSdk.model.base_error import BaseError
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.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 Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = models_api.ModelsApi(api_client)
model_ids_query = ModelIdsQuery(
model_ids=[
"model_ids_example",
],
) # ModelIdsQuery |
# example passing only required values which don't have defaults set
try:
# Export models
api_response = api_instance.export_models_with_id(model_ids_query)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ModelsApi->export_models_with_id: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
model_ids_query | ModelIdsQuery |
Return type
file_type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json, application/zip
HTTP response details
Status code | Description | Response headers |
---|---|---|
422 | Unprocessable Entity | - |
200 | Zip file containing the model/s | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_model_by_id
HModelWrapper get_model_by_id(model_id)
Get Model by ID
Get a single model by ID
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import models_api
from Hacarus.SpectroSdk.model.base_error import BaseError
from Hacarus.SpectroSdk.model.h_model_wrapper import HModelWrapper
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.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 Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = models_api.ModelsApi(api_client)
model_id = "model_id_example" # str |
# example passing only required values which don't have defaults set
try:
# Get Model by ID
api_response = api_instance.get_model_by_id(model_id)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ModelsApi->get_model_by_id: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
model_id | str |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
0 | Default error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_models
HModelListWrapper get_models()
Get List of Models
Get all models created by user
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import models_api
from Hacarus.SpectroSdk.model.h_model_list_wrapper import HModelListWrapper
from Hacarus.SpectroSdk.model.base_error import BaseError
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.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 Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = models_api.ModelsApi(api_client)
algorithm_id = "algorithm_id_example" # str | (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
# Get List of Models
api_response = api_instance.get_models(algorithm_id=algorithm_id)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ModelsApi->get_models: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
algorithm_id | str | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
422 | Unprocessable Entity | - |
200 | OK | - |
0 | Default error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
import_models
HModelListWrapper import_models()
Import models
Import models from the zip file
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import models_api
from Hacarus.SpectroSdk.model.h_model_list_wrapper import HModelListWrapper
from Hacarus.SpectroSdk.model.base_error import BaseError
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.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 Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = models_api.ModelsApi(api_client)
models = open('/path/to/file', 'rb') # file_type | (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
# Import models
api_response = api_instance.import_models(models=models)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ModelsApi->import_models: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
models | file_type | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
422 | Unprocessable Entity | - |
200 | OK | - |
0 | Default error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
predict_items
PredictItemsResponseWrapper predict_items(model_id, predict)
Predict Items
Predict items in the background
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import models_api
from Hacarus.SpectroSdk.model.predict import Predict
from Hacarus.SpectroSdk.model.base_error import BaseError
from Hacarus.SpectroSdk.model.predict_items_response_wrapper import PredictItemsResponseWrapper
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.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 Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = models_api.ModelsApi(api_client)
model_id = "model_id_example" # str | The model id, set to \"active\" to use current active model
predict = Predict(
item_ids=[
"item_ids_example",
],
) # Predict |
# example passing only required values which don't have defaults set
try:
# Predict Items
api_response = api_instance.predict_items(model_id, predict)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ModelsApi->predict_items: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
model_id | str | The model id, set to "active" to use current active model | |
predict | Predict |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
425 | The server is busy processing requests. Try again in a while. | - |
404 | item_id not found | - |
400 | model_id not found | - |
200 | OK | - |
0 | Default error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
set_model_predict_callback
UpdatePredictCallbackResponseWrapper set_model_predict_callback(model_id, update_predict_callback)
Set Prediction Callback URL
Updates the callback URL for prediction. Once this endpoint has been set, a successful prediction will do a POST or GET operation to the callback URL with the data PredictionItemCallbackResponse
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import models_api
from Hacarus.SpectroSdk.model.update_predict_callback_response_wrapper import UpdatePredictCallbackResponseWrapper
from Hacarus.SpectroSdk.model.base_error import BaseError
from Hacarus.SpectroSdk.model.update_predict_callback import UpdatePredictCallback
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.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 Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = models_api.ModelsApi(api_client)
model_id = "model_id_example" # str |
update_predict_callback = UpdatePredictCallback(
callback_url="callback_url_example",
callback_method="callback_method_example",
) # UpdatePredictCallback |
# example passing only required values which don't have defaults set
try:
# Set Prediction Callback URL
api_response = api_instance.set_model_predict_callback(model_id, update_predict_callback)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ModelsApi->set_model_predict_callback: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
model_id | str | ||
update_predict_callback | UpdatePredictCallback |
Return type
UpdatePredictCallbackResponseWrapper
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
400 | Invalid parameters | - |
200 | OK | - |
0 | Default error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
set_model_predict_parameters
UpdatePredictParametersResponseWrapper set_model_predict_parameters(model_id, update_predict_parameters)
Set Prediction Parameters
Updates predict parameters
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import models_api
from Hacarus.SpectroSdk.model.update_predict_parameters_response_wrapper import UpdatePredictParametersResponseWrapper
from Hacarus.SpectroSdk.model.base_error import BaseError
from Hacarus.SpectroSdk.model.update_predict_parameters import UpdatePredictParameters
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.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 Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = models_api.ModelsApi(api_client)
model_id = "model_id_example" # str |
update_predict_parameters = UpdatePredictParameters(
threshold=3.14,
ignore_outer="ignore_outer_example",
min_detected_area=3.14,
) # UpdatePredictParameters |
# example passing only required values which don't have defaults set
try:
# Set Prediction Parameters
api_response = api_instance.set_model_predict_parameters(model_id, update_predict_parameters)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ModelsApi->set_model_predict_parameters: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
model_id | str | ||
update_predict_parameters | UpdatePredictParameters |
Return type
UpdatePredictParametersResponseWrapper
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
400 | Invalid parameters | - |
200 | OK | - |
0 | Default error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]