예제 #1
0
        static void AddTagsToVault(IAmazonGlacier glacier)
        {
            var req = new AddTagsToVaultRequest
            {
                VaultName = VaultName,
                Tags      = new Dictionary <string, string>
                {
                    { "cost-center", "1234" },
                    { "stack", "production" }
                }
            };

            Task <AddTagsToVaultResponse> res = glacier.AddTagsToVaultAsync(req);

            Task.WaitAll(res);

            if (res.IsCompletedSuccessfully)
            {
                Console.WriteLine($"Successfully added tags to vault {VaultName}");
            }
        }
예제 #2
0
 private Amazon.Glacier.Model.AddTagsToVaultResponse CallAWSServiceOperation(IAmazonGlacier client, Amazon.Glacier.Model.AddTagsToVaultRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Glacier", "AddTagsToVault");
     try
     {
         #if DESKTOP
         return(client.AddTagsToVault(request));
         #elif CORECLR
         return(client.AddTagsToVaultAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }