Class: Infrawrench::SlackChannelsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::SlackChannelsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.slack.channels
Instance Method Summary collapse
-
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Connect a Slack channel as an alert destination.
-
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Disconnect a channel.
-
#initialize(transport) ⇒ SlackChannelsNamespace
constructor
private
A new instance of SlackChannelsNamespace.
-
#update(id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash
Refresh a channel's cached name.
Constructor Details
#initialize(transport) ⇒ SlackChannelsNamespace
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SlackChannelsNamespace.
13678 13679 13680 |
# File 'lib/infrawrench/client.rb', line 13678 def initialize(transport) @transport = transport end |
Instance Method Details
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Connect a Slack channel as an alert destination
Adds a channel as a possible destination, or refreshes the cached name of one already added. Which alerts reach it is decided by /alert-rules; an organization with no rules falls back to the default (everything except drift, everywhere), so a freshly added channel starts receiving alerts without a second step.
POST /api/org/orgId/slack/channels
Raises on 400: Bad request
Raises on 404: Not found
13702 13703 13704 13705 13706 13707 13708 13709 13710 |
# File 'lib/infrawrench/client.rb', line 13702 def create(org_id: nil, body: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/slack/channels", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Disconnect a channel
DELETE /api/org/orgId/slack/channels/id
Raises on 404: Not found
13724 13725 13726 13727 13728 13729 13730 13731 |
# File 'lib/infrawrench/client.rb', line 13724 def delete(id:, org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/slack/channels/{id}", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#update(id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash
Refresh a channel's cached name
PATCH /api/org/orgId/slack/channels/id
Raises on 404: Not found
13746 13747 13748 13749 13750 13751 13752 13753 13754 |
# File 'lib/infrawrench/client.rb', line 13746 def update(id:, org_id: nil, body: nil, request_options: nil) @transport.request( http_method: "PATCH", path: "/api/org/{orgId}/slack/channels/{id}", path_params: { "orgId" => org_id, "id" => id }, body: body, request_options: ) end |