Class: Infrawrench::DeploymentsTriggersNamespace

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

Overview

client.deployments.triggers

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ DeploymentsTriggersNamespace

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

Parameters:



6712
6713
6714
# File 'lib/infrawrench/client.rb', line 6712

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Deploy an environment whenever a branch moves

Arming a trigger records the branch's current commit WITHOUT deploying it — the trigger fires on the next push, not on the state at the moment it was created. The environment is validated against the Infrafile at that branch head, so a typo fails here rather than silently never firing.

Requires permission: deployments:write.

POST /api/org/orgId/deployments/triggers

Raises on 400: Bad request

Raises on 401: Unauthenticated

Raises on 403: Forbidden

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

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

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

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

Returns:

  • (Hash)

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

Raises:



6741
6742
6743
6744
6745
6746
6747
6748
6749
# File 'lib/infrawrench/client.rb', line 6741

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

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

Delete a deploy trigger

Requires permission: deployments:write.

DELETE /api/org/orgId/deployments/triggers/id

Raises on 401: Unauthenticated

Raises on 403: Forbidden

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:



6767
6768
6769
6770
6771
6772
6773
6774
# File 'lib/infrawrench/client.rb', line 6767

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

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

List deploy-on-push triggers

Requires permission: deployments:read.

GET /api/org/orgId/deployments/triggers

Raises on 401: Unauthenticated

Raises on 403: Forbidden

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

Raises:



6792
6793
6794
6795
6796
6797
6798
6799
# File 'lib/infrawrench/client.rb', line 6792

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

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

Enable or disable a deploy trigger

Requires permission: deployments:write.

PATCH /api/org/orgId/deployments/triggers/id

Raises on 401: Unauthenticated

Raises on 403: Forbidden

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

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

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

  • id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • body: ({ "enabled" => bool }, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

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

Raises:



6820
6821
6822
6823
6824
6825
6826
6827
6828
# File 'lib/infrawrench/client.rb', line 6820

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