Skip to content

Latest commit

 

History

History
444 lines (308 loc) · 16.5 KB

HyperTraceApi.md

File metadata and controls

444 lines (308 loc) · 16.5 KB

corellium.HyperTraceApi

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_btrace_preauthorize GET /v3/instances/{instanceId}/btrace-authorize Get a HyperTrace download token
v3_clear_hyper_trace DELETE /v3/instances/{instanceId}/btrace Clear HyperTrace output
v3_get_instance_kcrange GET /v3/instances/{instanceId}/btrace-kcrange List kernel extension address ranges
v3_start_hyper_trace POST /v3/instances/{instanceId}/btrace/enable Start HyperTrace
v3_stop_hyper_trace POST /v3/instances/{instanceId}/btrace/disable Stop HyperTrace

v3_btrace_preauthorize

Token v3_btrace_preauthorize(instance_id)

Get a HyperTrace download token

Returns a short-lived token that authorizes downloading this device's HyperTrace output without an Authorization header. Download with GET /v1/preauthed/{token}/{filename}. The token works only for this device's trace and expires when your current session token expires.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.token import Token
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.HyperTraceApi(api_client)
    instance_id = 'f7f9832a-f824-416f-a5ea-4adfe34754b5' # str | Instance ID.

    try:
        # Get a HyperTrace download token
        api_response = api_instance.v3_btrace_preauthorize(instance_id)
        print("The response of HyperTraceApi->v3_btrace_preauthorize:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling HyperTraceApi->v3_btrace_preauthorize: %s\n" % e)

Parameters

Name Type Description Notes
instance_id str Instance ID.

Return type

Token

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Token. -
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_clear_hyper_trace

v3_clear_hyper_trace(instance_id)

Clear HyperTrace output

Deletes the HyperTrace output recorded so far on this device. An unknown instanceId is a successful no-op that returns 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.HyperTraceApi(api_client)
    instance_id = 'f7f9832a-f824-416f-a5ea-4adfe34754b5' # str | Instance ID.

    try:
        # Clear HyperTrace output
        api_instance.v3_clear_hyper_trace(instance_id)
    except Exception as e:
        print("Exception when calling HyperTraceApi->v3_clear_hyper_trace: %s\n" % e)

Parameters

Name Type Description Notes
instance_id str Instance 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 -
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_get_instance_kcrange

List[Kcrange] v3_get_instance_kcrange(instance_id)

List kernel extension address ranges

Lists the kernel extensions loaded on the device with the memory address range each occupies. Pass a range to v3StartHyperTrace to trace code in just that extension. The device must be running.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.kcrange import Kcrange
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.HyperTraceApi(api_client)
    instance_id = 'f7f9832a-f824-416f-a5ea-4adfe34754b5' # str | Instance ID.

    try:
        # List kernel extension address ranges
        api_response = api_instance.v3_get_instance_kcrange(instance_id)
        print("The response of HyperTraceApi->v3_get_instance_kcrange:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling HyperTraceApi->v3_get_instance_kcrange: %s\n" % e)

Parameters

Name Type Description Notes
instance_id str Instance ID.

Return type

List[Kcrange]

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Kcranges. -
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. -
404 Instance not found. -

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

v3_start_hyper_trace

v3_start_hyper_trace(instance_id, enable_btrace_body)

Start HyperTrace

Starts HyperTrace on a running device. HyperTrace records which kernel code runs inside the address ranges you choose, without changing the device's software, so you can measure kernel code coverage.

Workflow: list kernel extensions with v3GetInstanceKcrange, start tracing with the ranges you want (this call), exercise the device, stop with v3StopHyperTrace, then download with v3BtracePreauthorize. Clear old output with v3ClearHyperTrace.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.enable_btrace_body import EnableBtraceBody
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.HyperTraceApi(api_client)
    instance_id = 'f7f9832a-f824-416f-a5ea-4adfe34754b5' # str | Instance ID.
    enable_btrace_body = corellium.EnableBtraceBody() # EnableBtraceBody | 

    try:
        # Start HyperTrace
        api_instance.v3_start_hyper_trace(instance_id, enable_btrace_body)
    except Exception as e:
        print("Exception when calling HyperTraceApi->v3_start_hyper_trace: %s\n" % e)

Parameters

Name Type Description Notes
instance_id str Instance ID.
enable_btrace_body EnableBtraceBody

Return type

void (empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • 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 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_stop_hyper_trace

v3_stop_hyper_trace(instance_id)

Stop HyperTrace

Stops HyperTrace on this device. The trace recorded so far is kept for download with v3BtracePreauthorize.

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.HyperTraceApi(api_client)
    instance_id = 'f7f9832a-f824-416f-a5ea-4adfe34754b5' # str | Instance ID.

    try:
        # Stop HyperTrace
        api_instance.v3_stop_hyper_trace(instance_id)
    except Exception as e:
        print("Exception when calling HyperTraceApi->v3_stop_hyper_trace: %s\n" % e)

Parameters

Name Type Description Notes
instance_id str Instance 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 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]