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.
13461 13462 13463 |
# File 'lib/infrawrench/client.rb', line 13461 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
13485 13486 13487 13488 13489 13490 13491 13492 13493 |
# File 'lib/infrawrench/client.rb', line 13485 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
13507 13508 13509 13510 13511 13512 13513 13514 |
# File 'lib/infrawrench/client.rb', line 13507 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
13529 13530 13531 13532 13533 13534 13535 13536 13537 |
# File 'lib/infrawrench/client.rb', line 13529 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 |