Product instance APIs#
Extend products#
- class ansys.saf.glow.solution.products.config.IProductInstanceConfiguration(*args, **kwargs)#
Bases:
ProtocolInterface to configure a product instance.
All products managed by the product instance system (HPS or PIM) must implement this interface.
- get_version_configuration(version: str) IProductInstanceVersionConfiguration#
Return the configuration of a product for a specific version.
- class ansys.saf.glow.solution.products.config.IProductInstanceVersionConfiguration(*args, **kwargs)#
Bases:
ProtocolInterface to configure a given version of a product instance.
- property enable_secure_flags: bool#
Must be set to True for the product instance to use the secure communication command line arguments.
- property environment: dict[str, str]#
The environment variables that will be set in the environment running the
execution_command.
- property execution_command: str#
This is the command line used to start the product instance process.
It can contain template variables in the form ${VAR}. Supported variables are:
PORT: an integer which is the port that the process should expose its service on.
EXECUTABLE: the full path to the executable using either the first product listed in the software_requirements for HPS or the path specified by exe_path_for_pim for PIM.
Note that for PIM this code runs just once during the YAML file generation that PIM later uses to launch the products. Thus, it’s not feasible to generate and assign resources here for each launch. For instance, attempting to generate a temporary file/directory here and passing it to the command won’t work as expected.
- property health_route: str | None#
The health route for the service. Typically ‘/health’ for a HTTP service.
- property insecure_flags: str#
The command line arguments needed to configure the product instance for insecure communication.
- property linux_local_secure_flags: str#
The command line arguments needed to configure the product instance for secure local communication on Linux.
- property linux_uds_id: str#
Template for the uds_id, which is used to identify the socket file for UDS communication.
- property remote_secure_flags: str#
The command line arguments needed to configure the product instance for secure remote communication.
- property service_name: str#
This is the name of the service that is exposed by the instance management system (HPS or PIM) that identifies it from other services.
It should be consistent with the name used in the PIM light amd PIM K8S configurations. Typically its something simple like
grpcorhttp.
- property service_type: ServiceType#
The type of service: grpc, http or tcp.
- class ansys.saf.glow.solution.products.config.ISoftware(*args, **kwargs)#
Bases:
ProtocolInterface to define the software requirements.
- class ansys.saf.glow.solution.products.config.PimLightConfigWriter#
Bases:
objectA utility class for writing PIM Light Server configuration files.
- classmethod write_config(configurations_dir: Path, instance_configuration: IProductInstanceConfiguration)#
Writes the PIM configuration to a YAML file in the specified configurations directory.
- Parameters:
- configurations_dir
Path The path to the directory where the configuration YAML file will be written.
- configurations_dir
Examples
You can write the configuration to a directory called
my_solution/product_instance_configslike this:>>> config.write_config(Path("my_solution/product_instance_configs"))
- class ansys.saf.glow.solution.products.config.PimProductInstanceVersionDefinition(definition: ansys.platform.instancemanagement.Definition)#
Bases:
IProductInstanceVersionDefinitionPIM implementation to configure a given version of a product instance.
- class ansys.saf.glow.solution.products.config.ProductInstanceConfigurationsManager#
Bases:
objectManage the default and custom product instance configurations.
- get_version_configuration(product_name: str, product_version: str | None = None) tuple[str, IProductInstanceVersionConfiguration]#
Get the product instance configuration for the specified product and version.
Note: if product_version is None, returns the latest version configuration.
- list_configurations() list[IProductInstanceConfiguration]#
List all available product instance configurations.