public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { InitiateJobResponse response = new InitiateJobResponse(); context.Read(); UnmarshallResult(context, response); return(response); }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { InitiateJobResponse response = new InitiateJobResponse(); context.Read(); response.InitiateJobResult = InitiateJobResultUnmarshaller.GetInstance().Unmarshall(context); return(response); }
private static void UnmarshallResult(JsonUnmarshallerContext context, InitiateJobResponse response) { if (context.ResponseData.GetHeaderValue("Location") != null) { response.Location = context.ResponseData.GetHeaderValue("Location"); } if (context.ResponseData.GetHeaderValue("x-amz-job-id") != null) { response.JobId = context.ResponseData.GetHeaderValue("x-amz-job-id"); } return; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { InitiateJobResponse response = new InitiateJobResponse(); if (context.ResponseData.IsHeaderPresent("x-amz-job-id")) { response.JobId = context.ResponseData.GetHeaderValue("x-amz-job-id"); } if (context.ResponseData.IsHeaderPresent("Location")) { response.Location = context.ResponseData.GetHeaderValue("Location"); } return(response); }
public string InitiateVaultInventoryRequest() { InitiateJobRequest inventoryRequest = new InitiateJobRequest() { VaultName = _vault, JobParameters = new JobParameters() { Type = "inventory-retrieval" } }; InitiateJobResponse response = _amazonGlacierClient.InitiateJob(inventoryRequest); return(response.InitiateJobResult.JobId); }
public string InitiateDownloadRequest(string archiveId, string snsTopic = "") { InitiateJobRequest initDownloadRequest = new InitiateJobRequest() { VaultName = _vault, JobParameters = new JobParameters() { Type = "archive-retrieval", ArchiveId = archiveId } }; InitiateJobResponse response = _amazonGlacierClient.InitiateJob(initDownloadRequest); return(response.InitiateJobResult.JobId); }
public async Task <IActionResult> StartInventory() { InitiateJobRequest request = new InitiateJobRequest { VaultName = S3Settings.VaultName, JobParameters = new JobParameters { Type = "inventory-retrieval", Format = "JSON" } }; InitiateJobResponse response = await GlacierClient.InitiateJobAsync(request); return(Ok(response.JobId)); }
public async Task <IActionResult> StartArchiveRetrieval(string archiveId) { InitiateJobRequest request = new InitiateJobRequest { VaultName = S3Settings.VaultName, JobParameters = new JobParameters { Type = "archive-retrieval", ArchiveId = archiveId } }; InitiateJobResponse response = await GlacierClient.InitiateJobAsync(request); return(Ok(response.JobId)); }
private static string RequestInventory(string vaultName) { using (IAmazonGlacier client = new AmazonGlacierClient(RegionEndpoint.EUWest1)) { InitiateJobRequest initJobRequest = new InitiateJobRequest() { VaultName = vaultName, JobParameters = new JobParameters() { Type = "inventory-retrieval", Format = "CSV" } }; InitiateJobResponse initJobResponse = client.InitiateJob(initJobRequest); return(initJobResponse.JobId); } }
static string GetVaultInventoryJobId(string vaultName, AmazonGlacierClient client) { // Initiate job. InitiateJobRequest initJobRequest = new InitiateJobRequest() { VaultName = vaultName, JobParameters = new JobParameters() { Type = "inventory-retrieval", Description = DateTime.Now.ToString() + ": This job is to download a vault inventory.", SNSTopic = topicArn, } }; InitiateJobResponse initJobResponse = client.InitiateJob(initJobRequest); string jobId = initJobResponse.JobId; return(jobId); }
static void GetVaultInventory(AmazonGlacierClient client, Amazon.RegionEndpoint region) { // Initiate job. InitiateJobRequest initJobRequest = new InitiateJobRequest() { VaultName = s_vaultName, JobParameters = new JobParameters() { Type = "inventory-retrieval", Description = "This job is to download a vault inventory.", SNSTopic = s_topicArn, } }; InitiateJobResponse initJobResponse = client.InitiateJob(initJobRequest); string jobId = initJobResponse.JobId; // Check queue for a message and if job completed successfully, download inventory. ProcessQueue(jobId, client, region); }
static void RetrieveArchive(AmazonGlacier client, AWSArchiveRquest request) { // Initiate job. InitiateJobRequest initJobRequest = new InitiateJobRequest() { VaultName = vaultName, JobParameters = new JobParameters() { Type = "archive-retrieval", ArchiveId = request.ArchiveID, Description = "This job is to download archive updated as part of getting started", SNSTopic = topicArn, } }; InitiateJobResponse initJobResponse = client.InitiateJob(initJobRequest); string jobId = initJobResponse.InitiateJobResult.JobId; // Check queue for a message and if job completed successfully, download archive. ProcessQueue(jobId, client, request); }
public void Execute() { var initJobRequest = new InitiateJobRequest { VaultName = "backup-home", JobParameters = new JobParameters { Type = "inventory-retrieval" } }; using (AmazonGlacierClient client = new AmazonGlacierClient(RegionEndpoint.USWest2)) { InitiateJobResponse initJobResponse = client.InitiateJob(initJobRequest); string jobId = initJobResponse.JobId; ConsoleView.Show("Inventory requested"); ConsoleView.Show(string.Format("JobId: [{0}]", jobId)); } }