Class: Infrawrench::PagesNamespace
- Inherits:
-
Object
- Object
- Infrawrench::PagesNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.pages
Instance Method Summary collapse
-
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Raise an alert to the organization's on-call transports.
-
#delete(source:, org_id: nil, key: nil, request_options: nil) ⇒ Hash
Clear a page key's cooldown.
-
#initialize(transport) ⇒ PagesNamespace
constructor
private
A new instance of PagesNamespace.
Constructor Details
#initialize(transport) ⇒ PagesNamespace
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 PagesNamespace.
2111 2112 2113 |
# File 'lib/infrawrench/client.rb', line 2111 def initialize(transport) @transport = transport end |
Instance Method Details
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Raise an alert to the organization's on-call transports
Fans an alert out over whatever the org has configured — Twilio SMS (and
voice on request), mobile push, Slack channels, and Microsoft Teams
webhooks — honouring each recipient's opt-ins. This is the same alert a
workflow raises with infra.page(...), for code that runs somewhere
Infrawrench does not: a health check, a deploy script, a cron on a box.
Repeat pages under the same (source, key) are suppressed, not
rejected: a monitor that fires every minute pages once and then gets
200 with suppressed: true and the retryAt at which the key can page
again. A page that reached nobody does not start a cooldown, so the next
call tries again.
Recipients opt in per channel under the same setting that covers workflow pages.
Requires permission: pages:write.
POST /api/org/orgId/pages
Raises on 400: Bad request
2144 2145 2146 2147 2148 2149 2150 2151 2152 |
# File 'lib/infrawrench/client.rb', line 2144 def create(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/pages", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(source:, org_id: nil, key: nil, request_options: nil) ⇒ Hash
Clear a page key's cooldown
Drops the cooldown for one (source, key) so the next page under it
delivers immediately. Call it when the condition you alerted on recovers —
the workflow equivalent is infra.page.clear(key). Clearing a key that
was never paged is not an error.
Requires permission: pages:write.
DELETE /api/org/orgId/pages
Raises on 400: Bad request
2176 2177 2178 2179 2180 2181 2182 2183 2184 |
# File 'lib/infrawrench/client.rb', line 2176 def delete(source:, org_id: nil, key: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/pages", path_params: { "orgId" => org_id }, query: { "source" => source, "key" => key }, request_options: ) end |