From d4cbc38c2276108bcc3d313940337255881df36e Mon Sep 17 00:00:00 2001 From: CamDavidsonPilon Date: Thu, 19 Sep 2024 21:39:43 -0400 Subject: [PATCH] updates for new api --- developer-guide/20-User interface/02-api.md | 67 ++++++++++++++------- user-guide/30-Advanced/01-cli.md | 17 ++++-- 2 files changed, 57 insertions(+), 27 deletions(-) diff --git a/developer-guide/20-User interface/02-api.md b/developer-guide/20-User interface/02-api.md index 3bd6ef10..268e8ff7 100644 --- a/developer-guide/20-User interface/02-api.md +++ b/developer-guide/20-User interface/02-api.md @@ -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/ get_available_calibrations_of_type GET /api/calibrations// get_calibration_by_name GET /api/calibrations/// patch_calibrations PATCH /api/calibrations/// get_current_calibrations_of_type GET /api/calibrations///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/ update_config PATCH /api/configs/ get_automation_contrib GET /api/contrib/automations/ 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/ delete_experiment_profile DELETE /api/contrib/experiment_profiles/ @@ -32,6 +29,7 @@ get_experiments GET /api/experiments create_experiment POST /api/experiments delete_experiment DELETE /api/experiments/ update_experiment PATCH /api/experiments/ +get_experiment GET /api/experiments/ get_logs GET /api/experiments//logs get_media_rates GET /api/experiments//media_rates get_fallback_time_series GET /api/experiments//time_series// @@ -40,12 +38,11 @@ get_od_readings GET /api/experiments//time_series/od_readings_filtered get_temperature_readings GET /api/experiments//time_series/temperature_readings get_unit_labels GET /api/experiments//unit_labels -upsert_unit_labels PUT /api/experiments//unit_labels +upsert_unit_labels PATCH, PUT /api/experiments//unit_labels get_list_of_workers_for_experiment GET /api/experiments//workers add_worker_to_experiment PUT /api/experiments//workers remove_workers_from_experiment DELETE /api/experiments//workers remove_worker_from_experiment DELETE /api/experiments//workers/ -stop_all_in_experiment POST /api/experiments//workers/stop get_experiments_worker_assignments GET /api/experiments/assignment_count get_latest_experiment GET /api/experiments/latest export_datasets POST /api/export_datasets @@ -53,32 +50,60 @@ get_historical_config_for GET /api/historical_configs/ -uninstall_plugin POST /api/plugins/uninstall -reboot_unit POST /api/units//reboot -shutdown_unit POST /api/units//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//jobs/run/job_name//experiments/ +get_running_jobs_on_unit GET /api/units//jobs/running +stop_job_on_unit PATCH, POST /api/units//jobs/stop/job_name//experiments/ +update_job_on_unit PATCH /api/units//jobs/update/job_name//experiments/ +reboot_unit POST /api/units//system/reboot +shutdown_unit POST /api/units//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/ get_worker GET /api/workers/ get_experiment_assignment_for_worker GET /api/workers//experiment -run_job_on_unit PATCH, POST /api/workers//experiments//jobs//run -stop_job_on_unit PATCH /api/workers//experiments//jobs//stop -update_job_on_unit PATCH /api/workers//experiments//jobs//update get_logs_for_unit_and_experiment GET /api/workers//experiments//logs -stop_all_jobs_on_worker POST /api/workers//experiments//stop change_worker_status PUT /api/workers//is_active +run_job_on_unit_in_experiment PATCH, POST /api/workers//jobs/run/job_name//experiments/ +get_running_jobs_on_unit GET /api/workers//jobs/running +stop_all_jobs_on_worker_for_experiment PATCH, POST /api/workers//jobs/stop/experiments/ +stop_job_on_unit PATCH, POST /api/workers//jobs/stop/job_name//experiments/ +update_job_on_unit PATCH /api/workers//jobs/update/job_name//experiments/ 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/ setup_worker_pioreactor POST /api/workers/setup +reboot_units POST /api/workers/system/reboot +shutdown_units POST /api/workers/system/shutdown static GET /static/ +run_job PATCH, POST /unit_api/jobs/run/job_name/ +get_all_running_jobs GET /unit_api/jobs/running +get_running_jobs_for_experiment GET /unit_api/jobs/running/experiments/ +stop_all_jobs PATCH, POST /unit_api/jobs/stop/all +stop_all_jobs_by_experiment PATCH, POST /unit_api/jobs/stop/experiment/ +stop_job_by_name PATCH, POST /unit_api/jobs/stop/job_name/ +stop_all_jobs_by_source PATCH, POST /unit_api/jobs/stop/job_source/ +update_job PATCH /unit_api/jobs/update/job_name/ +install_plugin PATCH, POST /unit_api/plugins/install +get_installed_plugins GET /unit_api/plugins/installed +get_plugin GET /unit_api/plugins/installed/ +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/ +task_status GET /unit_api/task_results/ +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` diff --git a/user-guide/30-Advanced/01-cli.md b/user-guide/30-Advanced/01-cli.md index 85dc1d6f..f5635395 100644 --- a/user-guide/30-Advanced/01-cli.md +++ b/user-guide/30-Advanced/01-cli.md @@ -13,7 +13,9 @@ Interacting with the Pioreactor on the command line are through the `pio` tool. * `pio kill --name --experiment ` or `pio kill --all-jobs` to end jobs. * `pio run ` will run the ``. 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 ` will install a plugin * `pio plugins uninstall ` will uninstall a plugin * `pio plugins list` will list the currently installed plugins @@ -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 `: 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 `: 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 ` terminate the job `` on the workers. Ex: `pios kill --name dosing_automation`. -* `pios run ` on each worker, run the 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 ` on each worker, run the 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 ` will install the plugin on each worker _and_ the leader. * `pios plugins uninstall ` will uninstall the plugin on each worker _and_ the leader. @@ -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. ::: \ No newline at end of file