Skip to content

Commit

Permalink
updates for new api
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Sep 20, 2024
1 parent 64549d4 commit d4cbc38
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 27 deletions.
67 changes: 46 additions & 21 deletions developer-guide/20-User interface/02-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,20 @@ slug: /web-ui-api

```
Endpoint Methods Rule
--------------------------------------- ----------- -------------------------------------------------------------------------
able_to_install_plugins_from_ui GET /api/allow_ui_installs
--------------------------------------- ----------- ----------------------------------------------------------------------------------
create_or_update_new_calibrations PUT /api/calibrations
get_available_calibrations_type_by_unit GET /api/calibrations/<pioreactor_unit>
get_available_calibrations_of_type GET /api/calibrations/<pioreactor_unit>/<calibration_type>
get_calibration_by_name GET /api/calibrations/<pioreactor_unit>/<calibration_type>/<calibration_name>
patch_calibrations PATCH /api/calibrations/<pioreactor_unit>/<calibration_type>/<calibration_name>
get_current_calibrations_of_type GET /api/calibrations/<pioreactor_unit>/<calibration_type>/current
get_custer_time GET /api/cluster_time
set_cluster_time POST /api/cluster_time
get_configs GET /api/configs
get_config GET /api/configs/<filename>
update_config PATCH /api/configs/<filename>
get_automation_contrib GET /api/contrib/automations/<automation_type>
get_charts_contrib GET /api/contrib/charts
create_experiment_profile POST /api/contrib/experiment_profiles
edit_experiment_profile PATCH /api/contrib/experiment_profiles
update_experiment_profile PATCH /api/contrib/experiment_profiles
get_experiment_profiles GET /api/contrib/experiment_profiles
get_experiment_profile GET /api/contrib/experiment_profiles/<filename>
delete_experiment_profile DELETE /api/contrib/experiment_profiles/<filename>
Expand All @@ -32,6 +29,7 @@ get_experiments GET /api/experiments
create_experiment POST /api/experiments
delete_experiment DELETE /api/experiments/<experiment>
update_experiment PATCH /api/experiments/<experiment>
get_experiment GET /api/experiments/<experiment>
get_logs GET /api/experiments/<experiment>/logs
get_media_rates GET /api/experiments/<experiment>/media_rates
get_fallback_time_series GET /api/experiments/<experiment>/time_series/<data_source>/<column>
Expand All @@ -40,45 +38,72 @@ get_od_readings GET /api/experiments/<experime
get_od_readings_filtered GET /api/experiments/<experiment>/time_series/od_readings_filtered
get_temperature_readings GET /api/experiments/<experiment>/time_series/temperature_readings
get_unit_labels GET /api/experiments/<experiment>/unit_labels
upsert_unit_labels PUT /api/experiments/<experiment>/unit_labels
upsert_unit_labels PATCH, PUT /api/experiments/<experiment>/unit_labels
get_list_of_workers_for_experiment GET /api/experiments/<experiment>/workers
add_worker_to_experiment PUT /api/experiments/<experiment>/workers
remove_workers_from_experiment DELETE /api/experiments/<experiment>/workers
remove_worker_from_experiment DELETE /api/experiments/<experiment>/workers/<pioreactor_unit>
stop_all_in_experiment POST /api/experiments/<experiment>/workers/stop
get_experiments_worker_assignments GET /api/experiments/assignment_count
get_latest_experiment GET /api/experiments/latest
export_datasets POST /api/export_datasets
get_historical_config_for GET /api/historical_configs/<filename>
get_historical_media_used GET /api/historical_media
get_historical_organisms_used GET /api/historical_organisms
is_local_access_point_active GET /api/is_local_access_point_active
install_plugin POST /api/plugins/install
get_installed_plugins GET /api/plugins/installed
get_plugin GET /api/plugins/installed/<filename>
uninstall_plugin POST /api/plugins/uninstall
reboot_unit POST /api/units/<pioreactor_unit>/reboot
shutdown_unit POST /api/units/<pioreactor_unit>/shutdown
get_jobs_running_across_cluster GET /api/jobs/running
install_plugin_across_cluster PATCH, POST /api/plugins/install
get_plugins_across_cluster GET /api/plugins/installed
uninstall_plugin_across_cluster PATCH, POST /api/plugins/uninstall
upload POST /api/system/upload
run_job_on_unit_in_experiment PATCH, POST /api/units/<pioreactor_unit>/jobs/run/job_name/<job>/experiments/<experiment>
get_running_jobs_on_unit GET /api/units/<pioreactor_unit>/jobs/running
stop_job_on_unit PATCH, POST /api/units/<pioreactor_unit>/jobs/stop/job_name/<job>/experiments/<experiment>
update_job_on_unit PATCH /api/units/<pioreactor_unit>/jobs/update/job_name/<job>/experiments/<experiment>
reboot_unit POST /api/units/<pioreactor_unit>/system/reboot
shutdown_unit POST /api/units/<pioreactor_unit>/system/shutdown
update_app POST /api/update_app
update_app_from_release_archive POST /api/update_app_from_release_archive
update_app_to_develop POST /api/update_app_to_develop
upload POST /api/upload
get_app_version GET /api/versions/app
get_ui_version GET /api/versions/ui
get_app_versions_across_cluster GET /api/versions/app
get_ui_versions_across_cluster GET /api/versions/ui
get_list_of_workers GET /api/workers
add_worker PUT /api/workers
delete_worker DELETE /api/workers/<pioreactor_unit>
get_worker GET /api/workers/<pioreactor_unit>
get_experiment_assignment_for_worker GET /api/workers/<pioreactor_unit>/experiment
run_job_on_unit PATCH, POST /api/workers/<pioreactor_unit>/experiments/<experiment>/jobs/<job>/run
stop_job_on_unit PATCH /api/workers/<pioreactor_unit>/experiments/<experiment>/jobs/<job>/stop
update_job_on_unit PATCH /api/workers/<pioreactor_unit>/experiments/<experiment>/jobs/<job>/update
get_logs_for_unit_and_experiment GET /api/workers/<pioreactor_unit>/experiments/<experiment>/logs
stop_all_jobs_on_worker POST /api/workers/<pioreactor_unit>/experiments/<experiment>/stop
change_worker_status PUT /api/workers/<pioreactor_unit>/is_active
run_job_on_unit_in_experiment PATCH, POST /api/workers/<pioreactor_unit>/jobs/run/job_name/<job>/experiments/<experiment>
get_running_jobs_on_unit GET /api/workers/<pioreactor_unit>/jobs/running
stop_all_jobs_on_worker_for_experiment PATCH, POST /api/workers/<pioreactor_unit>/jobs/stop/experiments/<experiment>
stop_job_on_unit PATCH, POST /api/workers/<pioreactor_unit>/jobs/stop/job_name/<job>/experiments/<experiment>
update_job_on_unit PATCH /api/workers/<pioreactor_unit>/jobs/update/job_name/<job>/experiments/<experiment>
get_workers_and_experiment_assignments GET /api/workers/assignments
remove_all_workers_from_experiments DELETE /api/workers/assignments
stop_all_jobs_in_experiment PATCH, POST /api/workers/jobs/stop/experiments/<experiment>
setup_worker_pioreactor POST /api/workers/setup
reboot_units POST /api/workers/system/reboot
shutdown_units POST /api/workers/system/shutdown
static GET /static/<path:filename>
run_job PATCH, POST /unit_api/jobs/run/job_name/<job>
get_all_running_jobs GET /unit_api/jobs/running
get_running_jobs_for_experiment GET /unit_api/jobs/running/experiments/<experiment>
stop_all_jobs PATCH, POST /unit_api/jobs/stop/all
stop_all_jobs_by_experiment PATCH, POST /unit_api/jobs/stop/experiment/<experiment>
stop_job_by_name PATCH, POST /unit_api/jobs/stop/job_name/<job_name>
stop_all_jobs_by_source PATCH, POST /unit_api/jobs/stop/job_source/<job_source>
update_job PATCH /unit_api/jobs/update/job_name/<job>
install_plugin PATCH, POST /unit_api/plugins/install
get_installed_plugins GET /unit_api/plugins/installed
get_plugin GET /unit_api/plugins/installed/<filename>
uninstall_plugin PATCH, POST /unit_api/plugins/uninstall
reboot PATCH, POST /unit_api/system/reboot
remove_file PATCH, POST /unit_api/system/remove_file
shutdown PATCH, POST /unit_api/system/shutdown
update_app_and_ui PATCH, POST /unit_api/system/update
update_target PATCH, POST /unit_api/system/update/<target>
task_status GET /unit_api/task_results/<task_id>
get_app_version GET /unit_api/versions/app
get_ui_version GET /unit_api/versions/ui
```

From `python3 -m flask --debug --app main routes -s rule`
17 changes: 11 additions & 6 deletions user-guide/30-Advanced/01-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ Interacting with the Pioreactor on the command line are through the `pio` tool.
* `pio kill --name <job> --experiment <exp>` or `pio kill --all-jobs` to end jobs.
* `pio run <job> <options>` will run the `<job>`. Each job may have specific command line arguments.
* `pio version` print the version of the PioreactorApp software.
* `pio update app` will update the software to the latest app version.
* `pio update app` will update the software to the latest version.
* `pio update ui` will update the ui to the latest version.
* `pio update` will update both the app and ui to the latest version.
* `pio plugins install <plugin name>` will install a plugin
* `pio plugins uninstall <plugin name>` will uninstall a plugin
* `pio plugins list` will list the currently installed plugins
Expand All @@ -29,20 +31,19 @@ The leader also has their own unique set of `pio` commands (these commands do no

* `pio db`: open the sqlite3 CLI of the Pioreactor database.
* `pio mqtt`: tail the MQTT broker.
* `pio update ui` will update the UI software to the latest version and adding `--app` will upgrade the Pioreactor Python app (repo: pioreactor/pioreactor).
* `pio update app` will update the software to the latest version.
* `pio workers` has many subcommands for manager your cluster. For example:
* `pio workers add <hostname>`: add a Pioreactor to your cluster, with given (unique) name. Need a worker Pioreactor on the network first. See instructions [here](https://github.com/Pioreactor/pioreactor/wiki/Installation).
* `pio workers remove <hostname>`: remove a Pioreactor from your cluster.
* `pio workers discover` will return a list of workers on the network (may be a superset of the current cluster.)
* `pio workers status` will report to the user each Pioreactor in the cluster, and metadata like status, IP, and state.

#### Leader-only commands to control workers

The leader computer interacts with the worker computers using the `pios` command. Unless otherwise noted, the `pios` will target all worker computers. Available `pios` commands on the leader computer are the following:
The leader Pioreactor interacts with the worker computers using the `pios` command. Unless otherwise noted, the `pios` will target all worker computers. Available `pios` commands on the leader Pioreactor are the following:

* `pios kill --name <job>` terminate the job `<job>` on the workers. Ex: `pios kill --name dosing_automation`.
* `pios run <job>` on each worker, run the job `<job>` in the background. Job specific arguments can be specified after. Ex: `pios run add_media --ml 1`. Use `-y` to skip confirmation.
* `pios update` install the latest PioreactorApp code on each worker.
* `pios run <job>` on each worker, run the job `<job>` in the background. Job specific arguments can be specified after. Ex: `pios run add_media --ml 1`.
* `pios update` install the latest Pioreactor software on each worker.
* `pios sync-configs` deploy the config.ini files to workers.
* `pios plugins install <plugin name>` will install the plugin on each worker _and_ the leader.
* `pios plugins uninstall <plugin name>` will uninstall the plugin on each worker _and_ the leader.
Expand All @@ -57,4 +58,8 @@ In each of the above commands, specific workers can be invoked with `--units` (w

:::tip
`-y` will skip user confirmation of the command to run.
:::

:::tip
`--json` will display json output of the callbacks to each worker.
:::

0 comments on commit d4cbc38

Please sign in to comment.