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.
1997 1998 1999 |
# File 'lib/infrawrench/client.rb', line 1997 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
2020 2021 2022 2023 2024 2025 2026 2027 2028 |
# File 'lib/infrawrench/client.rb', line 2020 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
2045 2046 2047 2048 2049 2050 2051 2052 2053 |
# File 'lib/infrawrench/client.rb', line 2045 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
2068 2069 2070 2071 2072 2073 2074 2075 |
# File 'lib/infrawrench/client.rb', line 2068 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
2097 2098 2099 2100 2101 2102 2103 2104 2105 |
# File 'lib/infrawrench/client.rb', line 2097 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 |