Class: Infrawrench::OnCallOverridesNamespace

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

Overview

client.on_call.overrides

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ OnCallOverridesNamespace

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

Parameters:



10579
10580
10581
# File 'lib/infrawrench/client.rb', line 10579

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Arrange cover

A cover beats the rotation for exactly its window. Among several overlapping covers the one that started most recently wins, so a later-written cover supersedes an earlier one rather than the answer depending on row order.

Takes team:read, not a settings permission: cover is arranged at 17:55 on a Friday and the person handing over is rarely an org admin. Every cover is audit-logged, which is the control that makes the looser permission safe.

POST /api/org/orgId/on-call/overrides

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

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

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

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

Returns:

  • (Hash)

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

Raises:



10607
10608
10609
10610
10611
10612
10613
10614
10615
# File 'lib/infrawrench/client.rb', line 10607

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

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

Cancel a cover

DELETE /api/org/orgId/on-call/overrides/overrideId

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.

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

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

  • override_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:



10629
10630
10631
10632
10633
10634
10635
10636
10637
# File 'lib/infrawrench/client.rb', line 10629

def delete(override_id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "DELETE",
    path: "/api/org/{orgId}/on-call/overrides/{overrideId}",
    path_params: { "orgId" => org_id, "overrideId" => override_id },
    accept: :empty,
    request_options: request_options
  )
end

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

List covers

GET /api/org/orgId/on-call/overrides

Parameters:

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

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

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

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

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

Returns:

  • (Hash)

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

Raises:



10649
10650
10651
10652
10653
10654
10655
10656
10657
# File 'lib/infrawrench/client.rb', line 10649

def get(org_id: nil, schedule_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/on-call/overrides",
    path_params: { "orgId" => org_id },
    query: { "scheduleId" => schedule_id },
    request_options: request_options
  )
end