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.
1797 1798 1799 |
# File 'lib/infrawrench/client.rb', line 1797 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
1820 1821 1822 1823 1824 1825 1826 1827 1828 |
# File 'lib/infrawrench/client.rb', line 1820 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
1845 1846 1847 1848 1849 1850 1851 1852 1853 |
# File 'lib/infrawrench/client.rb', line 1845 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
1868 1869 1870 1871 1872 1873 1874 1875 |
# File 'lib/infrawrench/client.rb', line 1868 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
1897 1898 1899 1900 1901 1902 1903 1904 1905 |
# File 'lib/infrawrench/client.rb', line 1897 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 |