Skip to content

Latest commit

 

History

History
511 lines (373 loc) · 23.7 KB

StorageApi.md

File metadata and controls

511 lines (373 loc) · 23.7 KB

corellium.StorageApi

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_attach_cluster_storage POST /v3/cluster/storage/{id}/attach Attach storage device
v3_eject_cluster_storage POST /v3/cluster/storage/{id}/eject Eject storage device
v3_list_cluster_storage GET /v3/cluster/storage List cluster storage devices
v3_list_storage GET /v3/storage List server-attached storage devices
v3_list_storage_files GET /v3/storage/{id}/files/{path} List storage files

v3_attach_cluster_storage

StorageAlreadyMountedResponse v3_attach_cluster_storage(id)

Attach storage device

Required role: Cluster administrator.

Mounts an attached storage device so its files can be used. Mounting runs in the background: returns 202 when the mount has been queued, or 200 if the device is already mounted. Browse its files with GET /v3/storage/{id}/files/{path}. Requires a cluster administrator. Requires the serverAttachedStorage feature. Not available on cloud installations.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.storage_already_mounted_response import StorageAlreadyMountedResponse
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.StorageApi(api_client)
    id = '73357171-23a0-4a3e-8661-216dbfbdd7ab' # str | Storage device identifier.

    try:
        # Attach storage device
        api_response = api_instance.v3_attach_cluster_storage(id)
        print("The response of StorageApi->v3_attach_cluster_storage:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling StorageApi->v3_attach_cluster_storage: %s\n" % e)

Parameters

Name Type Description Notes
id str Storage device identifier.

Return type

StorageAlreadyMountedResponse

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Device is already mounted. -
202 Mount job queued. -
400 Server-attached storage is not available on cloud installations. -
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 Cluster administrator permissions required. The serverAttachedStorage feature must be enabled. -
404 Storage device not found. -
500 Failed to queue the mount job. -

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

v3_eject_cluster_storage

StorageEjectAlreadyUnmountedResponse v3_eject_cluster_storage(id)

Eject storage device

Required role: Cluster administrator.

Unmounts an attached storage device so it can be unplugged safely. Unmounting runs in the background: returns 202 when the unmount has been queued, or 200 if the device is already unmounted. Requires a cluster administrator. Requires the serverAttachedStorage feature. Not available on cloud installations.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.storage_eject_already_unmounted_response import StorageEjectAlreadyUnmountedResponse
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.StorageApi(api_client)
    id = '73357171-23a0-4a3e-8661-216dbfbdd7ab' # str | Storage device identifier.

    try:
        # Eject storage device
        api_response = api_instance.v3_eject_cluster_storage(id)
        print("The response of StorageApi->v3_eject_cluster_storage:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling StorageApi->v3_eject_cluster_storage: %s\n" % e)

Parameters

Name Type Description Notes
id str Storage device identifier.

Return type

StorageEjectAlreadyUnmountedResponse

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Device is already unmounted. -
202 Unmount job queued. -
400 Server-attached storage is not available on cloud installations. -
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 Cluster administrator permissions required. The serverAttachedStorage feature must be enabled. -
404 Storage device not found. -
500 Failed to queue the unmount job. -

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

v3_list_cluster_storage

StorageDeviceList v3_list_cluster_storage(limit=limit, offset=offset, id=id, device=device, fs_type=fs_type, fs_uuid=fs_uuid, label=label, serial=serial, vendor=vendor, model=model, mount_policy=mount_policy, status=status, sort=sort)

List cluster storage devices

Required role: Cluster administrator.

Lists the physical storage devices (for example USB drives) attached to the cluster's servers, for cluster administrators. Requires a cluster administrator. Requires the serverAttachedStorage feature. Not available on cloud installations.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.storage_device_list import StorageDeviceList
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.StorageApi(api_client)
    limit = 100 # float | Maximum results to return. (optional) (default to 100)
    offset = 0 # float | Results to skip. (optional) (default to 0)
    id = '73357171-23a0-4a3e-8661-216dbfbdd7ab' # str | Filter by identifier (comma-separated for multiple). (optional)
    device = 'sdb1' # str | Filter by device name (partial match). (optional)
    fs_type = 'ext4' # str | Filter by filesystem type (comma-separated). (optional)
    fs_uuid = '4a3f2e1d' # str | Filter by filesystem UUID (partial match). (optional)
    label = 'EXTERNAL' # str | Filter by label (partial match). (optional)
    serial = '0123456789' # str | Filter by serial number (partial match). (optional)
    vendor = 'SanDisk' # str | Filter by vendor (partial match). (optional)
    model = 'Ultra' # str | Filter by model (partial match). (optional)
    mount_policy = 'mount_policy_example' # str | Filter by mount policy. (optional)
    status = 'status_example' # str | Filter by mount status. (optional)
    sort = '-device' # str | Sort order (e.g. 'device' or '-device'). (optional)

    try:
        # List cluster storage devices
        api_response = api_instance.v3_list_cluster_storage(limit=limit, offset=offset, id=id, device=device, fs_type=fs_type, fs_uuid=fs_uuid, label=label, serial=serial, vendor=vendor, model=model, mount_policy=mount_policy, status=status, sort=sort)
        print("The response of StorageApi->v3_list_cluster_storage:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling StorageApi->v3_list_cluster_storage: %s\n" % e)

Parameters

Name Type Description Notes
limit float Maximum results to return. [optional] [default to 100]
offset float Results to skip. [optional] [default to 0]
id str Filter by identifier (comma-separated for multiple). [optional]
device str Filter by device name (partial match). [optional]
fs_type str Filter by filesystem type (comma-separated). [optional]
fs_uuid str Filter by filesystem UUID (partial match). [optional]
label str Filter by label (partial match). [optional]
serial str Filter by serial number (partial match). [optional]
vendor str Filter by vendor (partial match). [optional]
model str Filter by model (partial match). [optional]
mount_policy str Filter by mount policy. [optional]
status str Filter by mount status. [optional]
sort str Sort order (e.g. 'device' or '-device'). [optional]

Return type

StorageDeviceList

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Paginated list of attached storage devices. -
400 Invalid query parameter(s). -
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 Cluster administrator permissions required. The serverAttachedStorage feature must be enabled. -

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

v3_list_storage

StorageList v3_list_storage(limit=limit, offset=offset, sort=sort, identifier=identifier, device=device, fs_type=fs_type, mount_policy=mount_policy, status=status)

List server-attached storage devices

Lists the physical storage devices (for example USB drives or disks) plugged into an on-site Corellium server, with their name, filesystem, label, vendor, whether they are mounted, and whether they are mounted read-only (RO) or read-write (RW). Use a device's id with v3ListStorageFiles to browse its contents. For cluster administrators on on-site deployments; not available on cloud installations. Results are paginated and can be filtered and sorted with the query parameters.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.storage_list import StorageList
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.StorageApi(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)
    sort = '-createdAt' # str | Sort order (prefix a field with \"-\" for descending). (optional)
    identifier = '73357171-23a0-4a3e-8661-216dbfbdd7ab,9f2b6c04-58ad-4d61-b0e7-1ac9d8e07f35' # str | Filter by identifier (comma separated). (optional)
    device = 'sdb' # str | Filter by device name (partial match). (optional)
    fs_type = 'ext4,exfat' # str | Filter by filesystem type (comma separated). (optional)
    mount_policy = 'mount_policy_example' # str | Filter by mount policy. (optional)
    status = 'status_example' # str | Filter by mount status. (optional)

    try:
        # List server-attached storage devices
        api_response = api_instance.v3_list_storage(limit=limit, offset=offset, sort=sort, identifier=identifier, device=device, fs_type=fs_type, mount_policy=mount_policy, status=status)
        print("The response of StorageApi->v3_list_storage:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling StorageApi->v3_list_storage: %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]
sort str Sort order (prefix a field with &quot;-&quot; for descending). [optional]
identifier str Filter by identifier (comma separated). [optional]
device str Filter by device name (partial match). [optional]
fs_type str Filter by filesystem type (comma separated). [optional]
mount_policy str Filter by mount policy. [optional]
status str Filter by mount status. [optional]

Return type

StorageList

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List of storage devices. -
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 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_list_storage_files

StorageFileList v3_list_storage_files(id, path, limit=limit, offset=offset, sort=sort, name=name, type=type)

List storage files

Lists the files and folders at one path on a server-attached storage device (see v3ListStorage), with each entry's name, type, size and modification time. Use / to list the top level, then pass a folder's path to go deeper. The path must be a folder; a file path returns 400, and paths that try to leave the device (for example with ..) are rejected. Returns 404 if the device or path does not exist.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.storage_file_list import StorageFileList
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.StorageApi(api_client)
    id = '73357171-23a0-4a3e-8661-216dbfbdd7ab' # str | Storage device identifier.
    path = '/var/mobile/Media' # str | Folder to list, relative to the top of the storage device. Slashes are kept as path separators.
    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)
    sort = '-lastModifiedTime' # str | Sort order (prefix a field with \"-\" for descending). (optional)
    name = 'firmware.ipsw,boot.img' # str | Filter by name (case-insensitive exact match, comma separated). (optional)
    type = 'file' # str | Filter by type (case-insensitive partial match, e.g. \"file\" or \"dir\"). (optional)

    try:
        # List storage files
        api_response = api_instance.v3_list_storage_files(id, path, limit=limit, offset=offset, sort=sort, name=name, type=type)
        print("The response of StorageApi->v3_list_storage_files:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling StorageApi->v3_list_storage_files: %s\n" % e)

Parameters

Name Type Description Notes
id str Storage device identifier.
path str Folder to list, relative to the top of the storage device. Slashes are kept as path separators.
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]
sort str Sort order (prefix a field with &quot;-&quot; for descending). [optional]
name str Filter by name (case-insensitive exact match, comma separated). [optional]
type str Filter by type (case-insensitive partial match, e.g. &quot;file&quot; or &quot;dir&quot;). [optional]

Return type

StorageFileList

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List of files and directories. -
400 Invalid path or query 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 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 storage device or path with the given identifier. -

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