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.
13152 13153 13154 |
# File 'lib/infrawrench/client.rb', line 13152 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
13176 13177 13178 13179 13180 13181 13182 13183 13184 |
# File 'lib/infrawrench/client.rb', line 13176 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
13198 13199 13200 13201 13202 13203 13204 13205 |
# File 'lib/infrawrench/client.rb', line 13198 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
13220 13221 13222 13223 13224 13225 13226 13227 13228 |
# File 'lib/infrawrench/client.rb', line 13220 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 |