Class: Infrawrench::ChangeFreezesNamespace

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

Overview

client.change_freezes

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ ChangeFreezesNamespace

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

Parameters:



2514
2515
2516
# File 'lib/infrawrench/client.rb', line 2514

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Declare a change freeze window

While the freeze is in effect, destructive actions (resource deletion, destructive plugin actions, secret-version destroys, deployment rollbacks) return 423 unless explicitly overridden by a caller with freezes:override.

Requires permission: freezes:write.

POST /api/org/orgId/change-freezes

Raises on 400: Bad request

Parameters:

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

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

  • body (Hash)

    Request body, shaped as ChangeFreezeInput.

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

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

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

Returns:

  • (Hash)

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

Raises:



2537
2538
2539
2540
2541
2542
2543
2544
2545
# File 'lib/infrawrench/client.rb', line 2537

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

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

Delete a change freeze window

Requires permission: freezes:write.

DELETE /api/org/orgId/change-freezes/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:

  • (Hash)

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

Raises:



2561
2562
2563
2564
2565
2566
2567
2568
# File 'lib/infrawrench/client.rb', line 2561

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

#list(org_id: nil, request_options: nil) ⇒ Array<Hash>

List change freeze windows, newest first

Requires permission: freezes:read.

GET /api/org/orgId/change-freezes

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:

  • (Array<Hash>)

    Parsed JSON, shaped as Array<ChangeFreeze> — see sig/infrawrench/sdk.rbs.

Raises:



2605
2606
2607
2608
2609
2610
2611
2612
# File 'lib/infrawrench/client.rb', line 2605

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

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

End a change freeze now

Requires permission: freezes:write.

POST /api/org/orgId/change-freezes/id/end

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 ChangeFreeze — see sig/infrawrench/sdk.rbs.

Raises:



2584
2585
2586
2587
2588
2589
2590
2591
# File 'lib/infrawrench/client.rb', line 2584

def post_org_org_id_change_freezes_id_end(id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/change-freezes/{id}/end",
    path_params: { "orgId" => org_id, "id" => id },
    request_options: request_options
  )
end

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

The freeze currently in effect, if any

Returns the active freeze window (active, started, not yet past its end time) or freeze: null. Clients poll this to show the freeze banner and pre-warn before destructive actions.

Requires permission: freezes:read.

GET /api/org/orgId/change-freezes/status

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 ChangeFreezeStatus — see sig/infrawrench/sdk.rbs.

Raises:



2630
2631
2632
2633
2634
2635
2636
2637
# File 'lib/infrawrench/client.rb', line 2630

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

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

Update a change freeze window

Requires permission: freezes:write.

PUT /api/org/orgId/change-freezes/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)

    Request body, shaped as ChangeFreezeInput.

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

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

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

Returns:

  • (Hash)

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

Raises:



2656
2657
2658
2659
2660
2661
2662
2663
2664
# File 'lib/infrawrench/client.rb', line 2656

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