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
Route alerts to a Slack channel.
-
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Stop routing alerts to a channel.
-
#initialize(transport) ⇒ SlackChannelsNamespace
constructor
private
A new instance of SlackChannelsNamespace.
-
#update(id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash
Change which alerts a channel receives.
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.
3378 3379 3380 |
# File 'lib/infrawrench/client.rb', line 3378 def initialize(transport) @transport = transport end |
Instance Method Details
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Route alerts to a Slack channel
Adds a channel, or updates the trigger opt-ins of one already added. Each trigger defaults to enabled.
POST /api/org/orgId/slack/channels
Raises on 400: Bad request
Raises on 404: Not found
3399 3400 3401 3402 3403 3404 3405 3406 3407 |
# File 'lib/infrawrench/client.rb', line 3399 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
Stop routing alerts to a channel
DELETE /api/org/orgId/slack/channels/id
Raises on 404: Not found
3421 3422 3423 3424 3425 3426 3427 3428 |
# File 'lib/infrawrench/client.rb', line 3421 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
Change which alerts a channel receives
PATCH /api/org/orgId/slack/channels/id
Raises on 404: Not found
3443 3444 3445 3446 3447 3448 3449 3450 3451 |
# File 'lib/infrawrench/client.rb', line 3443 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 |