File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -519,3 +519,20 @@ def rollback_snapshot(
519519 json = data ,
520520 )
521521 return BoundAction (self ._parent .actions , response ["action" ])
522+
523+ def disable_snapshot_plan (
524+ self ,
525+ storage_box : StorageBox | BoundStorageBox ,
526+ ) -> BoundAction :
527+ """
528+ Disable the snapshot plan a Storage Box.
529+
530+ See https://docs.hetzner.cloud/reference/cloud#TODO
531+
532+ :param storage_box: Storage Box to update.
533+ """
534+ response = self ._client .request (
535+ method = "POST" ,
536+ url = f"{ self ._base_url } /{ storage_box .id } /actions/disable_snapshot_plan" ,
537+ )
538+ return BoundAction (self ._parent .actions , response ["action" ])
Original file line number Diff line number Diff line change @@ -419,3 +419,22 @@ def test_rollback_snapshot(
419419 )
420420
421421 assert_bound_action1 (action , resource_client ._parent .actions )
422+
423+ def test_disable_snapshot_plan (
424+ self ,
425+ request_mock : mock .MagicMock ,
426+ resource_client : StorageBoxesClient ,
427+ action_response ,
428+ ):
429+ request_mock .return_value = action_response
430+
431+ action = resource_client .disable_snapshot_plan (
432+ StorageBox (id = 42 ),
433+ )
434+
435+ request_mock .assert_called_with (
436+ method = "POST" ,
437+ url = "/storage_boxes/42/actions/disable_snapshot_plan" ,
438+ )
439+
440+ assert_bound_action1 (action , resource_client ._parent .actions )
You can’t perform that action at this time.
0 commit comments