ModifySecurityGroups
In this article:
ModifySecurityGroups#
Description#
Changes the list of security groups assigned to a PaaS service.
Important
Automatically created groups cannot be deleted; they must be included in the submitted list. The submitted list completely replaces the current list of security groups.
Request Parameters#
securityGroupIds — The IDs of the security groups that will replace the old ones.
Type: Array of strings
Required: Yes
serviceId — The service ID.
Type: String
Required: Yes
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.modify_security_groups(
serviceId="fm-cluster-703B8872",
securityGroupIds=["sg-A8F6D745"],
)
Or c2-paas utility from K2 Cloud API Client software suite:
c2-paas ModifySecurityGroups serviceId fm-cluster-7867D61F securityGroupIds.1 sg-A8F6D745