Пример #1
0
        public void SnowballCreateJob()
        {
            #region to-create-a-job-1482864834886

            var client   = new AmazonSnowballClient();
            var response = client.CreateJob(new CreateJobRequest
            {
                AddressId    = "ADID1234ab12-3eec-4eb3-9be6-9374c10eb51b",
                Description  = "My Job",
                JobType      = "IMPORT",
                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",
                SnowballCapacityPreference = "T80",
                SnowballType               = "STANDARD"
            });

            string jobId = response.JobId;

            #endregion
        }
Пример #2
0
        public void SnowballCreateCluster()
        {
            #region to-create-a-cluster-1482864724077

            var client   = new AmazonSnowballClient();
            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
        }
Пример #3
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonSnowballConfig config = new AmazonSnowballConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonSnowballClient client = new AmazonSnowballClient(creds, config);

            ListJobsResponse resp = new ListJobsResponse();

            do
            {
                ListJobsRequest req = new ListJobsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

                resp = client.ListJobs(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.JobListEntries)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Пример #4
0
        public void SnowballCancelJob()
        {
            #region to-cancel-a-job-for-a-snowball-device-1482534699477

            var client   = new AmazonSnowballClient();
            var response = client.CancelJob(new CancelJobRequest
            {
                JobId = "JID123e4567-e89b-12d3-a456-426655440000"
            });


            #endregion
        }
Пример #5
0
        public void SnowballListJobs()
        {
            #region to-get-a-list-of-jobs-that-youve-created-for-aws-snowball-1482542167627

            var client   = new AmazonSnowballClient();
            var response = client.ListJobs(new ListJobsRequest
            {
            });

            List <JobListEntry> jobListEntries = response.JobListEntries;

            #endregion
        }
Пример #6
0
        public void SnowballListClusters()
        {
            #region to-get-a-list-of-clusters-that-youve-created-for-aws-snowball-1482862223003

            var client   = new AmazonSnowballClient();
            var response = client.ListClusters(new ListClustersRequest
            {
            });

            List <ClusterListEntry> clusterListEntries = response.ClusterListEntries;

            #endregion
        }
Пример #7
0
        public void SnowballDescribeAddresses()
        {
            #region to-describe-all-the-addresses-youve-created-for-aws-snowball-1482538936603

            var client   = new AmazonSnowballClient();
            var response = client.DescribeAddresses(new DescribeAddressesRequest
            {
            });

            List <Address> addresses = response.Addresses;

            #endregion
        }
Пример #8
0
        public void SnowballCancelCluster()
        {
            #region to-cancel-a-cluster-job-1482533760554

            var client   = new AmazonSnowballClient();
            var response = client.CancelCluster(new CancelClusterRequest
            {
                ClusterId = "CID123e4567-e89b-12d3-a456-426655440000"
            });


            #endregion
        }
Пример #9
0
        public void SnowballListClusterJobs()
        {
            #region to-get-a-list-of-jobs-in-a-cluster-that-youve-created-for-aws-snowball-1482863105773

            var client   = new AmazonSnowballClient();
            var response = client.ListClusterJobs(new ListClusterJobsRequest
            {
                ClusterId = "CID123e4567-e89b-12d3-a456-426655440000"
            });

            List <JobListEntry> jobListEntries = response.JobListEntries;

            #endregion
        }
Пример #10
0
        public void SnowballGetJobUnlockCode()
        {
            #region to-get-the-unlock-code-for-a-job-youve-created-for-aws-snowball-1482541987286

            var client   = new AmazonSnowballClient();
            var response = client.GetJobUnlockCode(new GetJobUnlockCodeRequest
            {
                JobId = "JID123e4567-e89b-12d3-a456-426655440000"
            });

            string unlockCode = response.UnlockCode;

            #endregion
        }
Пример #11
0
        public void SnowballGetJobManifest()
        {
            #region to-get-the-manifest-for-a-job-youve-created-for-aws-snowball-1482540389246

            var client   = new AmazonSnowballClient();
            var response = client.GetJobManifest(new GetJobManifestRequest
            {
                JobId = "JID123e4567-e89b-12d3-a456-426655440000"
            });

            string manifestURI = response.ManifestURI;

            #endregion
        }
Пример #12
0
        public void SnowballDescribeJob()
        {
            #region to-describe-a-job-youve-created-for-aws-snowball-1482539500180

            var client   = new AmazonSnowballClient();
            var response = client.DescribeJob(new DescribeJobRequest
            {
                JobId = "JID123e4567-e89b-12d3-a456-426655440000"
            });

            JobMetadata jobMetadata = response.JobMetadata;

            #endregion
        }
Пример #13
0
        public void SnowballDescribeCluster()
        {
            #region to-describe-a-cluster-1482864218396

            var client   = new AmazonSnowballClient();
            var response = client.DescribeCluster(new DescribeClusterRequest
            {
                ClusterId = "CID123e4567-e89b-12d3-a456-426655440000"
            });

            ClusterMetadata clusterMetadata = response.ClusterMetadata;

            #endregion
        }
Пример #14
0
        public void SnowballDescribeAddress()
        {
            #region to-describe-an-address-for-a-job-1482538608745

            var client   = new AmazonSnowballClient();
            var response = client.DescribeAddress(new DescribeAddressRequest
            {
                AddressId = "ADID1234ab12-3eec-4eb3-9be6-9374c10eb51b"
            });

            Address address = response.Address;

            #endregion
        }
Пример #15
0
        public void SnowballGetSnowballUsage()
        {
            #region to-see-your-snowball-service-limit-and-the-number-of-snowballs-you-have-in-use-1482863394588

            var client   = new AmazonSnowballClient();
            var response = client.GetSnowballUsage(new GetSnowballUsageRequest
            {
            });

            int snowballLimit  = response.SnowballLimit;
            int snowballsInUse = response.SnowballsInUse;

            #endregion
        }
Пример #16
0
        protected IAmazonSnowball CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonSnowballConfig {
                RegionEndpoint = region
            };

            Amazon.PowerShell.Utils.Common.PopulateConfig(this, config);
            this.CustomizeClientConfig(config);
            var client = new AmazonSnowballClient(credentials, config);

            client.BeforeRequestEvent += RequestEventHandler;
            client.AfterResponseEvent += ResponseEventHandler;
            return(client);
        }
Пример #17
0
        public void SnowballUpdateCluster()
        {
            #region to-update-a-cluster-1482863900595

            var client   = new AmazonSnowballClient();
            var response = client.UpdateCluster(new UpdateClusterRequest
            {
                AddressId   = "ADID1234ab12-3eec-4eb3-9be6-9374c10eb51b",
                ClusterId   = "CID123e4567-e89b-12d3-a456-426655440000",
                Description = "Updated the address to send this to image processing - RJ"
            });


            #endregion
        }
Пример #18
0
        public void SnowballUpdateJob()
        {
            #region to-update-a-job-1482863556886

            var client   = new AmazonSnowballClient();
            var response = client.UpdateJob(new UpdateJobRequest
            {
                AddressId                  = "ADID1234ab12-3eec-4eb3-9be6-9374c10eb51b",
                Description                = "Upgraded to Edge, shipped to Finance Dept, and requested faster shipping speed - TS.",
                JobId                      = "JID123e4567-e89b-12d3-a456-426655440000",
                ShippingOption             = "NEXT_DAY",
                SnowballCapacityPreference = "T100"
            });


            #endregion
        }
Пример #19
0
        public void SnowballCreateAddress()
        {
            #region to-create-an-address-for-a-job-1482535416294

            var client   = new AmazonSnowballClient();
            var response = client.CreateAddress(new CreateAddressRequest
            {
                Address = new Address {
                    City            = "Seattle",
                    Company         = "My Company's Name",
                    Country         = "USA",
                    Name            = "My Name",
                    PhoneNumber     = "425-555-5555",
                    PostalCode      = "98101",
                    StateOrProvince = "WA",
                    Street1         = "123 Main Street"
                }
            });

            string addressId = response.AddressId;

            #endregion
        }