forked from aws/aws-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAWSDataSyncClient.java
More file actions
1668 lines (1433 loc) · 78.7 KB
/
AWSDataSyncClient.java
File metadata and controls
1668 lines (1433 loc) · 78.7 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 2014-2019 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.datasync;
import org.w3c.dom.*;
import java.net.*;
import java.util.*;
import javax.annotation.Generated;
import org.apache.commons.logging.*;
import com.amazonaws.*;
import com.amazonaws.annotation.SdkInternalApi;
import com.amazonaws.auth.*;
import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
import com.amazonaws.internal.auth.*;
import com.amazonaws.metrics.*;
import com.amazonaws.regions.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.*;
import com.amazonaws.protocol.json.*;
import com.amazonaws.util.AWSRequestMetrics.Field;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.client.AwsSyncClientParams;
import com.amazonaws.client.builder.AdvancedConfig;
import com.amazonaws.services.datasync.AWSDataSyncClientBuilder;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.datasync.model.*;
import com.amazonaws.services.datasync.model.transform.*;
/**
* Client for accessing DataSync. All service calls made using this client are blocking, and will not return until the
* service call completes.
* <p>
* <fullname>AWS DataSync</fullname>
* <p>
* AWS DataSync is a managed data transfer service that makes it simpler for you to automate moving data between
* on-premises storage and Amazon Simple Storage Service (Amazon S3) or Amazon Elastic File System (Amazon EFS).
* </p>
* <p>
* This API interface reference for AWS DataSync contains documentation for a programming interface that you can use to
* manage AWS DataSync.
* </p>
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSDataSyncClient extends AmazonWebServiceClient implements AWSDataSync {
/** Provider for AWS credentials. */
private final AWSCredentialsProvider awsCredentialsProvider;
private static final Log log = LogFactory.getLog(AWSDataSync.class);
/** Default signing name for the service. */
private static final String DEFAULT_SIGNING_NAME = "datasync";
/** Client configuration factory providing ClientConfigurations tailored to this client */
protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory();
private final AdvancedConfig advancedConfig;
private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory(
new JsonClientMetadata()
.withProtocolVersion("1.1")
.withSupportsCbor(false)
.withSupportsIon(false)
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("InvalidRequestException").withModeledClass(
com.amazonaws.services.datasync.model.InvalidRequestException.class))
.withBaseServiceExceptionClass(com.amazonaws.services.datasync.model.AWSDataSyncException.class));
public static AWSDataSyncClientBuilder builder() {
return AWSDataSyncClientBuilder.standard();
}
/**
* Constructs a new client to invoke service methods on DataSync using the specified parameters.
*
* <p>
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientParams
* Object providing client parameters.
*/
AWSDataSyncClient(AwsSyncClientParams clientParams) {
this(clientParams, false);
}
/**
* Constructs a new client to invoke service methods on DataSync using the specified parameters.
*
* <p>
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientParams
* Object providing client parameters.
*/
AWSDataSyncClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) {
super(clientParams);
this.awsCredentialsProvider = clientParams.getCredentialsProvider();
this.advancedConfig = clientParams.getAdvancedConfig();
init();
}
private void init() {
setServiceNameIntern(DEFAULT_SIGNING_NAME);
setEndpointPrefix(ENDPOINT_PREFIX);
// calling this.setEndPoint(...) will also modify the signer accordingly
setEndpoint("datasync.us-east-1.amazonaws.com");
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/datasync/request.handlers"));
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/datasync/request.handler2s"));
requestHandler2s.addAll(chainFactory.getGlobalHandlers());
}
/**
* <p>
* Cancels execution of a task.
* </p>
* <p>
* When you cancel a task execution, the transfer of some files are abruptly interrupted. The contents of files that
* are transferred to the destination might be incomplete or inconsistent with the source files. However, if you
* start a new task execution on the same task and you allow the task execution to complete, file content on the
* destination is complete and consistent. This applies to other unexpected failures that interrupt a task
* execution. In all of these cases, AWS DataSync successfully complete the transfer when you start the next task
* execution.
* </p>
*
* @param cancelTaskExecutionRequest
* CancelTaskExecutionRequest
* @return Result of the CancelTaskExecution operation returned by the service.
* @throws InvalidRequestException
* This exception is thrown when the client submits a malformed request.
* @sample AWSDataSync.CancelTaskExecution
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CancelTaskExecution" target="_top">AWS
* API Documentation</a>
*/
@Override
public CancelTaskExecutionResult cancelTaskExecution(CancelTaskExecutionRequest request) {
request = beforeClientExecution(request);
return executeCancelTaskExecution(request);
}
@SdkInternalApi
final CancelTaskExecutionResult executeCancelTaskExecution(CancelTaskExecutionRequest cancelTaskExecutionRequest) {
ExecutionContext executionContext = createExecutionContext(cancelTaskExecutionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<CancelTaskExecutionRequest> request = null;
Response<CancelTaskExecutionResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelTaskExecutionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(cancelTaskExecutionRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelTaskExecution");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<CancelTaskExecutionResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CancelTaskExecutionResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Activates an AWS DataSync agent that you have deployed on your host. The activation process associates your agent
* with your account. In the activation process, you specify information such as the AWS Region that you want to
* activate the agent in. You activate the agent in the AWS Region where your target locations (in Amazon S3 or
* Amazon EFS) reside. Your tasks are created in this AWS Region.
* </p>
* <p>
* You can use an agent for more than one location. If a task uses multiple agents, all of them need to have status
* AVAILABLE for the task to run. If you use multiple agents for a source location, the status of all the agents
* must be AVAILABLE for the task to run. For more information, see <a href=
* "https://docs.aws.amazon.com/sync-service/latest/userguide/working-with-sync-agents.html#activating-sync-agent"
* >Activating a Sync Agent</a> in the <i>AWS DataSync User Guide.</i>
* </p>
* <p>
* Agents are automatically updated by AWS on a regular basis, using a mechanism that ensures minimal interruption
* to your tasks.
* </p>
* <p/>
*
* @param createAgentRequest
* CreateAgentRequest
* @return Result of the CreateAgent operation returned by the service.
* @throws InvalidRequestException
* This exception is thrown when the client submits a malformed request.
* @sample AWSDataSync.CreateAgent
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CreateAgent" target="_top">AWS API
* Documentation</a>
*/
@Override
public CreateAgentResult createAgent(CreateAgentRequest request) {
request = beforeClientExecution(request);
return executeCreateAgent(request);
}
@SdkInternalApi
final CreateAgentResult executeCreateAgent(CreateAgentRequest createAgentRequest) {
ExecutionContext executionContext = createExecutionContext(createAgentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<CreateAgentRequest> request = null;
Response<CreateAgentResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateAgentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createAgentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateAgent");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<CreateAgentResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateAgentResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Creates an endpoint for an Amazon EFS file system.
* </p>
*
* @param createLocationEfsRequest
* CreateLocationEfsRequest
* @return Result of the CreateLocationEfs operation returned by the service.
* @throws InvalidRequestException
* This exception is thrown when the client submits a malformed request.
* @sample AWSDataSync.CreateLocationEfs
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CreateLocationEfs" target="_top">AWS API
* Documentation</a>
*/
@Override
public CreateLocationEfsResult createLocationEfs(CreateLocationEfsRequest request) {
request = beforeClientExecution(request);
return executeCreateLocationEfs(request);
}
@SdkInternalApi
final CreateLocationEfsResult executeCreateLocationEfs(CreateLocationEfsRequest createLocationEfsRequest) {
ExecutionContext executionContext = createExecutionContext(createLocationEfsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<CreateLocationEfsRequest> request = null;
Response<CreateLocationEfsResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateLocationEfsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createLocationEfsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLocationEfs");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<CreateLocationEfsResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateLocationEfsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Creates an endpoint for a Network File System (NFS) file system.
* </p>
*
* @param createLocationNfsRequest
* CreateLocationNfsRequest
* @return Result of the CreateLocationNfs operation returned by the service.
* @throws InvalidRequestException
* This exception is thrown when the client submits a malformed request.
* @sample AWSDataSync.CreateLocationNfs
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CreateLocationNfs" target="_top">AWS API
* Documentation</a>
*/
@Override
public CreateLocationNfsResult createLocationNfs(CreateLocationNfsRequest request) {
request = beforeClientExecution(request);
return executeCreateLocationNfs(request);
}
@SdkInternalApi
final CreateLocationNfsResult executeCreateLocationNfs(CreateLocationNfsRequest createLocationNfsRequest) {
ExecutionContext executionContext = createExecutionContext(createLocationNfsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<CreateLocationNfsRequest> request = null;
Response<CreateLocationNfsResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateLocationNfsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createLocationNfsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLocationNfs");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<CreateLocationNfsResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateLocationNfsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Creates an endpoint for an Amazon S3 bucket.
* </p>
* <p>
* For AWS DataSync to access a destination S3 bucket, it needs an AWS Identity and Access Management (IAM) role
* that has the required permissions. You can set up the required permissions by creating an IAM policy that grants
* the required permissions and attaching the policy to the role. An example of such a policy is shown in the
* examples section. For more information, see <a
* href="https://docs.aws.amazon.com/sync-service/latest/userguide/configuring-s3-locations.html">Configuring Amazon
* S3 Location Settings</a> in the <i>AWS DataSync User Guide</i>.
* </p>
*
* @param createLocationS3Request
* CreateLocationS3Request
* @return Result of the CreateLocationS3 operation returned by the service.
* @throws InvalidRequestException
* This exception is thrown when the client submits a malformed request.
* @sample AWSDataSync.CreateLocationS3
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CreateLocationS3" target="_top">AWS API
* Documentation</a>
*/
@Override
public CreateLocationS3Result createLocationS3(CreateLocationS3Request request) {
request = beforeClientExecution(request);
return executeCreateLocationS3(request);
}
@SdkInternalApi
final CreateLocationS3Result executeCreateLocationS3(CreateLocationS3Request createLocationS3Request) {
ExecutionContext executionContext = createExecutionContext(createLocationS3Request);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<CreateLocationS3Request> request = null;
Response<CreateLocationS3Result> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateLocationS3RequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createLocationS3Request));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLocationS3");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<CreateLocationS3Result>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateLocationS3ResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Creates a task. A task is a set of two locations (source and destination) and a set of default
* <code>OverrideOptions</code> that you use to control the behavior of a task. If you don't specify default values
* for <code>Options</code> when you create a task, AWS DataSync populates them with safe service defaults.
* </p>
* <p>
* When you initially create a task, it enters the INITIALIZING status and then the CREATING status. In CREATING
* status, AWS DataSync attempts to mount the source Network File System (NFS) location. The task transitions to the
* AVAILABLE status without waiting for the destination location to mount. Instead, AWS DataSync mounts a
* destination before every task execution and then unmounts it after every task execution.
* </p>
* <p>
* If an agent that is associated with a source (NFS) location goes offline, the task transitions to the UNAVAILABLE
* status. If the status of the task remains in the CREATING status for more than a few minutes, it means that your
* agent might be having trouble mounting the source NFS file system. Check the task's <code>ErrorCode</code> and
* <code>ErrorDetail</code>. Mount issues are often caused by either a misconfigured firewall or a mistyped NFS
* server host name.
* </p>
*
* @param createTaskRequest
* CreateTaskRequest
* @return Result of the CreateTask operation returned by the service.
* @throws InvalidRequestException
* This exception is thrown when the client submits a malformed request.
* @sample AWSDataSync.CreateTask
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CreateTask" target="_top">AWS API
* Documentation</a>
*/
@Override
public CreateTaskResult createTask(CreateTaskRequest request) {
request = beforeClientExecution(request);
return executeCreateTask(request);
}
@SdkInternalApi
final CreateTaskResult executeCreateTask(CreateTaskRequest createTaskRequest) {
ExecutionContext executionContext = createExecutionContext(createTaskRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<CreateTaskRequest> request = null;
Response<CreateTaskResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateTaskRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createTaskRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateTask");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<CreateTaskResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateTaskResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Deletes an agent. To specify which agent to delete, use the Amazon Resource Name (ARN) of the agent in your
* request. The operation disassociates the agent from your AWS account. However, it doesn't delete the agent
* virtual machine (VM) from your on-premises environment.
* </p>
* <note>
* <p>
* After you delete an agent, you can't reactivate it and you longer pay software charges for it.
* </p>
* </note>
*
* @param deleteAgentRequest
* DeleteAgentRequest
* @return Result of the DeleteAgent operation returned by the service.
* @throws InvalidRequestException
* This exception is thrown when the client submits a malformed request.
* @sample AWSDataSync.DeleteAgent
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DeleteAgent" target="_top">AWS API
* Documentation</a>
*/
@Override
public DeleteAgentResult deleteAgent(DeleteAgentRequest request) {
request = beforeClientExecution(request);
return executeDeleteAgent(request);
}
@SdkInternalApi
final DeleteAgentResult executeDeleteAgent(DeleteAgentRequest deleteAgentRequest) {
ExecutionContext executionContext = createExecutionContext(deleteAgentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<DeleteAgentRequest> request = null;
Response<DeleteAgentResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteAgentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteAgentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteAgent");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<DeleteAgentResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteAgentResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Deletes the configuration of a location used by AWS DataSync.
* </p>
*
* @param deleteLocationRequest
* DeleteLocation
* @return Result of the DeleteLocation operation returned by the service.
* @throws InvalidRequestException
* This exception is thrown when the client submits a malformed request.
* @sample AWSDataSync.DeleteLocation
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DeleteLocation" target="_top">AWS API
* Documentation</a>
*/
@Override
public DeleteLocationResult deleteLocation(DeleteLocationRequest request) {
request = beforeClientExecution(request);
return executeDeleteLocation(request);
}
@SdkInternalApi
final DeleteLocationResult executeDeleteLocation(DeleteLocationRequest deleteLocationRequest) {
ExecutionContext executionContext = createExecutionContext(deleteLocationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<DeleteLocationRequest> request = null;
Response<DeleteLocationResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteLocationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteLocationRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteLocation");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<DeleteLocationResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteLocationResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Deletes a task.
* </p>
*
* @param deleteTaskRequest
* DeleteTask
* @return Result of the DeleteTask operation returned by the service.
* @throws InvalidRequestException
* This exception is thrown when the client submits a malformed request.
* @sample AWSDataSync.DeleteTask
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DeleteTask" target="_top">AWS API
* Documentation</a>
*/
@Override
public DeleteTaskResult deleteTask(DeleteTaskRequest request) {
request = beforeClientExecution(request);
return executeDeleteTask(request);
}
@SdkInternalApi
final DeleteTaskResult executeDeleteTask(DeleteTaskRequest deleteTaskRequest) {
ExecutionContext executionContext = createExecutionContext(deleteTaskRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<DeleteTaskRequest> request = null;
Response<DeleteTaskResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteTaskRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteTaskRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteTask");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<DeleteTaskResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteTaskResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Returns metadata such as the name, the network interfaces, and the status (that is, whether the agent is running
* or not) for an agent. To specify which agent to describe, use the Amazon Resource Name (ARN) of the agent in your
* request.
* </p>
*
* @param describeAgentRequest
* DescribeAgent
* @return Result of the DescribeAgent operation returned by the service.
* @throws InvalidRequestException
* This exception is thrown when the client submits a malformed request.
* @sample AWSDataSync.DescribeAgent
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DescribeAgent" target="_top">AWS API
* Documentation</a>
*/
@Override
public DescribeAgentResult describeAgent(DescribeAgentRequest request) {
request = beforeClientExecution(request);
return executeDescribeAgent(request);
}
@SdkInternalApi
final DescribeAgentResult executeDescribeAgent(DescribeAgentRequest describeAgentRequest) {
ExecutionContext executionContext = createExecutionContext(describeAgentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<DescribeAgentRequest> request = null;
Response<DescribeAgentResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeAgentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeAgentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAgent");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<DescribeAgentResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeAgentResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Returns metadata, such as the path information about an Amazon EFS location.
* </p>
*
* @param describeLocationEfsRequest
* DescribeLocationEfsRequest
* @return Result of the DescribeLocationEfs operation returned by the service.
* @throws InvalidRequestException
* This exception is thrown when the client submits a malformed request.
* @sample AWSDataSync.DescribeLocationEfs
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DescribeLocationEfs" target="_top">AWS
* API Documentation</a>
*/
@Override
public DescribeLocationEfsResult describeLocationEfs(DescribeLocationEfsRequest request) {
request = beforeClientExecution(request);
return executeDescribeLocationEfs(request);
}
@SdkInternalApi
final DescribeLocationEfsResult executeDescribeLocationEfs(DescribeLocationEfsRequest describeLocationEfsRequest) {
ExecutionContext executionContext = createExecutionContext(describeLocationEfsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<DescribeLocationEfsRequest> request = null;
Response<DescribeLocationEfsResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeLocationEfsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeLocationEfsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeLocationEfs");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<DescribeLocationEfsResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeLocationEfsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Returns metadata, such as the path information, about a NFS location.
* </p>
*
* @param describeLocationNfsRequest
* DescribeLocationNfsRequest
* @return Result of the DescribeLocationNfs operation returned by the service.
* @throws InvalidRequestException
* This exception is thrown when the client submits a malformed request.
* @sample AWSDataSync.DescribeLocationNfs
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DescribeLocationNfs" target="_top">AWS
* API Documentation</a>
*/
@Override
public DescribeLocationNfsResult describeLocationNfs(DescribeLocationNfsRequest request) {
request = beforeClientExecution(request);
return executeDescribeLocationNfs(request);
}
@SdkInternalApi
final DescribeLocationNfsResult executeDescribeLocationNfs(DescribeLocationNfsRequest describeLocationNfsRequest) {
ExecutionContext executionContext = createExecutionContext(describeLocationNfsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<DescribeLocationNfsRequest> request = null;
Response<DescribeLocationNfsResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeLocationNfsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeLocationNfsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeLocationNfs");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<DescribeLocationNfsResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeLocationNfsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Returns metadata, such as bucket name, about an Amazon S3 bucket location.
* </p>
*
* @param describeLocationS3Request
* DescribeLocationS3Request
* @return Result of the DescribeLocationS3 operation returned by the service.
* @throws InvalidRequestException
* This exception is thrown when the client submits a malformed request.
* @sample AWSDataSync.DescribeLocationS3
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DescribeLocationS3" target="_top">AWS
* API Documentation</a>
*/
@Override
public DescribeLocationS3Result describeLocationS3(DescribeLocationS3Request request) {
request = beforeClientExecution(request);
return executeDescribeLocationS3(request);
}
@SdkInternalApi
final DescribeLocationS3Result executeDescribeLocationS3(DescribeLocationS3Request describeLocationS3Request) {
ExecutionContext executionContext = createExecutionContext(describeLocationS3Request);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<DescribeLocationS3Request> request = null;
Response<DescribeLocationS3Result> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeLocationS3RequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeLocationS3Request));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeLocationS3");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<DescribeLocationS3Result>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeLocationS3ResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Returns metadata about a task.
* </p>
*
* @param describeTaskRequest
* DescribeTaskRequest
* @return Result of the DescribeTask operation returned by the service.
* @throws InvalidRequestException
* This exception is thrown when the client submits a malformed request.
* @sample AWSDataSync.DescribeTask
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DescribeTask" target="_top">AWS API
* Documentation</a>
*/
@Override
public DescribeTaskResult describeTask(DescribeTaskRequest request) {
request = beforeClientExecution(request);
return executeDescribeTask(request);
}
@SdkInternalApi
final DescribeTaskResult executeDescribeTask(DescribeTaskRequest describeTaskRequest) {
ExecutionContext executionContext = createExecutionContext(describeTaskRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<DescribeTaskRequest> request = null;
Response<DescribeTaskResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeTaskRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeTaskRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeTask");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<DescribeTaskResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeTaskResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Returns detailed metadata about a task that is being executed.
* </p>
*
* @param describeTaskExecutionRequest
* DescribeTaskExecutionRequest
* @return Result of the DescribeTaskExecution operation returned by the service.
* @throws InvalidRequestException
* This exception is thrown when the client submits a malformed request.
* @sample AWSDataSync.DescribeTaskExecution
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DescribeTaskExecution" target="_top">AWS
* API Documentation</a>
*/
@Override
public DescribeTaskExecutionResult describeTaskExecution(DescribeTaskExecutionRequest request) {
request = beforeClientExecution(request);
return executeDescribeTaskExecution(request);
}
@SdkInternalApi
final DescribeTaskExecutionResult executeDescribeTaskExecution(DescribeTaskExecutionRequest describeTaskExecutionRequest) {
ExecutionContext executionContext = createExecutionContext(describeTaskExecutionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<DescribeTaskExecutionRequest> request = null;
Response<DescribeTaskExecutionResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeTaskExecutionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeTaskExecutionRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeTaskExecution");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {