Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,30 @@ try {
```
For pagerduty template supported template type value: pagerduty.notification

#### Eventstreams Template
```js
const templateConfigModel = {
params: {
body: 'base 64 encoded json body',
},
};
let createTemplateParams = {
instanceId: <instance-id>,
name: <template-name>,
type: <template-type>,
templateConfigModel,
description: <template-description>,
};
let createTemplateResult;
try {
createTemplateResult = await eventNotificationsService.createTemplate(createTemplateParams);
console.log(JSON.stringify(createTemplateResult.result, null, 2));
} catch (err) {
console.warn(err);
}
```
For EventStreams template supported template type value: event_streams.notification

### List Templates
```js
const params = {
Expand Down Expand Up @@ -787,6 +811,29 @@ try {
```
For pagerduty template supported template type value: pagerduty.notification

#### Update EventStreams Template
```js
const templateConfigModel = {
params: {
body: 'base 64 encoded json body',
},
};
let replaceTemplateParams = {
instanceId: <instance-id>,
name: <template-name>,
type: <template-type>,
templateConfigModel,
description: <template-description>,s
};
let replaceTemplateResult;
try {
replaceTemplateResult = await eventNotificationsService.replaceTemplate(replaceTemplateParams);
} catch (err) {
console.warn(err);
}
```
For Event Streams template supported template type value: event_streams.notification

### Delete Template
```js
const params = {
Expand Down Expand Up @@ -1430,6 +1477,11 @@ Find [event_notifications_v1.env.hide](https://github.com/IBM/event-notification
- `EVENT_NOTIFICATIONS_SLACK_TEMPLATE_BODY` - base 64 encoded json body
- `EVENT_NOTIFICATIONS_WEBHOOK_TEMPLATE_BODY` - base 64 encoded json body
- `EVENT_NOTIFICATIONS_SCHEDULER_SOURCE_ID` - periodic timer source id
- `EVENT_NOTIFICATIONS_PAGERDUTY_TEMPLATE_BODY` - base 64 encoded json body for pagerduty destination
- `EVENT_NOTIFICATIONS_EVENT_STREAMS_TEMPLATE_BODY` - base 64 encoded json body for event streams destination
- `EVENT_NOTIFICATIONS_EVENT_STREAMS_CRN` - Event Streams instance CRN
- `EVENT_NOTIFICATIONS_EVENT_STREAMS_TOPIC` - Event Streams instance Topic name
- `EVENT_NOTIFICATIONS_EVENT_STREAMS_ENDPOINT` - Event streams end point

## Questions

Expand Down
41 changes: 40 additions & 1 deletion event-notifications/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3480,6 +3480,7 @@ namespace EventNotificationsV1 {
PUSH_HUAWEI = 'push_huawei',
SMTP_CUSTOM = 'smtp_custom',
SMS_CUSTOM = 'sms_custom',
EVENT_STREAMS = 'event_streams',
}
}

Expand Down Expand Up @@ -3933,7 +3934,7 @@ namespace EventNotificationsV1 {
/** Destination description. */
description: string;
/** Destination type
* Email/SMS/Webhook/FCM/Slack/MSTeams/PagerDuty/IBMCodeEngine/ServiceNow/IBMCloudObjectStorage/Huawei.
* Email/SMS/Webhook/FCM/Slack/MSTeams/PagerDuty/IBMCodeEngine/ServiceNow/IBMCloudObjectStorage/Huawei/CustomEmail/CustomSMS/EventStreams.
*/
type: string;
/** Whether to collect the failed event in Cloud Object Storage bucket. */
Expand Down Expand Up @@ -4855,6 +4856,17 @@ namespace EventNotificationsV1 {
spf?: SPFAttributes;
}

/** Payload describing a Event Streams destination configuration. */
export interface DestinationConfigOneOfEventStreamsDestinationConfig
extends DestinationConfigOneOf {
/** CRN of the Event Streans instance. */
crn: string;
/** End Point of Event Streams. */
endpoint: string;
/** Topic of Event Streams. */
topic: string;
}

/** Payload describing an FCM destination configuration. project_id, private_key and client_email for FCM HTTP v1 APIs. */
export interface DestinationConfigOneOfFCMDestinationConfig extends DestinationConfigOneOf {
/** Deprecated: FCM server_key. */
Expand Down Expand Up @@ -5050,6 +5062,13 @@ namespace EventNotificationsV1 {
from_name: string;
}

/** The attributes for a Event Streams response. */
export interface SubscriptionAttributesEventStreamsAttributesResponse
extends SubscriptionAttributes {
/** ID of Base64 converted JSON Pagerduty Blocks w/o Handlebars. */
template_id_notification?: string;
}

/** The attributes for a PagerDuty notification. */
export interface SubscriptionAttributesPagerDutyAttributesResponse
extends SubscriptionAttributes {
Expand Down Expand Up @@ -5144,6 +5163,13 @@ namespace EventNotificationsV1 {
from_name: string;
}

/** The attributes for a Event Streams subscription. */
export interface SubscriptionCreateAttributesEventstreamsAttributes
extends SubscriptionCreateAttributes {
/** ID of Base64 converted JSON Slack Blocks w/o Handlebars. */
template_id_notification?: string;
}

/** The attributes for an FCM notification. */
export interface SubscriptionCreateAttributesFCMAttributes extends SubscriptionCreateAttributes {}

Expand Down Expand Up @@ -5251,6 +5277,13 @@ namespace EventNotificationsV1 {
unsubscribed?: UpdateAttributesUnsubscribed;
}

/** The attributes for a Event Streams subscription. */
export interface SubscriptionUpdateAttributesEventstreamsAttributes
extends SubscriptionUpdateAttributes {
/** ID of Base64 converted JSON Slack Blocks w/o Handlebars. */
template_id_notification?: string;
}

/** The attributes for a pagerduty notification. */
export interface SubscriptionUpdateAttributesPagerDutyAttributes
extends SubscriptionUpdateAttributes {
Expand Down Expand Up @@ -5313,6 +5346,12 @@ namespace EventNotificationsV1 {
subject?: string;
}

/** Payload describing a event streams template configuration. */
export interface TemplateConfigOneOfEventStreamsTemplateConfig extends TemplateConfigOneOf {
/** Template body(Base64 encoded). */
body: string;
}

/** Payload describing a pagerduty template configuration. */
export interface TemplateConfigOneOfPagerdutyTemplateConfig extends TemplateConfigOneOf {
/** Template body(Base64 encoded). */
Expand Down
Loading