/// <summary>
        /// 删除手动备份
        /// </summary>
        public static void DeleteManualBackup(DdsClient client)
        {
            DeleteManualBackupRequest req = new DeleteManualBackupRequest
            {
                BackupId = "4677057d10f44ac9b722b78fdb75fc8bbr02"
            };

            try
            {
                DeleteManualBackupResponse resp = client.DeleteManualBackup(req);
                Console.WriteLine(resp.JobId);
                Console.WriteLine(resp.HttpStatusCode);
                Console.WriteLine("Delete ManualBackup Success!");
            }
            catch (RequestTimeoutException requestTimeoutException)
            {
                Console.WriteLine(requestTimeoutException.ErrorMessage);
            }
            catch (ServiceResponseException clientRequestException)
            {
                Console.WriteLine(clientRequestException.HttpStatusCode);
                Console.WriteLine(clientRequestException.ErrorCode);
                Console.WriteLine(clientRequestException.ErrorMsg);
            }
            catch (ConnectionException connectionException)
            {
                Console.WriteLine(connectionException.ErrorMessage);
            }
        }
Example #2
0
        /// <summary>
        /// 删除数据库实例的手动备份
        /// </summary>
        public DeleteManualBackupResponse DeleteManualBackup(DeleteManualBackupRequest deleteManualBackupRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("backup_id", deleteManualBackupRequest.BackupId.ToString());
            string      urlPath  = HttpUtils.AddUrlPath("/v3/{project_id}/backups/{backup_id}", urlParam);
            SdkRequest  request  = HttpUtils.InitSdkRequest(urlPath, deleteManualBackupRequest);
            SdkResponse response = DoHttpRequest("DELETE", request);

            return(JsonUtils.DeSerialize <DeleteManualBackupResponse>(response));
        }
        /// <summary>
        /// 删除手动备份
        /// </summary>
        public async Task <DeleteManualBackupResponse> DeleteManualBackupAsync(DeleteManualBackupRequest deleteManualBackupRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("backup_id", deleteManualBackupRequest.BackupId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v3/{project_id}/backups/{backup_id}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", deleteManualBackupRequest);
            HttpResponseMessage response = await DoHttpRequestAsync("DELETE", request);

            return(JsonUtils.DeSerialize <DeleteManualBackupResponse>(response));
        }