コード例 #1
0
        public void SnowballCreateCluster()
        {
            #region to-create-a-cluster-1482864724077

            var response = client.CreateCluster(new CreateClusterRequest
            {
                AddressId    = "ADID1234ab12-3eec-4eb3-9be6-9374c10eb51b",
                Description  = "MyCluster",
                JobType      = "LOCAL_USE",
                KmsKeyARN    = "arn:aws:kms:us-east-1:123456789012:key/abcd1234-12ab-34cd-56ef-123456123456",
                Notification = new Notification {
                    JobStatesToNotify = new List <string> {
                    },
                    NotifyAll         = false
                },
                Resources = new JobResource {
                    S3Resources = new List <S3Resource> {
                        new S3Resource {
                            BucketArn = "arn:aws:s3:::MyBucket",
                            KeyRange  = new KeyRange {
                            }
                        }
                    }
                },
                RoleARN        = "arn:aws:iam::123456789012:role/snowball-import-S3-role",
                ShippingOption = "SECOND_DAY",
                SnowballType   = "EDGE"
            });

            string clusterId = response.ClusterId;

            #endregion
        }
コード例 #2
0
 private Amazon.Snowball.Model.CreateClusterResponse CallAWSServiceOperation(IAmazonSnowball client, Amazon.Snowball.Model.CreateClusterRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Import/Export Snowball", "CreateCluster");
     try
     {
         #if DESKTOP
         return(client.CreateCluster(request));
         #elif CORECLR
         return(client.CreateClusterAsync(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;
     }
 }