CreateNotificationChannel
In this article:
CreateNotificationChannel#
Description#
Request to create a notification channel for a PaaS service.
Request Parameters#
name — The name of the notification channel.
Type: String
Required: Yes
parameters — Parameters of the notification channel.
Type: Dict
Required: Yes
serviceId — The PaaS service ID.
Type: String
Required: Yes
Response Elements#
notificationChannel — Information about the notification channel.
Type: NotificationChannel 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.k2.cloud/',
)
channel = paas_client.create_notification_channel(
serviceId='fm-cluster-1ACD3963',
name="channel1",
parameters={
"is_default": True,
"type": "telegram",
"bot_token": "12345678:ABC-DEF1234ghIkl-zyx57W2v1u123ew111",
"chat_id": 87739407,
}
)
Or c2-paas utility from K2 Cloud API Client software suite:
c2-paas CreateNotificationChannel serviceId fm-cluster-1ACD3963 name channel1 parameters.is_default true parameters.type telegram parameters.bot_token '12345678:ABC-DEF1234ghIkl-zyx57W2v1u123ew111' parameters.chat_id 87739407