Skip to content

Latest commit

 

History

History
557 lines (390 loc) · 22.2 KB

ExtensionsApi.md

File metadata and controls

557 lines (390 loc) · 22.2 KB

corellium.ExtensionsApi

Request timeouts

Every API method accepts _request_timeout in seconds: a positive float for the urllib3 total timeout, or a pair of positive floats (connect, read). This controls HTTP transport waiting, not how long the server operation may run. It is not a wall-clock deadline for the operation or for all retries combined.

Transport timeouts raise urllib3.exceptions.TimeoutError subclasses such as ReadTimeoutError and ConnectTimeoutError. When retries are exhausted, urllib3 can instead raise urllib3.exceptions.MaxRetryError; inspect its reason to distinguish a timeout from other connection failures. Retry behavior depends on the HTTP method and Configuration.retries. These are client-side exceptions, not HTTP response statuses or SDK ApiException responses.

A timeout does not guarantee cancellation or rollback of an operation accepted by the server. For example, after a start request times out, the instance may still be starting or may already be running; the timeout alone does not establish its state or mean it was stopped or destroyed. The request might not have reached the server at all, leaving the instance off. Treat the outcome as unknown and fetch the instance's current state before deciding whether to retry. If it has since been destroyed, that lookup may return not found; the timeout itself does not prove destruction. Do not blindly repeat a state-changing request.

Catch urllib3.exceptions.TimeoutError and urllib3.exceptions.MaxRetryError separately from the SDK ApiException. MaxRetryError is not a subclass of TimeoutError. With _with_http_info the same rules apply. With _without_preload_content, a read timeout may also occur later when reading the returned response body.

All URIs are relative to https://app.corellium.com/api

Method HTTP request Description
v3_delete_extension DELETE /v3/extensions/{extensionId} Delete an existing extension
v3_get_extension_by_id GET /v3/extensions/{extensionId} Get extension by ID
v3_list_extensions GET /v3/extensions List all extensions
v3_load_extension POST /v3/extensions Load an extension
v3_parse_extension_json POST /v3/extensions/parse/extension.json Validates extension.json
v3_update_extension PUT /v3/extensions/{extensionId} Update an existing extension

v3_delete_extension

v3_delete_extension(extension_id)

Delete an existing extension

Required role: Domain administrator.

Deletes the extension identified by the given extension ID. Available on on-site deployments only. Deletion is asynchronous: the extension is marked deleting and the call returns 204 before removal completes.

Deletes are idempotent: an unknown extension ID, or an extension that was already deleted, is a successful no-op that still returns 204, and repeated calls return 204 as well. A 404 means the request path did not match a delete route, not that the target was missing. A repeat therefore returns 204 both while the record is still present in the deleting state and after it has disappeared.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# 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): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.ExtensionsApi(api_client)
    extension_id = 'rpi4b' # str | Extension ID.

    try:
        # Delete an existing extension
        api_instance.v3_delete_extension(extension_id)
    except Exception as e:
        print("Exception when calling ExtensionsApi->v3_delete_extension: %s\n" % e)

Parameters

Name Type Description Notes
extension_id str Extension ID.

Return type

void (empty response body)

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No content -
400 The request was invalid, for example a missing or malformed field. The body says which field; fix it before retrying. -
401 Not signed in: the `Authorization: Bearer <token>` header is missing, or the token is invalid or expired. Get a new token and retry. -
403 Domain administrator permissions required. Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_get_extension_by_id

Extension v3_get_extension_by_id(extension_id)

Get extension by ID

Required role: Domain administrator.

Returns one installed extension, including whether it is enabled and the device models (flavors) it adds. Requires a domain administrator. Available on on-site deployments only.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.extension import Extension
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# 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): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.ExtensionsApi(api_client)
    extension_id = 'rpi4b' # str | Extension ID.

    try:
        # Get extension by ID
        api_response = api_instance.v3_get_extension_by_id(extension_id)
        print("The response of ExtensionsApi->v3_get_extension_by_id:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ExtensionsApi->v3_get_extension_by_id: %s\n" % e)

Parameters

Name Type Description Notes
extension_id str Extension ID.

Return type

Extension

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Extension. -
400 The request was invalid, for example a missing or malformed field. The body says which field; fix it before retrying. -
401 Not signed in: the `Authorization: Bearer <token>` header is missing, or the token is invalid or expired. Get a new token and retry. -
403 Domain administrator permissions required. Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -
404 No extension with the given extension ID. -

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

v3_list_extensions

ExtensionList v3_list_extensions(limit=limit, offset=offset, if_none_match=if_none_match)

List all extensions

Required role: Domain administrator.

Lists the extensions installed on this deployment. An extension adds new device models (for example an IoT board such as a Raspberry Pi 4) that you can then create devices from; each one is defined by an extension.json file listing its models, CPU cores, memory and boot options. Requires a domain administrator. Available on on-site deployments only. The response carries an ETag; send it back as If-None-Match to get 304 when nothing changed.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.extension_list import ExtensionList
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# 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): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.ExtensionsApi(api_client)
    limit = 100 # float | Most results to return in one page. Whole number from 1 to 1000; defaults to 100. A value outside that range is rejected with 400. (optional) (default to 100)
    offset = 0 # float | How many results to skip before this page starts; defaults to 0. To get the next page, add `limit` to the previous `offset`. (optional) (default to 0)
    if_none_match = '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08' # str | SHA-256 sum of the last response with the same parameters. (optional)

    try:
        # List all extensions
        api_response = api_instance.v3_list_extensions(limit=limit, offset=offset, if_none_match=if_none_match)
        print("The response of ExtensionsApi->v3_list_extensions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ExtensionsApi->v3_list_extensions: %s\n" % e)

Parameters

Name Type Description Notes
limit float Most results to return in one page. Whole number from 1 to 1000; defaults to 100. A value outside that range is rejected with 400. [optional] [default to 100]
offset float How many results to skip before this page starts; defaults to 0. To get the next page, add `limit` to the previous `offset`. [optional] [default to 0]
if_none_match str SHA-256 sum of the last response with the same parameters. [optional]

Return type

ExtensionList

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Paginated list of extensions. -
304 Not modified. -
400 The request was invalid, for example a missing or malformed field. The body says which field; fix it before retrying. -
401 Not signed in: the `Authorization: Bearer <token>` header is missing, or the token is invalid or expired. Get a new token and retry. -
403 Domain administrator permissions required. Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_load_extension

Extension v3_load_extension(load_extension_body)

Load an extension

Required role: Domain administrator.

Installs an extension so its device models become available. Steps: (1) optionally check your extension.json with v3ParseExtensionJson; (2) upload the extension file with POST /v3/images using type: "extension"; (3) call this with the returned imageId. The definition is read from the uploaded file, so only the image ID is sent. The new models then appear in GET /v3/models. Requires a domain administrator. Available on on-site deployments only.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.extension import Extension
from corellium.models.load_extension_body import LoadExtensionBody
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# 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): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.ExtensionsApi(api_client)
    load_extension_body = corellium.LoadExtensionBody() # LoadExtensionBody | 

    try:
        # Load an extension
        api_response = api_instance.v3_load_extension(load_extension_body)
        print("The response of ExtensionsApi->v3_load_extension:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ExtensionsApi->v3_load_extension: %s\n" % e)

Parameters

Name Type Description Notes
load_extension_body LoadExtensionBody

Return type

Extension

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Extension. -
400 Invalid extension or image. -
401 Not signed in: the `Authorization: Bearer <token>` header is missing, or the token is invalid or expired. Get a new token and retry. -
403 Domain administrator permissions required. Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_parse_extension_json

Dict[str, Optional[object]] v3_parse_extension_json(request_body)

Validates extension.json

Required role: Domain administrator.

Checks an extension.json document before you upload it, and returns the normalised definition the platform would use (with defaults filled in). Returns 400 with the problem if the document is invalid. Nothing is installed. Requires a domain administrator. Available on on-site deployments only.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# 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): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.ExtensionsApi(api_client)
    request_body = None # Dict[str, Optional[object]] | Contents of the extension.json file.

    try:
        # Validates extension.json
        api_response = api_instance.v3_parse_extension_json(request_body)
        print("The response of ExtensionsApi->v3_parse_extension_json:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ExtensionsApi->v3_parse_extension_json: %s\n" % e)

Parameters

Name Type Description Notes
request_body Dict[str, Optional[object]] Contents of the extension.json file.

Return type

Dict[str, Optional[object]]

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
400 Invalid extension.json. -
401 Not signed in: the `Authorization: Bearer <token>` header is missing, or the token is invalid or expired. Get a new token and retry. -
403 Domain administrator permissions required. Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_update_extension

Extension v3_update_extension(extension_id, update_extension_body)

Update an existing extension

Required role: Domain administrator.

Turns an installed extension on or off with enabled. While it is off, devices that use its models cannot be created or started. Requires a domain administrator. Available on on-site deployments only.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.extension import Extension
from corellium.models.update_extension_body import UpdateExtensionBody
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# 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): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.ExtensionsApi(api_client)
    extension_id = 'rpi4b' # str | Extension ID.
    update_extension_body = corellium.UpdateExtensionBody() # UpdateExtensionBody | 

    try:
        # Update an existing extension
        api_response = api_instance.v3_update_extension(extension_id, update_extension_body)
        print("The response of ExtensionsApi->v3_update_extension:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ExtensionsApi->v3_update_extension: %s\n" % e)

Parameters

Name Type Description Notes
extension_id str Extension ID.
update_extension_body UpdateExtensionBody

Return type

Extension

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The updated extension. -
400 The request was invalid, for example a missing or malformed field. The body says which field; fix it before retrying. -
401 Not signed in: the `Authorization: Bearer <token>` header is missing, or the token is invalid or expired. Get a new token and retry. -
403 Domain administrator permissions required. Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -
404 No extension with the given extension ID. -

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