ModifyMaintenancePreferences
In this article:
ModifyMaintenancePreferences#
Description#
Request to change maitenance settings for a PaaS service.
Request Parameters#
Required parameters#
serviceId — The PaaS service ID.
Type: String
Required: Yes
Optional parameters#
anytime — Indicates whether there is a time preference when maintenance is performed.
Type: Boolean
Required: Yes, if period is specified
period — The period when maintenance is performed.
Type: MaintenancePeriod object
Required: No, if the anytime value is set to
True
Response Elements#
service — Information about the service with the changed maintenance settings.
Type: Service object
Examples#
Managing PaaS services in K2 Cloud via API requires a customized version of the boto3 library:
import boto3
session = boto3.Session(
aws_access_key_id="<AWS_ACCESS_KEY_ID>",
aws_secret_access_key="<AWS_SECRET_ACCESS_KEY>",
region_name="",
)
paas_client = session.client(
'paas',
endpoint_url='https://paas.ru-msk.k2.cloud',
)
paas_client.modify_maintenance_preferences(
serviceId='fm-cluster-82892C63',
period={
"dayOfWeek": "MON",
"hour": 22,
},
)
Or c2-paas utility from K2 Cloud API Client software suite:
c2-paas ModifyMaintenancePreferences serviceId fm-cluster-82892C63 period.dayOfWeek MON period.hour 22