create_instance#

Client.create_instance(product_name: str, product_version: str | None = None, requests_timeout: float | None = None) Instance#

Create a remote instance of a product based on its name and optionally its version.

This effectively starts the product in the backend, according to the backend configuration.

The created instance will not yet be ready to use. You must call wait_for_ready() to wait for the instance to be ready.

Parameters:
product_namestr

Name of the product to start. For example, mapdl.

product_versionstr, optional

Version of the product. For example, "222". The default is None.

requests_timeoutfloat, optional

Maximum time for each request in seconds. The default is None.

Returns:
Instance

Instance of the product.

Raises:
UnsupportedProductError

The product or the selected version is not available remotely.

Examples

>>> import ansys.platform.instancemanagement as pypim
>>> client = pypim.connect()
>>> instance = client.create_instance(product_name="mapdl")
>>> instance.wait_for_ready()
>>> print(instance.services)
>>> instance.delete()
    {'grpc': Service(uri='dns:10.240.4.231:50052', headers={})}