REST API - set

appliance update policy: set

Sets the automatic update checking and staging policy. This operation was added in vSphere API 6.7.

Request:

HTTP request

PUT https://{server}/rest/appliance/update/policy

Request Body Structure:

{
    "policy"{
        "password""secret string",
        "auto_stage"true,
        "certificate_check"true,
        "check_schedule"[
            {
                "hour"1,
                "day""MONDAY",
                "minute"1
            },
            {
                "hour"1,
                "day""MONDAY",
                "minute"1
            }
        ],
        "custom_URL""string",
        "username""string"
    }
}

Request Body Parameters:

Name Type Description
bold = required
policy config Info structure containing the policy for the appliance update.
policy.custom_URL string Current appliance update repository URL. This attribute was added in vSphere API 6.7.

Optional. If unset then default URL is assumed.

policy.username string Username for the update repository. This attribute was added in vSphere API 6.7.

Optional. If unset username will not be used to login.

policy.password secret Password for the update repository. This attribute was added in vSphere API 6.7.

Optional. password If unset password will not be used to login.

policy.check_schedule time[] Schedule when the automatic check will be run. This attribute was added in vSphere API 6.7.

policy.check_schedule[].day string weekday to check for updates. This attribute was added in vSphere API 6.7.

Defines the set of days. This enumeration was added in vSphere API 6.7. Value is one of:
MONDAY: Monday. This constant was added in vSphere API 6.7.
TUESDAY: Tuesday. This constant was added in vSphere API 6.7.
WEDNESDAY: Wednesday. This constant was added in vSphere API 6.7.
THURSDAY: Thursday. This constant was added in vSphere API 6.7.
FRIDAY: Friday. This constant was added in vSphere API 6.7.
SATURDAY: Saturday. This constant was added in vSphere API 6.7.
SUNDAY: Sunday. This constant was added in vSphere API 6.7.

policy.check_schedule[].hour long Hour: 0-24. This attribute was added in vSphere API 6.7.

policy.check_schedule[].minute long Minute: 0-59. This attribute was added in vSphere API 6.7.

policy.auto_stage boolean Automatically stage the latest update if available. This attribute was added in vSphere API 6.7.

policy.certificate_check boolean Indicates whether certificates will be checked during patching.

Warning: Setting this field to false will result in an insecure connection to update repository which can potentially put the appliance security at risk.

. This attribute was added in vSphere API 6.7.

Optional. certificateCheck If unset the certificate checks are enabled.

Response:

HTTP Status Code: 200

None

Errors:

HTTP Status Code Type Description
500 error Generic error
401 unauthenticated session is not authenticated
403 unauthorized session is not authorized to perform this operation