Skip to content

Latest commit

 

History

History
222 lines (156 loc) · 10.2 KB

ModelsApi.md

File metadata and controls

222 lines (156 loc) · 10.2 KB

corellium.ModelsApi

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_get_model_software GET /v3/models/{model}/software List software for a model
v3_get_models GET /v3/models List device models

v3_get_model_software

List[ModelFirmware] v3_get_model_software(model)

List software for a model

Lists the operating-system builds you can install on a new instance of one model. Identify the model by its flavor ID (for example iphone17a) or its product identifier. Each entry's osVersion and osBuild are the values to pass to POST /v3/instances.

Where the list comes from. It includes vendor builds the platform supports for this model (for example public iOS releases), firmware installed cluster-wide with POST /v3/images/install-firmware, and firmware uploaded at domain level with POST /v3/images (no projectId or instanceId). It does not include images that belong to a project or instance; to boot one of those, reference it explicitly when creating the instance.

Choosing a build.

  • installed: true builds are already on your deployment and start fastest. Others are downloaded when first used.
  • On Android there are usually two builds per version; rooted tells them apart. MATRIX needs the rooted build.
  • springboardSnapshot present means the build supports rapid start.

Returns 404 if the model is unknown or has no software.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.model_firmware import ModelFirmware
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.ModelsApi(api_client)
    model = 'iphone17a' # str | Which model to list software for: a flavor ID (the `flavor` value from `v3GetModels`, for example \"iphone17a\") or a product identifier such as \"iPhone18,4\". Only a flavor ID returns `springboardSnapshot`.

    try:
        # List software for a model
        api_response = api_instance.v3_get_model_software(model)
        print("The response of ModelsApi->v3_get_model_software:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ModelsApi->v3_get_model_software: %s\n" % e)

Parameters

Name Type Description Notes
model str Which model to list software for: a flavor ID (the `flavor` value from `v3GetModels`, for example "iphone17a") or a product identifier such as "iPhone18,4". Only a flavor ID returns `springboardSnapshot`.

Return type

List[ModelFirmware]

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Supported software loads for this model. -
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 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 software found for the given model. -

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

v3_get_models

List[Model] v3_get_models(if_none_match=if_none_match)

List device models

Lists every device model you can create an instance of. Call it first when creating a device: pick a model, then list its software with v3GetModelSoftware, then create the instance with POST /v3/instances.

The list only includes models your account can use. iOS models are left out if iOS is disabled for your domain, models from vendors your domain has not enabled are left out, and beta models appear only on deployments that allow them.

Each entry tells you what you need to create a valid instance:

  • flavor: the value to pass as flavor when creating the instance.
  • cores, coresMin, coresMax, coresStep, coresAllowed: which CPU core counts are allowed.
  • ram, ramMin, ramMax: allowed memory, in MiB.
  • hasSoftware: false means there is no operating system available for this model yet, so an instance cannot be created from a standard build.
  • mast: whether MATRIX assessments work on it.

Caching. The response carries an ETag header. Send it back as If-None-Match on later calls; if nothing has changed you get 304 with no body and can reuse your copy.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.model import Model
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.ModelsApi(api_client)
    if_none_match = '\"20184446fd197a424d5221fc7bfcd0084414c4b1ba822cac6f8f2221ebc80d06\"' # str | An ETag a previous response carried, quotes included. (optional)

    try:
        # List device models
        api_response = api_instance.v3_get_models(if_none_match=if_none_match)
        print("The response of ModelsApi->v3_get_models:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ModelsApi->v3_get_models: %s\n" % e)

Parameters

Name Type Description Notes
if_none_match str An ETag a previous response carried, quotes included. [optional]

Return type

List[Model]

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Supported device configurations. * ETag - Entity tag for this body. Send it back unchanged as `If-None-Match` to make the next request conditional.
304 The resource is unchanged since the ETag given in If-None-Match. * ETag - Entity tag for this body. Send it back unchanged as `If-None-Match` to make the next request conditional.
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 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]