Skip to content

Commit

Permalink
fix: table in doc (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdh authored Apr 4, 2024
1 parent 9b1aba4 commit b632eb7
Show file tree
Hide file tree
Showing 3 changed files with 171 additions and 15 deletions.
6 changes: 3 additions & 3 deletions docs/docs/guides/notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ We could send a notification with `POST /notifications` API to a specific receiv

| Field Name | Type | Required? | Description |
|--- |--- |--- |--- |
| receivers | list of json | yes | Selector of receivers using receiver labels <pre>[<br> {<br> "id": 3, <br> },<br> {<br> "type": "slack_channel",<br> "team": "de-infra"<br> },<br> {<br> "type": "email",<br> "team": "de-experience" <br> }<br>]
</pre> This will fetch all receivers that have the labels. |
| receivers | list of json | yes | Selector of receivers using receiver labels <br/>[<br/> {<br/> "id": 3, <br/> },<br/> {<br/> "type": "slack_channel",<br/> "team": "de-infra"<br/> },<br/> {<br/> "type": "email",<br/> "team": "de-experience" <br/> }<br/>]<br/>
This will fetch all receivers that have the labels. |
| data | json | yes | any data that we want to pass to the message. The data will populate the corresponding template or content variables. |
| template | string | no | template name that will be used to populate the message. default template will be used if this value is empty. errors might be thrown if there are errors when parsing template. |
| labels | json | no | If populated, labels would be used by subscription matchers to find the subscribers that listen to specific labels. e.g. <pre>{<br> "team": "de-infra",<br> "severity": "CRITICAL"<br>}</pre> |
| labels | json | no | If populated, labels would be used by subscription matchers to find the subscribers that listen to specific labels. e.g. <br/>{<br/> "team": "de-infra",<br/> "severity": "CRITICAL"<br/>} |


### Example: Sending Notification to Slack
Expand Down
171 changes: 168 additions & 3 deletions docs/docs/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Documentation of our Siren API with gRPC and
gRPC-Gateway.

## Version: 0.5
## Version: 0.6

### /v1beta1/alerts/{provider_type}/{provider_id}

Expand Down Expand Up @@ -162,6 +162,65 @@ update a namespace
| 200 | A successful response. | [UpdateNamespaceResponse](#updatenamespaceresponse) |
| default | An unexpected error response. | [Status](#status) |

### /v1beta1/notifications

#### GET
##### Summary

List notifications

##### Parameters

| Name | Located in | Description | Required | Schema |
| ---- | ---------- | ----------- | -------- | ---- |
| type | query | | No | string |
| template | query | | No | string |

##### Responses

| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | A successful response. | [ListNotificationsResponse](#listnotificationsresponse) |
| default | An unexpected error response. | [Status](#status) |

#### POST
##### Summary

Post an event notification

##### Parameters

| Name | Located in | Description | Required | Schema |
| ---- | ---------- | ----------- | -------- | ---- |
| body | body | | Yes | [PostNotificationRequest](#postnotificationrequest) |

##### Responses

| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | A successful response. | [PostNotificationResponse](#postnotificationresponse) |
| default | An unexpected error response. | [Status](#status) |

### /v1beta1/notifications/{notification_id}/messages

#### GET
##### Summary

List messages generated by notification

##### Parameters

| Name | Located in | Description | Required | Schema |
| ---- | ---------- | ----------- | -------- | ---- |
| notification_id | path | | Yes | string |

##### Responses

| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | A successful response. | [ListNotificationMessagesResponse](#listnotificationmessagesresponse) |
| default | An unexpected error response. | [Status](#status) |

### /v1beta1/providers

#### GET
Expand Down Expand Up @@ -696,6 +755,14 @@ render a template
| triggered_at | dateTime | | No |
| namespace_id | string (uint64) | | No |
| silence_status | string | | No |
| created_at | dateTime | | No |
| updated_at | dateTime | | No |
| group_key | string | | No |
| status | string | | No |
| annotations | object | | No |
| labels | object | | No |
| generator_url | string | | No |
| fingerprint | string | | No |

#### Any

Expand Down Expand Up @@ -758,6 +825,7 @@ render a template
| type | string | | No |
| labels | object | | No |
| configurations | object | | No |
| parent_id | string (uint64) | | No |

#### CreateReceiverResponse

Expand Down Expand Up @@ -788,6 +856,8 @@ render a template
| namespace | string (uint64) | | No |
| receivers | [ [ReceiverMetadata](#receivermetadata) ] | | No |
| match | object | | No |
| metadata | object | | No |
| created_by | string | | No |

#### CreateSubscriptionResponse

Expand Down Expand Up @@ -879,6 +949,18 @@ render a template
| ---- | ---- | ----------- | -------- |
| namespaces | [ [Namespace](#namespace) ] | | No |

#### ListNotificationMessagesResponse

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| messages | [ [NotificationMessage](#notificationmessage) ] | | No |

#### ListNotificationsResponse

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| notifications | [ [Notification](#notification) ] | | No |

#### ListProvidersResponse

| Name | Type | Description | Required |
Expand Down Expand Up @@ -928,6 +1010,39 @@ render a template
| created_at | dateTime | | No |
| updated_at | dateTime | | No |

#### Notification

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| id | string | | No |
| namespace_id | string (uint64) | | No |
| type | string | | No |
| data | object | | No |
| labels | object | | No |
| valid_duration | string | | No |
| template | string | | No |
| create_at | dateTime | | No |
| unique_key | string | | No |
| receiver_selectors | [ [ReceiverSelector](#receiverselector) ] | | No |

#### NotificationMessage

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| id | string | | No |
| notification_id | string | | No |
| status | string | | No |
| receiver_type | string | | No |
| details | object | | No |
| last_error | string | | No |
| max_tries | string (uint64) | | No |
| try_count | string (uint64) | | No |
| retryable | boolean | | No |
| expired_at | dateTime | | No |
| created_at | dateTime | | No |
| updated_at | dateTime | | No |
| configs | object | | No |

#### NotifyReceiverResponse

| Name | Type | Description | Required |
Expand All @@ -939,13 +1054,28 @@ render a template
`NullValue` is a singleton enumeration to represent the null value for the
`Value` type union.

The JSON representation for `NullValue` is JSON `null`.
The JSON representation for `NullValue` is JSON `null`.

- NULL_VALUE: Null value.

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| NullValue | string | `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - NULL_VALUE: Null value. | |
| NullValue | string | `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - NULL_VALUE: Null value. | |

#### PostNotificationRequest

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| receivers | [ object ] | | No |
| data | object | | No |
| labels | object | | No |
| template | string | | No |

#### PostNotificationResponse

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| notification_id | string | | No |

#### Provider

Expand Down Expand Up @@ -973,6 +1103,7 @@ render a template
| data | object | | No |
| created_at | dateTime | | No |
| updated_at | dateTime | | No |
| parent_id | string (uint64) | | No |

#### ReceiverMetadata

Expand All @@ -981,6 +1112,12 @@ render a template
| id | string (uint64) | | No |
| configuration | object | | No |

#### ReceiverSelector

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| receiver_selector | object | | No |

#### RenderTemplateResponse

| Name | Type | Description | Required |
Expand All @@ -1002,6 +1139,12 @@ render a template
| updated_at | dateTime | | No |
| provider_namespace | string (uint64) | | No |

#### SetConfigResponse

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| SetConfigResponse | object | | |

#### Silence

| Name | Type | Description | Required |
Expand Down Expand Up @@ -1034,6 +1177,15 @@ render a template
| match | object | | No |
| created_at | dateTime | | No |
| updated_at | dateTime | | No |
| metadata | object | | No |
| created_by | string | | No |
| updated_by | string | | No |

#### SyncRuntimeConfigResponse

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| labels | object | | No |

#### Template

Expand All @@ -1056,6 +1208,13 @@ render a template
| default | string | | No |
| description | string | | No |

#### TransformToAlertsResponse

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| alerts | [ [Alert](#alert) ] | | No |
| firing_num | string (uint64) | | No |

#### UpdateNamespaceResponse

| Name | Type | Description | Required |
Expand Down Expand Up @@ -1097,6 +1256,12 @@ render a template
| ---- | ---- | ----------- | -------- |
| id | string (uint64) | | No |

#### UpsertRuleResponse

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| UpsertRuleResponse | object | | |

#### UpsertTemplateRequest

| Name | Type | Description | Required |
Expand Down
9 changes: 0 additions & 9 deletions docs/docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,6 @@ Edit a receiver

List receivers

### `siren receiver send [flags]`

Send a receiver notification

```
-f, --file string Path to the receiver notification message
--id uint receiver id
````

### `siren receiver view [flags]`

View a receiver details
Expand Down

0 comments on commit b632eb7

Please sign in to comment.