The following cURL command examples show the syntax for performing update operations such as checking for, staging, and installing updates, as well as retrieving information about update status, and setting update policies.
This example queries a custom URL for a new update.
curl -X GET -k -u root:<root_password> "https://<server>:5480/rest/appliance/update/pending?source_type=LOCAL_AND_ONLINE&url=https://<custom_url>"
This example initiates the staging of the update.
curl -X POST -k -u root:<root_password> -H "Content-Type: application/json" -d '{"version":"<target_version>"}' https://<server>:5480/rest/appliance/update/pending/<target_version>?action=stage
This example initiates the installation of the update.
curl -X POST -k -u root:<root_password> -H "Content-Type: application/json" -d '{"version":"<target_version>","user_data":[{"key":"vmdir.password","value":"<sso_password>"}]}' https://<server>/rest/appliance/update/pending/<target_version>?action=install
This example downloads the update and installs it when the download completes.
curl -X POST -k -u root:<root_password> -H "Content-Type: application/json" -d '{"version":"<target_version>","user_data":[{"key":"vmdir.password","value":"<sso_password>"}]}' https://<server>/rest/appliance/update/pending/<target_version>?action=stage-and-install
This example retrieves information about the update state.
curl -X GET -k -u root:<root_password> https://<server>:5480/rest/appliance/update
This example sets an update policy to check a custom URL for new updates at specific times every Friday and Saturday, and if a new update is available, it is staged automatically.
curl -X PUT -k -u root:<root_password> -H "Content-Type: application/json" -d '{"policy":{"auto_stage": true,"check_schedule": [{"day": "FRIDAY","hour": 23,"minute": 30},{"day": "SATURDAY","hour": 12,"minute": 30}],"custom_URL":"https://123.com"}}'