Class: Infrawrench::BackupsDrillsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::BackupsDrillsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.backups.drills
Instance Method Summary collapse
-
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Record a restore drill.
-
#delete(drill_id:, org_id: nil, request_options: nil) ⇒ nil
Delete a recorded drill.
-
#get(org_id: nil, valid_days: nil, request_options: nil) ⇒ Hash
Where every protected resource stands on restore.
-
#initialize(transport) ⇒ BackupsDrillsNamespace
constructor
private
A new instance of BackupsDrillsNamespace.
-
#log(org_id: nil, resource_id: nil, request_options: nil) ⇒ Hash
List recorded restore drills.
Constructor Details
#initialize(transport) ⇒ BackupsDrillsNamespace
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 BackupsDrillsNamespace.
1878 1879 1880 |
# File 'lib/infrawrench/client.rb', line 1878 def initialize(transport) @transport = transport end |
Instance Method Details
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Record a restore drill
A verified drill must carry the measured time: an RPO comes from the
backup, and an RTO can only come from somebody with a stopwatch — that
number is the entire point of the exercise. A blocked drill must not
carry one, because it never started.
Takes resources:write, not a settings permission: recording a drill is
reporting what you did, and the person who spent Saturday restoring a
database is rarely the person who set the recovery objective.
POST /api/org/orgId/backups/drills
Raises on 400: Bad request
1903 1904 1905 1906 1907 1908 1909 1910 1911 |
# File 'lib/infrawrench/client.rb', line 1903 def create(org_id: nil, body: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/backups/drills", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(drill_id:, org_id: nil, request_options: nil) ⇒ nil
Delete a recorded drill
For one recorded against the wrong resource or the wrong date. Audited — deleting evidence that a restore failed is exactly the edit a reviewer would want to know about.
DELETE /api/org/orgId/backups/drills/drillId
Raises on 404: Not found
1929 1930 1931 1932 1933 1934 1935 1936 1937 |
# File 'lib/infrawrench/client.rb', line 1929 def delete(drill_id:, org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/backups/drills/{drillId}", path_params: { "orgId" => org_id, "drillId" => drill_id }, accept: :empty, request_options: ) end |
#get(org_id: nil, valid_days: nil, request_options: nil) ⇒ Hash
Where every protected resource stands on restore
Backup coverage answers 'is there a backup'. This answers 'does it restore, and how long does it take' — a different question, and the one routinely answered wrongly on the day.
A drill is a record that somebody tried, not an automated restore: restoring a customer's database unattended costs real money, can collide with production, and cannot be generically verified. What the product can do is make the exercise scheduled, recorded and visible when it lapses.
GET /api/org/orgId/backups/drills
Raises on 400: Bad request
1962 1963 1964 1965 1966 1967 1968 1969 1970 |
# File 'lib/infrawrench/client.rb', line 1962 def get(org_id: nil, valid_days: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/backups/drills", path_params: { "orgId" => org_id }, query: { "validDays" => valid_days }, request_options: ) end |
#log(org_id: nil, resource_id: nil, request_options: nil) ⇒ Hash
List recorded restore drills
GET /api/org/orgId/backups/drills/log
1982 1983 1984 1985 1986 1987 1988 1989 1990 |
# File 'lib/infrawrench/client.rb', line 1982 def log(org_id: nil, resource_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/backups/drills/log", path_params: { "orgId" => org_id }, query: { "resourceId" => resource_id }, request_options: ) end |