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:



2284
2285
2286
2287
2288
# File 'lib/infrawrench/client.rb', line 2284

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

Instance Attribute Details

#runsDeploymentsRunsNamespace (readonly)

Returns client.deployments.runs.

Returns:



2278
2279
2280
# File 'lib/infrawrench/client.rb', line 2278

def runs
  @runs
end

#triggersDeploymentsTriggersNamespace (readonly)

Returns client.deployments.triggers.

Returns:



2280
2281
2282
# File 'lib/infrawrench/client.rb', line 2280

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:



2313
2314
2315
2316
2317
2318
2319
2320
2321
# File 'lib/infrawrench/client.rb', line 2313

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:



2346
2347
2348
2349
2350
2351
2352
2353
2354
# File 'lib/infrawrench/client.rb', line 2346

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:



2375
2376
2377
2378
2379
2380
2381
2382
# File 'lib/infrawrench/client.rb', line 2375

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