Skip to content

Latest commit

 

History

History
459 lines (319 loc) · 18.7 KB

WebPlayerApi.md

File metadata and controls

459 lines (319 loc) · 18.7 KB

corellium.WebPlayerApi

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_web_player_session POST /v3/webplayer Create a webplayer session
v3_delete_web_player_session DELETE /v3/webplayer/{sessionId} Delete a webplayer session
v3_get_web_player_allowed_domains GET /v3/webplayer/allowedDomains Get allowed webplayer domains
v3_get_web_player_session GET /v3/webplayer/{sessionId} Get a webplayer session
v3_list_web_player_sessions GET /v3/webplayer List webplayer sessions

v3_create_web_player_session

WebPlayerCreatedSession v3_create_web_player_session(create_web_player_session_body)

Create a webplayer session

Required role: Domain administrator.

Creates a Web Player session: a limited token that lets someone use one device, embedded in your own web page, without giving them a Corellium account. Requires a domain administrator.

Choose the device (projectId, instanceId), how long the session lasts (expiresIn, at least 1800 seconds), and which parts of the device interface the viewer may use (features). Pass the returned token to the Web Player in your page. The website domains configured for embedding are listed by v3GetWebPlayerAllowedDomains and set with webplayer.allowedDomains on PATCH /v3/domain. End the session early with v3DeleteWebPlayerSession.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.create_web_player_session_body import CreateWebPlayerSessionBody
from corellium.models.web_player_created_session import WebPlayerCreatedSession
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.WebPlayerApi(api_client)
    create_web_player_session_body = corellium.CreateWebPlayerSessionBody() # CreateWebPlayerSessionBody | 

    try:
        # Create a webplayer session
        api_response = api_instance.v3_create_web_player_session(create_web_player_session_body)
        print("The response of WebPlayerApi->v3_create_web_player_session:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling WebPlayerApi->v3_create_web_player_session: %s\n" % e)

Parameters

Name Type Description Notes
create_web_player_session_body CreateWebPlayerSessionBody

Return type

WebPlayerCreatedSession

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Session created. -
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_delete_web_player_session

v3_delete_web_player_session(session_id)

Delete a webplayer session

Required role: Domain administrator.

Ends a Web Player session: its token stops working, so the embedded viewer loses access to the device. Requires a domain administrator. The device itself is not affected.

Deletes are idempotent: an unknown sessionId 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.WebPlayerApi(api_client)
    session_id = 'a3569608-10e1-41c7-99fa-1a7d1f336c58' # str | Webplayer session identifier.

    try:
        # Delete a webplayer session
        api_instance.v3_delete_web_player_session(session_id)
    except Exception as e:
        print("Exception when calling WebPlayerApi->v3_delete_web_player_session: %s\n" % e)

Parameters

Name Type Description Notes
session_id str Webplayer session identifier.

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 Session torn down, or no such session; empty body. -
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_web_player_allowed_domains

WebPlayerAllowedDomains v3_get_web_player_allowed_domains()

Get allowed webplayer domains

Returns the website domains configured for embedding the Web Player (webplayer.allowedDomains in your domain settings). Change the list with PATCH /v3/domain.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.web_player_allowed_domains import WebPlayerAllowedDomains
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.WebPlayerApi(api_client)

    try:
        # Get allowed webplayer domains
        api_response = api_instance.v3_get_web_player_allowed_domains()
        print("The response of WebPlayerApi->v3_get_web_player_allowed_domains:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling WebPlayerApi->v3_get_web_player_allowed_domains: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

WebPlayerAllowedDomains

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Allowed domains. -
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_get_web_player_session

List[WebPlayerSession] v3_get_web_player_session(session_id)

Get a webplayer session

Required role: Domain administrator.

Returns one Web Player session, including its token and expiration. Requires a domain administrator.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.web_player_session import WebPlayerSession
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.WebPlayerApi(api_client)
    session_id = 'a3569608-10e1-41c7-99fa-1a7d1f336c58' # str | Webplayer session identifier.

    try:
        # Get a webplayer session
        api_response = api_instance.v3_get_web_player_session(session_id)
        print("The response of WebPlayerApi->v3_get_web_player_session:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling WebPlayerApi->v3_get_web_player_session: %s\n" % e)

Parameters

Name Type Description Notes
session_id str Webplayer session identifier.

Return type

List[WebPlayerSession]

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The webplayer session. -
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 session with the given sessionId. -

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

v3_list_web_player_sessions

WebPlayerSessionListResponse v3_list_web_player_sessions(limit=limit, offset=offset)

List webplayer sessions

Required role: Domain administrator.

Lists the Web Player sessions in your domain, with each session's ID, token and expiration. Requires a domain administrator. Results are paginated with limit and offset.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.web_player_session_list_response import WebPlayerSessionListResponse
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.WebPlayerApi(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)

    try:
        # List webplayer sessions
        api_response = api_instance.v3_list_web_player_sessions(limit=limit, offset=offset)
        print("The response of WebPlayerApi->v3_list_web_player_sessions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling WebPlayerApi->v3_list_web_player_sessions: %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]

Return type

WebPlayerSessionListResponse

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Paginated list of webplayer sessions. -
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]