cURL Examples of
Performing
Software Update Operations
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.
Check for an
Update
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>"
Stage an
Update
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
Install an
Update
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
Stage and Install an
Update
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
Retrieve Update
Status
This example retrieves
information about the update state.
curl -X GET -k -u root:<root_password> https://<server>:5480/rest/appliance/update
Set an Update
Policy
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"}}'