internal DeleteVaultResponse DeleteVault(DeleteVaultRequest request) { var marshaller = new DeleteVaultRequestMarshaller(); var unmarshaller = DeleteVaultResponseUnmarshaller.Instance; return(Invoke <DeleteVaultRequest, DeleteVaultResponse>(request, marshaller, unmarshaller)); }
static void DeleteVault(IAmazonGlacier glacier) { // PLEASE SEE THE IMPORTANT NOTE AT THE START OF THIS SAMPLE. // // This method shows how to delete a vault using the service api BUT will fail // to delete the vault created in the sample because the inventory job, started // in the RequestVaultInventory method, will not have completed at the time this // method runs. If the RequestVaultInventory method is not run, it can take up to // 24 hours for Glacier to schedule an inventory automatically. // // Check back in the AWS management console after a few hours and once the // inventory job is complete, delete the vault from within the console. var req = new DeleteVaultRequest { VaultName = VaultName }; try { Task <DeleteVaultResponse> res = glacier.DeleteVaultAsync(req); Task.WaitAll(res); Console.WriteLine($"Deleted vault {VaultName}"); } catch (Exception e) { Console.WriteLine($"Failed to delete vault {VaultName}. The service returned error: {e.Message}"); } }
/// <summary> /// Initiates the asynchronous execution of the DeleteVault operation. /// <seealso cref="Amazon.Glacier.IAmazonGlacier"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteVault operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task <DeleteVaultResponse> DeleteVaultAsync(DeleteVaultRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteVaultRequestMarshaller(); var unmarshaller = DeleteVaultResponseUnmarshaller.Instance; return(InvokeAsync <DeleteVaultRequest, DeleteVaultResponse>(request, marshaller, unmarshaller, cancellationToken)); }
public static Task <DeleteVaultResponse> DeleteVaultAsync(string vaultName) { using (var client = GetGlacierClient()) { DeleteVaultRequest request = new DeleteVaultRequest(GetAccountId(), vaultName); return(client.DeleteVaultAsync(request)); } }
/// <summary> /// Deletes the specified vault. Before deletion, the vault must be empty of all archives. /// </summary> /// <param name="vaultName">The name of the vault to delete.</param> public Task DeleteVaultAsync(string vaultName) { DeleteVaultRequest request = new DeleteVaultRequest() { VaultName = vaultName }; ((Amazon.Runtime.Internal.IAmazonWebServiceRequest)request).AddBeforeRequestHandler(new UserAgentPostFix("DeleteVault").UserAgentRequestEventHandlerSync); return(this.glacierClient.DeleteVaultAsync(request)); }
/// <summary> /// Deletes the specified vault. Before deletion, the vault must be empty of all archives. /// </summary> /// <param name="vaultName">The name of the vault to delete.</param> public void DeleteVault(string vaultName) { DeleteVaultRequest request = new DeleteVaultRequest() { VaultName = vaultName }; request.BeforeRequestEvent += new UserAgentPostFix("DeleteVault").UserAgentRequestEventHandlerSync; this.glacierClient.DeleteVault(request); }
private void DeleteVault(Guid vaultGuid, Person person) { var deleteVaultRequest = new DeleteVaultRequest(_id, _key, vaultGuid); var success = deleteVaultRequest.Execute(); if (!success) { throw new Exception($"Sage failed to delete the vault for people id: {person.PeopleId}"); } }
/// <summary> /// 删除存储库 /// </summary> public async Task <DeleteVaultResponse> DeleteVaultAsync(DeleteVaultRequest deleteVaultRequest) { Dictionary <string, string> urlParam = new Dictionary <string, string>(); urlParam.Add("vault_id", deleteVaultRequest.VaultId.ToString()); string urlPath = HttpUtils.AddUrlPath("/v3/{project_id}/vaults/{vault_id}", urlParam); SdkRequest request = HttpUtils.InitSdkRequest(urlPath, "application/json", deleteVaultRequest); HttpResponseMessage response = await DoHttpRequestAsync("DELETE", request); return(JsonUtils.DeSerializeNull <DeleteVaultResponse>(response)); }
private static bool DeleteVault(string vaultName) { using (IAmazonGlacier client = new AmazonGlacierClient(RegionEndpoint.EUWest1)) { DeleteVaultRequest request = new DeleteVaultRequest() { VaultName = vaultName }; DeleteVaultResponse response = client.DeleteVault(request); return(response.HttpStatusCode == System.Net.HttpStatusCode.NoContent); } }
private void DeleteVault(int vaultId, Person person) { var deleteVaultRequest = new DeleteVaultRequest( _userName, _password, vaultId.ToString(CultureInfo.InvariantCulture)); var response = deleteVaultRequest.Execute(); if (response.ResponseStatus != ResponseStatus.Approved) { throw new Exception("TransNational failed to delete the vault for people id: {0}, responseCode: {1}, responseText: {2}".Fmt(person.PeopleId, response.ResponseCode, response.ResponseText)); } }
private static void DeleteVault(AmazonGlacierClient glacier) { DeleteVaultRequest req = new DeleteVaultRequest(); req.VaultName = vaultName; Task <DeleteVaultResponse> res = glacier.DeleteVaultAsync(req); Task.WaitAll(res); if (res.IsCompletedSuccessfully) { Console.WriteLine("Deleted Vault {0}", vaultName); } }
public async Task DeleteVaultAsync(CancellationToken token) { var req = new DeleteVaultRequest(Vault); await client.DeleteVaultAsync(req, token); }