ProjectApi#

class ansys.hps.client.jms.api.ProjectApi(client, project_id)#

Exposes the project endpoints of the JMS.

Parameters:
clientClient

HPS client object.

project_idstr

ID of the project.

Examples

>>> from ansys.hps.client import Client
>>> from ansys.hps.client.jms import JmsApi, Project, ProjectApi
>>> cl = Client(
...     url="https://127.0.0.1:8443/hps", username="repuser", password="repuser"
... )
>>> project = Project(name="Example project")
>>> print(project)
{
    "name": "Example project"
}
>>> jms_api = JmsApi(cl)
>>> project = jms_api.create_project(project)
>>> print(project)
{
    "id": "02qtyJfpfAQ0fr3zkoIAfC",
    "name": "Example project",
    "active": false,
    "priority": 1,
    "creation_time": ...
    ...
}
>>> project_api = ProjectApi(cl, project.id)
>>> print(project_api)
'https://127.0.0.1:8443/hps/jms/api/v1/projects/02qtyJfpfAQ0fr3zkoIAfC'
>>> jobs = project_api.get_jobs()

Initialize project API.

Methods

ProjectApi.analyze_task_definition(...[, ...])

Compare resource requirements against available compute resources.

ProjectApi.archive_project(path[, ...])

Archive a project and save it to disk.

ProjectApi.copy_default_execution_script(...)

Copy a default execution script to the current project.

ProjectApi.copy_job_definitions(job_definitions)

Create job definitions by copying existing job definitions.

ProjectApi.copy_jobs(jobs[, wait])

Create jobs by copying existing jobs.

ProjectApi.copy_project([wait])

Duplicate the project.

ProjectApi.copy_task_definitions(...[, wait])

Create task definitions by copying existing task definitions.

ProjectApi.create_algorithms(algorithms[, ...])

Create a list of algorithms.

ProjectApi.create_files(files[, as_objects])

Create a list of files.

ProjectApi.create_job_definitions(...[, ...])

Create a list of job definitions.

ProjectApi.create_job_selections(selections)

Create a list of job selections.

ProjectApi.create_jobs(jobs[, as_objects])

Create jobs.

ProjectApi.create_license_contexts([as_objects])

Create a list of license contexts.

ProjectApi.create_parameter_definitions(...)

Create a list of parameter definitions.

ProjectApi.create_parameter_mappings(...[, ...])

Get a list of created parameter mappings.

ProjectApi.create_task_commands(commands[, ...])

Create task commands.

ProjectApi.create_task_definitions(...[, ...])

Create a list of task definitions.

ProjectApi.delete_algorithms(algorithms)

Delete a list of algorithms.

ProjectApi.delete_files(files)

Delete files.

ProjectApi.delete_job_definitions(...)

Delete a list of job definitions.

ProjectApi.delete_job_selections(selections)

Delete a list of job selections.

ProjectApi.delete_jobs(jobs)

Delete jobs.

ProjectApi.delete_license_contexts()

Delete license contexts.

ProjectApi.delete_parameter_definitions(...)

Delete a list of parameter definitions.

ProjectApi.delete_parameter_mappings(...)

Delete a list of parameter mappings.

ProjectApi.delete_task_definitions(...)

Delete a list of task definitions.

ProjectApi.download_file(file, target_path)

Download file content and save it to disk.

ProjectApi.get_algorithms([as_objects])

Get a list of algorithms.

ProjectApi.get_files([as_objects, content])

Get a list of file resources, optionally filtered by query parameters.

ProjectApi.get_job_definitions([as_objects])

Get a list of job definitions.

ProjectApi.get_job_selections([as_objects])

Get a list of job selections.

ProjectApi.get_jobs([as_objects])

Get a list of jobs.

ProjectApi.get_license_contexts([as_objects])

Get a list of license contexts.

ProjectApi.get_parameter_definitions([...])

Get a list of parameter definitions.

ProjectApi.get_parameter_mappings([as_objects])

Get a list of parameter mappings.

ProjectApi.get_permissions([as_objects])

Get a list of permissions.

ProjectApi.get_task_command_definitions([...])

Get the list of task command definitions.

ProjectApi.get_task_commands([as_objects])

Get a list of task commands.

ProjectApi.get_task_definitions([as_objects])

Get a list of task definitions.

ProjectApi.get_tasks([as_objects])

Get a list of tasks.

ProjectApi.queue_task_command(task_id, name, ...)

Queue a command to a task.

ProjectApi.sync_jobs(jobs)

Sync a list of jobs.

ProjectApi.update_algorithms(algorithms[, ...])

Update a list of algorithms.

ProjectApi.update_files(files[, as_objects])

Update files.

ProjectApi.update_job_definitions(...[, ...])

Update a list of job definitions.

ProjectApi.update_job_selections(selections)

Update a list of job selections.

ProjectApi.update_jobs(jobs[, as_objects])

Update jobs.

ProjectApi.update_license_contexts(...[, ...])

Update a list of license contexts.

ProjectApi.update_parameter_definitions(...)

Update a list of parameter definitions.

ProjectApi.update_parameter_mappings(...[, ...])

Get a list of updated parameter mappings.

ProjectApi.update_permissions(permissions[, ...])

Update a list of permissions.

ProjectApi.update_task_definitions(...[, ...])

Update a list of task definitions.

ProjectApi.update_tasks(tasks[, as_objects])

Update a list of tasks.

Attributes

ProjectApi.fs_bucket_url

URL of the project's bucket in the file storage gateway.

ProjectApi.fs_url

URL of the file storage gateway.

ProjectApi.jms_api_url

Get the JMS API URL.

ProjectApi.url

URL of the API.