Skip to content

Commit 6dd1afb

Browse files
committed
Support for SMS notifications in ONS
1 parent 2723e7f commit 6dd1afb

10 files changed

+62
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 4.17.0 (Unreleased)
2+
3+
### Added
4+
- Support for SMS notifications for ONS
5+
16
## 4.16.0 (March 03, 2021)
27

38
### Added

oci/ons_notification_topic_data_source.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ func (s *OnsNotificationTopicDataSourceCrud) SetData() error {
9696
s.D.Set("name", *s.Res.Name)
9797
}
9898

99+
if s.Res.ShortTopicId != nil {
100+
s.D.Set("short_topic_id", *s.Res.ShortTopicId)
101+
}
102+
99103
s.D.Set("state", s.Res.LifecycleState)
100104

101105
if s.Res.TimeCreated != nil {

oci/ons_notification_topic_resource.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ func OnsNotificationTopicResource() *schema.Resource {
7070
Type: schema.TypeString,
7171
Computed: true,
7272
},
73+
"short_topic_id": {
74+
Type: schema.TypeString,
75+
Computed: true,
76+
},
7377
"state": {
7478
Type: schema.TypeString,
7579
Computed: true,
@@ -309,6 +313,10 @@ func (s *OnsNotificationTopicResourceCrud) SetData() error {
309313
s.D.Set("name", *s.Res.Name)
310314
}
311315

316+
if s.Res.ShortTopicId != nil {
317+
s.D.Set("short_topic_id", *s.Res.ShortTopicId)
318+
}
319+
312320
s.D.Set("state", s.Res.LifecycleState)
313321

314322
if s.Res.TimeCreated != nil {

oci/ons_notification_topics_data_source.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ func (s *OnsNotificationTopicsDataSourceCrud) SetData() error {
142142
notificationTopic["name"] = *r.Name
143143
}
144144

145+
if r.ShortTopicId != nil {
146+
notificationTopic["short_topic_id"] = *r.ShortTopicId
147+
}
148+
145149
notificationTopic["state"] = r.LifecycleState
146150

147151
if r.TimeCreated != nil {

website/docs/d/ons_notification_topic.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ The following attributes are exported:
4242
* `etag` - For optimistic concurrency control. See `if-match`.
4343
* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}`
4444
* `name` - The name of the topic.
45+
* `short_topic_id` - A unique short topic Id. This is used only for SMS subscriptions.
4546
* `state` - The lifecycle state of the topic.
4647
* `time_created` - The time the topic was created.
4748
* `topic_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic.

website/docs/d/ons_notification_topics.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ The following attributes are exported:
5656
* `etag` - For optimistic concurrency control. See `if-match`.
5757
* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}`
5858
* `name` - The name of the topic.
59+
* `short_topic_id` - A unique short topic Id. This is used only for SMS subscriptions.
5960
* `state` - The lifecycle state of the topic.
6061
* `time_created` - The time the topic was created.
6162
* `topic_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic.

website/docs/d/ons_subscription.html.markdown

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,18 @@ The following attributes are exported:
4343
* `etag` - For optimistic concurrency control. See `if-match`.
4444
* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}`
4545
* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription.
46-
* `protocol` - The protocol used for the subscription. For information about subscription protocols, see [To create a subscription](https://docs.cloud.oracle.com/iaas/Content/Notification/Tasks/managingtopicsandsubscriptions.htm#createSub).
46+
* `protocol` - The protocol used for the subscription.
47+
48+
Allowed values:
49+
* `CUSTOM_HTTPS`
50+
* `EMAIL`
51+
* `HTTPS` (deprecated; for PagerDuty endpoints, use `PAGERDUTY`)
52+
* `ORACLE_FUNCTIONS`
53+
* `PAGERDUTY`
54+
* `SLACK`
55+
* `SMS`
56+
57+
For information about subscription protocols, see [To create a subscription](https://docs.cloud.oracle.com/iaas/Content/Notification/Tasks/managingtopicsandsubscriptions.htm#createSub).
4758
* `state` - The lifecycle state of the subscription. The status of a new subscription is PENDING; when confirmed, the subscription status changes to ACTIVE.
4859
* `topic_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the associated topic.
4960

website/docs/d/ons_subscriptions.html.markdown

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,18 @@ The following attributes are exported:
5656
* `etag` - For optimistic concurrency control. See `if-match`.
5757
* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}`
5858
* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription.
59-
* `protocol` - The protocol used for the subscription. For information about subscription protocols, see [To create a subscription](https://docs.cloud.oracle.com/iaas/Content/Notification/Tasks/managingtopicsandsubscriptions.htm#createSub).
59+
* `protocol` - The protocol used for the subscription.
60+
61+
Allowed values:
62+
* `CUSTOM_HTTPS`
63+
* `EMAIL`
64+
* `HTTPS` (deprecated; for PagerDuty endpoints, use `PAGERDUTY`)
65+
* `ORACLE_FUNCTIONS`
66+
* `PAGERDUTY`
67+
* `SLACK`
68+
* `SMS`
69+
70+
For information about subscription protocols, see [To create a subscription](https://docs.cloud.oracle.com/iaas/Content/Notification/Tasks/managingtopicsandsubscriptions.htm#createSub).
6071
* `state` - The lifecycle state of the subscription. The status of a new subscription is PENDING; when confirmed, the subscription status changes to ACTIVE.
6172
* `topic_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the associated topic.
6273

website/docs/r/ons_notification_topic.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ The following attributes are exported:
6666
* `etag` - For optimistic concurrency control. See `if-match`.
6767
* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}`
6868
* `name` - The name of the topic.
69+
* `short_topic_id` - A unique short topic Id. This is used only for SMS subscriptions.
6970
* `state` - The lifecycle state of the topic.
7071
* `time_created` - The time the topic was created.
7172
* `topic_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic.

website/docs/r/ons_subscription.html.markdown

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ The following arguments are supported:
4949
* `CUSTOM_HTTPS`
5050
* `EMAIL`
5151
* `HTTPS` (deprecated; for PagerDuty endpoints, use `PAGERDUTY`)
52+
* `ORACLE_FUNCTIONS`
5253
* `PAGERDUTY`
5354
* `SLACK`
54-
* `ORACLE_FUNCTIONS`
55+
* `SMS`
5556

5657
For information about subscription protocols, see [To create a subscription](https://docs.cloud.oracle.com/iaas/Content/Notification/Tasks/managingtopicsandsubscriptions.htm#createSub).
5758
* `topic_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic for the subscription.
@@ -72,7 +73,18 @@ The following attributes are exported:
7273
* `etag` - For optimistic concurrency control. See `if-match`.
7374
* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}`
7475
* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription.
75-
* `protocol` - The protocol used for the subscription. For information about subscription protocols, see [To create a subscription](https://docs.cloud.oracle.com/iaas/Content/Notification/Tasks/managingtopicsandsubscriptions.htm#createSub).
76+
* `protocol` - The protocol used for the subscription.
77+
78+
Allowed values:
79+
* `CUSTOM_HTTPS`
80+
* `EMAIL`
81+
* `HTTPS` (deprecated; for PagerDuty endpoints, use `PAGERDUTY`)
82+
* `ORACLE_FUNCTIONS`
83+
* `PAGERDUTY`
84+
* `SLACK`
85+
* `SMS`
86+
87+
For information about subscription protocols, see [To create a subscription](https://docs.cloud.oracle.com/iaas/Content/Notification/Tasks/managingtopicsandsubscriptions.htm#createSub).
7688
* `state` - The lifecycle state of the subscription. The status of a new subscription is PENDING; when confirmed, the subscription status changes to ACTIVE.
7789
* `topic_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the associated topic.
7890

0 commit comments

Comments
 (0)