Class: Infrawrench::DeploymentsTriggersNamespace
- Inherits:
-
Object
- Object
- Infrawrench::DeploymentsTriggersNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.deployments.triggers
Instance Method Summary collapse
-
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Deploy an environment whenever a branch moves.
-
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Delete a deploy trigger.
-
#initialize(transport) ⇒ DeploymentsTriggersNamespace
constructor
private
A new instance of DeploymentsTriggersNamespace.
-
#list(org_id: nil, request_options: nil) ⇒ Array<Hash>
List deploy-on-push triggers.
-
#update(id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash
Enable or disable a deploy trigger.
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.
2438 2439 2440 |
# File 'lib/infrawrench/client.rb', line 2438 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
2467 2468 2469 2470 2471 2472 2473 2474 2475 |
# File 'lib/infrawrench/client.rb', line 2467 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: ) 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
2493 2494 2495 2496 2497 2498 2499 2500 |
# File 'lib/infrawrench/client.rb', line 2493 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: ) 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
2518 2519 2520 2521 2522 2523 2524 2525 |
# File 'lib/infrawrench/client.rb', line 2518 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: ) 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
2546 2547 2548 2549 2550 2551 2552 2553 2554 |
# File 'lib/infrawrench/client.rb', line 2546 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: ) end |