forked from aws/aws-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAmazonRedshiftClient.java
More file actions
2019 lines (1941 loc) · 98.1 KB
/
AmazonRedshiftClient.java
File metadata and controls
2019 lines (1941 loc) · 98.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.redshift;
import org.w3c.dom.Node;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map.Entry;
import com.amazonaws.*;
import com.amazonaws.auth.*;
import com.amazonaws.handlers.HandlerChainFactory;
import com.amazonaws.handlers.RequestHandler;
import com.amazonaws.http.StaxResponseHandler;
import com.amazonaws.http.DefaultErrorResponseHandler;
import com.amazonaws.http.ExecutionContext;
import com.amazonaws.internal.StaticCredentialsProvider;
import com.amazonaws.transform.Unmarshaller;
import com.amazonaws.transform.StaxUnmarshallerContext;
import com.amazonaws.transform.StandardErrorUnmarshaller;
import com.amazonaws.services.redshift.model.*;
import com.amazonaws.services.redshift.model.transform.*;
/**
* Client for accessing AmazonRedshift. All service calls made
* using this client are blocking, and will not return until the service call
* completes.
* <p>
* Amazon Redshift <b>Overview</b> <p>
* This is the Amazon Redshift API Reference. This guide provides descriptions and samples of the Amazon Redshift API.
* </p>
* <p>
* Amazon Redshift manages all the work of setting up, operating, and scaling a data warehouse: provisioning capacity, monitoring and backing up the
* cluster, and applying patches and upgrades to the Amazon Redshift engine. You can focus on using your data to acquire new insights for your business
* and customers.
* </p>
* <b>Are You a First-Time Amazon Redshift User?</b> <p>
* If you are a first-time user of Amazon Redshift, we recommend that you begin by reading the following sections:
* </p>
* <p>
*
* <ul>
* <li> <p>
* <i>Service Highlights and Pricing</i> - The <a href="http://aws.amazon.com/redshift/"> product detail page </a> provides the Amazon Redshift value
* proposition, service highlights and pricing.
* </p>
* </li>
* <li> <p>
* <i>Getting Started</i> - The <a href="http://docs.aws.amazon.com/redshift/latest/gsg/getting-started.html"> Getting Started Guide </a> includes an
* example that walks you through the process of creating a cluster, creating database tables, uploading data, and testing queries.
* </p>
* </li>
*
* </ul>
*
* </p>
* <p>
* After you complete the Getting Started Guide, we recommend that you explore one of the following guides:
* </p>
*
* <ul>
* <li> <p>
* <i>Cluster Management</i> - If you are responsible for managing Amazon Redshift clusters, the <a
* href="http://docs.aws.amazon.com/redshift/latest/mgmt/welcome.html"> Cluster Management Guide </a> shows you how to create and manage Amazon Redshift
* clusters.
* </p>
* <p>
* If you are an application developer, you can use the Amazon Redshift Query API to manage clusters programmatically. Additionally, the AWS SDK
* libraries that wrap the underlying Amazon Redshift API simplify your programming tasks. If you prefer a more interactive way of managing clusters,
* you can use the Amazon Redshift console and the AWS command line interface (AWS CLI). For information about the API and CLI, go to the following
* manuals :
* </p>
*
* <ul>
* <li> <p>
* API Reference ( <i>this document</i> )
* </p>
* </li>
* <li> <p>
* <a href="http://docs.aws.amazon.com/redshift/latest/cli"> CLI Reference </a>
* </p>
* </li>
*
* </ul>
* </li>
* <li> <p>
* <i>Amazon Redshift Database Database Developer</i> - If you are a database developer, the Amazon Redshift <a
* href="http://docs.aws.amazon.com/redshift/latest/dg/"> Database Developer Guide </a> explains how to design, build, query, and maintain the databases
* that make up your data warehouse.
* </p>
* </li>
*
* </ul>
* <p>
* For a list of supported AWS regions where you can provision a cluster, go to the <a
* href="http://docs.aws.amazon.com/general/latest/gr/rande.html#redshift_region"> Regions and Endpoints </a> section in the <i>Amazon Web Services
* Glossary</i> .
* </p>
*/
public class AmazonRedshiftClient extends AmazonWebServiceClient implements AmazonRedshift {
/** Provider for AWS credentials. */
private AWSCredentialsProvider awsCredentialsProvider;
/**
* List of exception unmarshallers for all AmazonRedshift exceptions.
*/
protected final List<Unmarshaller<AmazonServiceException, Node>> exceptionUnmarshallers
= new ArrayList<Unmarshaller<AmazonServiceException, Node>>();
/** AWS signer for authenticating requests. */
private AWS4Signer signer;
/**
* Constructs a new client to invoke service methods on
* AmazonRedshift. A credentials provider chain will be used
* that searches for credentials in this order:
* <ul>
* <li> Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY </li>
* <li> Java System Properties - aws.accessKeyId and aws.secretKey </li>
* <li> Instance profile credentials delivered through the Amazon EC2 metadata service </li>
* </ul>
*
* <p>
* All service calls made using this new client object are blocking, and will not
* return until the service call completes.
*
* @see DefaultAWSCredentialsProvider
*/
public AmazonRedshiftClient() {
this(new DefaultAWSCredentialsProviderChain(), new ClientConfiguration());
}
/**
* Constructs a new client to invoke service methods on
* AmazonRedshift. A credentials provider chain will be used
* that searches for credentials in this order:
* <ul>
* <li> Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY </li>
* <li> Java System Properties - aws.accessKeyId and aws.secretKey </li>
* <li> Instance profile credentials delivered through the Amazon EC2 metadata service </li>
* </ul>
*
* <p>
* All service calls made using this new client object are blocking, and will not
* return until the service call completes.
*
* @param clientConfiguration The client configuration options controlling how this
* client connects to AmazonRedshift
* (ex: proxy settings, retry counts, etc.).
*
* @see DefaultAWSCredentialsProvider
*/
public AmazonRedshiftClient(ClientConfiguration clientConfiguration) {
this(new DefaultAWSCredentialsProviderChain(), clientConfiguration);
}
/**
* Constructs a new client to invoke service methods on
* AmazonRedshift using the specified AWS account credentials.
*
* <p>
* All service calls made using this new client object are blocking, and will not
* return until the service call completes.
*
* @param awsCredentials The AWS credentials (access key ID and secret key) to use
* when authenticating with AWS services.
*/
public AmazonRedshiftClient(AWSCredentials awsCredentials) {
this(awsCredentials, new ClientConfiguration());
}
/**
* Constructs a new client to invoke service methods on
* AmazonRedshift using the specified AWS account credentials
* and client configuration options.
*
* <p>
* All service calls made using this new client object are blocking, and will not
* return until the service call completes.
*
* @param awsCredentials The AWS credentials (access key ID and secret key) to use
* when authenticating with AWS services.
* @param clientConfiguration The client configuration options controlling how this
* client connects to AmazonRedshift
* (ex: proxy settings, retry counts, etc.).
*/
public AmazonRedshiftClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) {
super(clientConfiguration);
this.awsCredentialsProvider = new StaticCredentialsProvider(awsCredentials);
init();
}
/**
* Constructs a new client to invoke service methods on
* AmazonRedshift using the specified AWS account credentials provider.
*
* <p>
* All service calls made using this new client object are blocking, and will not
* return until the service call completes.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials
* to authenticate requests with AWS services.
*/
public AmazonRedshiftClient(AWSCredentialsProvider awsCredentialsProvider) {
this(awsCredentialsProvider, new ClientConfiguration());
}
/**
* Constructs a new client to invoke service methods on
* AmazonRedshift using the specified AWS account credentials
* provider and client configuration options.
*
* <p>
* All service calls made using this new client object are blocking, and will not
* return until the service call completes.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials
* to authenticate requests with AWS services.
* @param clientConfiguration The client configuration options controlling how this
* client connects to AmazonRedshift
* (ex: proxy settings, retry counts, etc.).
*/
public AmazonRedshiftClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) {
super(clientConfiguration);
this.awsCredentialsProvider = awsCredentialsProvider;
init();
}
private void init() {
exceptionUnmarshallers.add(new ReservedNodeAlreadyExistsExceptionUnmarshaller());
exceptionUnmarshallers.add(new AuthorizationAlreadyExistsExceptionUnmarshaller());
exceptionUnmarshallers.add(new InvalidClusterSubnetStateExceptionUnmarshaller());
exceptionUnmarshallers.add(new AuthorizationNotFoundExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterAlreadyExistsExceptionUnmarshaller());
exceptionUnmarshallers.add(new AccessToSnapshotDeniedExceptionUnmarshaller());
exceptionUnmarshallers.add(new NumberOfNodesQuotaExceededExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterNotFoundExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterSnapshotQuotaExceededExceptionUnmarshaller());
exceptionUnmarshallers.add(new InvalidRestoreExceptionUnmarshaller());
exceptionUnmarshallers.add(new InsufficientClusterCapacityExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterSnapshotNotFoundExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterQuotaExceededExceptionUnmarshaller());
exceptionUnmarshallers.add(new InvalidSubnetExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterSecurityGroupAlreadyExistsExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterSubnetGroupQuotaExceededExceptionUnmarshaller());
exceptionUnmarshallers.add(new ReservedNodeQuotaExceededExceptionUnmarshaller());
exceptionUnmarshallers.add(new InvalidVPCNetworkStateExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterParameterGroupNotFoundExceptionUnmarshaller());
exceptionUnmarshallers.add(new ReservedNodeOfferingNotFoundExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterSecurityGroupQuotaExceededExceptionUnmarshaller());
exceptionUnmarshallers.add(new InvalidClusterSubnetGroupStateExceptionUnmarshaller());
exceptionUnmarshallers.add(new AuthorizationQuotaExceededExceptionUnmarshaller());
exceptionUnmarshallers.add(new UnsupportedOptionExceptionUnmarshaller());
exceptionUnmarshallers.add(new SubnetAlreadyInUseExceptionUnmarshaller());
exceptionUnmarshallers.add(new ReservedNodeNotFoundExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterSnapshotAlreadyExistsExceptionUnmarshaller());
exceptionUnmarshallers.add(new UnauthorizedOperationExceptionUnmarshaller());
exceptionUnmarshallers.add(new NumberOfNodesPerClusterLimitExceededExceptionUnmarshaller());
exceptionUnmarshallers.add(new InvalidClusterStateExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterParameterGroupAlreadyExistsExceptionUnmarshaller());
exceptionUnmarshallers.add(new InvalidClusterParameterGroupStateExceptionUnmarshaller());
exceptionUnmarshallers.add(new InvalidClusterSnapshotStateExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterSecurityGroupNotFoundExceptionUnmarshaller());
exceptionUnmarshallers.add(new InvalidClusterSecurityGroupStateExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterSubnetGroupNotFoundExceptionUnmarshaller());
exceptionUnmarshallers.add(new ResizeNotFoundExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterParameterGroupQuotaExceededExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterSubnetQuotaExceededExceptionUnmarshaller());
exceptionUnmarshallers.add(new ClusterSubnetGroupAlreadyExistsExceptionUnmarshaller());
exceptionUnmarshallers.add(new StandardErrorUnmarshaller());
setEndpoint("redshift.us-east-1.amazonaws.com");
signer = new AWS4Signer();
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandlers.addAll(chainFactory.newRequestHandlerChain(
"/com/amazonaws/services/redshift/request.handlers"));
}
/**
* <p>
* Removes the ability of the specified AWS customer account to restore
* the specified snapshot. If the account is currently restoring the
* snapshot, the restore will run to completion.
* </p>
* <p>
* For more information about working with snapshots, go to <a
* docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html">
* Amazon Redshift Snapshots </a> in the <i>Amazon Redshift Management
* Guide</i> .
* </p>
*
* @param revokeSnapshotAccessRequest Container for the necessary
* parameters to execute the RevokeSnapshotAccess service method on
* AmazonRedshift.
*
* @return The response from the RevokeSnapshotAccess service method, as
* returned by AmazonRedshift.
*
* @throws AccessToSnapshotDeniedException
* @throws ClusterSnapshotNotFoundException
* @throws AuthorizationNotFoundException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public Snapshot revokeSnapshotAccess(RevokeSnapshotAccessRequest revokeSnapshotAccessRequest)
throws AmazonServiceException, AmazonClientException {
Request<RevokeSnapshotAccessRequest> request = new RevokeSnapshotAccessRequestMarshaller().marshall(revokeSnapshotAccessRequest);
return invoke(request, new SnapshotStaxUnmarshaller());
}
/**
* <p>
* Modifies a cluster subnet group to include the specified list of VPC
* subnets. The operation replaces the existing list of subnets with the
* new list of subnets.
* </p>
*
* @param modifyClusterSubnetGroupRequest Container for the necessary
* parameters to execute the ModifyClusterSubnetGroup service method on
* AmazonRedshift.
*
* @return The response from the ModifyClusterSubnetGroup service method,
* as returned by AmazonRedshift.
*
* @throws SubnetAlreadyInUseException
* @throws InvalidSubnetException
* @throws UnauthorizedOperationException
* @throws ClusterSubnetQuotaExceededException
* @throws ClusterSubnetGroupNotFoundException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public ClusterSubnetGroup modifyClusterSubnetGroup(ModifyClusterSubnetGroupRequest modifyClusterSubnetGroupRequest)
throws AmazonServiceException, AmazonClientException {
Request<ModifyClusterSubnetGroupRequest> request = new ModifyClusterSubnetGroupRequestMarshaller().marshall(modifyClusterSubnetGroupRequest);
return invoke(request, new ClusterSubnetGroupStaxUnmarshaller());
}
/**
* <p>
* Allows you to purchase reserved nodes. Amazon Redshift offers a
* predefined set of reserved node offerings. You can purchase one of the
* offerings. You can call the DescribeReservedNodeOfferings API to
* obtain the available reserved node offerings. You can call this API by
* providing a specific reserved node offering and the number of nodes
* you want to reserve.
* </p>
* <p>
* For more information about managing parameter groups, go to <a
* amazon.com/redshift/latest/mgmt/purchase-reserved-node-instance.html">
* Purchasing Reserved Nodes </a> in the <i>Amazon Redshift Management
* Guide</i> .
*
*
* </p>
*
* @param purchaseReservedNodeOfferingRequest Container for the necessary
* parameters to execute the PurchaseReservedNodeOffering service method
* on AmazonRedshift.
*
* @return The response from the PurchaseReservedNodeOffering service
* method, as returned by AmazonRedshift.
*
* @throws ReservedNodeAlreadyExistsException
* @throws ReservedNodeOfferingNotFoundException
* @throws ReservedNodeQuotaExceededException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public ReservedNode purchaseReservedNodeOffering(PurchaseReservedNodeOfferingRequest purchaseReservedNodeOfferingRequest)
throws AmazonServiceException, AmazonClientException {
Request<PurchaseReservedNodeOfferingRequest> request = new PurchaseReservedNodeOfferingRequestMarshaller().marshall(purchaseReservedNodeOfferingRequest);
return invoke(request, new ReservedNodeStaxUnmarshaller());
}
/**
* <p>
* Modifies the settings for a cluster. For example, you can add another
* security or parameter group, update the preferred maintenance window,
* or change the master user password. Resetting a cluster password or
* modifying the security groups associated with a cluster do not need a
* reboot. However, modifying parameter group requires a reboot for
* parameters to take effect. For more information about managing
* clusters, go to <a
* /docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html">
* Amazon Redshift Clusters </a> in the <i>Amazon Redshift Management
* Guide</i>
* </p>
* <p>
* You can also change node type and the number of nodes to scale up or
* down the cluster. When resizing a cluster, you must specify both the
* number of nodes and the node type even if one of the parameters does
* not change. If you specify the same number of nodes and node type that
* are already configured for the cluster, an error is returned.
* </p>
*
* @param modifyClusterRequest Container for the necessary parameters to
* execute the ModifyCluster service method on AmazonRedshift.
*
* @return The response from the ModifyCluster service method, as
* returned by AmazonRedshift.
*
* @throws InvalidClusterSecurityGroupStateException
* @throws InsufficientClusterCapacityException
* @throws UnauthorizedOperationException
* @throws InvalidClusterStateException
* @throws NumberOfNodesQuotaExceededException
* @throws ClusterNotFoundException
* @throws UnsupportedOptionException
* @throws ClusterSecurityGroupNotFoundException
* @throws ClusterParameterGroupNotFoundException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public Cluster modifyCluster(ModifyClusterRequest modifyClusterRequest)
throws AmazonServiceException, AmazonClientException {
Request<ModifyClusterRequest> request = new ModifyClusterRequestMarshaller().marshall(modifyClusterRequest);
return invoke(request, new ClusterStaxUnmarshaller());
}
/**
* <p>
* Modifies the parameters of a parameter group.
* </p>
* <p>
* For more information about managing parameter groups, go to <a
* s.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html">
* Amazon Redshift Parameter Groups </a> in the <i>Amazon Redshift
* Management Guide</i> .
* </p>
*
* @param modifyClusterParameterGroupRequest Container for the necessary
* parameters to execute the ModifyClusterParameterGroup service method
* on AmazonRedshift.
*
* @return The response from the ModifyClusterParameterGroup service
* method, as returned by AmazonRedshift.
*
* @throws InvalidClusterParameterGroupStateException
* @throws ClusterParameterGroupNotFoundException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public ModifyClusterParameterGroupResult modifyClusterParameterGroup(ModifyClusterParameterGroupRequest modifyClusterParameterGroupRequest)
throws AmazonServiceException, AmazonClientException {
Request<ModifyClusterParameterGroupRequest> request = new ModifyClusterParameterGroupRequestMarshaller().marshall(modifyClusterParameterGroupRequest);
return invoke(request, new ModifyClusterParameterGroupResultStaxUnmarshaller());
}
/**
* <p>
* Returns information about Amazon Redshift security groups. If the
* name of a security group is specified, the response will contain only
* information about only that security group.
* </p>
* <p>
* For information about managing security groups, go to <a
* ws.amazon.com/redshift/latest/mgmt/working-with-security-groups.html">
* Amazon Redshift Cluster Security Groups </a> in the <i>Amazon
* Redshift Management Guide</i> .
* </p>
*
* @param describeClusterSecurityGroupsRequest Container for the
* necessary parameters to execute the DescribeClusterSecurityGroups
* service method on AmazonRedshift.
*
* @return The response from the DescribeClusterSecurityGroups service
* method, as returned by AmazonRedshift.
*
* @throws ClusterSecurityGroupNotFoundException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeClusterSecurityGroupsResult describeClusterSecurityGroups(DescribeClusterSecurityGroupsRequest describeClusterSecurityGroupsRequest)
throws AmazonServiceException, AmazonClientException {
Request<DescribeClusterSecurityGroupsRequest> request = new DescribeClusterSecurityGroupsRequestMarshaller().marshall(describeClusterSecurityGroupsRequest);
return invoke(request, new DescribeClusterSecurityGroupsResultStaxUnmarshaller());
}
/**
* <p>
* Copies the specified automated cluster snapshot to a new manual
* cluster snapshot. The source must be an automated snapshot and it must
* be in the available state.
* </p>
* <p>
* When you delete a cluster, Amazon Redshift deletes any automated
* snapshots of the cluster. Also, when the retention period of the
* snapshot expires, Amazon Redshift automatically deletes it. If you
* want to keep an automated snapshot for a longer period, you can make a
* manual copy of the snapshot. Manual snapshots are retained until you
* delete them.
* </p>
* <p>
* For more information about working with snapshots, go to <a
* docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html">
* Amazon Redshift Snapshots </a> in the <i>Amazon Redshift Management
* Guide</i> .
* </p>
*
* @param copyClusterSnapshotRequest Container for the necessary
* parameters to execute the CopyClusterSnapshot service method on
* AmazonRedshift.
*
* @return The response from the CopyClusterSnapshot service method, as
* returned by AmazonRedshift.
*
* @throws ClusterSnapshotAlreadyExistsException
* @throws ClusterSnapshotNotFoundException
* @throws ClusterSnapshotQuotaExceededException
* @throws InvalidClusterSnapshotStateException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public Snapshot copyClusterSnapshot(CopyClusterSnapshotRequest copyClusterSnapshotRequest)
throws AmazonServiceException, AmazonClientException {
Request<CopyClusterSnapshotRequest> request = new CopyClusterSnapshotRequestMarshaller().marshall(copyClusterSnapshotRequest);
return invoke(request, new SnapshotStaxUnmarshaller());
}
/**
* <p>
* Returns a list of orderable cluster options. Before you create a new
* cluster you can use this operation to find what options are available,
* such as the EC2 Availability Zones (AZ) in the specific AWS region
* that you can specify, and the node types you can request. The node
* types differ by available storage, memory, CPU and price. With the
* cost involved you might want to obtain a list of cluster options in
* the specific region and specify values when creating a cluster. For
* more information about managing clusters, go to <a
* /docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html">
* Amazon Redshift Clusters </a> in the <i>Amazon Redshift Management
* Guide</i>
* </p>
*
* @param describeOrderableClusterOptionsRequest Container for the
* necessary parameters to execute the DescribeOrderableClusterOptions
* service method on AmazonRedshift.
*
* @return The response from the DescribeOrderableClusterOptions service
* method, as returned by AmazonRedshift.
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeOrderableClusterOptionsResult describeOrderableClusterOptions(DescribeOrderableClusterOptionsRequest describeOrderableClusterOptionsRequest)
throws AmazonServiceException, AmazonClientException {
Request<DescribeOrderableClusterOptionsRequest> request = new DescribeOrderableClusterOptionsRequestMarshaller().marshall(describeOrderableClusterOptionsRequest);
return invoke(request, new DescribeOrderableClusterOptionsResultStaxUnmarshaller());
}
/**
* <p>
* Creates a new Amazon Redshift subnet group. You must provide a list
* of one or more subnets in your existing Amazon Virtual Private Cloud
* (Amazon VPC) when creating Amazon Redshift subnet group.
* </p>
* <p>
* For information about subnet groups, go to <a
* zon.com/redshift/latest/mgmt/working-with-cluster-subnet-groups.html">
* Amazon Redshift Cluster Subnet Groups </a> in the <i>Amazon Redshift
* Management Guide</i> .
*
* </p>
*
* @param createClusterSubnetGroupRequest Container for the necessary
* parameters to execute the CreateClusterSubnetGroup service method on
* AmazonRedshift.
*
* @return The response from the CreateClusterSubnetGroup service method,
* as returned by AmazonRedshift.
*
* @throws InvalidSubnetException
* @throws UnauthorizedOperationException
* @throws ClusterSubnetQuotaExceededException
* @throws ClusterSubnetGroupAlreadyExistsException
* @throws ClusterSubnetGroupQuotaExceededException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public ClusterSubnetGroup createClusterSubnetGroup(CreateClusterSubnetGroupRequest createClusterSubnetGroupRequest)
throws AmazonServiceException, AmazonClientException {
Request<CreateClusterSubnetGroupRequest> request = new CreateClusterSubnetGroupRequestMarshaller().marshall(createClusterSubnetGroupRequest);
return invoke(request, new ClusterSubnetGroupStaxUnmarshaller());
}
/**
* <p>
* Reboots a cluster. This action is taken as soon as possible. It
* results in a momentary outage to the cluster, during which the cluster
* status is set to <code>rebooting</code> . A cluster event is created
* when the reboot is completed. Any pending cluster modifications (see
* ModifyCluster) are applied at this reboot. For more information about
* managing clusters, go to <a
* /docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html">
* Amazon Redshift Clusters </a> in the <i>Amazon Redshift Management
* Guide</i>
* </p>
*
* @param rebootClusterRequest Container for the necessary parameters to
* execute the RebootCluster service method on AmazonRedshift.
*
* @return The response from the RebootCluster service method, as
* returned by AmazonRedshift.
*
* @throws InvalidClusterStateException
* @throws ClusterNotFoundException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public Cluster rebootCluster(RebootClusterRequest rebootClusterRequest)
throws AmazonServiceException, AmazonClientException {
Request<RebootClusterRequest> request = new RebootClusterRequestMarshaller().marshall(rebootClusterRequest);
return invoke(request, new ClusterStaxUnmarshaller());
}
/**
* <p>
* Deletes the specified cluster subnet group.
* </p>
*
* @param deleteClusterSubnetGroupRequest Container for the necessary
* parameters to execute the DeleteClusterSubnetGroup service method on
* AmazonRedshift.
*
* @throws InvalidClusterSubnetStateException
* @throws ClusterSubnetGroupNotFoundException
* @throws InvalidClusterSubnetGroupStateException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public void deleteClusterSubnetGroup(DeleteClusterSubnetGroupRequest deleteClusterSubnetGroupRequest)
throws AmazonServiceException, AmazonClientException {
Request<DeleteClusterSubnetGroupRequest> request = new DeleteClusterSubnetGroupRequestMarshaller().marshall(deleteClusterSubnetGroupRequest);
invoke(request, null);
}
/**
* <p>
* Returns one or more cluster subnet group objects, which contain
* metadata about your cluster subnet groups. By default, this operation
* returns information about all cluster subnet groups that are defined
* in you AWS account.
* </p>
*
* @param describeClusterSubnetGroupsRequest Container for the necessary
* parameters to execute the DescribeClusterSubnetGroups service method
* on AmazonRedshift.
*
* @return The response from the DescribeClusterSubnetGroups service
* method, as returned by AmazonRedshift.
*
* @throws ClusterSubnetGroupNotFoundException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeClusterSubnetGroupsResult describeClusterSubnetGroups(DescribeClusterSubnetGroupsRequest describeClusterSubnetGroupsRequest)
throws AmazonServiceException, AmazonClientException {
Request<DescribeClusterSubnetGroupsRequest> request = new DescribeClusterSubnetGroupsRequestMarshaller().marshall(describeClusterSubnetGroupsRequest);
return invoke(request, new DescribeClusterSubnetGroupsResultStaxUnmarshaller());
}
/**
* <p>
* Deletes a previously provisioned cluster. A successful response from
* the web service indicates that the request was received correctly. If
* a final cluster snapshot is requested the status of the cluster will
* be "final-snapshot" while the snapshot is being taken, then it's
* "deleting" once Amazon Redshift begins deleting the cluster. Use
* DescribeClusters to monitor the status of the deletion. The delete
* operation cannot be canceled or reverted once submitted. For more
* information about managing clusters, go to <a
* /docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html">
* Amazon Redshift Clusters </a> in the <i>Amazon Redshift Management
* Guide</i> .
*
* </p>
*
* @param deleteClusterRequest Container for the necessary parameters to
* execute the DeleteCluster service method on AmazonRedshift.
*
* @return The response from the DeleteCluster service method, as
* returned by AmazonRedshift.
*
* @throws ClusterSnapshotAlreadyExistsException
* @throws InvalidClusterStateException
* @throws ClusterNotFoundException
* @throws ClusterSnapshotQuotaExceededException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public Cluster deleteCluster(DeleteClusterRequest deleteClusterRequest)
throws AmazonServiceException, AmazonClientException {
Request<DeleteClusterRequest> request = new DeleteClusterRequestMarshaller().marshall(deleteClusterRequest);
return invoke(request, new ClusterStaxUnmarshaller());
}
/**
* <p>
* Creates a manual snapshot of the specified cluster. The cluster must
* be in the "available" state.
* </p>
* <p>
* For more information about working with snapshots, go to <a
* docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html">
* Amazon Redshift Snapshots </a> in the <i>Amazon Redshift Management
* Guide</i> .
* </p>
*
* @param createClusterSnapshotRequest Container for the necessary
* parameters to execute the CreateClusterSnapshot service method on
* AmazonRedshift.
*
* @return The response from the CreateClusterSnapshot service method, as
* returned by AmazonRedshift.
*
* @throws ClusterSnapshotAlreadyExistsException
* @throws InvalidClusterStateException
* @throws ClusterNotFoundException
* @throws ClusterSnapshotQuotaExceededException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public Snapshot createClusterSnapshot(CreateClusterSnapshotRequest createClusterSnapshotRequest)
throws AmazonServiceException, AmazonClientException {
Request<CreateClusterSnapshotRequest> request = new CreateClusterSnapshotRequestMarshaller().marshall(createClusterSnapshotRequest);
return invoke(request, new SnapshotStaxUnmarshaller());
}
/**
* <p>
* Creates a new cluster. To create the cluster in virtual private cloud
* (VPC), you must provide cluster subnet group name. If you don't
* provide a cluster subnet group name or the cluster security group
* parameter, Amazon Redshift creates a non-VPC cluster, it associates
* the default cluster security group with the cluster. For more
* information about managing clusters, go to <a
* /docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html">
* Amazon Redshift Clusters </a> in the <i>Amazon Redshift Management
* Guide</i> .
*
* </p>
*
* @param createClusterRequest Container for the necessary parameters to
* execute the CreateCluster service method on AmazonRedshift.
*
* @return The response from the CreateCluster service method, as
* returned by AmazonRedshift.
*
* @throws InvalidSubnetException
* @throws InsufficientClusterCapacityException
* @throws UnauthorizedOperationException
* @throws NumberOfNodesQuotaExceededException
* @throws NumberOfNodesPerClusterLimitExceededException
* @throws ClusterSubnetGroupNotFoundException
* @throws InvalidClusterSubnetGroupStateException
* @throws ClusterAlreadyExistsException
* @throws ClusterSecurityGroupNotFoundException
* @throws ClusterQuotaExceededException
* @throws InvalidVPCNetworkStateException
* @throws ClusterParameterGroupNotFoundException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public Cluster createCluster(CreateClusterRequest createClusterRequest)
throws AmazonServiceException, AmazonClientException {
Request<CreateClusterRequest> request = new CreateClusterRequestMarshaller().marshall(createClusterRequest);
return invoke(request, new ClusterStaxUnmarshaller());
}
/**
* <p>
* Deletes the specified manual snapshot. The snapshot must be in the
* "available" state, with no other users authorized to access the
* snapshot.
* </p>
* <p>
* Unlike automated snapshots, manual snapshots are retained even after
* you delete your cluster. Amazon Redshift does not delete your manual
* snapshots. You must delete manual snapshot explicitly to avoid getting
* charged. If other accounts are authorized to access the snapshot, you
* must revoke all of the authorizations before you can delete the
* snapshot.
* </p>
*
* @param deleteClusterSnapshotRequest Container for the necessary
* parameters to execute the DeleteClusterSnapshot service method on
* AmazonRedshift.
*
* @return The response from the DeleteClusterSnapshot service method, as
* returned by AmazonRedshift.
*
* @throws ClusterSnapshotNotFoundException
* @throws InvalidClusterSnapshotStateException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public Snapshot deleteClusterSnapshot(DeleteClusterSnapshotRequest deleteClusterSnapshotRequest)
throws AmazonServiceException, AmazonClientException {
Request<DeleteClusterSnapshotRequest> request = new DeleteClusterSnapshotRequestMarshaller().marshall(deleteClusterSnapshotRequest);
return invoke(request, new SnapshotStaxUnmarshaller());
}
/**
* <p>
* Deletes a specified Amazon Redshift parameter group. <p>
* <b>NOTE:</b>You cannot delete a parameter group if it is associated
* with a cluster.
* </p>
*
* </p>
*
* @param deleteClusterParameterGroupRequest Container for the necessary
* parameters to execute the DeleteClusterParameterGroup service method
* on AmazonRedshift.
*
* @throws InvalidClusterParameterGroupStateException
* @throws ClusterParameterGroupNotFoundException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating
* either a problem with the data in the request, or a server side issue.
*/
public void deleteClusterParameterGroup(DeleteClusterParameterGroupRequest deleteClusterParameterGroupRequest)
throws AmazonServiceException, AmazonClientException {
Request<DeleteClusterParameterGroupRequest> request = new DeleteClusterParameterGroupRequestMarshaller().marshall(deleteClusterParameterGroupRequest);
invoke(request, null);
}
/**
* <p>
* Adds an inbound (ingress) rule to an Amazon Redshift security group.
* Depending on whether the application accessing your cluster is running
* on the Internet or an EC2 instance, you can authorize inbound access
* to either a Classless Interdomain Routing (CIDR) IP address range or
* an EC2 security group. You can add as many as 20 ingress rules to an
* Amazon Redshift security group.
* </p>
* <p>
* <b>NOTE:</b> The EC2 security group must be defined in the AWS region
* where the cluster resides.
* </p>
* <p>
* For an overview of CIDR blocks, see the Wikipedia article on <a
* href="http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing">
* Classless Inter-Domain Routing </a> .
* </p>
* <p>
* You must also associate the security group with a cluster so that
* clients running on these IP addresses or the EC2 instance are
* authorized to connect to the cluster. For information about managing
* security groups, go to <a
* ws.amazon.com/redshift/latest/mgmt/working-with-security-groups.html">
* Working with Security Groups </a> in the <i>Amazon Redshift
* Management Guide</i> .
* </p>
*
* @param authorizeClusterSecurityGroupIngressRequest Container for the
* necessary parameters to execute the
* AuthorizeClusterSecurityGroupIngress service method on AmazonRedshift.
*
* @return The response from the AuthorizeClusterSecurityGroupIngress
* service method, as returned by AmazonRedshift.
*
* @throws InvalidClusterSecurityGroupStateException
* @throws AuthorizationAlreadyExistsException
* @throws AuthorizationQuotaExceededException
* @throws ClusterSecurityGroupNotFoundException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonRedshift indicating