Class: Infrawrench::StatusPagesNamespace

Inherits:
Object
  • Object
show all
Defined in:
lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs

Overview

client.status_pages

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ StatusPagesNamespace

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 StatusPagesNamespace.

Parameters:



13882
13883
13884
# File 'lib/infrawrench/client.rb', line 13882

def initialize(transport)
  @transport = transport
end

Instance Method Details

#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash

Create a status page

Creates a page with a freshly generated slug. published defaults to false, so creating a page never exposes anything — publish it as a separate, deliberate step.

Requires permission: resources:write.

POST /api/org/orgId/status-pages

Raises on 400: Bad request

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • body (Hash, nil) (defaults to: nil)

    Request body, shaped as StatusPageCreate.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • org_id: (String, nil) (defaults to: nil)
  • body: (status_page_create, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as StatusPage — see sig/infrawrench/sdk.rbs.

Raises:



13906
13907
13908
13909
13910
13911
13912
13913
13914
# File 'lib/infrawrench/client.rb', line 13906

def create(org_id: nil, body: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/status-pages",
    path_params: { "orgId" => org_id },
    body: body,
    request_options: request_options
  )
end

#delete(id:, org_id: nil, request_options: nil) ⇒ nil

Delete a status page

The page's link stops working. The probes it published are untouched.

Requires permission: resources:write.

DELETE /api/org/orgId/status-pages/id

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • id (String)
  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (nil)

    This endpoint returns no content.

Raises:



13932
13933
13934
13935
13936
13937
13938
13939
13940
# File 'lib/infrawrench/client.rb', line 13932

def delete(id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "DELETE",
    path: "/api/org/{orgId}/status-pages/{id}",
    path_params: { "orgId" => org_id, "id" => id },
    accept: :empty,
    request_options: request_options
  )
end

#get(org_id: nil, request_options: nil) ⇒ Hash

List status pages

Every status page in the organization, with the probes each publishes and whether it is currently reachable.

Requires permission: resources:read.

GET /api/org/orgId/status-pages

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as StatusPageListResponse — see sig/infrawrench/sdk.rbs.

Raises:



13957
13958
13959
13960
13961
13962
13963
13964
# File 'lib/infrawrench/client.rb', line 13957

def get(org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/status-pages",
    path_params: { "orgId" => org_id },
    request_options: request_options
  )
end

#rotate_slug(id:, org_id: nil, request_options: nil) ⇒ Hash

Issue a new public link

Replaces the slug, revoking the current public URL immediately — the reroll for a link that ended up somewhere unintended. The page stays published.

Requires permission: resources:write.

POST /api/org/orgId/status-pages/id/rotate-slug

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • id (String)
  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as StatusPage — see sig/infrawrench/sdk.rbs.

Raises:



13984
13985
13986
13987
13988
13989
13990
13991
# File 'lib/infrawrench/client.rb', line 13984

def rotate_slug(id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/status-pages/{id}/rotate-slug",
    path_params: { "orgId" => org_id, "id" => id },
    request_options: request_options
  )
end

#update(id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash

Update a status page

Omitted fields keep their value. components, when present, replaces the whole ordered set — which is also how a reorder is expressed.

Requires permission: resources:write.

PUT /api/org/orgId/status-pages/id

Raises on 400: Bad request

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • id (String)
  • body (Hash, nil) (defaults to: nil)

    Request body, shaped as StatusPagePatch.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • body: (status_page_patch, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as StatusPage — see sig/infrawrench/sdk.rbs.

Raises:



14013
14014
14015
14016
14017
14018
14019
14020
14021
# File 'lib/infrawrench/client.rb', line 14013

def update(id:, org_id: nil, body: nil, request_options: nil)
  @transport.request(
    http_method: "PUT",
    path: "/api/org/{orgId}/status-pages/{id}",
    path_params: { "orgId" => org_id, "id" => id },
    body: body,
    request_options: request_options
  )
end