diff --git a/clients/client-opensearchserverless/README.md b/clients/client-opensearchserverless/README.md index 113d3179c8f5..9f449493a5a0 100644 --- a/clients/client-opensearchserverless/README.md +++ b/clients/client-opensearchserverless/README.md @@ -219,6 +219,22 @@ BatchGetCollection [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/classes/batchgetcollectioncommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/batchgetcollectioncommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/batchgetcollectioncommandoutput.html) + +
+ +BatchGetEffectiveLifecyclePolicy + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/classes/batchgeteffectivelifecyclepolicycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/batchgeteffectivelifecyclepolicycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/batchgeteffectivelifecyclepolicycommandoutput.html) + +
+
+ +BatchGetLifecyclePolicy + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/classes/batchgetlifecyclepolicycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/batchgetlifecyclepolicycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/batchgetlifecyclepolicycommandoutput.html) +
@@ -243,6 +259,14 @@ CreateCollection [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/classes/createcollectioncommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/createcollectioncommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/createcollectioncommandoutput.html) +
+
+ +CreateLifecyclePolicy + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/classes/createlifecyclepolicycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/createlifecyclepolicycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/createlifecyclepolicycommandoutput.html) +
@@ -283,6 +307,14 @@ DeleteCollection [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/classes/deletecollectioncommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/deletecollectioncommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/deletecollectioncommandoutput.html) +
+
+ +DeleteLifecyclePolicy + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/classes/deletelifecyclepolicycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/deletelifecyclepolicycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/deletelifecyclepolicycommandoutput.html) +
@@ -363,6 +395,14 @@ ListCollections [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/classes/listcollectionscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/listcollectionscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/listcollectionscommandoutput.html) +
+
+ +ListLifecyclePolicies + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/classes/listlifecyclepoliciescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/listlifecyclepoliciescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/listlifecyclepoliciescommandoutput.html) +
@@ -435,6 +475,14 @@ UpdateCollection [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/classes/updatecollectioncommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/updatecollectioncommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/updatecollectioncommandoutput.html) +
+
+ +UpdateLifecyclePolicy + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/classes/updatelifecyclepolicycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/updatelifecyclepolicycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-opensearchserverless/interfaces/updatelifecyclepolicycommandoutput.html) +
diff --git a/clients/client-opensearchserverless/src/OpenSearchServerless.ts b/clients/client-opensearchserverless/src/OpenSearchServerless.ts index 9fd30a6363fe..afecaf8ffa73 100644 --- a/clients/client-opensearchserverless/src/OpenSearchServerless.ts +++ b/clients/client-opensearchserverless/src/OpenSearchServerless.ts @@ -7,6 +7,16 @@ import { BatchGetCollectionCommandInput, BatchGetCollectionCommandOutput, } from "./commands/BatchGetCollectionCommand"; +import { + BatchGetEffectiveLifecyclePolicyCommand, + BatchGetEffectiveLifecyclePolicyCommandInput, + BatchGetEffectiveLifecyclePolicyCommandOutput, +} from "./commands/BatchGetEffectiveLifecyclePolicyCommand"; +import { + BatchGetLifecyclePolicyCommand, + BatchGetLifecyclePolicyCommandInput, + BatchGetLifecyclePolicyCommandOutput, +} from "./commands/BatchGetLifecyclePolicyCommand"; import { BatchGetVpcEndpointCommand, BatchGetVpcEndpointCommandInput, @@ -22,6 +32,11 @@ import { CreateCollectionCommandInput, CreateCollectionCommandOutput, } from "./commands/CreateCollectionCommand"; +import { + CreateLifecyclePolicyCommand, + CreateLifecyclePolicyCommandInput, + CreateLifecyclePolicyCommandOutput, +} from "./commands/CreateLifecyclePolicyCommand"; import { CreateSecurityConfigCommand, CreateSecurityConfigCommandInput, @@ -47,6 +62,11 @@ import { DeleteCollectionCommandInput, DeleteCollectionCommandOutput, } from "./commands/DeleteCollectionCommand"; +import { + DeleteLifecyclePolicyCommand, + DeleteLifecyclePolicyCommandInput, + DeleteLifecyclePolicyCommandOutput, +} from "./commands/DeleteLifecyclePolicyCommand"; import { DeleteSecurityConfigCommand, DeleteSecurityConfigCommandInput, @@ -97,6 +117,11 @@ import { ListCollectionsCommandInput, ListCollectionsCommandOutput, } from "./commands/ListCollectionsCommand"; +import { + ListLifecyclePoliciesCommand, + ListLifecyclePoliciesCommandInput, + ListLifecyclePoliciesCommandOutput, +} from "./commands/ListLifecyclePoliciesCommand"; import { ListSecurityConfigsCommand, ListSecurityConfigsCommandInput, @@ -138,6 +163,11 @@ import { UpdateCollectionCommandInput, UpdateCollectionCommandOutput, } from "./commands/UpdateCollectionCommand"; +import { + UpdateLifecyclePolicyCommand, + UpdateLifecyclePolicyCommandInput, + UpdateLifecyclePolicyCommandOutput, +} from "./commands/UpdateLifecyclePolicyCommand"; import { UpdateSecurityConfigCommand, UpdateSecurityConfigCommandInput, @@ -157,14 +187,18 @@ import { OpenSearchServerlessClient, OpenSearchServerlessClientConfig } from "./ const commands = { BatchGetCollectionCommand, + BatchGetEffectiveLifecyclePolicyCommand, + BatchGetLifecyclePolicyCommand, BatchGetVpcEndpointCommand, CreateAccessPolicyCommand, CreateCollectionCommand, + CreateLifecyclePolicyCommand, CreateSecurityConfigCommand, CreateSecurityPolicyCommand, CreateVpcEndpointCommand, DeleteAccessPolicyCommand, DeleteCollectionCommand, + DeleteLifecyclePolicyCommand, DeleteSecurityConfigCommand, DeleteSecurityPolicyCommand, DeleteVpcEndpointCommand, @@ -175,6 +209,7 @@ const commands = { GetSecurityPolicyCommand, ListAccessPoliciesCommand, ListCollectionsCommand, + ListLifecyclePoliciesCommand, ListSecurityConfigsCommand, ListSecurityPoliciesCommand, ListTagsForResourceCommand, @@ -184,6 +219,7 @@ const commands = { UpdateAccessPolicyCommand, UpdateAccountSettingsCommand, UpdateCollectionCommand, + UpdateLifecyclePolicyCommand, UpdateSecurityConfigCommand, UpdateSecurityPolicyCommand, UpdateVpcEndpointCommand, @@ -207,6 +243,40 @@ export interface OpenSearchServerless { cb: (err: any, data?: BatchGetCollectionCommandOutput) => void ): void; + /** + * @see {@link BatchGetEffectiveLifecyclePolicyCommand} + */ + batchGetEffectiveLifecyclePolicy( + args: BatchGetEffectiveLifecyclePolicyCommandInput, + options?: __HttpHandlerOptions + ): Promise; + batchGetEffectiveLifecyclePolicy( + args: BatchGetEffectiveLifecyclePolicyCommandInput, + cb: (err: any, data?: BatchGetEffectiveLifecyclePolicyCommandOutput) => void + ): void; + batchGetEffectiveLifecyclePolicy( + args: BatchGetEffectiveLifecyclePolicyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: BatchGetEffectiveLifecyclePolicyCommandOutput) => void + ): void; + + /** + * @see {@link BatchGetLifecyclePolicyCommand} + */ + batchGetLifecyclePolicy( + args: BatchGetLifecyclePolicyCommandInput, + options?: __HttpHandlerOptions + ): Promise; + batchGetLifecyclePolicy( + args: BatchGetLifecyclePolicyCommandInput, + cb: (err: any, data?: BatchGetLifecyclePolicyCommandOutput) => void + ): void; + batchGetLifecyclePolicy( + args: BatchGetLifecyclePolicyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: BatchGetLifecyclePolicyCommandOutput) => void + ): void; + /** * @see {@link BatchGetVpcEndpointCommand} */ @@ -258,6 +328,23 @@ export interface OpenSearchServerless { cb: (err: any, data?: CreateCollectionCommandOutput) => void ): void; + /** + * @see {@link CreateLifecyclePolicyCommand} + */ + createLifecyclePolicy( + args: CreateLifecyclePolicyCommandInput, + options?: __HttpHandlerOptions + ): Promise; + createLifecyclePolicy( + args: CreateLifecyclePolicyCommandInput, + cb: (err: any, data?: CreateLifecyclePolicyCommandOutput) => void + ): void; + createLifecyclePolicy( + args: CreateLifecyclePolicyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateLifecyclePolicyCommandOutput) => void + ): void; + /** * @see {@link CreateSecurityConfigCommand} */ @@ -343,6 +430,23 @@ export interface OpenSearchServerless { cb: (err: any, data?: DeleteCollectionCommandOutput) => void ): void; + /** + * @see {@link DeleteLifecyclePolicyCommand} + */ + deleteLifecyclePolicy( + args: DeleteLifecyclePolicyCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteLifecyclePolicy( + args: DeleteLifecyclePolicyCommandInput, + cb: (err: any, data?: DeleteLifecyclePolicyCommandOutput) => void + ): void; + deleteLifecyclePolicy( + args: DeleteLifecyclePolicyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteLifecyclePolicyCommandOutput) => void + ): void; + /** * @see {@link DeleteSecurityConfigCommand} */ @@ -507,6 +611,23 @@ export interface OpenSearchServerless { cb: (err: any, data?: ListCollectionsCommandOutput) => void ): void; + /** + * @see {@link ListLifecyclePoliciesCommand} + */ + listLifecyclePolicies( + args: ListLifecyclePoliciesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listLifecyclePolicies( + args: ListLifecyclePoliciesCommandInput, + cb: (err: any, data?: ListLifecyclePoliciesCommandOutput) => void + ): void; + listLifecyclePolicies( + args: ListLifecyclePoliciesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListLifecyclePoliciesCommandOutput) => void + ): void; + /** * @see {@link ListSecurityConfigsCommand} */ @@ -648,6 +769,23 @@ export interface OpenSearchServerless { cb: (err: any, data?: UpdateCollectionCommandOutput) => void ): void; + /** + * @see {@link UpdateLifecyclePolicyCommand} + */ + updateLifecyclePolicy( + args: UpdateLifecyclePolicyCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateLifecyclePolicy( + args: UpdateLifecyclePolicyCommandInput, + cb: (err: any, data?: UpdateLifecyclePolicyCommandOutput) => void + ): void; + updateLifecyclePolicy( + args: UpdateLifecyclePolicyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateLifecyclePolicyCommandOutput) => void + ): void; + /** * @see {@link UpdateSecurityConfigCommand} */ diff --git a/clients/client-opensearchserverless/src/OpenSearchServerlessClient.ts b/clients/client-opensearchserverless/src/OpenSearchServerlessClient.ts index 8d9ee5d74e00..2af54edebf4c 100644 --- a/clients/client-opensearchserverless/src/OpenSearchServerlessClient.ts +++ b/clients/client-opensearchserverless/src/OpenSearchServerlessClient.ts @@ -51,12 +51,24 @@ import { } from "@smithy/types"; import { BatchGetCollectionCommandInput, BatchGetCollectionCommandOutput } from "./commands/BatchGetCollectionCommand"; +import { + BatchGetEffectiveLifecyclePolicyCommandInput, + BatchGetEffectiveLifecyclePolicyCommandOutput, +} from "./commands/BatchGetEffectiveLifecyclePolicyCommand"; +import { + BatchGetLifecyclePolicyCommandInput, + BatchGetLifecyclePolicyCommandOutput, +} from "./commands/BatchGetLifecyclePolicyCommand"; import { BatchGetVpcEndpointCommandInput, BatchGetVpcEndpointCommandOutput, } from "./commands/BatchGetVpcEndpointCommand"; import { CreateAccessPolicyCommandInput, CreateAccessPolicyCommandOutput } from "./commands/CreateAccessPolicyCommand"; import { CreateCollectionCommandInput, CreateCollectionCommandOutput } from "./commands/CreateCollectionCommand"; +import { + CreateLifecyclePolicyCommandInput, + CreateLifecyclePolicyCommandOutput, +} from "./commands/CreateLifecyclePolicyCommand"; import { CreateSecurityConfigCommandInput, CreateSecurityConfigCommandOutput, @@ -68,6 +80,10 @@ import { import { CreateVpcEndpointCommandInput, CreateVpcEndpointCommandOutput } from "./commands/CreateVpcEndpointCommand"; import { DeleteAccessPolicyCommandInput, DeleteAccessPolicyCommandOutput } from "./commands/DeleteAccessPolicyCommand"; import { DeleteCollectionCommandInput, DeleteCollectionCommandOutput } from "./commands/DeleteCollectionCommand"; +import { + DeleteLifecyclePolicyCommandInput, + DeleteLifecyclePolicyCommandOutput, +} from "./commands/DeleteLifecyclePolicyCommand"; import { DeleteSecurityConfigCommandInput, DeleteSecurityConfigCommandOutput, @@ -84,6 +100,10 @@ import { GetSecurityConfigCommandInput, GetSecurityConfigCommandOutput } from ". import { GetSecurityPolicyCommandInput, GetSecurityPolicyCommandOutput } from "./commands/GetSecurityPolicyCommand"; import { ListAccessPoliciesCommandInput, ListAccessPoliciesCommandOutput } from "./commands/ListAccessPoliciesCommand"; import { ListCollectionsCommandInput, ListCollectionsCommandOutput } from "./commands/ListCollectionsCommand"; +import { + ListLifecyclePoliciesCommandInput, + ListLifecyclePoliciesCommandOutput, +} from "./commands/ListLifecyclePoliciesCommand"; import { ListSecurityConfigsCommandInput, ListSecurityConfigsCommandOutput, @@ -105,6 +125,10 @@ import { UpdateAccountSettingsCommandOutput, } from "./commands/UpdateAccountSettingsCommand"; import { UpdateCollectionCommandInput, UpdateCollectionCommandOutput } from "./commands/UpdateCollectionCommand"; +import { + UpdateLifecyclePolicyCommandInput, + UpdateLifecyclePolicyCommandOutput, +} from "./commands/UpdateLifecyclePolicyCommand"; import { UpdateSecurityConfigCommandInput, UpdateSecurityConfigCommandOutput, @@ -130,14 +154,18 @@ export { __Client }; */ export type ServiceInputTypes = | BatchGetCollectionCommandInput + | BatchGetEffectiveLifecyclePolicyCommandInput + | BatchGetLifecyclePolicyCommandInput | BatchGetVpcEndpointCommandInput | CreateAccessPolicyCommandInput | CreateCollectionCommandInput + | CreateLifecyclePolicyCommandInput | CreateSecurityConfigCommandInput | CreateSecurityPolicyCommandInput | CreateVpcEndpointCommandInput | DeleteAccessPolicyCommandInput | DeleteCollectionCommandInput + | DeleteLifecyclePolicyCommandInput | DeleteSecurityConfigCommandInput | DeleteSecurityPolicyCommandInput | DeleteVpcEndpointCommandInput @@ -148,6 +176,7 @@ export type ServiceInputTypes = | GetSecurityPolicyCommandInput | ListAccessPoliciesCommandInput | ListCollectionsCommandInput + | ListLifecyclePoliciesCommandInput | ListSecurityConfigsCommandInput | ListSecurityPoliciesCommandInput | ListTagsForResourceCommandInput @@ -157,6 +186,7 @@ export type ServiceInputTypes = | UpdateAccessPolicyCommandInput | UpdateAccountSettingsCommandInput | UpdateCollectionCommandInput + | UpdateLifecyclePolicyCommandInput | UpdateSecurityConfigCommandInput | UpdateSecurityPolicyCommandInput | UpdateVpcEndpointCommandInput; @@ -166,14 +196,18 @@ export type ServiceInputTypes = */ export type ServiceOutputTypes = | BatchGetCollectionCommandOutput + | BatchGetEffectiveLifecyclePolicyCommandOutput + | BatchGetLifecyclePolicyCommandOutput | BatchGetVpcEndpointCommandOutput | CreateAccessPolicyCommandOutput | CreateCollectionCommandOutput + | CreateLifecyclePolicyCommandOutput | CreateSecurityConfigCommandOutput | CreateSecurityPolicyCommandOutput | CreateVpcEndpointCommandOutput | DeleteAccessPolicyCommandOutput | DeleteCollectionCommandOutput + | DeleteLifecyclePolicyCommandOutput | DeleteSecurityConfigCommandOutput | DeleteSecurityPolicyCommandOutput | DeleteVpcEndpointCommandOutput @@ -184,6 +218,7 @@ export type ServiceOutputTypes = | GetSecurityPolicyCommandOutput | ListAccessPoliciesCommandOutput | ListCollectionsCommandOutput + | ListLifecyclePoliciesCommandOutput | ListSecurityConfigsCommandOutput | ListSecurityPoliciesCommandOutput | ListTagsForResourceCommandOutput @@ -193,6 +228,7 @@ export type ServiceOutputTypes = | UpdateAccessPolicyCommandOutput | UpdateAccountSettingsCommandOutput | UpdateCollectionCommandOutput + | UpdateLifecyclePolicyCommandOutput | UpdateSecurityConfigCommandOutput | UpdateSecurityPolicyCommandOutput | UpdateVpcEndpointCommandOutput; diff --git a/clients/client-opensearchserverless/src/commands/BatchGetEffectiveLifecyclePolicyCommand.ts b/clients/client-opensearchserverless/src/commands/BatchGetEffectiveLifecyclePolicyCommand.ts new file mode 100644 index 000000000000..902baadbf8df --- /dev/null +++ b/clients/client-opensearchserverless/src/commands/BatchGetEffectiveLifecyclePolicyCommand.ts @@ -0,0 +1,191 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BatchGetEffectiveLifecyclePolicyRequest, BatchGetEffectiveLifecyclePolicyResponse } from "../models/models_0"; +import { + OpenSearchServerlessClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../OpenSearchServerlessClient"; +import { + de_BatchGetEffectiveLifecyclePolicyCommand, + se_BatchGetEffectiveLifecyclePolicyCommand, +} from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link BatchGetEffectiveLifecyclePolicyCommand}. + */ +export interface BatchGetEffectiveLifecyclePolicyCommandInput extends BatchGetEffectiveLifecyclePolicyRequest {} +/** + * @public + * + * The output of {@link BatchGetEffectiveLifecyclePolicyCommand}. + */ +export interface BatchGetEffectiveLifecyclePolicyCommandOutput + extends BatchGetEffectiveLifecyclePolicyResponse, + __MetadataBearer {} + +/** + * @public + *

Returns a list of successful and failed retrievals for the OpenSearch Serverless indexes. For more information, see Viewing data lifecycle policies.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { OpenSearchServerlessClient, BatchGetEffectiveLifecyclePolicyCommand } from "@aws-sdk/client-opensearchserverless"; // ES Modules import + * // const { OpenSearchServerlessClient, BatchGetEffectiveLifecyclePolicyCommand } = require("@aws-sdk/client-opensearchserverless"); // CommonJS import + * const client = new OpenSearchServerlessClient(config); + * const input = { // BatchGetEffectiveLifecyclePolicyRequest + * resourceIdentifiers: [ // LifecyclePolicyResourceIdentifiers // required + * { // LifecyclePolicyResourceIdentifier + * type: "STRING_VALUE", // required + * resource: "STRING_VALUE", // required + * }, + * ], + * }; + * const command = new BatchGetEffectiveLifecyclePolicyCommand(input); + * const response = await client.send(command); + * // { // BatchGetEffectiveLifecyclePolicyResponse + * // effectiveLifecyclePolicyDetails: [ // EffectiveLifecyclePolicyDetails + * // { // EffectiveLifecyclePolicyDetail + * // type: "STRING_VALUE", + * // resource: "STRING_VALUE", + * // policyName: "STRING_VALUE", + * // resourceType: "STRING_VALUE", + * // retentionPeriod: "STRING_VALUE", + * // noMinRetentionPeriod: true || false, + * // }, + * // ], + * // effectiveLifecyclePolicyErrorDetails: [ // EffectiveLifecyclePolicyErrorDetails + * // { // EffectiveLifecyclePolicyErrorDetail + * // type: "STRING_VALUE", + * // resource: "STRING_VALUE", + * // errorMessage: "STRING_VALUE", + * // errorCode: "STRING_VALUE", + * // }, + * // ], + * // }; + * + * ``` + * + * @param BatchGetEffectiveLifecyclePolicyCommandInput - {@link BatchGetEffectiveLifecyclePolicyCommandInput} + * @returns {@link BatchGetEffectiveLifecyclePolicyCommandOutput} + * @see {@link BatchGetEffectiveLifecyclePolicyCommandInput} for command's `input` shape. + * @see {@link BatchGetEffectiveLifecyclePolicyCommandOutput} for command's `response` shape. + * @see {@link OpenSearchServerlessClientResolvedConfig | config} for OpenSearchServerlessClient's `config` shape. + * + * @throws {@link InternalServerException} (server fault) + *

Thrown when an error internal to the service occurs while processing a request.

+ * + * @throws {@link ValidationException} (client fault) + *

Thrown when the HTTP request contains invalid input or is missing required + * input.

+ * + * @throws {@link OpenSearchServerlessServiceException} + *

Base exception class for all service exceptions from OpenSearchServerless service.

+ * + */ +export class BatchGetEffectiveLifecyclePolicyCommand extends $Command< + BatchGetEffectiveLifecyclePolicyCommandInput, + BatchGetEffectiveLifecyclePolicyCommandOutput, + OpenSearchServerlessClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: BatchGetEffectiveLifecyclePolicyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: OpenSearchServerlessClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, BatchGetEffectiveLifecyclePolicyCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "OpenSearchServerlessClient"; + const commandName = "BatchGetEffectiveLifecyclePolicyCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "OpenSearchServerless", + operation: "BatchGetEffectiveLifecyclePolicy", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize( + input: BatchGetEffectiveLifecyclePolicyCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return se_BatchGetEffectiveLifecyclePolicyCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_BatchGetEffectiveLifecyclePolicyCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-opensearchserverless/src/commands/BatchGetLifecyclePolicyCommand.ts b/clients/client-opensearchserverless/src/commands/BatchGetLifecyclePolicyCommand.ts new file mode 100644 index 000000000000..af90be2e142e --- /dev/null +++ b/clients/client-opensearchserverless/src/commands/BatchGetLifecyclePolicyCommand.ts @@ -0,0 +1,181 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BatchGetLifecyclePolicyRequest, BatchGetLifecyclePolicyResponse } from "../models/models_0"; +import { + OpenSearchServerlessClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../OpenSearchServerlessClient"; +import { de_BatchGetLifecyclePolicyCommand, se_BatchGetLifecyclePolicyCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link BatchGetLifecyclePolicyCommand}. + */ +export interface BatchGetLifecyclePolicyCommandInput extends BatchGetLifecyclePolicyRequest {} +/** + * @public + * + * The output of {@link BatchGetLifecyclePolicyCommand}. + */ +export interface BatchGetLifecyclePolicyCommandOutput extends BatchGetLifecyclePolicyResponse, __MetadataBearer {} + +/** + * @public + *

Returns one or more configured OpenSearch Serverless lifecycle policies. For more information, see Viewing data lifecycle policies.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { OpenSearchServerlessClient, BatchGetLifecyclePolicyCommand } from "@aws-sdk/client-opensearchserverless"; // ES Modules import + * // const { OpenSearchServerlessClient, BatchGetLifecyclePolicyCommand } = require("@aws-sdk/client-opensearchserverless"); // CommonJS import + * const client = new OpenSearchServerlessClient(config); + * const input = { // BatchGetLifecyclePolicyRequest + * identifiers: [ // LifecyclePolicyIdentifiers // required + * { // LifecyclePolicyIdentifier + * type: "STRING_VALUE", // required + * name: "STRING_VALUE", // required + * }, + * ], + * }; + * const command = new BatchGetLifecyclePolicyCommand(input); + * const response = await client.send(command); + * // { // BatchGetLifecyclePolicyResponse + * // lifecyclePolicyDetails: [ // LifecyclePolicyDetails + * // { // LifecyclePolicyDetail + * // type: "STRING_VALUE", + * // name: "STRING_VALUE", + * // policyVersion: "STRING_VALUE", + * // description: "STRING_VALUE", + * // policy: "DOCUMENT_VALUE", + * // createdDate: Number("long"), + * // lastModifiedDate: Number("long"), + * // }, + * // ], + * // lifecyclePolicyErrorDetails: [ // LifecyclePolicyErrorDetails + * // { // LifecyclePolicyErrorDetail + * // type: "STRING_VALUE", + * // name: "STRING_VALUE", + * // errorMessage: "STRING_VALUE", + * // errorCode: "STRING_VALUE", + * // }, + * // ], + * // }; + * + * ``` + * + * @param BatchGetLifecyclePolicyCommandInput - {@link BatchGetLifecyclePolicyCommandInput} + * @returns {@link BatchGetLifecyclePolicyCommandOutput} + * @see {@link BatchGetLifecyclePolicyCommandInput} for command's `input` shape. + * @see {@link BatchGetLifecyclePolicyCommandOutput} for command's `response` shape. + * @see {@link OpenSearchServerlessClientResolvedConfig | config} for OpenSearchServerlessClient's `config` shape. + * + * @throws {@link InternalServerException} (server fault) + *

Thrown when an error internal to the service occurs while processing a request.

+ * + * @throws {@link ValidationException} (client fault) + *

Thrown when the HTTP request contains invalid input or is missing required + * input.

+ * + * @throws {@link OpenSearchServerlessServiceException} + *

Base exception class for all service exceptions from OpenSearchServerless service.

+ * + */ +export class BatchGetLifecyclePolicyCommand extends $Command< + BatchGetLifecyclePolicyCommandInput, + BatchGetLifecyclePolicyCommandOutput, + OpenSearchServerlessClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: BatchGetLifecyclePolicyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: OpenSearchServerlessClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, BatchGetLifecyclePolicyCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "OpenSearchServerlessClient"; + const commandName = "BatchGetLifecyclePolicyCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "OpenSearchServerless", + operation: "BatchGetLifecyclePolicy", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: BatchGetLifecyclePolicyCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_BatchGetLifecyclePolicyCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_BatchGetLifecyclePolicyCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-opensearchserverless/src/commands/CreateLifecyclePolicyCommand.ts b/clients/client-opensearchserverless/src/commands/CreateLifecyclePolicyCommand.ts new file mode 100644 index 000000000000..d706facb55fb --- /dev/null +++ b/clients/client-opensearchserverless/src/commands/CreateLifecyclePolicyCommand.ts @@ -0,0 +1,179 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { CreateLifecyclePolicyRequest, CreateLifecyclePolicyResponse } from "../models/models_0"; +import { + OpenSearchServerlessClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../OpenSearchServerlessClient"; +import { de_CreateLifecyclePolicyCommand, se_CreateLifecyclePolicyCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link CreateLifecyclePolicyCommand}. + */ +export interface CreateLifecyclePolicyCommandInput extends CreateLifecyclePolicyRequest {} +/** + * @public + * + * The output of {@link CreateLifecyclePolicyCommand}. + */ +export interface CreateLifecyclePolicyCommandOutput extends CreateLifecyclePolicyResponse, __MetadataBearer {} + +/** + * @public + *

Creates a lifecyle policy to be applied to OpenSearch Serverless indexes. Lifecycle policies define + * the number of days or hours to retain the data on an OpenSearch Serverless index. For more information, see Creating data lifecycle policies.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { OpenSearchServerlessClient, CreateLifecyclePolicyCommand } from "@aws-sdk/client-opensearchserverless"; // ES Modules import + * // const { OpenSearchServerlessClient, CreateLifecyclePolicyCommand } = require("@aws-sdk/client-opensearchserverless"); // CommonJS import + * const client = new OpenSearchServerlessClient(config); + * const input = { // CreateLifecyclePolicyRequest + * type: "STRING_VALUE", // required + * name: "STRING_VALUE", // required + * description: "STRING_VALUE", + * policy: "STRING_VALUE", // required + * clientToken: "STRING_VALUE", + * }; + * const command = new CreateLifecyclePolicyCommand(input); + * const response = await client.send(command); + * // { // CreateLifecyclePolicyResponse + * // lifecyclePolicyDetail: { // LifecyclePolicyDetail + * // type: "STRING_VALUE", + * // name: "STRING_VALUE", + * // policyVersion: "STRING_VALUE", + * // description: "STRING_VALUE", + * // policy: "DOCUMENT_VALUE", + * // createdDate: Number("long"), + * // lastModifiedDate: Number("long"), + * // }, + * // }; + * + * ``` + * + * @param CreateLifecyclePolicyCommandInput - {@link CreateLifecyclePolicyCommandInput} + * @returns {@link CreateLifecyclePolicyCommandOutput} + * @see {@link CreateLifecyclePolicyCommandInput} for command's `input` shape. + * @see {@link CreateLifecyclePolicyCommandOutput} for command's `response` shape. + * @see {@link OpenSearchServerlessClientResolvedConfig | config} for OpenSearchServerlessClient's `config` shape. + * + * @throws {@link ConflictException} (client fault) + *

When creating a resource, thrown when a resource with the same name already exists + * or is being created. When deleting a resource, thrown when the resource is not in + * the ACTIVE or FAILED state.

+ * + * @throws {@link InternalServerException} (server fault) + *

Thrown when an error internal to the service occurs while processing a request.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

Thrown when you attempt to create more resources than the service allows based on service quotas.

+ * + * @throws {@link ValidationException} (client fault) + *

Thrown when the HTTP request contains invalid input or is missing required + * input.

+ * + * @throws {@link OpenSearchServerlessServiceException} + *

Base exception class for all service exceptions from OpenSearchServerless service.

+ * + */ +export class CreateLifecyclePolicyCommand extends $Command< + CreateLifecyclePolicyCommandInput, + CreateLifecyclePolicyCommandOutput, + OpenSearchServerlessClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: CreateLifecyclePolicyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: OpenSearchServerlessClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, CreateLifecyclePolicyCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "OpenSearchServerlessClient"; + const commandName = "CreateLifecyclePolicyCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "OpenSearchServerless", + operation: "CreateLifecyclePolicy", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: CreateLifecyclePolicyCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_CreateLifecyclePolicyCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_CreateLifecyclePolicyCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-opensearchserverless/src/commands/DeleteLifecyclePolicyCommand.ts b/clients/client-opensearchserverless/src/commands/DeleteLifecyclePolicyCommand.ts new file mode 100644 index 000000000000..5d17dad2ff79 --- /dev/null +++ b/clients/client-opensearchserverless/src/commands/DeleteLifecyclePolicyCommand.ts @@ -0,0 +1,166 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { DeleteLifecyclePolicyRequest, DeleteLifecyclePolicyResponse } from "../models/models_0"; +import { + OpenSearchServerlessClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../OpenSearchServerlessClient"; +import { de_DeleteLifecyclePolicyCommand, se_DeleteLifecyclePolicyCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteLifecyclePolicyCommand}. + */ +export interface DeleteLifecyclePolicyCommandInput extends DeleteLifecyclePolicyRequest {} +/** + * @public + * + * The output of {@link DeleteLifecyclePolicyCommand}. + */ +export interface DeleteLifecyclePolicyCommandOutput extends DeleteLifecyclePolicyResponse, __MetadataBearer {} + +/** + * @public + *

Deletes an OpenSearch Serverless lifecycle policy. For more information, see Deleting data lifecycle policies.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { OpenSearchServerlessClient, DeleteLifecyclePolicyCommand } from "@aws-sdk/client-opensearchserverless"; // ES Modules import + * // const { OpenSearchServerlessClient, DeleteLifecyclePolicyCommand } = require("@aws-sdk/client-opensearchserverless"); // CommonJS import + * const client = new OpenSearchServerlessClient(config); + * const input = { // DeleteLifecyclePolicyRequest + * type: "STRING_VALUE", // required + * name: "STRING_VALUE", // required + * clientToken: "STRING_VALUE", + * }; + * const command = new DeleteLifecyclePolicyCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DeleteLifecyclePolicyCommandInput - {@link DeleteLifecyclePolicyCommandInput} + * @returns {@link DeleteLifecyclePolicyCommandOutput} + * @see {@link DeleteLifecyclePolicyCommandInput} for command's `input` shape. + * @see {@link DeleteLifecyclePolicyCommandOutput} for command's `response` shape. + * @see {@link OpenSearchServerlessClientResolvedConfig | config} for OpenSearchServerlessClient's `config` shape. + * + * @throws {@link ConflictException} (client fault) + *

When creating a resource, thrown when a resource with the same name already exists + * or is being created. When deleting a resource, thrown when the resource is not in + * the ACTIVE or FAILED state.

+ * + * @throws {@link InternalServerException} (server fault) + *

Thrown when an error internal to the service occurs while processing a request.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

Thrown when accessing or deleting a resource that does not exist.

+ * + * @throws {@link ValidationException} (client fault) + *

Thrown when the HTTP request contains invalid input or is missing required + * input.

+ * + * @throws {@link OpenSearchServerlessServiceException} + *

Base exception class for all service exceptions from OpenSearchServerless service.

+ * + */ +export class DeleteLifecyclePolicyCommand extends $Command< + DeleteLifecyclePolicyCommandInput, + DeleteLifecyclePolicyCommandOutput, + OpenSearchServerlessClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: DeleteLifecyclePolicyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: OpenSearchServerlessClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, DeleteLifecyclePolicyCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "OpenSearchServerlessClient"; + const commandName = "DeleteLifecyclePolicyCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "OpenSearchServerless", + operation: "DeleteLifecyclePolicy", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: DeleteLifecyclePolicyCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DeleteLifecyclePolicyCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_DeleteLifecyclePolicyCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-opensearchserverless/src/commands/GetPoliciesStatsCommand.ts b/clients/client-opensearchserverless/src/commands/GetPoliciesStatsCommand.ts index a800f3d54b72..c4e1fc962ad4 100644 --- a/clients/client-opensearchserverless/src/commands/GetPoliciesStatsCommand.ts +++ b/clients/client-opensearchserverless/src/commands/GetPoliciesStatsCommand.ts @@ -63,6 +63,9 @@ export interface GetPoliciesStatsCommandOutput extends GetPoliciesStatsResponse, * // SecurityConfigStats: { // SecurityConfigStats * // SamlConfigCount: Number("long"), * // }, + * // LifecyclePolicyStats: { // LifecyclePolicyStats + * // RetentionPolicyCount: Number("long"), + * // }, * // TotalPolicyCount: Number("long"), * // }; * diff --git a/clients/client-opensearchserverless/src/commands/ListLifecyclePoliciesCommand.ts b/clients/client-opensearchserverless/src/commands/ListLifecyclePoliciesCommand.ts new file mode 100644 index 000000000000..9a0cbc9c086a --- /dev/null +++ b/clients/client-opensearchserverless/src/commands/ListLifecyclePoliciesCommand.ts @@ -0,0 +1,173 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { ListLifecyclePoliciesRequest, ListLifecyclePoliciesResponse } from "../models/models_0"; +import { + OpenSearchServerlessClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../OpenSearchServerlessClient"; +import { de_ListLifecyclePoliciesCommand, se_ListLifecyclePoliciesCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListLifecyclePoliciesCommand}. + */ +export interface ListLifecyclePoliciesCommandInput extends ListLifecyclePoliciesRequest {} +/** + * @public + * + * The output of {@link ListLifecyclePoliciesCommand}. + */ +export interface ListLifecyclePoliciesCommandOutput extends ListLifecyclePoliciesResponse, __MetadataBearer {} + +/** + * @public + *

Returns a list of OpenSearch Serverless lifecycle policies. For more information, see Viewing data lifecycle policies.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { OpenSearchServerlessClient, ListLifecyclePoliciesCommand } from "@aws-sdk/client-opensearchserverless"; // ES Modules import + * // const { OpenSearchServerlessClient, ListLifecyclePoliciesCommand } = require("@aws-sdk/client-opensearchserverless"); // CommonJS import + * const client = new OpenSearchServerlessClient(config); + * const input = { // ListLifecyclePoliciesRequest + * type: "STRING_VALUE", // required + * resources: [ // LifecycleResourceFilter + * "STRING_VALUE", + * ], + * nextToken: "STRING_VALUE", + * maxResults: Number("int"), + * }; + * const command = new ListLifecyclePoliciesCommand(input); + * const response = await client.send(command); + * // { // ListLifecyclePoliciesResponse + * // lifecyclePolicySummaries: [ // LifecyclePolicySummaries + * // { // LifecyclePolicySummary + * // type: "STRING_VALUE", + * // name: "STRING_VALUE", + * // policyVersion: "STRING_VALUE", + * // description: "STRING_VALUE", + * // createdDate: Number("long"), + * // lastModifiedDate: Number("long"), + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListLifecyclePoliciesCommandInput - {@link ListLifecyclePoliciesCommandInput} + * @returns {@link ListLifecyclePoliciesCommandOutput} + * @see {@link ListLifecyclePoliciesCommandInput} for command's `input` shape. + * @see {@link ListLifecyclePoliciesCommandOutput} for command's `response` shape. + * @see {@link OpenSearchServerlessClientResolvedConfig | config} for OpenSearchServerlessClient's `config` shape. + * + * @throws {@link InternalServerException} (server fault) + *

Thrown when an error internal to the service occurs while processing a request.

+ * + * @throws {@link ValidationException} (client fault) + *

Thrown when the HTTP request contains invalid input or is missing required + * input.

+ * + * @throws {@link OpenSearchServerlessServiceException} + *

Base exception class for all service exceptions from OpenSearchServerless service.

+ * + */ +export class ListLifecyclePoliciesCommand extends $Command< + ListLifecyclePoliciesCommandInput, + ListLifecyclePoliciesCommandOutput, + OpenSearchServerlessClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListLifecyclePoliciesCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: OpenSearchServerlessClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListLifecyclePoliciesCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "OpenSearchServerlessClient"; + const commandName = "ListLifecyclePoliciesCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "OpenSearchServerless", + operation: "ListLifecyclePolicies", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListLifecyclePoliciesCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListLifecyclePoliciesCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListLifecyclePoliciesCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-opensearchserverless/src/commands/UpdateLifecyclePolicyCommand.ts b/clients/client-opensearchserverless/src/commands/UpdateLifecyclePolicyCommand.ts new file mode 100644 index 000000000000..dc238bf6a0e2 --- /dev/null +++ b/clients/client-opensearchserverless/src/commands/UpdateLifecyclePolicyCommand.ts @@ -0,0 +1,182 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { UpdateLifecyclePolicyRequest, UpdateLifecyclePolicyResponse } from "../models/models_0"; +import { + OpenSearchServerlessClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../OpenSearchServerlessClient"; +import { de_UpdateLifecyclePolicyCommand, se_UpdateLifecyclePolicyCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UpdateLifecyclePolicyCommand}. + */ +export interface UpdateLifecyclePolicyCommandInput extends UpdateLifecyclePolicyRequest {} +/** + * @public + * + * The output of {@link UpdateLifecyclePolicyCommand}. + */ +export interface UpdateLifecyclePolicyCommandOutput extends UpdateLifecyclePolicyResponse, __MetadataBearer {} + +/** + * @public + *

Updates an OpenSearch Serverless access policy. For more information, see Updating data lifecycle policies.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { OpenSearchServerlessClient, UpdateLifecyclePolicyCommand } from "@aws-sdk/client-opensearchserverless"; // ES Modules import + * // const { OpenSearchServerlessClient, UpdateLifecyclePolicyCommand } = require("@aws-sdk/client-opensearchserverless"); // CommonJS import + * const client = new OpenSearchServerlessClient(config); + * const input = { // UpdateLifecyclePolicyRequest + * type: "STRING_VALUE", // required + * name: "STRING_VALUE", // required + * policyVersion: "STRING_VALUE", // required + * description: "STRING_VALUE", + * policy: "STRING_VALUE", + * clientToken: "STRING_VALUE", + * }; + * const command = new UpdateLifecyclePolicyCommand(input); + * const response = await client.send(command); + * // { // UpdateLifecyclePolicyResponse + * // lifecyclePolicyDetail: { // LifecyclePolicyDetail + * // type: "STRING_VALUE", + * // name: "STRING_VALUE", + * // policyVersion: "STRING_VALUE", + * // description: "STRING_VALUE", + * // policy: "DOCUMENT_VALUE", + * // createdDate: Number("long"), + * // lastModifiedDate: Number("long"), + * // }, + * // }; + * + * ``` + * + * @param UpdateLifecyclePolicyCommandInput - {@link UpdateLifecyclePolicyCommandInput} + * @returns {@link UpdateLifecyclePolicyCommandOutput} + * @see {@link UpdateLifecyclePolicyCommandInput} for command's `input` shape. + * @see {@link UpdateLifecyclePolicyCommandOutput} for command's `response` shape. + * @see {@link OpenSearchServerlessClientResolvedConfig | config} for OpenSearchServerlessClient's `config` shape. + * + * @throws {@link ConflictException} (client fault) + *

When creating a resource, thrown when a resource with the same name already exists + * or is being created. When deleting a resource, thrown when the resource is not in + * the ACTIVE or FAILED state.

+ * + * @throws {@link InternalServerException} (server fault) + *

Thrown when an error internal to the service occurs while processing a request.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

Thrown when accessing or deleting a resource that does not exist.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

Thrown when you attempt to create more resources than the service allows based on service quotas.

+ * + * @throws {@link ValidationException} (client fault) + *

Thrown when the HTTP request contains invalid input or is missing required + * input.

+ * + * @throws {@link OpenSearchServerlessServiceException} + *

Base exception class for all service exceptions from OpenSearchServerless service.

+ * + */ +export class UpdateLifecyclePolicyCommand extends $Command< + UpdateLifecyclePolicyCommandInput, + UpdateLifecyclePolicyCommandOutput, + OpenSearchServerlessClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateLifecyclePolicyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: OpenSearchServerlessClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, UpdateLifecyclePolicyCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "OpenSearchServerlessClient"; + const commandName = "UpdateLifecyclePolicyCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "OpenSearchServerless", + operation: "UpdateLifecyclePolicy", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UpdateLifecyclePolicyCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UpdateLifecyclePolicyCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_UpdateLifecyclePolicyCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-opensearchserverless/src/commands/index.ts b/clients/client-opensearchserverless/src/commands/index.ts index 5dda98c2aeb4..a2cfd6bb34cc 100644 --- a/clients/client-opensearchserverless/src/commands/index.ts +++ b/clients/client-opensearchserverless/src/commands/index.ts @@ -1,13 +1,17 @@ // smithy-typescript generated code export * from "./BatchGetCollectionCommand"; +export * from "./BatchGetEffectiveLifecyclePolicyCommand"; +export * from "./BatchGetLifecyclePolicyCommand"; export * from "./BatchGetVpcEndpointCommand"; export * from "./CreateAccessPolicyCommand"; export * from "./CreateCollectionCommand"; +export * from "./CreateLifecyclePolicyCommand"; export * from "./CreateSecurityConfigCommand"; export * from "./CreateSecurityPolicyCommand"; export * from "./CreateVpcEndpointCommand"; export * from "./DeleteAccessPolicyCommand"; export * from "./DeleteCollectionCommand"; +export * from "./DeleteLifecyclePolicyCommand"; export * from "./DeleteSecurityConfigCommand"; export * from "./DeleteSecurityPolicyCommand"; export * from "./DeleteVpcEndpointCommand"; @@ -18,6 +22,7 @@ export * from "./GetSecurityConfigCommand"; export * from "./GetSecurityPolicyCommand"; export * from "./ListAccessPoliciesCommand"; export * from "./ListCollectionsCommand"; +export * from "./ListLifecyclePoliciesCommand"; export * from "./ListSecurityConfigsCommand"; export * from "./ListSecurityPoliciesCommand"; export * from "./ListTagsForResourceCommand"; @@ -27,6 +32,7 @@ export * from "./UntagResourceCommand"; export * from "./UpdateAccessPolicyCommand"; export * from "./UpdateAccountSettingsCommand"; export * from "./UpdateCollectionCommand"; +export * from "./UpdateLifecyclePolicyCommand"; export * from "./UpdateSecurityConfigCommand"; export * from "./UpdateSecurityPolicyCommand"; export * from "./UpdateVpcEndpointCommand"; diff --git a/clients/client-opensearchserverless/src/models/models_0.ts b/clients/client-opensearchserverless/src/models/models_0.ts index 0303bcca275b..0967549382f3 100644 --- a/clients/client-opensearchserverless/src/models/models_0.ts +++ b/clients/client-opensearchserverless/src/models/models_0.ts @@ -280,7 +280,7 @@ export class ResourceNotFoundException extends __BaseException { export interface GetAccessPolicyRequest { /** * @public - *

Tye type of policy. Currently the only supported value is data.

+ *

Tye type of policy. Currently, the only supported value is data.

*/ type: AccessPolicyType | undefined; @@ -342,7 +342,7 @@ export interface ListAccessPoliciesRequest { export interface AccessPolicySummary { /** * @public - *

The type of access policy. Currently the only available type is data.

+ *

The type of access policy. Currently, the only available type is data.

*/ type?: AccessPolicyType; @@ -692,6 +692,281 @@ export interface BatchGetCollectionResponse { collectionErrorDetails?: CollectionErrorDetail[]; } +/** + * @public + * @enum + */ +export const LifecyclePolicyType = { + /** + * retention policy type + */ + retention: "retention", +} as const; + +/** + * @public + */ +export type LifecyclePolicyType = (typeof LifecyclePolicyType)[keyof typeof LifecyclePolicyType]; + +/** + * @public + *

The unique identifiers of policy types and resource names.

+ */ +export interface LifecyclePolicyResourceIdentifier { + /** + * @public + *

The type of lifecycle policy.

+ */ + type: LifecyclePolicyType | undefined; + + /** + * @public + *

The name of the OpenSearch Serverless ilndex resource.

+ */ + resource: string | undefined; +} + +/** + * @public + */ +export interface BatchGetEffectiveLifecyclePolicyRequest { + /** + * @public + *

The unique identifiers of policy types and resource names.

+ */ + resourceIdentifiers: LifecyclePolicyResourceIdentifier[] | undefined; +} + +/** + * @public + * @enum + */ +export const ResourceType = { + /** + * index resource type + */ + index: "index", +} as const; + +/** + * @public + */ +export type ResourceType = (typeof ResourceType)[keyof typeof ResourceType]; + +/** + * @public + *

Error information for an OpenSearch Serverless request.

+ */ +export interface EffectiveLifecyclePolicyDetail { + /** + * @public + *

The type of lifecycle policy.

+ */ + type?: LifecyclePolicyType; + + /** + * @public + *

The name of the OpenSearch Serverless index resource.

+ */ + resource?: string; + + /** + * @public + *

The name of the lifecycle policy.

+ */ + policyName?: string; + + /** + * @public + *

The type of OpenSearch Serverless resource. Currently, the only supported resource is index.

+ */ + resourceType?: ResourceType; + + /** + * @public + *

The minimum number of index retention in days or hours. This is an optional parameter that will return only if it’s set.

+ */ + retentionPeriod?: string; + + /** + * @public + *

The minimum number of index retention days set. That is an optional param that will return as true if the minimum number of days or + * hours is not set to a index resource.

+ */ + noMinRetentionPeriod?: boolean; +} + +/** + * @public + *

Error information for an OpenSearch Serverless request.

+ */ +export interface EffectiveLifecyclePolicyErrorDetail { + /** + * @public + *

The type of lifecycle policy.

+ */ + type?: LifecyclePolicyType; + + /** + * @public + *

The name of OpenSearch Serverless index resource.

+ */ + resource?: string; + + /** + * @public + *

A description of the error. For example, The specified Index resource is not found.

+ */ + errorMessage?: string; + + /** + * @public + *

The error code for the request.

+ */ + errorCode?: string; +} + +/** + * @public + */ +export interface BatchGetEffectiveLifecyclePolicyResponse { + /** + * @public + *

A list of lifecycle policies applied to the OpenSearch Serverless indexes.

+ */ + effectiveLifecyclePolicyDetails?: EffectiveLifecyclePolicyDetail[]; + + /** + * @public + *

A list of resources for which retrieval failed.

+ */ + effectiveLifecyclePolicyErrorDetails?: EffectiveLifecyclePolicyErrorDetail[]; +} + +/** + * @public + *

The unique identifiers of policy types and policy names.

+ */ +export interface LifecyclePolicyIdentifier { + /** + * @public + *

The type of lifecycle policy.

+ */ + type: LifecyclePolicyType | undefined; + + /** + * @public + *

The name of the lifecycle policy.

+ */ + name: string | undefined; +} + +/** + * @public + */ +export interface BatchGetLifecyclePolicyRequest { + /** + * @public + *

The unique identifiers of policy types and policy names.

+ */ + identifiers: LifecyclePolicyIdentifier[] | undefined; +} + +/** + * @public + *

Details about an OpenSearch Serverless lifecycle policy.

+ */ +export interface LifecyclePolicyDetail { + /** + * @public + *

The type of lifecycle policy.

+ */ + type?: LifecyclePolicyType; + + /** + * @public + *

The name of the lifecycle policy.

+ */ + name?: string; + + /** + * @public + *

The version of the lifecycle policy.

+ */ + policyVersion?: string; + + /** + * @public + *

The description of the lifecycle policy.

+ */ + description?: string; + + /** + * @public + *

The JSON policy document without any whitespaces.

+ */ + policy?: __DocumentType; + + /** + * @public + *

The date the lifecycle policy was created.

+ */ + createdDate?: number; + + /** + * @public + *

The timestamp of when the lifecycle policy was last modified.

+ */ + lastModifiedDate?: number; +} + +/** + * @public + *

Error information for an OpenSearch Serverless request.

+ */ +export interface LifecyclePolicyErrorDetail { + /** + * @public + *

The type of lifecycle policy.

+ */ + type?: LifecyclePolicyType; + + /** + * @public + *

The name of the lifecycle policy.

+ */ + name?: string; + + /** + * @public + *

A description of the error. For example, The specified Lifecycle Policy is not found.

+ */ + errorMessage?: string; + + /** + * @public + *

The error code for the request. For example, NOT_FOUND.

+ */ + errorCode?: string; +} + +/** + * @public + */ +export interface BatchGetLifecyclePolicyResponse { + /** + * @public + *

A list of lifecycle policies matched to the input policy name and policy type.

+ */ + lifecyclePolicyDetails?: LifecyclePolicyDetail[]; + + /** + * @public + *

A list of lifecycle policy names and policy types for which retrieval failed.

+ */ + lifecyclePolicyErrorDetails?: LifecyclePolicyErrorDetail[]; +} + /** * @public */ @@ -1020,7 +1295,7 @@ export interface DeleteCollectionResponse { /** * @public - *

List of filter keys that you can use for LIST, UPDATE, and DELETE requests to OpenSearch Serverless + *

A list of filter keys that you can use for LIST, UPDATE, and DELETE requests to OpenSearch Serverless * collections.

*/ export interface CollectionFilters { @@ -1043,7 +1318,7 @@ export interface CollectionFilters { export interface ListCollectionsRequest { /** * @public - *

List of filter names and values that you can use for requests.

+ *

A list of filter names and values that you can use for requests.

*/ collectionFilters?: CollectionFilters; @@ -1200,6 +1475,52 @@ export interface UpdateCollectionResponse { updateCollectionDetail?: UpdateCollectionDetail; } +/** + * @public + */ +export interface CreateLifecyclePolicyRequest { + /** + * @public + *

The type of lifecycle policy.

+ */ + type: LifecyclePolicyType | undefined; + + /** + * @public + *

The name of the lifecycle policy.

+ */ + name: string | undefined; + + /** + * @public + *

A description of the lifecycle policy.

+ */ + description?: string; + + /** + * @public + *

The JSON policy document to use as the content for the lifecycle policy.

+ */ + policy: string | undefined; + + /** + * @public + *

A unique, case-sensitive identifier to ensure idempotency of the request.

+ */ + clientToken?: string; +} + +/** + * @public + */ +export interface CreateLifecyclePolicyResponse { + /** + * @public + *

Details about the created lifecycle policy.

+ */ + lifecyclePolicyDetail?: LifecyclePolicyDetail; +} + /** * @public *

Describes SAML options for an OpenSearch Serverless security configuration in the form of a key-value @@ -1529,6 +1850,34 @@ export interface CreateVpcEndpointResponse { createVpcEndpointDetail?: CreateVpcEndpointDetail; } +/** + * @public + */ +export interface DeleteLifecyclePolicyRequest { + /** + * @public + *

The type of lifecycle policy.

+ */ + type: LifecyclePolicyType | undefined; + + /** + * @public + *

The name of the policy to delete.

+ */ + name: string | undefined; + + /** + * @public + *

Unique, case-sensitive identifier to ensure idempotency of the request.

+ */ + clientToken?: string; +} + +/** + * @public + */ +export interface DeleteLifecyclePolicyResponse {} + /** * @public */ @@ -1654,6 +2003,18 @@ export interface GetAccountSettingsResponse { */ export interface GetPoliciesStatsRequest {} +/** + * @public + *

Statistics for an OpenSearch Serverless lifecycle policy.

+ */ +export interface LifecyclePolicyStats { + /** + * @public + *

The number of retention lifecycle policies in the current account.

+ */ + RetentionPolicyCount?: number; +} + /** * @public *

Statistics for an OpenSearch Serverless security configuration.

@@ -1706,6 +2067,12 @@ export interface GetPoliciesStatsResponse { */ SecurityConfigStats?: SecurityConfigStats; + /** + * @public + *

Information about the lifecycle policies in your account.

+ */ + LifecyclePolicyStats?: LifecyclePolicyStats; + /** * @public *

The total number of OpenSearch Serverless security policies and configurations in your @@ -1764,6 +2131,146 @@ export interface GetSecurityPolicyResponse { securityPolicyDetail?: SecurityPolicyDetail; } +/** + * @public + */ +export interface ListLifecyclePoliciesRequest { + /** + * @public + *

The type of lifecycle policy.

+ */ + type: LifecyclePolicyType | undefined; + + /** + * @public + *

Resource filters that policies can apply to. Currently, the only supported resource type is index.

+ */ + resources?: string[]; + + /** + * @public + *

If your initial ListLifecyclePolicies operation returns a nextToken, you can include the returned nextToken in subsequent ListLifecyclePolicies operations, which returns results in the next page.

+ */ + nextToken?: string; + + /** + * @public + *

An optional parameter that specifies the maximum number of results to return. You can use use nextToken to get the next page of results. The default is 10.

+ */ + maxResults?: number; +} + +/** + * @public + *

A summary of the lifecycle policy.

+ */ +export interface LifecyclePolicySummary { + /** + * @public + *

The type of lifecycle policy.

+ */ + type?: LifecyclePolicyType; + + /** + * @public + *

The name of the lifecycle policy.

+ */ + name?: string; + + /** + * @public + *

The version of the lifecycle policy.

+ */ + policyVersion?: string; + + /** + * @public + *

The description of the lifecycle policy.

+ */ + description?: string; + + /** + * @public + *

The Epoch time when the lifecycle policy was created.

+ */ + createdDate?: number; + + /** + * @public + *

The date and time when the lifecycle policy was last modified.

+ */ + lastModifiedDate?: number; +} + +/** + * @public + */ +export interface ListLifecyclePoliciesResponse { + /** + * @public + *

Details about the requested lifecycle policies.

+ */ + lifecyclePolicySummaries?: LifecyclePolicySummary[]; + + /** + * @public + *

When nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page.

+ */ + nextToken?: string; +} + +/** + * @public + */ +export interface UpdateLifecyclePolicyRequest { + /** + * @public + *

The type of lifecycle policy.

+ */ + type: LifecyclePolicyType | undefined; + + /** + * @public + *

The name of the policy.

+ */ + name: string | undefined; + + /** + * @public + *

The version of the policy being updated.

+ */ + policyVersion: string | undefined; + + /** + * @public + *

A description of the lifecycle policy.

+ */ + description?: string; + + /** + * @public + *

The JSON policy document to use as the content for the lifecycle policy.

+ */ + policy?: string; + + /** + * @public + *

A unique, case-sensitive identifier to ensure idempotency of the request.

+ */ + clientToken?: string; +} + +/** + * @public + */ +export interface UpdateLifecyclePolicyResponse { + /** + * @public + *

Details about the updated lifecycle policy.

+ */ + lifecyclePolicyDetail?: LifecyclePolicyDetail; +} + /** * @public */ diff --git a/clients/client-opensearchserverless/src/pagination/ListLifecyclePoliciesPaginator.ts b/clients/client-opensearchserverless/src/pagination/ListLifecyclePoliciesPaginator.ts new file mode 100644 index 000000000000..afbffbf69be7 --- /dev/null +++ b/clients/client-opensearchserverless/src/pagination/ListLifecyclePoliciesPaginator.ts @@ -0,0 +1,49 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { + ListLifecyclePoliciesCommand, + ListLifecyclePoliciesCommandInput, + ListLifecyclePoliciesCommandOutput, +} from "../commands/ListLifecyclePoliciesCommand"; +import { OpenSearchServerlessClient } from "../OpenSearchServerlessClient"; +import { OpenSearchServerlessPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: OpenSearchServerlessClient, + input: ListLifecyclePoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListLifecyclePoliciesCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListLifecyclePolicies( + config: OpenSearchServerlessPaginationConfiguration, + input: ListLifecyclePoliciesCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListLifecyclePoliciesCommandOutput; + while (hasNext) { + input.nextToken = token; + if (config.client instanceof OpenSearchServerlessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected OpenSearchServerless | OpenSearchServerlessClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-opensearchserverless/src/pagination/index.ts b/clients/client-opensearchserverless/src/pagination/index.ts index d03a51c4f41e..2fb9c4c64dd8 100644 --- a/clients/client-opensearchserverless/src/pagination/index.ts +++ b/clients/client-opensearchserverless/src/pagination/index.ts @@ -2,6 +2,7 @@ export * from "./Interfaces"; export * from "./ListAccessPoliciesPaginator"; export * from "./ListCollectionsPaginator"; +export * from "./ListLifecyclePoliciesPaginator"; export * from "./ListSecurityConfigsPaginator"; export * from "./ListSecurityPoliciesPaginator"; export * from "./ListVpcEndpointsPaginator"; diff --git a/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts b/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts index 963b39a1795f..2c0200c3717f 100644 --- a/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts +++ b/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts @@ -19,12 +19,24 @@ import { import { v4 as generateIdempotencyToken } from "uuid"; import { BatchGetCollectionCommandInput, BatchGetCollectionCommandOutput } from "../commands/BatchGetCollectionCommand"; +import { + BatchGetEffectiveLifecyclePolicyCommandInput, + BatchGetEffectiveLifecyclePolicyCommandOutput, +} from "../commands/BatchGetEffectiveLifecyclePolicyCommand"; +import { + BatchGetLifecyclePolicyCommandInput, + BatchGetLifecyclePolicyCommandOutput, +} from "../commands/BatchGetLifecyclePolicyCommand"; import { BatchGetVpcEndpointCommandInput, BatchGetVpcEndpointCommandOutput, } from "../commands/BatchGetVpcEndpointCommand"; import { CreateAccessPolicyCommandInput, CreateAccessPolicyCommandOutput } from "../commands/CreateAccessPolicyCommand"; import { CreateCollectionCommandInput, CreateCollectionCommandOutput } from "../commands/CreateCollectionCommand"; +import { + CreateLifecyclePolicyCommandInput, + CreateLifecyclePolicyCommandOutput, +} from "../commands/CreateLifecyclePolicyCommand"; import { CreateSecurityConfigCommandInput, CreateSecurityConfigCommandOutput, @@ -36,6 +48,10 @@ import { import { CreateVpcEndpointCommandInput, CreateVpcEndpointCommandOutput } from "../commands/CreateVpcEndpointCommand"; import { DeleteAccessPolicyCommandInput, DeleteAccessPolicyCommandOutput } from "../commands/DeleteAccessPolicyCommand"; import { DeleteCollectionCommandInput, DeleteCollectionCommandOutput } from "../commands/DeleteCollectionCommand"; +import { + DeleteLifecyclePolicyCommandInput, + DeleteLifecyclePolicyCommandOutput, +} from "../commands/DeleteLifecyclePolicyCommand"; import { DeleteSecurityConfigCommandInput, DeleteSecurityConfigCommandOutput, @@ -52,6 +68,10 @@ import { GetSecurityConfigCommandInput, GetSecurityConfigCommandOutput } from ". import { GetSecurityPolicyCommandInput, GetSecurityPolicyCommandOutput } from "../commands/GetSecurityPolicyCommand"; import { ListAccessPoliciesCommandInput, ListAccessPoliciesCommandOutput } from "../commands/ListAccessPoliciesCommand"; import { ListCollectionsCommandInput, ListCollectionsCommandOutput } from "../commands/ListCollectionsCommand"; +import { + ListLifecyclePoliciesCommandInput, + ListLifecyclePoliciesCommandOutput, +} from "../commands/ListLifecyclePoliciesCommand"; import { ListSecurityConfigsCommandInput, ListSecurityConfigsCommandOutput, @@ -73,6 +93,10 @@ import { UpdateAccountSettingsCommandOutput, } from "../commands/UpdateAccountSettingsCommand"; import { UpdateCollectionCommandInput, UpdateCollectionCommandOutput } from "../commands/UpdateCollectionCommand"; +import { + UpdateLifecyclePolicyCommandInput, + UpdateLifecyclePolicyCommandOutput, +} from "../commands/UpdateLifecyclePolicyCommand"; import { UpdateSecurityConfigCommandInput, UpdateSecurityConfigCommandOutput, @@ -85,6 +109,9 @@ import { UpdateVpcEndpointCommandInput, UpdateVpcEndpointCommandOutput } from ". import { AccessPolicyDetail, BatchGetCollectionRequest, + BatchGetEffectiveLifecyclePolicyRequest, + BatchGetLifecyclePolicyRequest, + BatchGetLifecyclePolicyResponse, BatchGetVpcEndpointRequest, CapacityLimits, CollectionFilters, @@ -92,12 +119,15 @@ import { CreateAccessPolicyRequest, CreateAccessPolicyResponse, CreateCollectionRequest, + CreateLifecyclePolicyRequest, + CreateLifecyclePolicyResponse, CreateSecurityConfigRequest, CreateSecurityPolicyRequest, CreateSecurityPolicyResponse, CreateVpcEndpointRequest, DeleteAccessPolicyRequest, DeleteCollectionRequest, + DeleteLifecyclePolicyRequest, DeleteSecurityConfigRequest, DeleteSecurityPolicyRequest, DeleteVpcEndpointRequest, @@ -109,8 +139,12 @@ import { GetSecurityPolicyRequest, GetSecurityPolicyResponse, InternalServerException, + LifecyclePolicyDetail, + LifecyclePolicyIdentifier, + LifecyclePolicyResourceIdentifier, ListAccessPoliciesRequest, ListCollectionsRequest, + ListLifecyclePoliciesRequest, ListSecurityConfigsRequest, ListSecurityPoliciesRequest, ListTagsForResourceRequest, @@ -127,6 +161,8 @@ import { UpdateAccessPolicyResponse, UpdateAccountSettingsRequest, UpdateCollectionRequest, + UpdateLifecyclePolicyRequest, + UpdateLifecyclePolicyResponse, UpdateSecurityConfigRequest, UpdateSecurityPolicyRequest, UpdateSecurityPolicyResponse, @@ -149,6 +185,32 @@ export const se_BatchGetCollectionCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_0BatchGetEffectiveLifecyclePolicyCommand + */ +export const se_BatchGetEffectiveLifecyclePolicyCommand = async ( + input: BatchGetEffectiveLifecyclePolicyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("BatchGetEffectiveLifecyclePolicy"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0BatchGetLifecyclePolicyCommand + */ +export const se_BatchGetLifecyclePolicyCommand = async ( + input: BatchGetLifecyclePolicyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("BatchGetLifecyclePolicy"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_0BatchGetVpcEndpointCommand */ @@ -188,6 +250,19 @@ export const se_CreateCollectionCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_0CreateLifecyclePolicyCommand + */ +export const se_CreateLifecyclePolicyCommand = async ( + input: CreateLifecyclePolicyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("CreateLifecyclePolicy"); + let body: any; + body = JSON.stringify(se_CreateLifecyclePolicyRequest(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_0CreateSecurityConfigCommand */ @@ -253,6 +328,19 @@ export const se_DeleteCollectionCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_0DeleteLifecyclePolicyCommand + */ +export const se_DeleteLifecyclePolicyCommand = async ( + input: DeleteLifecyclePolicyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("DeleteLifecyclePolicy"); + let body: any; + body = JSON.stringify(se_DeleteLifecyclePolicyRequest(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_0DeleteSecurityConfigCommand */ @@ -383,6 +471,19 @@ export const se_ListCollectionsCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_0ListLifecyclePoliciesCommand + */ +export const se_ListLifecyclePoliciesCommand = async ( + input: ListLifecyclePoliciesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("ListLifecyclePolicies"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_0ListSecurityConfigsCommand */ @@ -500,6 +601,19 @@ export const se_UpdateCollectionCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_0UpdateLifecyclePolicyCommand + */ +export const se_UpdateLifecyclePolicyCommand = async ( + input: UpdateLifecyclePolicyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("UpdateLifecyclePolicy"); + let body: any; + body = JSON.stringify(se_UpdateLifecyclePolicyRequest(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_0UpdateSecurityConfigCommand */ @@ -588,6 +702,104 @@ const de_BatchGetCollectionCommandError = async ( } }; +/** + * deserializeAws_json1_0BatchGetEffectiveLifecyclePolicyCommand + */ +export const de_BatchGetEffectiveLifecyclePolicyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_BatchGetEffectiveLifecyclePolicyCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: BatchGetEffectiveLifecyclePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0BatchGetEffectiveLifecyclePolicyCommandError + */ +const de_BatchGetEffectiveLifecyclePolicyCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.opensearchserverless#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.opensearchserverless#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0BatchGetLifecyclePolicyCommand + */ +export const de_BatchGetLifecyclePolicyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_BatchGetLifecyclePolicyCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_BatchGetLifecyclePolicyResponse(data, context); + const response: BatchGetLifecyclePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0BatchGetLifecyclePolicyCommandError + */ +const de_BatchGetLifecyclePolicyCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.opensearchserverless#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.opensearchserverless#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_json1_0BatchGetVpcEndpointCommand */ @@ -750,6 +962,61 @@ const de_CreateCollectionCommandError = async ( } }; +/** + * deserializeAws_json1_0CreateLifecyclePolicyCommand + */ +export const de_CreateLifecyclePolicyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CreateLifecyclePolicyCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateLifecyclePolicyResponse(data, context); + const response: CreateLifecyclePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0CreateLifecyclePolicyCommandError + */ +const de_CreateLifecyclePolicyCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ConflictException": + case "com.amazonaws.opensearchserverless#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.opensearchserverless#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.opensearchserverless#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_json1_0CreateSecurityConfigCommand */ @@ -1025,6 +1292,61 @@ const de_DeleteCollectionCommandError = async ( } }; +/** + * deserializeAws_json1_0DeleteLifecyclePolicyCommand + */ +export const de_DeleteLifecyclePolicyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_DeleteLifecyclePolicyCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteLifecyclePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0DeleteLifecyclePolicyCommandError + */ +const de_DeleteLifecyclePolicyCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ConflictException": + case "com.amazonaws.opensearchserverless#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.opensearchserverless#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.opensearchserverless#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.opensearchserverless#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_json1_0DeleteSecurityConfigCommand */ @@ -1539,6 +1861,55 @@ const de_ListCollectionsCommandError = async ( } }; +/** + * deserializeAws_json1_0ListLifecyclePoliciesCommand + */ +export const de_ListLifecyclePoliciesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_ListLifecyclePoliciesCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListLifecyclePoliciesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0ListLifecyclePoliciesCommandError + */ +const de_ListLifecyclePoliciesCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.opensearchserverless#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.opensearchserverless#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_json1_0ListSecurityConfigsCommand */ @@ -2007,6 +2378,64 @@ const de_UpdateCollectionCommandError = async ( } }; +/** + * deserializeAws_json1_0UpdateLifecyclePolicyCommand + */ +export const de_UpdateLifecyclePolicyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_UpdateLifecyclePolicyCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateLifecyclePolicyResponse(data, context); + const response: UpdateLifecyclePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0UpdateLifecyclePolicyCommandError + */ +const de_UpdateLifecyclePolicyCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ConflictException": + case "com.amazonaws.opensearchserverless#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.opensearchserverless#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.opensearchserverless#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.opensearchserverless#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_json1_0UpdateSecurityConfigCommand */ @@ -2264,6 +2693,10 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_BatchGetCollectionRequest omitted. +// se_BatchGetEffectiveLifecyclePolicyRequest omitted. + +// se_BatchGetLifecyclePolicyRequest omitted. + // se_BatchGetVpcEndpointRequest omitted. // se_CapacityLimits omitted. @@ -2300,6 +2733,19 @@ const se_CreateCollectionRequest = (input: CreateCollectionRequest, context: __S }); }; +/** + * serializeAws_json1_0CreateLifecyclePolicyRequest + */ +const se_CreateLifecyclePolicyRequest = (input: CreateLifecyclePolicyRequest, context: __SerdeContext): any => { + return take(input, { + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + description: [], + name: [], + policy: [], + type: [], + }); +}; + /** * serializeAws_json1_0CreateSecurityConfigRequest */ @@ -2360,6 +2806,17 @@ const se_DeleteCollectionRequest = (input: DeleteCollectionRequest, context: __S }); }; +/** + * serializeAws_json1_0DeleteLifecyclePolicyRequest + */ +const se_DeleteLifecyclePolicyRequest = (input: DeleteLifecyclePolicyRequest, context: __SerdeContext): any => { + return take(input, { + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + name: [], + type: [], + }); +}; + /** * serializeAws_json1_0DeleteSecurityConfigRequest */ @@ -2401,10 +2858,22 @@ const se_DeleteVpcEndpointRequest = (input: DeleteVpcEndpointRequest, context: _ // se_GetSecurityPolicyRequest omitted. +// se_LifecyclePolicyIdentifier omitted. + +// se_LifecyclePolicyIdentifiers omitted. + +// se_LifecyclePolicyResourceIdentifier omitted. + +// se_LifecyclePolicyResourceIdentifiers omitted. + +// se_LifecycleResourceFilter omitted. + // se_ListAccessPoliciesRequest omitted. // se_ListCollectionsRequest omitted. +// se_ListLifecyclePoliciesRequest omitted. + // se_ListSecurityConfigsRequest omitted. // se_ListSecurityPoliciesRequest omitted. @@ -2458,6 +2927,20 @@ const se_UpdateCollectionRequest = (input: UpdateCollectionRequest, context: __S }); }; +/** + * serializeAws_json1_0UpdateLifecyclePolicyRequest + */ +const se_UpdateLifecyclePolicyRequest = (input: UpdateLifecyclePolicyRequest, context: __SerdeContext): any => { + return take(input, { + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + description: [], + name: [], + policy: [], + policyVersion: [], + type: [], + }); +}; + /** * serializeAws_json1_0UpdateSecurityConfigRequest */ @@ -2528,6 +3011,18 @@ const de_AccessPolicyDetail = (output: any, context: __SerdeContext): AccessPoli // de_BatchGetCollectionResponse omitted. +// de_BatchGetEffectiveLifecyclePolicyResponse omitted. + +/** + * deserializeAws_json1_0BatchGetLifecyclePolicyResponse + */ +const de_BatchGetLifecyclePolicyResponse = (output: any, context: __SerdeContext): BatchGetLifecyclePolicyResponse => { + return take(output, { + lifecyclePolicyDetails: (_: any) => de_LifecyclePolicyDetails(_, context), + lifecyclePolicyErrorDetails: _json, + }) as any; +}; + // de_BatchGetVpcEndpointResponse omitted. // de_CapacityLimits omitted. @@ -2559,6 +3054,15 @@ const de_CreateAccessPolicyResponse = (output: any, context: __SerdeContext): Cr // de_CreateCollectionResponse omitted. +/** + * deserializeAws_json1_0CreateLifecyclePolicyResponse + */ +const de_CreateLifecyclePolicyResponse = (output: any, context: __SerdeContext): CreateLifecyclePolicyResponse => { + return take(output, { + lifecyclePolicyDetail: (_: any) => de_LifecyclePolicyDetail(_, context), + }) as any; +}; + // de_CreateSecurityConfigResponse omitted. /** @@ -2580,6 +3084,8 @@ const de_CreateSecurityPolicyResponse = (output: any, context: __SerdeContext): // de_DeleteCollectionResponse omitted. +// de_DeleteLifecyclePolicyResponse omitted. + // de_DeleteSecurityConfigResponse omitted. // de_DeleteSecurityPolicyResponse omitted. @@ -2588,6 +3094,14 @@ const de_CreateSecurityPolicyResponse = (output: any, context: __SerdeContext): // de_DeleteVpcEndpointResponse omitted. +// de_EffectiveLifecyclePolicyDetail omitted. + +// de_EffectiveLifecyclePolicyDetails omitted. + +// de_EffectiveLifecyclePolicyErrorDetail omitted. + +// de_EffectiveLifecyclePolicyErrorDetails omitted. + /** * deserializeAws_json1_0GetAccessPolicyResponse */ @@ -2614,10 +3128,49 @@ const de_GetSecurityPolicyResponse = (output: any, context: __SerdeContext): Get // de_InternalServerException omitted. +/** + * deserializeAws_json1_0LifecyclePolicyDetail + */ +const de_LifecyclePolicyDetail = (output: any, context: __SerdeContext): LifecyclePolicyDetail => { + return take(output, { + createdDate: __expectLong, + description: __expectString, + lastModifiedDate: __expectLong, + name: __expectString, + policy: (_: any) => de_Document(_, context), + policyVersion: __expectString, + type: __expectString, + }) as any; +}; + +/** + * deserializeAws_json1_0LifecyclePolicyDetails + */ +const de_LifecyclePolicyDetails = (output: any, context: __SerdeContext): LifecyclePolicyDetail[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_LifecyclePolicyDetail(entry, context); + }); + return retVal; +}; + +// de_LifecyclePolicyErrorDetail omitted. + +// de_LifecyclePolicyErrorDetails omitted. + +// de_LifecyclePolicyStats omitted. + +// de_LifecyclePolicySummaries omitted. + +// de_LifecyclePolicySummary omitted. + // de_ListAccessPoliciesResponse omitted. // de_ListCollectionsResponse omitted. +// de_ListLifecyclePoliciesResponse omitted. + // de_ListSecurityConfigsResponse omitted. // de_ListSecurityPoliciesResponse omitted. @@ -2690,6 +3243,15 @@ const de_UpdateAccessPolicyResponse = (output: any, context: __SerdeContext): Up // de_UpdateCollectionResponse omitted. +/** + * deserializeAws_json1_0UpdateLifecyclePolicyResponse + */ +const de_UpdateLifecyclePolicyResponse = (output: any, context: __SerdeContext): UpdateLifecyclePolicyResponse => { + return take(output, { + lifecyclePolicyDetail: (_: any) => de_LifecyclePolicyDetail(_, context), + }) as any; +}; + // de_UpdateSecurityConfigResponse omitted. /** diff --git a/codegen/sdk-codegen/aws-models/opensearchserverless.json b/codegen/sdk-codegen/aws-models/opensearchserverless.json index 4a95e190d5de..fd7f8bb4ba9f 100644 --- a/codegen/sdk-codegen/aws-models/opensearchserverless.json +++ b/codegen/sdk-codegen/aws-models/opensearchserverless.json @@ -108,7 +108,7 @@ "type": { "target": "com.amazonaws.opensearchserverless#AccessPolicyType", "traits": { - "smithy.api#documentation": "

The type of access policy. Currently the only available type is data.

" + "smithy.api#documentation": "

The type of access policy. Currently, the only available type is data.

" } }, "name": { @@ -233,6 +233,118 @@ } } }, + "com.amazonaws.opensearchserverless#BatchGetEffectiveLifecyclePolicy": { + "type": "operation", + "input": { + "target": "com.amazonaws.opensearchserverless#BatchGetEffectiveLifecyclePolicyRequest" + }, + "output": { + "target": "com.amazonaws.opensearchserverless#BatchGetEffectiveLifecyclePolicyResponse" + }, + "errors": [ + { + "target": "com.amazonaws.opensearchserverless#InternalServerException" + }, + { + "target": "com.amazonaws.opensearchserverless#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns a list of successful and failed retrievals for the OpenSearch Serverless indexes. For more information, see Viewing data lifecycle policies.

", + "smithy.api#readonly": {} + } + }, + "com.amazonaws.opensearchserverless#BatchGetEffectiveLifecyclePolicyRequest": { + "type": "structure", + "members": { + "resourceIdentifiers": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyResourceIdentifiers", + "traits": { + "smithy.api#documentation": "

The unique identifiers of policy types and resource names.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.opensearchserverless#BatchGetEffectiveLifecyclePolicyResponse": { + "type": "structure", + "members": { + "effectiveLifecyclePolicyDetails": { + "target": "com.amazonaws.opensearchserverless#EffectiveLifecyclePolicyDetails", + "traits": { + "smithy.api#documentation": "

A list of lifecycle policies applied to the OpenSearch Serverless indexes.

" + } + }, + "effectiveLifecyclePolicyErrorDetails": { + "target": "com.amazonaws.opensearchserverless#EffectiveLifecyclePolicyErrorDetails", + "traits": { + "smithy.api#documentation": "

A list of resources for which retrieval failed.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.opensearchserverless#BatchGetLifecyclePolicy": { + "type": "operation", + "input": { + "target": "com.amazonaws.opensearchserverless#BatchGetLifecyclePolicyRequest" + }, + "output": { + "target": "com.amazonaws.opensearchserverless#BatchGetLifecyclePolicyResponse" + }, + "errors": [ + { + "target": "com.amazonaws.opensearchserverless#InternalServerException" + }, + { + "target": "com.amazonaws.opensearchserverless#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns one or more configured OpenSearch Serverless lifecycle policies. For more information, see Viewing data lifecycle policies.

", + "smithy.api#readonly": {} + } + }, + "com.amazonaws.opensearchserverless#BatchGetLifecyclePolicyRequest": { + "type": "structure", + "members": { + "identifiers": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyIdentifiers", + "traits": { + "smithy.api#documentation": "

The unique identifiers of policy types and policy names.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.opensearchserverless#BatchGetLifecyclePolicyResponse": { + "type": "structure", + "members": { + "lifecyclePolicyDetails": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyDetails", + "traits": { + "smithy.api#documentation": "

A list of lifecycle policies matched to the input policy name and policy type.

" + } + }, + "lifecyclePolicyErrorDetails": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyErrorDetails", + "traits": { + "smithy.api#documentation": "

A list of lifecycle policy names and policy types for which retrieval failed.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.opensearchserverless#BatchGetVpcEndpoint": { "type": "operation", "input": { @@ -475,7 +587,7 @@ } }, "traits": { - "smithy.api#documentation": "

List of filter keys that you can use for LIST, UPDATE, and DELETE requests to OpenSearch Serverless\n collections.

" + "smithy.api#documentation": "

A list of filter keys that you can use for LIST, UPDATE, and DELETE requests to OpenSearch Serverless\n collections.

" } }, "com.amazonaws.opensearchserverless#CollectionId": { @@ -863,6 +975,90 @@ } } }, + "com.amazonaws.opensearchserverless#CreateLifecyclePolicy": { + "type": "operation", + "input": { + "target": "com.amazonaws.opensearchserverless#CreateLifecyclePolicyRequest" + }, + "output": { + "target": "com.amazonaws.opensearchserverless#CreateLifecyclePolicyResponse" + }, + "errors": [ + { + "target": "com.amazonaws.opensearchserverless#ConflictException" + }, + { + "target": "com.amazonaws.opensearchserverless#InternalServerException" + }, + { + "target": "com.amazonaws.opensearchserverless#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.opensearchserverless#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a lifecyle policy to be applied to OpenSearch Serverless indexes. Lifecycle policies define\n the number of days or hours to retain the data on an OpenSearch Serverless index. For more information, see Creating data lifecycle policies.

", + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.opensearchserverless#CreateLifecyclePolicyRequest": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyType", + "traits": { + "smithy.api#documentation": "

The type of lifecycle policy.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.opensearchserverless#PolicyName", + "traits": { + "smithy.api#documentation": "

The name of the lifecycle policy.

", + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.opensearchserverless#PolicyDescription", + "traits": { + "smithy.api#documentation": "

A description of the lifecycle policy.

" + } + }, + "policy": { + "target": "com.amazonaws.opensearchserverless#PolicyDocument", + "traits": { + "smithy.api#documentation": "

The JSON policy document to use as the content for the lifecycle policy.

", + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.opensearchserverless#ClientToken", + "traits": { + "aws.cloudformation#cfnExcludeProperty": {}, + "smithy.api#documentation": "

A unique, case-sensitive identifier to ensure idempotency of the request.

", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.opensearchserverless#CreateLifecyclePolicyResponse": { + "type": "structure", + "members": { + "lifecyclePolicyDetail": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyDetail", + "traits": { + "smithy.api#documentation": "

Details about the created lifecycle policy.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.opensearchserverless#CreateSecurityConfig": { "type": "operation", "input": { @@ -1263,6 +1459,70 @@ } } }, + "com.amazonaws.opensearchserverless#DeleteLifecyclePolicy": { + "type": "operation", + "input": { + "target": "com.amazonaws.opensearchserverless#DeleteLifecyclePolicyRequest" + }, + "output": { + "target": "com.amazonaws.opensearchserverless#DeleteLifecyclePolicyResponse" + }, + "errors": [ + { + "target": "com.amazonaws.opensearchserverless#ConflictException" + }, + { + "target": "com.amazonaws.opensearchserverless#InternalServerException" + }, + { + "target": "com.amazonaws.opensearchserverless#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.opensearchserverless#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes an OpenSearch Serverless lifecycle policy. For more information, see Deleting data lifecycle policies.

", + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.opensearchserverless#DeleteLifecyclePolicyRequest": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyType", + "traits": { + "smithy.api#documentation": "

The type of lifecycle policy.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.opensearchserverless#PolicyName", + "traits": { + "smithy.api#documentation": "

The name of the policy to delete.

", + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.opensearchserverless#ClientToken", + "traits": { + "aws.cloudformation#cfnExcludeProperty": {}, + "smithy.api#documentation": "

Unique, case-sensitive identifier to ensure idempotency of the request.

", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.opensearchserverless#DeleteLifecyclePolicyResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.opensearchserverless#DeleteSecurityConfig": { "type": "operation", "input": { @@ -1456,6 +1716,94 @@ } } }, + "com.amazonaws.opensearchserverless#EffectiveLifecyclePolicyDetail": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyType", + "traits": { + "smithy.api#documentation": "

The type of lifecycle policy.

" + } + }, + "resource": { + "target": "com.amazonaws.opensearchserverless#Resource", + "traits": { + "smithy.api#documentation": "

The name of the OpenSearch Serverless index resource.

" + } + }, + "policyName": { + "target": "com.amazonaws.opensearchserverless#PolicyName", + "traits": { + "smithy.api#documentation": "

The name of the lifecycle policy.

" + } + }, + "resourceType": { + "target": "com.amazonaws.opensearchserverless#ResourceType", + "traits": { + "smithy.api#documentation": "

The type of OpenSearch Serverless resource. Currently, the only supported resource is index.

" + } + }, + "retentionPeriod": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The minimum number of index retention in days or hours. This is an optional parameter that will return only if it’s set.

" + } + }, + "noMinRetentionPeriod": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

The minimum number of index retention days set. That is an optional param that will return as true if the minimum number of days or \n hours is not set to a index resource.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Error information for an OpenSearch Serverless request.

" + } + }, + "com.amazonaws.opensearchserverless#EffectiveLifecyclePolicyDetails": { + "type": "list", + "member": { + "target": "com.amazonaws.opensearchserverless#EffectiveLifecyclePolicyDetail" + } + }, + "com.amazonaws.opensearchserverless#EffectiveLifecyclePolicyErrorDetail": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyType", + "traits": { + "smithy.api#documentation": "

The type of lifecycle policy.

" + } + }, + "resource": { + "target": "com.amazonaws.opensearchserverless#Resource", + "traits": { + "smithy.api#documentation": "

The name of OpenSearch Serverless index resource.

" + } + }, + "errorMessage": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A description of the error. For example, The specified Index resource is not found.

" + } + }, + "errorCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The error code for the request.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Error information for an OpenSearch Serverless request.

" + } + }, + "com.amazonaws.opensearchserverless#EffectiveLifecyclePolicyErrorDetails": { + "type": "list", + "member": { + "target": "com.amazonaws.opensearchserverless#EffectiveLifecyclePolicyErrorDetail" + } + }, "com.amazonaws.opensearchserverless#GetAccessPolicy": { "type": "operation", "input": { @@ -1486,7 +1834,7 @@ "type": { "target": "com.amazonaws.opensearchserverless#AccessPolicyType", "traits": { - "smithy.api#documentation": "

Tye type of policy. Currently the only supported value is data.

", + "smithy.api#documentation": "

Tye type of policy. Currently, the only supported value is data.

", "smithy.api#required": {} } }, @@ -1589,6 +1937,12 @@ "smithy.api#documentation": "

Information about the security configurations in your account.

" } }, + "LifecyclePolicyStats": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyStats", + "traits": { + "smithy.api#documentation": "

Information about the lifecycle policies in your account.

" + } + }, "TotalPolicyCount": { "target": "smithy.api#Long", "traits": { @@ -1664,59 +2018,331 @@ } ], "traits": { - "smithy.api#documentation": "

Returns information about a configured OpenSearch Serverless security policy. For more information, see Network access\n for Amazon OpenSearch Serverless and Encryption at\n rest for Amazon OpenSearch Serverless.

", - "smithy.api#readonly": {} + "smithy.api#documentation": "

Returns information about a configured OpenSearch Serverless security policy. For more information, see Network access\n for Amazon OpenSearch Serverless and Encryption at\n rest for Amazon OpenSearch Serverless.

", + "smithy.api#readonly": {} + } + }, + "com.amazonaws.opensearchserverless#GetSecurityPolicyRequest": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.opensearchserverless#SecurityPolicyType", + "traits": { + "smithy.api#documentation": "

The type of security policy.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.opensearchserverless#PolicyName", + "traits": { + "smithy.api#documentation": "

The name of the security policy.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.opensearchserverless#GetSecurityPolicyResponse": { + "type": "structure", + "members": { + "securityPolicyDetail": { + "target": "com.amazonaws.opensearchserverless#SecurityPolicyDetail", + "traits": { + "smithy.api#documentation": "

Details about the requested security policy.

" + } + } + } + }, + "com.amazonaws.opensearchserverless#IndexingCapacityValue": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 2 + } + } + }, + "com.amazonaws.opensearchserverless#InternalServerException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

Thrown when an error internal to the service occurs while processing a request.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500 + } + }, + "com.amazonaws.opensearchserverless#LifecyclePolicy": { + "type": "resource", + "identifiers": { + "type": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyType" + }, + "name": { + "target": "com.amazonaws.opensearchserverless#PolicyName" + } + }, + "update": { + "target": "com.amazonaws.opensearchserverless#UpdateLifecyclePolicy" + }, + "delete": { + "target": "com.amazonaws.opensearchserverless#DeleteLifecyclePolicy" + }, + "list": { + "target": "com.amazonaws.opensearchserverless#ListLifecyclePolicies" + }, + "traits": { + "aws.cloudformation#cfnResource": { + "name": "LifecyclePolicy" + } + } + }, + "com.amazonaws.opensearchserverless#LifecyclePolicyDetail": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyType", + "traits": { + "smithy.api#documentation": "

The type of lifecycle policy.

" + } + }, + "name": { + "target": "com.amazonaws.opensearchserverless#PolicyName", + "traits": { + "smithy.api#documentation": "

The name of the lifecycle policy.

" + } + }, + "policyVersion": { + "target": "com.amazonaws.opensearchserverless#PolicyVersion", + "traits": { + "smithy.api#documentation": "

The version of the lifecycle policy.

" + } + }, + "description": { + "target": "com.amazonaws.opensearchserverless#PolicyDescription", + "traits": { + "smithy.api#documentation": "

The description of the lifecycle policy.

" + } + }, + "policy": { + "target": "smithy.api#Document", + "traits": { + "smithy.api#documentation": "

The JSON policy document without any whitespaces.

" + } + }, + "createdDate": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "

The date the lifecycle policy was created.

" + } + }, + "lastModifiedDate": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "

The timestamp of when the lifecycle policy was last modified.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Details about an OpenSearch Serverless lifecycle policy.

" + } + }, + "com.amazonaws.opensearchserverless#LifecyclePolicyDetails": { + "type": "list", + "member": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyDetail" + } + }, + "com.amazonaws.opensearchserverless#LifecyclePolicyErrorDetail": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyType", + "traits": { + "smithy.api#documentation": "

The type of lifecycle policy.

" + } + }, + "name": { + "target": "com.amazonaws.opensearchserverless#PolicyName", + "traits": { + "smithy.api#documentation": "

The name of the lifecycle policy.

" + } + }, + "errorMessage": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A description of the error. For example, The specified Lifecycle Policy is not found.

" + } + }, + "errorCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The error code for the request. For example, NOT_FOUND.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Error information for an OpenSearch Serverless request.

" + } + }, + "com.amazonaws.opensearchserverless#LifecyclePolicyErrorDetails": { + "type": "list", + "member": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyErrorDetail" + } + }, + "com.amazonaws.opensearchserverless#LifecyclePolicyIdentifier": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyType", + "traits": { + "smithy.api#documentation": "

The type of lifecycle policy.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.opensearchserverless#PolicyName", + "traits": { + "smithy.api#documentation": "

The name of the lifecycle policy.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The unique identifiers of policy types and policy names.

" + } + }, + "com.amazonaws.opensearchserverless#LifecyclePolicyIdentifiers": { + "type": "list", + "member": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyIdentifier" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 40 + } } }, - "com.amazonaws.opensearchserverless#GetSecurityPolicyRequest": { + "com.amazonaws.opensearchserverless#LifecyclePolicyResourceIdentifier": { "type": "structure", "members": { "type": { - "target": "com.amazonaws.opensearchserverless#SecurityPolicyType", + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyType", "traits": { - "smithy.api#documentation": "

The type of security policy.

", + "smithy.api#documentation": "

The type of lifecycle policy.

", "smithy.api#required": {} } }, - "name": { - "target": "com.amazonaws.opensearchserverless#PolicyName", + "resource": { + "target": "com.amazonaws.opensearchserverless#ResourceName", "traits": { - "smithy.api#documentation": "

The name of the security policy.

", + "smithy.api#documentation": "

The name of the OpenSearch Serverless ilndex resource.

", "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#documentation": "

The unique identifiers of policy types and resource names.

" + } + }, + "com.amazonaws.opensearchserverless#LifecyclePolicyResourceIdentifiers": { + "type": "list", + "member": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyResourceIdentifier" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } } }, - "com.amazonaws.opensearchserverless#GetSecurityPolicyResponse": { + "com.amazonaws.opensearchserverless#LifecyclePolicyStats": { "type": "structure", "members": { - "securityPolicyDetail": { - "target": "com.amazonaws.opensearchserverless#SecurityPolicyDetail", + "RetentionPolicyCount": { + "target": "smithy.api#Long", "traits": { - "smithy.api#documentation": "

Details about the requested security policy.

" + "smithy.api#documentation": "

The number of retention lifecycle policies in the current account.

" } } + }, + "traits": { + "smithy.api#documentation": "

Statistics for an OpenSearch Serverless lifecycle policy.

" } }, - "com.amazonaws.opensearchserverless#IndexingCapacityValue": { - "type": "integer", - "traits": { - "smithy.api#range": { - "min": 2 - } + "com.amazonaws.opensearchserverless#LifecyclePolicySummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicySummary" } }, - "com.amazonaws.opensearchserverless#InternalServerException": { + "com.amazonaws.opensearchserverless#LifecyclePolicySummary": { "type": "structure", "members": { - "message": { - "target": "smithy.api#String" + "type": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyType", + "traits": { + "smithy.api#documentation": "

The type of lifecycle policy.

" + } + }, + "name": { + "target": "com.amazonaws.opensearchserverless#PolicyName", + "traits": { + "smithy.api#documentation": "

The name of the lifecycle policy.

" + } + }, + "policyVersion": { + "target": "com.amazonaws.opensearchserverless#PolicyVersion", + "traits": { + "smithy.api#documentation": "

The version of the lifecycle policy.

" + } + }, + "description": { + "target": "com.amazonaws.opensearchserverless#PolicyDescription", + "traits": { + "smithy.api#documentation": "

The description of the lifecycle policy.

" + } + }, + "createdDate": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "

The Epoch time when the lifecycle policy was created.

" + } + }, + "lastModifiedDate": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "

The date and time when the lifecycle policy was last modified.

" + } } }, "traits": { - "smithy.api#documentation": "

Thrown when an error internal to the service occurs while processing a request.

", - "smithy.api#error": "server", - "smithy.api#httpError": 500 + "smithy.api#documentation": "

A summary of the lifecycle policy.

" + } + }, + "com.amazonaws.opensearchserverless#LifecyclePolicyType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "name": "retention", + "value": "retention", + "documentation": "retention policy type" + } + ] + } + }, + "com.amazonaws.opensearchserverless#LifecycleResource": { + "type": "string" + }, + "com.amazonaws.opensearchserverless#LifecycleResourceFilter": { + "type": "list", + "member": { + "target": "com.amazonaws.opensearchserverless#LifecycleResource" } }, "com.amazonaws.opensearchserverless#ListAccessPolicies": { @@ -1832,7 +2458,7 @@ "collectionFilters": { "target": "com.amazonaws.opensearchserverless#CollectionFilters", "traits": { - "smithy.api#documentation": "

List of filter names and values that you can use for requests.

" + "smithy.api#documentation": "

A list of filter names and values that you can use for requests.

" } }, "nextToken": { @@ -1870,6 +2496,93 @@ } } }, + "com.amazonaws.opensearchserverless#ListLifecyclePolicies": { + "type": "operation", + "input": { + "target": "com.amazonaws.opensearchserverless#ListLifecyclePoliciesRequest" + }, + "output": { + "target": "com.amazonaws.opensearchserverless#ListLifecyclePoliciesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.opensearchserverless#InternalServerException" + }, + { + "target": "com.amazonaws.opensearchserverless#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns a list of OpenSearch Serverless lifecycle policies. For more information, see Viewing data lifecycle policies.

", + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "maxResults": "maxResults" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.opensearchserverless#ListLifecyclePoliciesRequest": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyType", + "traits": { + "smithy.api#documentation": "

The type of lifecycle policy.

", + "smithy.api#required": {} + } + }, + "resources": { + "target": "com.amazonaws.opensearchserverless#LifecycleResourceFilter", + "traits": { + "smithy.api#documentation": "

Resource filters that policies can apply to. Currently, the only supported resource type is index.

", + "smithy.api#length": { + "min": 1, + "max": 1000 + } + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

If your initial ListLifecyclePolicies operation returns a nextToken, you can include the returned nextToken in subsequent ListLifecyclePolicies operations, which returns results in the next page.

" + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

An optional parameter that specifies the maximum number of results to return. You can use use nextToken to get the next page of results. The default is 10.

", + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.opensearchserverless#ListLifecyclePoliciesResponse": { + "type": "structure", + "members": { + "lifecyclePolicySummaries": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicySummaries", + "traits": { + "smithy.api#documentation": "

Details about the requested lifecycle policies.

" + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

When nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.opensearchserverless#ListSecurityConfigs": { "type": "operation", "input": { @@ -2162,9 +2875,18 @@ { "target": "com.amazonaws.opensearchserverless#BatchGetCollection" }, + { + "target": "com.amazonaws.opensearchserverless#BatchGetEffectiveLifecyclePolicy" + }, + { + "target": "com.amazonaws.opensearchserverless#BatchGetLifecyclePolicy" + }, { "target": "com.amazonaws.opensearchserverless#BatchGetVpcEndpoint" }, + { + "target": "com.amazonaws.opensearchserverless#CreateLifecyclePolicy" + }, { "target": "com.amazonaws.opensearchserverless#CreateSecurityPolicy" }, @@ -2197,6 +2919,9 @@ { "target": "com.amazonaws.opensearchserverless#Collection" }, + { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicy" + }, { "target": "com.amazonaws.opensearchserverless#SecurityConfig" }, @@ -2933,6 +3658,12 @@ "target": "com.amazonaws.opensearchserverless#Resource" } }, + "com.amazonaws.opensearchserverless#ResourceName": { + "type": "string", + "traits": { + "smithy.api#pattern": "^index/[a-z][a-z0-9-]{3,32}/([a-z;0-9&$%][+.~=\\-_a-z;0-9&$%]*|\\*)$" + } + }, "com.amazonaws.opensearchserverless#ResourceNotFoundException": { "type": "structure", "members": { @@ -2946,6 +3677,18 @@ "smithy.api#httpError": 404 } }, + "com.amazonaws.opensearchserverless#ResourceType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "name": "index", + "value": "index", + "documentation": "index resource type" + } + ] + } + }, "com.amazonaws.opensearchserverless#SamlConfigOptions": { "type": "structure", "members": { @@ -3813,6 +4556,99 @@ } } }, + "com.amazonaws.opensearchserverless#UpdateLifecyclePolicy": { + "type": "operation", + "input": { + "target": "com.amazonaws.opensearchserverless#UpdateLifecyclePolicyRequest" + }, + "output": { + "target": "com.amazonaws.opensearchserverless#UpdateLifecyclePolicyResponse" + }, + "errors": [ + { + "target": "com.amazonaws.opensearchserverless#ConflictException" + }, + { + "target": "com.amazonaws.opensearchserverless#InternalServerException" + }, + { + "target": "com.amazonaws.opensearchserverless#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.opensearchserverless#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.opensearchserverless#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates an OpenSearch Serverless access policy. For more information, see Updating data lifecycle policies.

", + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.opensearchserverless#UpdateLifecyclePolicyRequest": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyType", + "traits": { + "smithy.api#documentation": "

The type of lifecycle policy.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.opensearchserverless#PolicyName", + "traits": { + "smithy.api#documentation": "

The name of the policy.

", + "smithy.api#required": {} + } + }, + "policyVersion": { + "target": "com.amazonaws.opensearchserverless#PolicyVersion", + "traits": { + "smithy.api#documentation": "

The version of the policy being updated.

", + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.opensearchserverless#PolicyDescription", + "traits": { + "smithy.api#documentation": "

A description of the lifecycle policy.

" + } + }, + "policy": { + "target": "com.amazonaws.opensearchserverless#PolicyDocument", + "traits": { + "smithy.api#documentation": "

The JSON policy document to use as the content for the lifecycle policy.

" + } + }, + "clientToken": { + "target": "com.amazonaws.opensearchserverless#ClientToken", + "traits": { + "aws.cloudformation#cfnExcludeProperty": {}, + "smithy.api#documentation": "

A unique, case-sensitive identifier to ensure idempotency of the request.

", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.opensearchserverless#UpdateLifecyclePolicyResponse": { + "type": "structure", + "members": { + "lifecyclePolicyDetail": { + "target": "com.amazonaws.opensearchserverless#LifecyclePolicyDetail", + "traits": { + "smithy.api#documentation": "

Details about the updated lifecycle policy.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.opensearchserverless#UpdateSecurityConfig": { "type": "operation", "input": {