ConvertToHighAvailability
In this article:
ConvertToHighAvailability#
Description#
Converts a service deployed on a single instance into a high-availability service based on a three-node cluster. Available for PostgreSQL and MongoDB services.
Request Parameters#
Required parameters#
serviceId — The service ID.
Type: String
Required: Yes
Optional parameters#
arbitratorRequired — Indicates whether to create a cluster with arbitrator.
Type: Boolean
Required: No
networkInterfaceIds — A list of network interface IDs for the new instances.
Type: Array of strings
Required: Yes, if the service was originally created with the networkInterfaceIds parameter
Constraints: Must contain exactly two IDs, one for each instance being added
parameters — A set of PaaS service parameters required for the cluster configuration.
Type: Dict
Required: No
Valid values: Depend on service type (see PaaS Parameters)
subnetIds — A list of subnet IDs where the instances are placed.
Type: Array of strings
Required: Yes, if the service was originally created with the subnetIds parameter
Constraints: Must contain either the ID of the service’s current subnet, or three subnet IDs including the current one
Response Elements#
service — Detailed description of a service.
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.convert_to_high_availability(
serviceId='fm-cluster-7867D61F',
subnetIds=["subnet-6A081480"]
)
Or c2-paas utility from K2 Cloud API Client software suite:
c2-paas ConvertToHighAvailability serviceId fm-cluster-7867D61F subnetIds.1 subnet-6A081480