Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable queries over the set of files supported by project API method copy_default_execution_script #393

Open
ansAFinney opened this issue May 2, 2024 · 1 comment
Labels
enhancement New features or code improvements

Comments

@ansAFinney
Copy link

ansAFinney commented May 2, 2024

馃摑 Description of the feature

problem

it is not possible to determine the set of arguments that copy_default_execution_script supports
for example you can't create a drop down list in a UI through which a user could select a script

suggested solution

add project api method get_default_execution_scripts(**query_parameters) where query parameters can be version and product and other fields that are relevant in the script naming scheme.

the result is a list of script names that can be passed to copy_default_execution_script
(the get_default_execution_scripts method shouldn't copy the files)

馃挕 Steps for implementing the feature

No response

馃敆 Useful links and references

No response

@ansAFinney ansAFinney added the enhancement New features or code improvements label May 2, 2024
@FedericoNegri
Copy link
Contributor

@ansAFinney I've started this https://github.com/ansys/pyhps/pull/399/files#diff-a79a7ec7df27242fbfbc1e3c0be88b34e17f1939289af2462f5987935867f35b to expose a JmsApi.list_default_execution_scripts method purely based on the file storage content. However, in your case I think you would be better off querying the templates and getting the script name from there:

from ansys.hps.client import Client, JmsApi

cl = Client(url="https://localhost:8443/hps", username="repuser", password="repuser")
jms_api = JmsApi(cl)

qwargs = {"name.contains": "Ansys LS-DYNA"}

print([t.execution_script_storage_id for t in jms_api.get_task_definition_templates(**qwargs)])

## output: ['lsdyna-v232-exec_lsdyna.py', 'lsdyna-v241-exec_lsdyna.py']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or code improvements
Projects
None yet
Development

No branches or pull requests

2 participants