Skip to content
This repository has been archived by the owner on Sep 26, 2018. It is now read-only.

Commit

Permalink
migrate Slack to schema
Browse files Browse the repository at this point in the history
  • Loading branch information
LindsayHill committed Nov 21, 2016
1 parent 1a5f759 commit 215f40b
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packs/slack/CHANGES.md
@@ -0,0 +1,5 @@
# Change Log

# 0.3.0

- Rename `config.yaml` to `config.schema.yaml` and update to use schema.
3 changes: 3 additions & 0 deletions packs/slack/README.md
Expand Up @@ -4,6 +4,9 @@ Pack which allows integration with [Slack](https://slack.com/) service.

## Configuration

Copy the example configuration in [slack`.yaml.example](./slack`.yaml.example)
to `/opt/stackstorm/configs/slack`.yaml` and edit as required.

* ``post_message_action.webhook_url`` - Webhook URL.
* ``post_message_action.channel`` - Channel to send the message to (e.g.
`#mychannel`). If not specified, messages will be sent to the channel which
Expand Down
77 changes: 77 additions & 0 deletions packs/slack/config.schema.yaml
@@ -0,0 +1,77 @@
---
post_message_action:
description: "Admin-action specific settings."
type: "object"
required: false
additionalProperties: false
properties:
webhook_url:
type: "string"
description: "Webhook URL, e.g. https://hooks.slack.com/services/<replace me>"
default: true
required: true
channel:
type: "string"
description: "Channel to send message to - e.g. #mychannel. If not specified, will use channel selected when configuring webook"
required: false
username:
type: "string"
description: "Default name of user under which messages will be posted"
required: true
icon_emoji:
type: "string"
description: "Default icon of user under which messages will be posted"
default: ":panda_face:"
required: false
sensor:
description: "Sensor specific settings."
type: "object"
required: false
additionalProperties: false
properties:
token:
type: "string"
description: "Authentication token used to authenticate against Real Time Messaging API."
default: true
required: false
strip_formatting:
type: "boolean"
description: "Slack automatically parses URLs, images, channels, and usernames by default. This option returns raw data. Default false"
default: false
required: false
action_token:
description: "Slack Action token."
type: "string"
required: true
secret: true
admin:
description: "Admin-action specific settings."
type: "object"
required: false
additionalProperties: false
properties:
admin_token:
type: "string"
description: "Admin-level token for adding new users"
default: true
required: false
organization:
type: "string"
description: "Name of organisation to add new user to"
required: true
set_active:
type: "boolean"
description: "Set new user as active? Default true"
default: true
required: false
attempts:
type: "integer"
description: "Number of attempts to make to add the new user"
default: 1
required: false
auto_join_channels:
type: "array"
description: "A list of channels to auto-join the new account to"
items:
type: "string"
required: false
4 changes: 2 additions & 2 deletions packs/slack/pack.yaml
Expand Up @@ -7,6 +7,6 @@ keywords:
- chat
- messaging
- instant messaging
version : 0.2.1
version : 0.3.0
author : StackStorm, Inc.
email : info@stackstorm.com
email : info@stackstorm.com
1 change: 1 addition & 0 deletions packs/slack/config.yaml → packs/slack/slack.yaml.example
Expand Up @@ -2,6 +2,7 @@
# Used for post message action
post_message_action:
webhook_url: "https://hooks.slack.com/services/<replace me>"
channel: "#mychannel"
username: "my-bot"
icon_emoji: ":panda_face:"

Expand Down

0 comments on commit 215f40b

Please sign in to comment.