protected override void ProcessRecord()
        {
            base.ProcessRecord();

            if (!ConfirmDelete("OCIBlockstorageBootVolumeBackup", "Remove"))
            {
                return;
            }

            DeleteBootVolumeBackupRequest request;

            try
            {
                request = new DeleteBootVolumeBackupRequest
                {
                    BootVolumeBackupId = BootVolumeBackupId,
                    IfMatch            = IfMatch
                };

                response = client.DeleteBootVolumeBackup(request).GetAwaiter().GetResult();
                WriteOutput(response);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
Exemplo n.º 2
0
        private static async Task DeleteBootVolumeBackup(BlockstorageClient client, string bootVolumeBackupId)
        {
            DeleteBootVolumeBackupRequest deleteBootVolumeBackupRequest = new DeleteBootVolumeBackupRequest
            {
                BootVolumeBackupId = bootVolumeBackupId
            };

            // Delete the boot volume backup
            logger.Info($"Deleting backup with id {bootVolumeBackupId}");
            logger.Info("=============");
            await client.DeleteBootVolumeBackup(deleteBootVolumeBackupRequest);

            logger.Info("Backup deleted!");
        }