Menu
Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version
Publication date

Mar 9, 2022

Confidentiality
Public
Reactions
1
Share

AppInstance

Attributes
access_mode: AppAccessModecustom_subdomain: str | Nonename: strparams: dict | Noneresource_model_id: strresources: list[gws_core.resource.resource.Resource] | Nonestop_policy: AppStopPolicy
Functions
__init__

Initialize self. See help(type(self)) for accurate signature.

resource_model_id : str
name : str
shell_proxy : ShellProxy
access_mode : AppAccessMode - AppAccessMode.AUTHENTICATED
get_app_type

Get the type of the app.

Return type : AppType
get_shell_proxy
Return type : ShellProxy
get_source_ids

Get the source references passed to the app, stored in the config file.

For virtual environment apps, the app runs in an isolated env that cannot load gws_core to resolve model ids to resources. So the file paths are passed instead. Only FSNode resources are supported for virtual environment apps.

For normal apps, the resource model ids are passed.

Return type : list
is_dev_mode
Return type : bool
is_virtual_env_app
Return type : bool
set_access_mode

Set the access mode of the app. By default the app is AUTHENTICATED.

access_mode : AppAccessMode
the access mode to apply
set_custom_subdomain

Set the custom subdomain used to build the app host. When None, the host falls back to the resource model id.

subdomain : str | None
the custom subdomain to apply, or None
set_dev_mode
set_dev_user

Set the user to be used in dev mode and return the user access token

user_id : str
set_input_resources

Set the resources of the app

: param resources: description : type resources: List[str]

resources : list
set_params
params : dict
set_requires_authentication

Back-compat shim for the former boolean flag. Maps True to AUTHENTICATED and False to PUBLIC (anonymous). Prefer set_access_mode for new code.

: param requires_authentication: True if the app requires authentication : type requires_authentication: bool

requires_authentication : bool
set_stop_policy

Set how the app should be stopped when no connections are detected. By default (AUTO), the app is automatically stopped when no connections are detected.

stop_policy : AppStopPolicy
the stop policy to apply
to_dto
Return type : AppInstanceDTO
token_in_url

Whether the app URL carries the access token (and a user access token).

True for AUTHENTICATED (only the launcher may open it). False for PUBLIC, whose URL is bare and shareable.

Return type : bool
was_generated_from_resource_model_id

Return true if the app was generated from the given resource model id

resource_model_id : str
Return type : bool
Shine Logo
Technical bricks to reuse or customize

Have you developed a brick?

Share it to accelerate projects for the entire community.