Class: Infrawrench::BackupsPoliciesNamespace
- Inherits:
-
Object
- Object
- Infrawrench::BackupsPoliciesNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.backups.policies
Instance Method Summary collapse
-
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Create a backup policy.
-
#delete(policy_id:, org_id: nil, request_options: nil) ⇒ nil
Delete a backup policy.
-
#get(org_id: nil, request_options: nil) ⇒ Hash
List the organization's backup policies.
-
#initialize(transport) ⇒ BackupsPoliciesNamespace
constructor
private
A new instance of BackupsPoliciesNamespace.
-
#update(policy_id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash
Update a backup policy.
Constructor Details
#initialize(transport) ⇒ BackupsPoliciesNamespace
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 BackupsPoliciesNamespace.
1542 1543 1544 |
# File 'lib/infrawrench/client.rb', line 1542 def initialize(transport) @transport = transport end |
Instance Method Details
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Create a backup policy
A policy must demand at least one of maxRpoHours and minRetentionDays
— one that demands nothing could never produce a finding and would read as
protection while providing none. An empty resourceTypeIds selects every
stateful resource type.
POST /api/org/orgId/backups/policies
Raises on 400: Bad request
Raises on 409: Conflict
1565 1566 1567 1568 1569 1570 1571 1572 1573 |
# File 'lib/infrawrench/client.rb', line 1565 def create(org_id: nil, body: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/backups/policies", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(policy_id:, org_id: nil, request_options: nil) ⇒ nil
Delete a backup policy
Removes the objective. To stop a policy judging without losing it, set
enabled to false instead.
DELETE /api/org/orgId/backups/policies/policyId
Raises on 404: Not found
1590 1591 1592 1593 1594 1595 1596 1597 1598 |
# File 'lib/infrawrench/client.rb', line 1590 def delete(policy_id:, org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/backups/policies/{policyId}", path_params: { "orgId" => org_id, "policyId" => policy_id }, accept: :empty, request_options: ) end |
#get(org_id: nil, request_options: nil) ⇒ Hash
List the organization's backup policies
The recovery objectives coverage is judged against. A policy selects resources by type and/or tag and demands a maximum RPO, a minimum retention, or both.
GET /api/org/orgId/backups/policies
1613 1614 1615 1616 1617 1618 1619 1620 |
# File 'lib/infrawrench/client.rb', line 1613 def get(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/backups/policies", path_params: { "orgId" => org_id }, request_options: ) end |
#update(policy_id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash
Update a backup policy
Omitted fields are left alone; an explicit null clears tagKey,
tagValue, maxRpoHours or minRetentionDays. The result is validated
after merging, so a patch that would leave the policy demanding nothing is
rejected.
PATCH /api/org/orgId/backups/policies/policyId
Raises on 400: Bad request
Raises on 404: Not found
1642 1643 1644 1645 1646 1647 1648 1649 1650 |
# File 'lib/infrawrench/client.rb', line 1642 def update(policy_id:, org_id: nil, body: nil, request_options: nil) @transport.request( http_method: "PATCH", path: "/api/org/{orgId}/backups/policies/{policyId}", path_params: { "orgId" => org_id, "policyId" => policy_id }, body: body, request_options: ) end |