/
api_op_CancelDataRepositoryTask.go
114 lines (101 loc) · 3.67 KB
/
api_op_CancelDataRepositoryTask.go
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
// Code generated by smithy-go-codegen DO NOT EDIT.
package fsx
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/fsx/types"
"github.com/awslabs/smithy-go/middleware"
smithyhttp "github.com/awslabs/smithy-go/transport/http"
)
// Cancels an existing Amazon FSx for Lustre data repository task if that task is
// in either the PENDING or EXECUTING state. When you cancel a task, Amazon FSx
// does the following.
//
// * Any files that FSx has already exported are not
// reverted.
//
// * FSx continues to export any files that are "in-flight" when the
// cancel operation is received.
//
// * FSx does not export any files that have not
// yet been exported.
func (c *Client) CancelDataRepositoryTask(ctx context.Context, params *CancelDataRepositoryTaskInput, optFns ...func(*Options)) (*CancelDataRepositoryTaskOutput, error) {
if params == nil {
params = &CancelDataRepositoryTaskInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CancelDataRepositoryTask", params, optFns, addOperationCancelDataRepositoryTaskMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CancelDataRepositoryTaskOutput)
out.ResultMetadata = metadata
return out, nil
}
// Cancels a data repository task.
type CancelDataRepositoryTaskInput struct {
// Specifies the data repository task to cancel.
//
// This member is required.
TaskId *string
}
type CancelDataRepositoryTaskOutput struct {
// The lifecycle status of the data repository task, as follows:
//
// * PENDING -
// Amazon FSx has not started the task.
//
// * EXECUTING - Amazon FSx is processing
// the task.
//
// * FAILED - Amazon FSx was not able to complete the task. For
// example, there may be files the task failed to process. The
// DataRepositoryTaskFailureDetails property provides more information about task
// failures.
//
// * SUCCEEDED - FSx completed the task successfully.
//
// *
// CANCELED - Amazon FSx canceled the task and it did not complete.
//
// *
// CANCELING - FSx is in process of canceling the task.
Lifecycle types.DataRepositoryTaskLifecycle
// The ID of the task being canceled.
TaskId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
}
func addOperationCancelDataRepositoryTaskMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelDataRepositoryTask{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCancelDataRepositoryTask{}, middleware.After)
if err != nil {
return err
}
awsmiddleware.AddRequestInvocationIDMiddleware(stack)
smithyhttp.AddContentLengthMiddleware(stack)
addResolveEndpointMiddleware(stack, options)
v4.AddComputePayloadSHA256Middleware(stack)
addRetryMiddlewares(stack, options)
addHTTPSignerV4Middleware(stack, options)
awsmiddleware.AddAttemptClockSkewMiddleware(stack)
addClientUserAgent(stack)
smithyhttp.AddErrorCloseResponseBodyMiddleware(stack)
smithyhttp.AddCloseResponseBodyMiddleware(stack)
addOpCancelDataRepositoryTaskValidationMiddleware(stack)
stack.Initialize.Add(newServiceMetadataMiddleware_opCancelDataRepositoryTask(options.Region), middleware.Before)
addRequestIDRetrieverMiddleware(stack)
addResponseErrorMiddleware(stack)
return nil
}
func newServiceMetadataMiddleware_opCancelDataRepositoryTask(region string) awsmiddleware.RegisterServiceMetadata {
return awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fsx",
OperationName: "CancelDataRepositoryTask",
}
}