Skip to content

Latest commit

 

History

History
1065 lines (758 loc) · 46.4 KB

ImagesApi.md

File metadata and controls

1065 lines (758 loc) · 46.4 KB

corellium.ImagesApi

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_create_image POST /v3/images Create an image
v3_delete_image DELETE /v3/images/{imageId} Delete an image
v3_get_image GET /v3/images/{imageId} Get image metadata
v3_get_image_chunk GET /v3/images/{imageId}/file Check whether an image chunk was already uploaded
v3_get_image_firmware_info POST /v3/images/{imageId}/fwinfo Get firmware info embedded in an image
v3_get_install_firmware_status GET /v3/images/install-firmware/{taskId} Get install-firmware task status
v3_install_firmware POST /v3/images/install-firmware Install firmware cluster-wide
v3_install_firmware_assets POST /v3/images/install-firmware-assets Install firmware assets cluster-wide
v3_list_images GET /v3/images List image metadata
v3_upload_image_chunk PUT /v3/images/{imageId}/file Upload one chunk of an image file
v3_upload_image_data POST /v3/images/{imageId} Upload image file contents

v3_create_image

Image v3_create_image(create_image_body)

Create an image

Creates an image: a stored file such as firmware, a kernel, a partition, or a MATRIX wordlist. Every upload starts here. The response is the new image, including its id.

Choosing how to upload the file:

  • Two steps (recommended). Send this request as application/json without a file; it returns 201. Then upload the contents with uploadImageData (one request) or uploadImageChunk (in pieces, resumable, best for large files). This is the only way to have the server verify the file against a corelliumChecksum.
  • One step. Send this request as multipart/form-data with the file in a file part; it returns 200 once the file is stored. Put the type field before the file part. Convenient for small files, but no checksum verification.

The response body is the same image in both cases; the status code (201 or 200) tells you whether the file was included.

Where the image lives depends on the optional IDs:

  • instanceId set: attached to that device. Replaces the device's existing image of the same type.
  • projectId set: stored in that project and counted against its quota.
  • Neither: a domain-level image. Domain-level fw and clbi images are also offered when you create a device, in addition to installed firmware. See the projectId and instanceId fields for side effects.

Other upload endpoints (PUT /v3/projects/{projectId}/image-upload/..., PUT /v3/instances/{instanceId}/image-upload/..., PUT /v3/domain/image-upload/...) use the same chunked protocol but create the image on the first chunk instead of requiring this call. They exist mainly for the web interface; new code should use this endpoint followed by uploadImageChunk.

name is not unique; sending the same request twice creates two images. For firmware, continue with installFirmware or installFirmwareAssets.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.create_image_body import CreateImageBody
from corellium.models.image import Image
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.ImagesApi(api_client)
    create_image_body = corellium.CreateImageBody() # CreateImageBody | 

    try:
        # Create an image
        api_response = api_instance.v3_create_image(create_image_body)
        print("The response of ImagesApi->v3_create_image:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ImagesApi->v3_create_image: %s\n" % e)

Parameters

Name Type Description Notes
create_image_body CreateImageBody

Return type

Image

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Image created with file uploaded (multipart). -
201 Image metadata created (JSON only); upload separately. -
400 Missing or invalid image fields. -
401 Not signed in: the `Authorization: Bearer <token>` header is missing, or the token is invalid or expired. Get a new token and retry. -
404 The instance named by `instanceId` does not exist. -

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

v3_delete_image

v3_delete_image(image_id)

Delete an image

Permanently deletes the image. This action cannot be undone.

Deletion is synchronous. Deletes are idempotent: an unknown imageId, or an image that has already been 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.

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.ImagesApi(api_client)
    image_id = '3e1354a3-fb10-46c0-8b05-56e28edbde69' # str | 

    try:
        # Delete an image
        api_instance.v3_delete_image(image_id)
    except Exception as e:
        print("Exception when calling ImagesApi->v3_delete_image: %s\n" % e)

Parameters

Name Type Description Notes
image_id str

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 Image deleted; empty body. -
401 Not signed in: the `Authorization: Bearer <token>` header is missing, or the token is invalid or expired. Get a new token and retry. -

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

v3_get_image

Image v3_get_image(image_id)

Get image metadata

Returns metadata for a single image. File contents are not returned by this endpoint.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.image import Image
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.ImagesApi(api_client)
    image_id = '3e1354a3-fb10-46c0-8b05-56e28edbde69' # str | 

    try:
        # Get image metadata
        api_response = api_instance.v3_get_image(image_id)
        print("The response of ImagesApi->v3_get_image:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ImagesApi->v3_get_image: %s\n" % e)

Parameters

Name Type Description Notes
image_id str

Return type

Image

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Image metadata. -
404 No image with the given imageId. -

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

v3_get_image_chunk

object v3_get_image_chunk(image_id, resumable_chunk_number, resumable_chunk_size, resumable_current_chunk_size)

Check whether an image chunk was already uploaded

Probes whether a single chunk of a chunked upload is already stored, so an interrupted upload can resume without re-sending data. Used together with uploadImageChunk.

Returns 200 when the chunk is present and 204 when it still needs to be uploaded. The chunk is identified exactly as in the upload request, by resumableChunkNumber, resumableChunkSize and resumableCurrentChunkSize, all of which are required. The image must already exist; an unknown imageId is a 404 rather than a 204.

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.ImagesApi(api_client)
    image_id = '3e1354a3-fb10-46c0-8b05-56e28edbde69' # str | 
    resumable_chunk_number = 1 # float | Chunk sequence number.
    resumable_chunk_size = 1048576 # float | Size of each chunk.
    resumable_current_chunk_size = 1048576 # float | Size of the current chunk.

    try:
        # Check whether an image chunk was already uploaded
        api_response = api_instance.v3_get_image_chunk(image_id, resumable_chunk_number, resumable_chunk_size, resumable_current_chunk_size)
        print("The response of ImagesApi->v3_get_image_chunk:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ImagesApi->v3_get_image_chunk: %s\n" % e)

Parameters

Name Type Description Notes
image_id str
resumable_chunk_number float Chunk sequence number.
resumable_chunk_size float Size of each chunk.
resumable_current_chunk_size float Size of the current chunk.

Return type

object

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The chunk is already stored; empty JSON body. -
204 The chunk is missing and still needs to be uploaded. -
400 Invalid or missing chunk parameters. -
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 No permission for the image's project, or the image is site-wide and the caller is not a domain (on-site) or cloud administrator. -
404 No image with the given imageId. -

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

v3_get_image_firmware_info

ImageFirmwareInfo v3_get_image_firmware_info(image_id, get_firmware_info_body=get_firmware_info_body)

Get firmware info embedded in an image

Reads the version information built into an uploaded firmware file, without installing it or creating a device. Use it to check what a file is before you install it or create a device from it: which operating-system version and build it contains, and which device models it supports.

Works on these kinds of uploaded files: an Apple iOS firmware file (IPSW), a Corellium firmware package (.coreimg), a Cellebrite firmware image, a Cellebrite extraction (UFD), and a Corellium extension. The image must be fully uploaded first; see createImage.

The request body is optional:

  • password: needed only if the file is encrypted. A wrong password returns 400.
  • extended: set to true to also get chip and board details and the supported device model this firmware matches (device). Use the matched model's flavor when you create an instance.

Returns 404 if the image does not exist, or if the file contains no version information that can be read (for example, it is not firmware).

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.get_firmware_info_body import GetFirmwareInfoBody
from corellium.models.image_firmware_info import ImageFirmwareInfo
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.ImagesApi(api_client)
    image_id = '3e1354a3-fb10-46c0-8b05-56e28edbde69' # str | 
    get_firmware_info_body = corellium.GetFirmwareInfoBody() # GetFirmwareInfoBody | Optional decryption password and extended-info flag. (optional)

    try:
        # Get firmware info embedded in an image
        api_response = api_instance.v3_get_image_firmware_info(image_id, get_firmware_info_body=get_firmware_info_body)
        print("The response of ImagesApi->v3_get_image_firmware_info:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ImagesApi->v3_get_image_firmware_info: %s\n" % e)

Parameters

Name Type Description Notes
image_id str
get_firmware_info_body GetFirmwareInfoBody Optional decryption password and extended-info flag. [optional]

Return type

ImageFirmwareInfo

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Firmware info parsed from the image. -
400 Invalid request body, or the supplied password is wrong. -
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 No permission for the image's project. -
404 No image with the given imageId, no firmware info file inside it, or the info was unparseable. -
409 The image backing file is not currently accessible. -

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

v3_get_install_firmware_status

InstallFirmwareStatusResponse v3_get_install_firmware_status(task_id)

Get install-firmware task status

Returns the current status of a firmware installation task previously created via installFirmware. Clients should poll this endpoint until status is complete or error.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.install_firmware_status_response import InstallFirmwareStatusResponse
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.ImagesApi(api_client)
    task_id = '722cdce5-6f71-4f4a-b2b6-c00f11c015f6' # str | 

    try:
        # Get install-firmware task status
        api_response = api_instance.v3_get_install_firmware_status(task_id)
        print("The response of ImagesApi->v3_get_install_firmware_status:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ImagesApi->v3_get_install_firmware_status: %s\n" % e)

Parameters

Name Type Description Notes
task_id str

Return type

InstallFirmwareStatusResponse

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Task status. -
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. -
404 No install-firmware task with the given taskId. -

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

v3_install_firmware

InstallFirmwareResponse v3_install_firmware(install_firmware_body)

Install firmware cluster-wide

Makes an uploaded fw image available for creating devices across the whole cluster. After it is installed, the firmware appears in GET /v3/models/{model}/software for the matching model and can be chosen when creating an instance.

Workflow:

  1. createImage with { "name": "...", "type": "fw", "encoding": "plain" } as JSON. Keep the returned id.
  2. Upload the file with uploadImageData or, for large files, uploadImageChunk. Supplying corelliumChecksum there lets the server verify the file.
  3. installFirmware with { "imageId": "<id>" }. Returns a taskId.
  4. Poll getInstallFirmwareStatus with the taskId until status is complete or error.

What happens. The server hands the file to the firmware service and returns 201 with a taskId as soon as the hand-off succeeds; installation continues in the background and can take a long time (up to 45 minutes for files around 10 GB). The source image is deleted from /v3/images at the moment of hand-off, before installation finishes. If installation then fails, upload the file again to retry.

A 400 can mean the firmware service rejected the image's checksum. Check that the file uploaded completely and, if you supplied corelliumChecksum, that it was correct.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.install_firmware_body import InstallFirmwareBody
from corellium.models.install_firmware_response import InstallFirmwareResponse
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.ImagesApi(api_client)
    install_firmware_body = corellium.InstallFirmwareBody() # InstallFirmwareBody | 

    try:
        # Install firmware cluster-wide
        api_response = api_instance.v3_install_firmware(install_firmware_body)
        print("The response of ImagesApi->v3_install_firmware:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ImagesApi->v3_install_firmware: %s\n" % e)

Parameters

Name Type Description Notes
install_firmware_body InstallFirmwareBody

Return type

InstallFirmwareResponse

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Install task accepted. -
400 Invalid request body, or firmware checksum rejected. -
401 Not signed in: the `Authorization: Bearer <token>` header is missing, or the token is invalid or expired. Get a new token and retry. -
404 No firmware-type Image with the given imageId. -

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

v3_install_firmware_assets

InstallFirmwareAssetsResponse v3_install_firmware_assets(install_firmware_assets_body)

Install firmware assets cluster-wide

Installs an uploaded firmware-assets JSON blob for cluster-wide use. On success the source Image is deleted from the Images store. The blob is forwarded to the firmware service, which merges it into the cluster-wide firmware-assets manifest.

This is step 3 of the firmware-assets-install workflow:

  1. createImage with { name: 'fcs-keys.json', type: 'fwasset' } → returns an imageId.
  2. uploadImageData with the assets file → uploads contents.
  3. installFirmwareAssets with { imageId } → installs the assets.

Unlike installFirmware, this endpoint completes synchronously and returns the firmware service's response message directly; there is no task to poll.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.install_firmware_assets_body import InstallFirmwareAssetsBody
from corellium.models.install_firmware_assets_response import InstallFirmwareAssetsResponse
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.ImagesApi(api_client)
    install_firmware_assets_body = corellium.InstallFirmwareAssetsBody() # InstallFirmwareAssetsBody | 

    try:
        # Install firmware assets cluster-wide
        api_response = api_instance.v3_install_firmware_assets(install_firmware_assets_body)
        print("The response of ImagesApi->v3_install_firmware_assets:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ImagesApi->v3_install_firmware_assets: %s\n" % e)

Parameters

Name Type Description Notes
install_firmware_assets_body InstallFirmwareAssetsBody

Return type

InstallFirmwareAssetsResponse

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Assets installed (or no-op if assets already present). -
400 Invalid request body, or image contents are not valid 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. -
404 No fwasset-type Image with the given imageId, or image is on a remote coordinator. -

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

v3_list_images

ImageList v3_list_images(limit=limit, offset=offset, project_id=project_id)

List image metadata

Lists the images you can see: images in your projects plus domain-level images. File contents are not included; use the download or upload endpoints for those.

Set projectId to list only one project's images. Results are paginated with limit and offset.

Installed firmware is not listed here: once installFirmware hands an image off, it disappears from this list and shows up in GET /v3/models/{model}/software instead.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.image_list import ImageList
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.ImagesApi(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)
    project_id = '1c41b1bc-4f53-48a8-b690-ad30611e1960' # str | Filter results to a single project. (optional)

    try:
        # List image metadata
        api_response = api_instance.v3_list_images(limit=limit, offset=offset, project_id=project_id)
        print("The response of ImagesApi->v3_list_images:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ImagesApi->v3_list_images: %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]
project_id str Filter results to a single project. [optional]

Return type

ImageList

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Paginated list of image metadata. -
401 Not signed in: the `Authorization: Bearer <token>` header is missing, or the token is invalid or expired. Get a new token and retry. -

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

v3_upload_image_chunk

v3_upload_image_chunk(image_id, resumable_chunk_number, resumable_chunk_size, resumable_current_chunk_size, resumable_total_size, resumable_total_chunks, body, resumable_identifier=resumable_identifier, resumable_filename=resumable_filename, resumable_relative_path=resumable_relative_path, resumable_type=resumable_type, corellium_checksum=corellium_checksum, x_corellium_total_file_size=x_corellium_total_file_size)

Upload one chunk of an image file

Uploads a single chunk of an Image previously created via createImage, using the resumable upload protocol. This is the recommended way to upload large images: the transfer survives interruptions, because any chunk can be re-sent and already-stored chunks can be skipped.

Chunked upload workflow:

  1. createImage with { name, type, encoding } → returns an imageId.
  2. Split the file into fixed-size chunks and uploadImageChunk each one with the resumable* query parameters describing it. Chunks may be uploaded in any order and concurrently.
  3. Optionally probe a chunk with getImageChunk before (re-)sending it, so an interrupted upload only re-sends what is missing.

The image is finalized automatically by the request that completes the chunk set, so the last chunk to arrive also validates corelliumChecksum (when supplied) and runs the firmware post-processing. Re-sending a chunk that was already stored is safe. If the upload fails for any reason other than a retryable transport error, the partially uploaded image is deleted, so the client must create a new image record before retrying.

The image's encoding and encapsulated settings are fixed when the record is created by createImage and cannot be changed by a chunk request.

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.ImagesApi(api_client)
    image_id = '3e1354a3-fb10-46c0-8b05-56e28edbde69' # str | 
    resumable_chunk_number = 1 # float | Chunk sequence number.
    resumable_chunk_size = 1048576 # float | Size of each chunk.
    resumable_current_chunk_size = 1048576 # float | Size of the current chunk.
    resumable_total_size = 2147483648 # float | Total file size.
    resumable_total_chunks = 2048 # float | Total number of chunks.
    body = None # bytearray | 
    resumable_identifier = '2147483648-customfirmwareipsw' # str | Client-side identifier of the file being uploaded. (optional)
    resumable_filename = 'custom-firmware.ipsw' # str | Original filename. (optional)
    resumable_relative_path = 'custom-firmware.ipsw' # str | Relative path. (optional)
    resumable_type = 'application/octet-stream' # str | MIME type. (optional)
    corellium_checksum = 'sha256$1048576$e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' # str | Expected Corellium checksum of the complete file, formatted `algorithm$blockSize$hash`. When supplied, every chunk is re-hashed and the upload is rejected (and the image removed) unless the recomputed checksum matches. The chunk size used for the upload must equal the block size embedded in the checksum. Required for `fw` uploads on airgapped deployments. (optional)
    x_corellium_total_file_size = '2147483648' # str | Total size of the whole file in bytes. Send it on every chunk so the image-pool pre-flight check sees the full upload size rather than the size of a single chunk. (optional)

    try:
        # Upload one chunk of an image file
        api_instance.v3_upload_image_chunk(image_id, resumable_chunk_number, resumable_chunk_size, resumable_current_chunk_size, resumable_total_size, resumable_total_chunks, body, resumable_identifier=resumable_identifier, resumable_filename=resumable_filename, resumable_relative_path=resumable_relative_path, resumable_type=resumable_type, corellium_checksum=corellium_checksum, x_corellium_total_file_size=x_corellium_total_file_size)
    except Exception as e:
        print("Exception when calling ImagesApi->v3_upload_image_chunk: %s\n" % e)

Parameters

Name Type Description Notes
image_id str
resumable_chunk_number float Chunk sequence number.
resumable_chunk_size float Size of each chunk.
resumable_current_chunk_size float Size of the current chunk.
resumable_total_size float Total file size.
resumable_total_chunks float Total number of chunks.
body bytearray
resumable_identifier str Client-side identifier of the file being uploaded. [optional]
resumable_filename str Original filename. [optional]
resumable_relative_path str Relative path. [optional]
resumable_type str MIME type. [optional]
corellium_checksum str Expected Corellium checksum of the complete file, formatted `algorithm$blockSize$hash`. When supplied, every chunk is re-hashed and the upload is rejected (and the image removed) unless the recomputed checksum matches. The chunk size used for the upload must equal the block size embedded in the checksum. Required for `fw` uploads on airgapped deployments. [optional]
x_corellium_total_file_size str Total size of the whole file in bytes. Send it on every chunk so the image-pool pre-flight check sees the full upload size rather than the size of a single chunk. [optional]

Return type

void (empty response body)

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Chunk stored; empty body. -
400 Invalid chunk parameters, checksum mismatch, chunk size differing from the block size of corelliumChecksum, or a missing corelliumChecksum for an airgapped firmware upload. -
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 No permission for the image's project, or the image is site-wide and the caller is not a domain (on-site) or cloud administrator. -
404 No image with the given imageId; create it before uploading chunks. -
413 The upload exceeds the project's storage quota, or the size limit for this image type (ramdisk, kernel). -
507 The local image pool does not have enough free space for this upload. -

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

v3_upload_image_data

Image v3_upload_image_data(image_id, file, corellium_checksum=corellium_checksum)

Upload image file contents

Uploads the whole file for an image created with createImage, in a single multipart/form-data request with the file in the file part. Returns the updated image, whose size and checksums are now filled in.

Supply corelliumChecksum to have the server verify the file: if the uploaded contents do not match, the upload is rejected with 400 and the image is removed. Compute it with the same algorithm and block size you pass in the value (algorithm$blockSize$hash).

The upload counts against the owning project's storage quota. If the connection drops, the whole file must be sent again. For large images (firmware in particular) use uploadImageChunk, which can resume.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.image import Image
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.ImagesApi(api_client)
    image_id = '3e1354a3-fb10-46c0-8b05-56e28edbde69' # str | 
    file = None # bytearray | 
    corellium_checksum = 'sha256$1048576$e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' # str | Optional. Expected Corellium checksum of the whole file, formatted `algorithm$blockSize$hash` (for example `sha256$1048576$<hex>`). When supplied, the upload is rejected and the image removed if the file does not match. (optional)

    try:
        # Upload image file contents
        api_response = api_instance.v3_upload_image_data(image_id, file, corellium_checksum=corellium_checksum)
        print("The response of ImagesApi->v3_upload_image_data:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ImagesApi->v3_upload_image_data: %s\n" % e)

Parameters

Name Type Description Notes
image_id str
file bytearray
corellium_checksum str Optional. Expected Corellium checksum of the whole file, formatted `algorithm$blockSize$hash` (for example `sha256$1048576$<hex>`). When supplied, the upload is rejected and the image removed if the file does not match. [optional]

Return type

Image

Authorization

BearerAuth

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Upload accepted; updated image metadata returned. -
400 Invalid upload or checksum mismatch. -
401 Not signed in: the `Authorization: Bearer <token>` header is missing, or the token is invalid or expired. Get a new token and retry. -
404 No image with the given imageId. -
409 An image with conflicting identity already exists. -

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