Skip to content

Commit 6ee1cf4

Browse files
author
awstools
committed
feat(client-storage-gateway): This release adds support to invoke a process that cleans the specified file share's cache of file entries that are failing upload to Amazon S3.
1 parent a3fdee6 commit 6ee1cf4

File tree

8 files changed

+303
-0
lines changed

8 files changed

+303
-0
lines changed

clients/client-storage-gateway/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,14 @@ DisassociateFileSystem
706706

707707
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/storage-gateway/command/DisassociateFileSystemCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-storage-gateway/Interface/DisassociateFileSystemCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-storage-gateway/Interface/DisassociateFileSystemCommandOutput/)
708708

709+
</details>
710+
<details>
711+
<summary>
712+
EvictFilesFailingUpload
713+
</summary>
714+
715+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/storage-gateway/command/EvictFilesFailingUploadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-storage-gateway/Interface/EvictFilesFailingUploadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-storage-gateway/Interface/EvictFilesFailingUploadCommandOutput/)
716+
709717
</details>
710718
<details>
711719
<summary>

clients/client-storage-gateway/src/StorageGateway.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,11 @@ import {
265265
DisassociateFileSystemCommandInput,
266266
DisassociateFileSystemCommandOutput,
267267
} from "./commands/DisassociateFileSystemCommand";
268+
import {
269+
EvictFilesFailingUploadCommand,
270+
EvictFilesFailingUploadCommandInput,
271+
EvictFilesFailingUploadCommandOutput,
272+
} from "./commands/EvictFilesFailingUploadCommand";
268273
import { JoinDomainCommand, JoinDomainCommandInput, JoinDomainCommandOutput } from "./commands/JoinDomainCommand";
269274
import {
270275
ListAutomaticTapeCreationPoliciesCommand,
@@ -507,6 +512,7 @@ const commands = {
507512
DetachVolumeCommand,
508513
DisableGatewayCommand,
509514
DisassociateFileSystemCommand,
515+
EvictFilesFailingUploadCommand,
510516
JoinDomainCommand,
511517
ListAutomaticTapeCreationPoliciesCommand,
512518
ListCacheReportsCommand,
@@ -1402,6 +1408,23 @@ export interface StorageGateway {
14021408
cb: (err: any, data?: DisassociateFileSystemCommandOutput) => void
14031409
): void;
14041410

1411+
/**
1412+
* @see {@link EvictFilesFailingUploadCommand}
1413+
*/
1414+
evictFilesFailingUpload(
1415+
args: EvictFilesFailingUploadCommandInput,
1416+
options?: __HttpHandlerOptions
1417+
): Promise<EvictFilesFailingUploadCommandOutput>;
1418+
evictFilesFailingUpload(
1419+
args: EvictFilesFailingUploadCommandInput,
1420+
cb: (err: any, data?: EvictFilesFailingUploadCommandOutput) => void
1421+
): void;
1422+
evictFilesFailingUpload(
1423+
args: EvictFilesFailingUploadCommandInput,
1424+
options: __HttpHandlerOptions,
1425+
cb: (err: any, data?: EvictFilesFailingUploadCommandOutput) => void
1426+
): void;
1427+
14051428
/**
14061429
* @see {@link JoinDomainCommand}
14071430
*/

clients/client-storage-gateway/src/StorageGatewayClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ import {
192192
DisassociateFileSystemCommandInput,
193193
DisassociateFileSystemCommandOutput,
194194
} from "./commands/DisassociateFileSystemCommand";
195+
import {
196+
EvictFilesFailingUploadCommandInput,
197+
EvictFilesFailingUploadCommandOutput,
198+
} from "./commands/EvictFilesFailingUploadCommand";
195199
import { JoinDomainCommandInput, JoinDomainCommandOutput } from "./commands/JoinDomainCommand";
196200
import {
197201
ListAutomaticTapeCreationPoliciesCommandInput,
@@ -374,6 +378,7 @@ export type ServiceInputTypes =
374378
| DetachVolumeCommandInput
375379
| DisableGatewayCommandInput
376380
| DisassociateFileSystemCommandInput
381+
| EvictFilesFailingUploadCommandInput
377382
| JoinDomainCommandInput
378383
| ListAutomaticTapeCreationPoliciesCommandInput
379384
| ListCacheReportsCommandInput
@@ -474,6 +479,7 @@ export type ServiceOutputTypes =
474479
| DetachVolumeCommandOutput
475480
| DisableGatewayCommandOutput
476481
| DisassociateFileSystemCommandOutput
482+
| EvictFilesFailingUploadCommandOutput
477483
| JoinDomainCommandOutput
478484
| ListAutomaticTapeCreationPoliciesCommandOutput
479485
| ListCacheReportsCommandOutput
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { EvictFilesFailingUploadInput, EvictFilesFailingUploadOutput } from "../models/models_0";
9+
import { de_EvictFilesFailingUploadCommand, se_EvictFilesFailingUploadCommand } from "../protocols/Aws_json1_1";
10+
import { ServiceInputTypes, ServiceOutputTypes, StorageGatewayClientResolvedConfig } from "../StorageGatewayClient";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link EvictFilesFailingUploadCommand}.
21+
*/
22+
export interface EvictFilesFailingUploadCommandInput extends EvictFilesFailingUploadInput {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link EvictFilesFailingUploadCommand}.
27+
*/
28+
export interface EvictFilesFailingUploadCommandOutput extends EvictFilesFailingUploadOutput, __MetadataBearer {}
29+
30+
/**
31+
* <p>Starts a process that cleans the specified file share's cache of file entries that are
32+
* failing upload to Amazon S3. This API operation reports success if the request is
33+
* received with valid arguments, and there are no other cache clean operations currently
34+
* in-progress for the specified file share. After a successful request, the cache clean
35+
* operation occurs asynchronously and reports progress using CloudWatch logs and
36+
* notifications.</p>
37+
* <important>
38+
* <p>If <code>ForceRemove</code> is set to <code>True</code>, the cache clean operation
39+
* will delete file data from the gateway which might otherwise be recoverable. We
40+
* recommend using this operation only after all other methods to clear files failing
41+
* upload have been exhausted, and if your business need outweighs the potential data
42+
* loss.</p>
43+
* </important>
44+
* @example
45+
* Use a bare-bones client and the command you need to make an API call.
46+
* ```javascript
47+
* import { StorageGatewayClient, EvictFilesFailingUploadCommand } from "@aws-sdk/client-storage-gateway"; // ES Modules import
48+
* // const { StorageGatewayClient, EvictFilesFailingUploadCommand } = require("@aws-sdk/client-storage-gateway"); // CommonJS import
49+
* const client = new StorageGatewayClient(config);
50+
* const input = { // EvictFilesFailingUploadInput
51+
* FileShareARN: "STRING_VALUE", // required
52+
* ForceRemove: true || false,
53+
* };
54+
* const command = new EvictFilesFailingUploadCommand(input);
55+
* const response = await client.send(command);
56+
* // { // EvictFilesFailingUploadOutput
57+
* // NotificationId: "STRING_VALUE",
58+
* // };
59+
*
60+
* ```
61+
*
62+
* @param EvictFilesFailingUploadCommandInput - {@link EvictFilesFailingUploadCommandInput}
63+
* @returns {@link EvictFilesFailingUploadCommandOutput}
64+
* @see {@link EvictFilesFailingUploadCommandInput} for command's `input` shape.
65+
* @see {@link EvictFilesFailingUploadCommandOutput} for command's `response` shape.
66+
* @see {@link StorageGatewayClientResolvedConfig | config} for StorageGatewayClient's `config` shape.
67+
*
68+
* @throws {@link InternalServerError} (server fault)
69+
* <p>An internal server error has occurred during the request. For more information, see the
70+
* error and message fields.</p>
71+
*
72+
* @throws {@link InvalidGatewayRequestException} (client fault)
73+
* <p>An exception occurred because an invalid gateway request was issued to the service. For
74+
* more information, see the error and message fields.</p>
75+
*
76+
* @throws {@link StorageGatewayServiceException}
77+
* <p>Base exception class for all service exceptions from StorageGateway service.</p>
78+
*
79+
* @public
80+
*/
81+
export class EvictFilesFailingUploadCommand extends $Command
82+
.classBuilder<
83+
EvictFilesFailingUploadCommandInput,
84+
EvictFilesFailingUploadCommandOutput,
85+
StorageGatewayClientResolvedConfig,
86+
ServiceInputTypes,
87+
ServiceOutputTypes
88+
>()
89+
.ep(commonParams)
90+
.m(function (this: any, Command: any, cs: any, config: StorageGatewayClientResolvedConfig, o: any) {
91+
return [
92+
getSerdePlugin(config, this.serialize, this.deserialize),
93+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
94+
];
95+
})
96+
.s("StorageGateway_20130630", "EvictFilesFailingUpload", {})
97+
.n("StorageGatewayClient", "EvictFilesFailingUploadCommand")
98+
.f(void 0, void 0)
99+
.ser(se_EvictFilesFailingUploadCommand)
100+
.de(de_EvictFilesFailingUploadCommand)
101+
.build() {
102+
/** @internal type navigation helper, not in runtime. */
103+
protected declare static __types: {
104+
api: {
105+
input: EvictFilesFailingUploadInput;
106+
output: EvictFilesFailingUploadOutput;
107+
};
108+
sdk: {
109+
input: EvictFilesFailingUploadCommandInput;
110+
output: EvictFilesFailingUploadCommandOutput;
111+
};
112+
};
113+
}

clients/client-storage-gateway/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export * from "./DescribeWorkingStorageCommand";
5454
export * from "./DetachVolumeCommand";
5555
export * from "./DisableGatewayCommand";
5656
export * from "./DisassociateFileSystemCommand";
57+
export * from "./EvictFilesFailingUploadCommand";
5758
export * from "./JoinDomainCommand";
5859
export * from "./ListAutomaticTapeCreationPoliciesCommand";
5960
export * from "./ListCacheReportsCommand";

clients/client-storage-gateway/src/models/models_0.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5759,6 +5759,57 @@ export interface Disk {
57595759
DiskAttributeList?: string[] | undefined;
57605760
}
57615761

5762+
/**
5763+
* @public
5764+
*/
5765+
export interface EvictFilesFailingUploadInput {
5766+
/**
5767+
* <p>The Amazon Resource Name (ARN) of the file share for which you want to start the cache
5768+
* clean operation.</p>
5769+
* @public
5770+
*/
5771+
FileShareARN: string | undefined;
5772+
5773+
/**
5774+
* <p>Specifies whether cache entries with full or partial file data currently stored on the
5775+
* gateway will be forcibly removed by the cache clean operation.</p>
5776+
* <p>Valid arguments:</p>
5777+
* <ul>
5778+
* <li>
5779+
* <p>
5780+
* <code>False</code> - The cache clean operation skips cache entries failing upload
5781+
* if they are associated with data currently stored on the gateway. This preserves the
5782+
* cached data.</p>
5783+
* </li>
5784+
* <li>
5785+
* <p>
5786+
* <code>True</code> - The cache clean operation removes cache entries failing upload
5787+
* even if they are associated with data currently stored on the gateway. This deletes
5788+
* the cached data.</p>
5789+
* <important>
5790+
* <p>If <code>ForceRemove</code> is set to <code>True</code>, the cache clean
5791+
* operation will delete file data from the gateway which might otherwise be
5792+
* recoverable.</p>
5793+
* </important>
5794+
* </li>
5795+
* </ul>
5796+
* @public
5797+
*/
5798+
ForceRemove?: boolean | undefined;
5799+
}
5800+
5801+
/**
5802+
* @public
5803+
*/
5804+
export interface EvictFilesFailingUploadOutput {
5805+
/**
5806+
* <p>The randomly generated ID of the CloudWatch notification associated with the
5807+
* cache clean operation. This ID is in UUID format.</p>
5808+
* @public
5809+
*/
5810+
NotificationId?: string | undefined;
5811+
}
5812+
57625813
/**
57635814
* @public
57645815
* @enum

clients/client-storage-gateway/src/protocols/Aws_json1_1.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ import {
162162
DisassociateFileSystemCommandInput,
163163
DisassociateFileSystemCommandOutput,
164164
} from "../commands/DisassociateFileSystemCommand";
165+
import {
166+
EvictFilesFailingUploadCommandInput,
167+
EvictFilesFailingUploadCommandOutput,
168+
} from "../commands/EvictFilesFailingUploadCommand";
165169
import { JoinDomainCommandInput, JoinDomainCommandOutput } from "../commands/JoinDomainCommand";
166170
import {
167171
ListAutomaticTapeCreationPoliciesCommandInput,
@@ -345,6 +349,7 @@ import {
345349
DisableGatewayInput,
346350
DisassociateFileSystemInput,
347351
EndpointNetworkConfiguration,
352+
EvictFilesFailingUploadInput,
348353
InternalServerError,
349354
InvalidGatewayRequestException,
350355
JoinDomainInput,
@@ -1117,6 +1122,19 @@ export const se_DisassociateFileSystemCommand = async (
11171122
return buildHttpRpcRequest(context, headers, "/", undefined, body);
11181123
};
11191124

1125+
/**
1126+
* serializeAws_json1_1EvictFilesFailingUploadCommand
1127+
*/
1128+
export const se_EvictFilesFailingUploadCommand = async (
1129+
input: EvictFilesFailingUploadCommandInput,
1130+
context: __SerdeContext
1131+
): Promise<__HttpRequest> => {
1132+
const headers: __HeaderBag = sharedHeaders("EvictFilesFailingUpload");
1133+
let body: any;
1134+
body = JSON.stringify(_json(input));
1135+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
1136+
};
1137+
11201138
/**
11211139
* serializeAws_json1_1JoinDomainCommand
11221140
*/
@@ -2737,6 +2755,26 @@ export const de_DisassociateFileSystemCommand = async (
27372755
return response;
27382756
};
27392757

2758+
/**
2759+
* deserializeAws_json1_1EvictFilesFailingUploadCommand
2760+
*/
2761+
export const de_EvictFilesFailingUploadCommand = async (
2762+
output: __HttpResponse,
2763+
context: __SerdeContext
2764+
): Promise<EvictFilesFailingUploadCommandOutput> => {
2765+
if (output.statusCode >= 300) {
2766+
return de_CommandError(output, context);
2767+
}
2768+
const data: any = await parseBody(output.body, context);
2769+
let contents: any = {};
2770+
contents = _json(data);
2771+
const response: EvictFilesFailingUploadCommandOutput = {
2772+
$metadata: deserializeMetadata(output),
2773+
...contents,
2774+
};
2775+
return response;
2776+
};
2777+
27402778
/**
27412779
* deserializeAws_json1_1JoinDomainCommand
27422780
*/
@@ -3743,6 +3781,8 @@ const de_ServiceUnavailableErrorRes = async (
37433781

37443782
// se_EndpointNetworkConfiguration omitted.
37453783

3784+
// se_EvictFilesFailingUploadInput omitted.
3785+
37463786
// se_FileShareARNList omitted.
37473787

37483788
// se_FileShareClientList omitted.
@@ -4152,6 +4192,8 @@ const de_DescribeTapesOutput = (output: any, context: __SerdeContext): DescribeT
41524192

41534193
// de_errorDetails omitted.
41544194

4195+
// de_EvictFilesFailingUploadOutput omitted.
4196+
41554197
// de_FileShareClientList omitted.
41564198

41574199
// de_FileShareInfo omitted.

0 commit comments

Comments
 (0)