Class: Infrawrench::DeploymentsNamespace

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

Overview

client.deployments

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ DeploymentsNamespace

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

Parameters:



6531
6532
6533
6534
6535
# File 'lib/infrawrench/client.rb', line 6531

def initialize(transport)
  @transport = transport
  @runs = DeploymentsRunsNamespace.new(@transport)
  @triggers = DeploymentsTriggersNamespace.new(@transport)
end

Instance Attribute Details

#runsDeploymentsRunsNamespace (readonly)

Returns client.deployments.runs.

Returns:



6525
6526
6527
# File 'lib/infrawrench/client.rb', line 6525

def runs
  @runs
end

#triggersDeploymentsTriggersNamespace (readonly)

Returns client.deployments.triggers.

Returns:



6527
6528
6529
# File 'lib/infrawrench/client.rb', line 6527

def triggers
  @triggers
end

Instance Method Details

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

List the environments a repository's Infrafile declares

Reads Infrafile at the branch head and returns its declared environments. The file is parsed, not executed.

Requires permission: deployments:read.

POST /api/org/orgId/deployments/envs

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

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

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

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

Returns:

  • (Hash)

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

Raises:



6560
6561
6562
6563
6564
6565
6566
6567
6568
# File 'lib/infrawrench/client.rb', line 6560

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

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

Preview a deploy without building

Runs the Infrafile's plan() and renders its Dockerfile, then stops. Nothing is built or deployed.

Requires permission: deployments:plan.

POST /api/org/orgId/deployments/plan

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

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

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

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

Returns:

  • (Hash)

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

Raises:



6593
6594
6595
6596
6597
6598
6599
6600
6601
# File 'lib/infrawrench/client.rb', line 6593

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

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

List repositories this organization can deploy from

Repositories visible to the organization's GitHub App installations. Empty when the app is not configured.

Requires permission: deployments:read.

GET /api/org/orgId/deployments/repos

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

Raises:



6622
6623
6624
6625
6626
6627
6628
6629
# File 'lib/infrawrench/client.rb', line 6622

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