Class: Infrawrench::DeploymentsRunsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::DeploymentsRunsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.deployments.runs
Instance Method Summary collapse
-
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Record a deployment that ran elsewhere.
-
#get(id:, org_id: nil, request_options: nil) ⇒ Hash
Get one deployment run, with its logs and rendered Dockerfile.
-
#initialize(transport) ⇒ DeploymentsRunsNamespace
constructor
private
A new instance of DeploymentsRunsNamespace.
-
#list(org_id: nil, env: nil, limit: nil, request_options: nil) ⇒ Array<Hash>
List deployment runs.
-
#rollback(id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash
Roll back to a previous deployment.
Constructor Details
#initialize(transport) ⇒ DeploymentsRunsNamespace
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 DeploymentsRunsNamespace.
2294 2295 2296 |
# File 'lib/infrawrench/client.rb', line 2294 def initialize(transport) @transport = transport end |
Instance Method Details
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Record a deployment that ran elsewhere
The CLI builds on the operator's own machine, so the server never sees that run. Reporting it here keeps one history across both origins.
Requires permission: deployments:write.
POST /api/org/orgId/deployments/runs
Raises on 400: Bad request
Raises on 401: Unauthenticated
Raises on 403: Forbidden
2319 2320 2321 2322 2323 2324 2325 2326 2327 |
# File 'lib/infrawrench/client.rb', line 2319 def create(org_id: nil, body: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/deployments/runs", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#get(id:, org_id: nil, request_options: nil) ⇒ Hash
Get one deployment run, with its logs and rendered Dockerfile
Requires permission: deployments:read.
GET /api/org/orgId/deployments/runs/id
Raises on 401: Unauthenticated
Raises on 403: Forbidden
Raises on 404: Not found
2347 2348 2349 2350 2351 2352 2353 2354 |
# File 'lib/infrawrench/client.rb', line 2347 def get(id:, org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/deployments/runs/{id}", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#list(org_id: nil, env: nil, limit: nil, request_options: nil) ⇒ Array<Hash>
List deployment runs
Requires permission: deployments:read.
GET /api/org/orgId/deployments/runs
Raises on 401: Unauthenticated
Raises on 403: Forbidden
2374 2375 2376 2377 2378 2379 2380 2381 2382 |
# File 'lib/infrawrench/client.rb', line 2374 def list(org_id: nil, env: nil, limit: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/deployments/runs", path_params: { "orgId" => org_id }, query: { "env" => env, "limit" => limit }, request_options: ) end |
#rollback(id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash
Roll back to a previous deployment
Re-runs that run's deploy() with the image and plan it recorded,
building nothing — the exact artifact that was known good ships again. The
Infrafile is read at the commit that run deployed, not at the branch head.
Only a successful run that produced an image can be rolled back to. With
deleteCreated, resources that runs after the target created through
infra.accounts are deleted once the rollback has succeeded — undoing the
provisioning, not just the shipping. Deletions are best-effort and
reported in the result's notes.
Requires permission: deployments:write.
POST /api/org/orgId/deployments/runs/id/rollback
Raises on 400: Bad request
Raises on 401: Unauthenticated
Raises on 402: Payment required — the organization's plan does not include this
Raises on 403: Forbidden
Raises on 404: Not found
Raises on 409: Conflict
Raises on 423: Blocked by an active change freeze. Retry with the
x-change-freeze-override: true header if you hold freezes:override;
both blocks and overrides are audit-logged.
2423 2424 2425 2426 2427 2428 2429 2430 2431 |
# File 'lib/infrawrench/client.rb', line 2423 def rollback(id:, org_id: nil, body: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/deployments/runs/{id}/rollback", path_params: { "orgId" => org_id, "id" => id }, body: body, request_options: ) end |