Skip to content

Commit 0c9782d

Browse files
author
awstools
committed
feat(client-fsx): This release adds support for Amazon File Cache.
1 parent 9a3cc54 commit 0c9782d

17 files changed

+4940
-1264
lines changed

clients/client-fsx/src/FSx.ts

Lines changed: 238 additions & 26 deletions
Large diffs are not rendered by default.

clients/client-fsx/src/FSxClient.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ import {
7171
CreateDataRepositoryTaskCommandInput,
7272
CreateDataRepositoryTaskCommandOutput,
7373
} from "./commands/CreateDataRepositoryTaskCommand";
74+
import { CreateFileCacheCommandInput, CreateFileCacheCommandOutput } from "./commands/CreateFileCacheCommand";
7475
import { CreateFileSystemCommandInput, CreateFileSystemCommandOutput } from "./commands/CreateFileSystemCommand";
7576
import {
7677
CreateFileSystemFromBackupCommandInput,
@@ -91,6 +92,7 @@ import {
9192
DeleteDataRepositoryAssociationCommandInput,
9293
DeleteDataRepositoryAssociationCommandOutput,
9394
} from "./commands/DeleteDataRepositoryAssociationCommand";
95+
import { DeleteFileCacheCommandInput, DeleteFileCacheCommandOutput } from "./commands/DeleteFileCacheCommand";
9496
import { DeleteFileSystemCommandInput, DeleteFileSystemCommandOutput } from "./commands/DeleteFileSystemCommand";
9597
import { DeleteSnapshotCommandInput, DeleteSnapshotCommandOutput } from "./commands/DeleteSnapshotCommand";
9698
import {
@@ -107,6 +109,7 @@ import {
107109
DescribeDataRepositoryTasksCommandInput,
108110
DescribeDataRepositoryTasksCommandOutput,
109111
} from "./commands/DescribeDataRepositoryTasksCommand";
112+
import { DescribeFileCachesCommandInput, DescribeFileCachesCommandOutput } from "./commands/DescribeFileCachesCommand";
110113
import {
111114
DescribeFileSystemAliasesCommandInput,
112115
DescribeFileSystemAliasesCommandOutput,
@@ -143,6 +146,7 @@ import {
143146
UpdateDataRepositoryAssociationCommandInput,
144147
UpdateDataRepositoryAssociationCommandOutput,
145148
} from "./commands/UpdateDataRepositoryAssociationCommand";
149+
import { UpdateFileCacheCommandInput, UpdateFileCacheCommandOutput } from "./commands/UpdateFileCacheCommand";
146150
import { UpdateFileSystemCommandInput, UpdateFileSystemCommandOutput } from "./commands/UpdateFileSystemCommand";
147151
import { UpdateSnapshotCommandInput, UpdateSnapshotCommandOutput } from "./commands/UpdateSnapshotCommand";
148152
import {
@@ -159,6 +163,7 @@ export type ServiceInputTypes =
159163
| CreateBackupCommandInput
160164
| CreateDataRepositoryAssociationCommandInput
161165
| CreateDataRepositoryTaskCommandInput
166+
| CreateFileCacheCommandInput
162167
| CreateFileSystemCommandInput
163168
| CreateFileSystemFromBackupCommandInput
164169
| CreateSnapshotCommandInput
@@ -167,13 +172,15 @@ export type ServiceInputTypes =
167172
| CreateVolumeFromBackupCommandInput
168173
| DeleteBackupCommandInput
169174
| DeleteDataRepositoryAssociationCommandInput
175+
| DeleteFileCacheCommandInput
170176
| DeleteFileSystemCommandInput
171177
| DeleteSnapshotCommandInput
172178
| DeleteStorageVirtualMachineCommandInput
173179
| DeleteVolumeCommandInput
174180
| DescribeBackupsCommandInput
175181
| DescribeDataRepositoryAssociationsCommandInput
176182
| DescribeDataRepositoryTasksCommandInput
183+
| DescribeFileCachesCommandInput
177184
| DescribeFileSystemAliasesCommandInput
178185
| DescribeFileSystemsCommandInput
179186
| DescribeSnapshotsCommandInput
@@ -186,6 +193,7 @@ export type ServiceInputTypes =
186193
| TagResourceCommandInput
187194
| UntagResourceCommandInput
188195
| UpdateDataRepositoryAssociationCommandInput
196+
| UpdateFileCacheCommandInput
189197
| UpdateFileSystemCommandInput
190198
| UpdateSnapshotCommandInput
191199
| UpdateStorageVirtualMachineCommandInput
@@ -198,6 +206,7 @@ export type ServiceOutputTypes =
198206
| CreateBackupCommandOutput
199207
| CreateDataRepositoryAssociationCommandOutput
200208
| CreateDataRepositoryTaskCommandOutput
209+
| CreateFileCacheCommandOutput
201210
| CreateFileSystemCommandOutput
202211
| CreateFileSystemFromBackupCommandOutput
203212
| CreateSnapshotCommandOutput
@@ -206,13 +215,15 @@ export type ServiceOutputTypes =
206215
| CreateVolumeFromBackupCommandOutput
207216
| DeleteBackupCommandOutput
208217
| DeleteDataRepositoryAssociationCommandOutput
218+
| DeleteFileCacheCommandOutput
209219
| DeleteFileSystemCommandOutput
210220
| DeleteSnapshotCommandOutput
211221
| DeleteStorageVirtualMachineCommandOutput
212222
| DeleteVolumeCommandOutput
213223
| DescribeBackupsCommandOutput
214224
| DescribeDataRepositoryAssociationsCommandOutput
215225
| DescribeDataRepositoryTasksCommandOutput
226+
| DescribeFileCachesCommandOutput
216227
| DescribeFileSystemAliasesCommandOutput
217228
| DescribeFileSystemsCommandOutput
218229
| DescribeSnapshotsCommandOutput
@@ -225,6 +236,7 @@ export type ServiceOutputTypes =
225236
| TagResourceCommandOutput
226237
| UntagResourceCommandOutput
227238
| UpdateDataRepositoryAssociationCommandOutput
239+
| UpdateFileCacheCommandOutput
228240
| UpdateFileSystemCommandOutput
229241
| UpdateSnapshotCommandOutput
230242
| UpdateStorageVirtualMachineCommandOutput

clients/client-fsx/src/commands/CreateDataRepositoryAssociationCommand.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ export interface CreateDataRepositoryAssociationCommandOutput
4141
* for automatic export only, or for both. To learn more about linking a
4242
* data repository to your file system, see
4343
* <a href="https://docs.aws.amazon.com/fsx/latest/LustreGuide/create-dra-linked-data-repo.html">Linking your file system to an S3 bucket</a>.</p>
44+
* <note>
45+
* <p>
46+
* <code>CreateDataRepositoryAssociation</code> isn't supported
47+
* on Amazon File Cache resources. To create a DRA on Amazon File Cache,
48+
* use the <code>CreateFileCache</code> operation.</p>
49+
* </note>
4450
* @example
4551
* Use a bare-bones client and the command you need to make an API call.
4652
* ```javascript
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { FSxClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../FSxClient";
16+
import {
17+
CreateFileCacheRequest,
18+
CreateFileCacheRequestFilterSensitiveLog,
19+
CreateFileCacheResponse,
20+
CreateFileCacheResponseFilterSensitiveLog,
21+
} from "../models/models_0";
22+
import {
23+
deserializeAws_json1_1CreateFileCacheCommand,
24+
serializeAws_json1_1CreateFileCacheCommand,
25+
} from "../protocols/Aws_json1_1";
26+
27+
export interface CreateFileCacheCommandInput extends CreateFileCacheRequest {}
28+
export interface CreateFileCacheCommandOutput extends CreateFileCacheResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Creates a new Amazon File Cache resource.</p>
32+
* <p>You can use this operation with a client request token in the request that
33+
* Amazon File Cache uses to ensure idempotent creation.
34+
* If a cache with the specified client request token exists and the parameters
35+
* match, <code>CreateFileCache</code> returns the description of the existing
36+
* cache. If a cache with the specified client request token exists and the
37+
* parameters don't match, this call returns <code>IncompatibleParameterError</code>.
38+
* If a file cache with the specified client request token doesn't exist,
39+
* <code>CreateFileCache</code> does the following: </p>
40+
* <ul>
41+
* <li>
42+
* <p>Creates a new, empty Amazon File Cache resourcewith an assigned ID, and
43+
* an initial lifecycle state of <code>CREATING</code>.</p>
44+
* </li>
45+
* <li>
46+
* <p>Returns the description of the cache in JSON format.</p>
47+
* </li>
48+
* </ul>
49+
* <note>
50+
* <p>The <code>CreateFileCache</code> call returns while the cache's lifecycle
51+
* state is still <code>CREATING</code>. You can check the cache creation status
52+
* by calling the <a href="https://docs.aws.amazon.com/fsx/latest/APIReference/API_DescribeFileCaches.html">DescribeFileCaches</a> operation, which returns the cache state
53+
* along with other information.</p>
54+
* </note>
55+
* @example
56+
* Use a bare-bones client and the command you need to make an API call.
57+
* ```javascript
58+
* import { FSxClient, CreateFileCacheCommand } from "@aws-sdk/client-fsx"; // ES Modules import
59+
* // const { FSxClient, CreateFileCacheCommand } = require("@aws-sdk/client-fsx"); // CommonJS import
60+
* const client = new FSxClient(config);
61+
* const command = new CreateFileCacheCommand(input);
62+
* const response = await client.send(command);
63+
* ```
64+
*
65+
* @see {@link CreateFileCacheCommandInput} for command's `input` shape.
66+
* @see {@link CreateFileCacheCommandOutput} for command's `response` shape.
67+
* @see {@link FSxClientResolvedConfig | config} for FSxClient's `config` shape.
68+
*
69+
*/
70+
export class CreateFileCacheCommand extends $Command<
71+
CreateFileCacheCommandInput,
72+
CreateFileCacheCommandOutput,
73+
FSxClientResolvedConfig
74+
> {
75+
// Start section: command_properties
76+
// End section: command_properties
77+
78+
constructor(readonly input: CreateFileCacheCommandInput) {
79+
// Start section: command_constructor
80+
super();
81+
// End section: command_constructor
82+
}
83+
84+
/**
85+
* @internal
86+
*/
87+
resolveMiddleware(
88+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
89+
configuration: FSxClientResolvedConfig,
90+
options?: __HttpHandlerOptions
91+
): Handler<CreateFileCacheCommandInput, CreateFileCacheCommandOutput> {
92+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
93+
94+
const stack = clientStack.concat(this.middlewareStack);
95+
96+
const { logger } = configuration;
97+
const clientName = "FSxClient";
98+
const commandName = "CreateFileCacheCommand";
99+
const handlerExecutionContext: HandlerExecutionContext = {
100+
logger,
101+
clientName,
102+
commandName,
103+
inputFilterSensitiveLog: CreateFileCacheRequestFilterSensitiveLog,
104+
outputFilterSensitiveLog: CreateFileCacheResponseFilterSensitiveLog,
105+
};
106+
const { requestHandler } = configuration;
107+
return stack.resolve(
108+
(request: FinalizeHandlerArguments<any>) =>
109+
requestHandler.handle(request.request as __HttpRequest, options || {}),
110+
handlerExecutionContext
111+
);
112+
}
113+
114+
private serialize(input: CreateFileCacheCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
115+
return serializeAws_json1_1CreateFileCacheCommand(input, context);
116+
}
117+
118+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateFileCacheCommandOutput> {
119+
return deserializeAws_json1_1CreateFileCacheCommand(output, context);
120+
}
121+
122+
// Start section: command_body_extra
123+
// End section: command_body_extra
124+
}

clients/client-fsx/src/commands/CreateFileSystemCommand.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,6 @@ export interface CreateFileSystemCommandOutput extends CreateFileSystemResponse,
6868
* <p>Returns the description of the file system in JSON format.</p>
6969
* </li>
7070
* </ul>
71-
*
72-
* <p>This operation requires a client request token in the request that Amazon FSx
73-
* uses to ensure idempotent creation. This means that calling the operation multiple times
74-
* with the same client request token has no effect. By using the idempotent operation, you
75-
* can retry a <code>CreateFileSystem</code> operation without the risk of creating an
76-
* extra file system. This approach can be useful when an initial call fails in a way that
77-
* makes it unclear whether a file system was created. Examples are if a transport-level
78-
* timeout occurred, or your connection was reset. If you use the same client request token
79-
* and the initial call created a file system, the client receives a success message as
80-
* long as the parameters are the same.</p>
8171
* <note>
8272
* <p>The <code>CreateFileSystem</code> call returns while the file system's lifecycle
8373
* state is still <code>CREATING</code>. You can check the file-system creation status
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { FSxClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../FSxClient";
16+
import {
17+
DeleteFileCacheRequest,
18+
DeleteFileCacheRequestFilterSensitiveLog,
19+
DeleteFileCacheResponse,
20+
DeleteFileCacheResponseFilterSensitiveLog,
21+
} from "../models/models_0";
22+
import {
23+
deserializeAws_json1_1DeleteFileCacheCommand,
24+
serializeAws_json1_1DeleteFileCacheCommand,
25+
} from "../protocols/Aws_json1_1";
26+
27+
export interface DeleteFileCacheCommandInput extends DeleteFileCacheRequest {}
28+
export interface DeleteFileCacheCommandOutput extends DeleteFileCacheResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Deletes an Amazon File Cache resource. After deletion, the cache no longer exists, and its data
32+
* is gone.</p>
33+
*
34+
* <p>The <code>DeleteFileCache</code> operation returns while the cache has the
35+
* <code>DELETING</code> status. You can check the cache deletion status by
36+
* calling the <a href="https://docs.aws.amazon.com/fsx/latest/APIReference/API_DescribeFileCaches.html">DescribeFileCaches</a> operation, which returns a list of caches in your
37+
* account. If you pass the cache ID for a deleted cache, the
38+
* <code>DescribeFileCaches</code> operation returns a <code>FileCacheNotFound</code>
39+
* error.</p>
40+
*
41+
* <important>
42+
* <p>The data in a deleted cache is also deleted and can't be recovered by
43+
* any means.</p>
44+
* </important>
45+
* @example
46+
* Use a bare-bones client and the command you need to make an API call.
47+
* ```javascript
48+
* import { FSxClient, DeleteFileCacheCommand } from "@aws-sdk/client-fsx"; // ES Modules import
49+
* // const { FSxClient, DeleteFileCacheCommand } = require("@aws-sdk/client-fsx"); // CommonJS import
50+
* const client = new FSxClient(config);
51+
* const command = new DeleteFileCacheCommand(input);
52+
* const response = await client.send(command);
53+
* ```
54+
*
55+
* @see {@link DeleteFileCacheCommandInput} for command's `input` shape.
56+
* @see {@link DeleteFileCacheCommandOutput} for command's `response` shape.
57+
* @see {@link FSxClientResolvedConfig | config} for FSxClient's `config` shape.
58+
*
59+
*/
60+
export class DeleteFileCacheCommand extends $Command<
61+
DeleteFileCacheCommandInput,
62+
DeleteFileCacheCommandOutput,
63+
FSxClientResolvedConfig
64+
> {
65+
// Start section: command_properties
66+
// End section: command_properties
67+
68+
constructor(readonly input: DeleteFileCacheCommandInput) {
69+
// Start section: command_constructor
70+
super();
71+
// End section: command_constructor
72+
}
73+
74+
/**
75+
* @internal
76+
*/
77+
resolveMiddleware(
78+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
79+
configuration: FSxClientResolvedConfig,
80+
options?: __HttpHandlerOptions
81+
): Handler<DeleteFileCacheCommandInput, DeleteFileCacheCommandOutput> {
82+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
83+
84+
const stack = clientStack.concat(this.middlewareStack);
85+
86+
const { logger } = configuration;
87+
const clientName = "FSxClient";
88+
const commandName = "DeleteFileCacheCommand";
89+
const handlerExecutionContext: HandlerExecutionContext = {
90+
logger,
91+
clientName,
92+
commandName,
93+
inputFilterSensitiveLog: DeleteFileCacheRequestFilterSensitiveLog,
94+
outputFilterSensitiveLog: DeleteFileCacheResponseFilterSensitiveLog,
95+
};
96+
const { requestHandler } = configuration;
97+
return stack.resolve(
98+
(request: FinalizeHandlerArguments<any>) =>
99+
requestHandler.handle(request.request as __HttpRequest, options || {}),
100+
handlerExecutionContext
101+
);
102+
}
103+
104+
private serialize(input: DeleteFileCacheCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
105+
return serializeAws_json1_1DeleteFileCacheCommand(input, context);
106+
}
107+
108+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DeleteFileCacheCommandOutput> {
109+
return deserializeAws_json1_1DeleteFileCacheCommand(output, context);
110+
}
111+
112+
// Start section: command_body_extra
113+
// End section: command_body_extra
114+
}

0 commit comments

Comments
 (0)