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.
13206 13207 13208 |
# File 'lib/infrawrench/client.rb', line 13206 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
13230 13231 13232 13233 13234 13235 13236 13237 13238 |
# File 'lib/infrawrench/client.rb', line 13230 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
13252 13253 13254 13255 13256 13257 13258 13259 |
# File 'lib/infrawrench/client.rb', line 13252 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
13274 13275 13276 13277 13278 13279 13280 13281 13282 |
# File 'lib/infrawrench/client.rb', line 13274 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 |