public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonRedshiftConfig config = new AmazonRedshiftConfig();

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

            DescribeEventsResponse resp = new DescribeEventsResponse();

            do
            {
                DescribeEventsRequest req = new DescribeEventsRequest
                {
                    Marker = resp.Marker
                    ,
                    MaxRecords = maxItems
                };

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

                foreach (var obj in resp.Events)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.Marker));
        }
示例#2
0
        public void RedshiftDescribeTags()
        {
            #region to-get-tags-for-a-resource-1482438593642

            var client   = new AmazonRedshiftClient();
            var response = client.DescribeTags(new DescribeTagsRequest
            {
            });

            List <TaggedResource> taggedResources = response.TaggedResources;

            #endregion
        }
示例#3
0
        public void RedshiftDisableSnapshotCopy()
        {
            #region to-disable-snapshot-copy-1482435501112

            var client   = new AmazonRedshiftClient();
            var response = client.DisableSnapshotCopy(new DisableSnapshotCopyRequest
            {
                ClusterIdentifier = "mycluster"
            });


            #endregion
        }
示例#4
0
        public void RedshiftDescribeDefaultClusterParameters()
        {
            #region to-get-a-description-of-cluster-default-parameters-1482365915635

            var client   = new AmazonRedshiftClient();
            var response = client.DescribeDefaultClusterParameters(new DescribeDefaultClusterParametersRequest
            {
                ParameterGroupFamily = "redshift-1.0"
            });


            #endregion
        }
示例#5
0
        public void RedshiftDescribeClusterSubnetGroups()
        {
            #region to-get-a-description-of-all-cluster-subnet-groups-1481847412769

            var client   = new AmazonRedshiftClient();
            var response = client.DescribeClusterSubnetGroups(new DescribeClusterSubnetGroupsRequest
            {
            });

            List <ClusterSubnetGroup> clusterSubnetGroups = response.ClusterSubnetGroups;

            #endregion
        }
示例#6
0
        public void RedshiftDescribeClusterVersions()
        {
            #region to-get-a-description-of-cluster-versions-1482363389639

            var client   = new AmazonRedshiftClient();
            var response = client.DescribeClusterVersions(new DescribeClusterVersionsRequest
            {
            });

            List <ClusterVersion> clusterVersions = response.ClusterVersions;

            #endregion
        }
示例#7
0
        public void RedshiftDescribeClusters()
        {
            #region to-get-a-description-of-all-clusters-1475865512651

            var client   = new AmazonRedshiftClient();
            var response = client.DescribeClusters(new DescribeClustersRequest
            {
            });

            List <Cluster> clusters = response.Clusters;

            #endregion
        }
示例#8
0
        public void RedshiftCreateHsmClientCertificate()
        {
            #region to-create-a-new-hsm-certificate-1482359863292

            var client   = new AmazonRedshiftClient();
            var response = client.CreateHsmClientCertificate(new CreateHsmClientCertificateRequest
            {
                HsmClientCertificateIdentifier = "my-hsm"
            });


            #endregion
        }
示例#9
0
        public void RedshiftDescribeClusterSecurityGroups()
        {
            #region to-get-a-description-of-cluster-security-groups-for-the-account-1482363060704

            var client   = new AmazonRedshiftClient();
            var response = client.DescribeClusterSecurityGroups(new DescribeClusterSecurityGroupsRequest
            {
            });

            List <ClusterSecurityGroup> clusterSecurityGroups = response.ClusterSecurityGroups;

            #endregion
        }
示例#10
0
        public void RedshiftDeleteEventSubscription()
        {
            #region to-delete-an-event-subscription-1483134357677

            var client   = new AmazonRedshiftClient();
            var response = client.DeleteEventSubscription(new DeleteEventSubscriptionRequest
            {
                SubscriptionName = "mysubscription"
            });


            #endregion
        }
示例#11
0
        public void RedshiftCreateSnapshotCopyGrant()
        {
            #region to-create-a-snapshot-copy-grant-1482180728699

            var client   = new AmazonRedshiftClient();
            var response = client.CreateSnapshotCopyGrant(new CreateSnapshotCopyGrantRequest
            {
                SnapshotCopyGrantName = "mycopygrant"
            });


            #endregion
        }
示例#12
0
        public void RedshiftDescribeHsmClientCertificates()
        {
            #region to-get-a-description-of-hsm-certificates-1482367536680

            var client   = new AmazonRedshiftClient();
            var response = client.DescribeHsmClientCertificates(new DescribeHsmClientCertificatesRequest
            {
            });

            List <HsmClientCertificate> hsmClientCertificates = response.HsmClientCertificates;

            #endregion
        }
示例#13
0
        public void RedshiftDescribeClusterSnapshots()
        {
            #region to-get-a-description-of-all-cluster-snapshots-1482181325771

            var client   = new AmazonRedshiftClient();
            var response = client.DescribeClusterSnapshots(new DescribeClusterSnapshotsRequest
            {
            });

            List <Snapshot> snapshots = response.Snapshots;

            #endregion
        }
示例#14
0
        public void RedshiftDescribeEventSubscriptions()
        {
            #region to-describe-an-event-subscription-1483133239054

            var client   = new AmazonRedshiftClient();
            var response = client.DescribeEventSubscriptions(new DescribeEventSubscriptionsRequest
            {
                SubscriptionName = "mysubscription"
            });

            List <EventSubscription> eventSubscriptionsList = response.EventSubscriptionsList;

            #endregion
        }
示例#15
0
        public void RedshiftDescribeEventCategories()
        {
            #region to-get-a-description-of-event-categories-1482366442369

            var client   = new AmazonRedshiftClient();
            var response = client.DescribeEventCategories(new DescribeEventCategoriesRequest
            {
                SourceType = "cluster"
            });

            List <EventCategoriesMap> eventCategoriesMapList = response.EventCategoriesMapList;

            #endregion
        }
示例#16
0
        public void RedshiftCopyClusterSnapshot()
        {
            #region to--creates-a-copy-of-a-snapshot-1482357194074

            var client   = new AmazonRedshiftClient();
            var response = client.CopyClusterSnapshot(new CopyClusterSnapshotRequest
            {
                SourceSnapshotIdentifier = "rs:mycluster-2016-12-21-20-40-51",
                TargetSnapshotIdentifier = "my-saved-snapshot-cop"
            });


            #endregion
        }
示例#17
0
        public void RedshiftDescribeClusterParameters()
        {
            #region to-get-the-parameters-for-a-parameter-group-1482362769122

            var client   = new AmazonRedshiftClient();
            var response = client.DescribeClusterParameters(new DescribeClusterParametersRequest
            {
                ParameterGroupName = "myclusterparametergroup"
            });

            List <Parameter> parameters = response.Parameters;

            #endregion
        }
示例#18
0
        public void RedshiftAuthorizeSnapshotAccess()
        {
            #region to-authorize-an-aws-account-to-restore-from-snapshot-1482368189016

            var client   = new AmazonRedshiftClient();
            var response = client.AuthorizeSnapshotAccess(new AuthorizeSnapshotAccessRequest
            {
                AccountWithRestoreAccess = "444455556666",
                SnapshotIdentifier       = "my-snapshot-id"
            });


            #endregion
        }
示例#19
0
        public void RedshiftCreateEventSubscription()
        {
            #region to-create-an-event-subscription-1483132129428

            var client   = new AmazonRedshiftClient();
            var response = client.CreateEventSubscription(new CreateEventSubscriptionRequest
            {
                SnsTopicArn      = "arn:aws:sns:us-west-2:123456789101:my-sns-topic",
                SubscriptionName = "mysubscription"
            });


            #endregion
        }
示例#20
0
        public void RedshiftDescribeEvents()
        {
            #region to-get-a-description-of-events-1482367106459

            var client   = new AmazonRedshiftClient();
            var response = client.DescribeEvents(new DescribeEventsRequest
            {
                Duration = 600
            });

            List <Event> events = response.Events;

            #endregion
        }
示例#21
0
        public void RedshiftCreateClusterSnapshot()
        {
            #region to-create-a-new-cluster-snapshot-1482180269983

            var client   = new AmazonRedshiftClient();
            var response = client.CreateClusterSnapshot(new CreateClusterSnapshotRequest
            {
                ClusterIdentifier  = "mycluster",
                SnapshotIdentifier = "my-snapshot-id"
            });


            #endregion
        }
示例#22
0
        protected IAmazonRedshift CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonRedshiftConfig {
                RegionEndpoint = region
            };

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

            client.BeforeRequestEvent += RequestEventHandler;
            client.AfterResponseEvent += ResponseEventHandler;
            return(client);
        }
示例#23
0
        public void RedshiftModifyEventSubscription()
        {
            #region to-modify-an-event-subscription-1483132220470

            var client   = new AmazonRedshiftClient();
            var response = client.ModifyEventSubscription(new ModifyEventSubscriptionRequest
            {
                SourceType       = "cluster",
                SubscriptionName = "mysubscription"
            });


            #endregion
        }
示例#24
0
        public void RedshiftCreateClusterSecurityGroup()
        {
            #region to-create-a-new-cluster-security-group-1481844171608

            var client   = new AmazonRedshiftClient();
            var response = client.CreateClusterSecurityGroup(new CreateClusterSecurityGroupRequest
            {
                ClusterSecurityGroupName = "mysecuritygroup",
                Description = "This is my cluster security group"
            });


            #endregion
        }
示例#25
0
        public void RedshiftEnableSnapshotCopy()
        {
            #region to-enable-snapshot-copy-1482435074072

            var client   = new AmazonRedshiftClient();
            var response = client.EnableSnapshotCopy(new EnableSnapshotCopyRequest
            {
                ClusterIdentifier = "mycluster",
                DestinationRegion = "us-east-1"
            });


            #endregion
        }
示例#26
0
 public static void DescribeRedShiftClusters()
 {
     using (var redshiftClient = new AmazonRedshiftClient(_awsRegion))
     {
         var describeClustersResponse = redshiftClient.DescribeClusters();
         var redshiftClusters         = describeClustersResponse.Clusters;
         foreach (var cluster in redshiftClusters)
         {
             Console.WriteLine($"Cluster id: {cluster.ClusterIdentifier}");
             Console.WriteLine($"Cluster status: {cluster.ClusterStatus}");
             Console.WriteLine($"Cluster creation date: {cluster.ClusterCreateTime}");
             Console.WriteLine($"Cluster DB name: {cluster.DBName}");
         }
     }
 }
示例#27
0
        public void RedshiftCreateClusterParameterGroup()
        {
            #region to-create-a-cluster-snapshot-1481844657333

            var client   = new AmazonRedshiftClient();
            var response = client.CreateClusterParameterGroup(new CreateClusterParameterGroupRequest
            {
                Description          = "My first cluster parameter group",
                ParameterGroupFamily = "redshift-1.0",
                ParameterGroupName   = "myclusterparametergroup"
            });


            #endregion
        }
示例#28
0
        public void RedshiftAuthorizeClusterSecurityGroupIngress()
        {
            #region authorizing-access-to-an-ec2-security-group-1481675923213

            var client   = new AmazonRedshiftClient();
            var response = client.AuthorizeClusterSecurityGroupIngress(new AuthorizeClusterSecurityGroupIngressRequest
            {
                ClusterSecurityGroupName = "mysecuritygroup",
                EC2SecurityGroupName     = "myec2securitygroup",
                EC2SecurityGroupOwnerId  = "123445677890"
            });


            #endregion
        }
示例#29
0
        public void RedshiftCreateCluster()
        {
            #region to-create-a-cluster-with-minimal-parameters-1481678090203

            var client   = new AmazonRedshiftClient();
            var response = client.CreateCluster(new CreateClusterRequest
            {
                ClusterIdentifier  = "mycluster",
                MasterUserPassword = "******",
                MasterUsername     = "******",
                NodeType           = "dw.hs1.xlarge"
            });


            #endregion
        }
示例#30
0
        public void RedshiftModifyClusterIamRoles()
        {
            #region to-modify-a-cluster-iam-roles-1482436895837

            var client   = new AmazonRedshiftClient();
            var response = client.ModifyClusterIamRoles(new ModifyClusterIamRolesRequest
            {
                AddIamRoles = new List <string> {
                    "arn:aws:iam::112233445566:role/myRedshiftRole"
                },
                ClusterIdentifier = "mycluster"
            });


            #endregion
        }