-
Notifications
You must be signed in to change notification settings - Fork 580
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-bedrock-agent): This release adds support to stop an ongo…
…ing ingestion job using the StopIngestionJob API in Agents for Amazon Bedrock.
- Loading branch information
awstools
committed
Oct 1, 2024
1 parent
cb499b9
commit ac89806
Showing
13 changed files
with
457 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
132 changes: 132 additions & 0 deletions
132
clients/client-bedrock-agent/src/commands/StopIngestionJobCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
// smithy-typescript generated code | ||
import { getEndpointPlugin } from "@smithy/middleware-endpoint"; | ||
import { getSerdePlugin } from "@smithy/middleware-serde"; | ||
import { Command as $Command } from "@smithy/smithy-client"; | ||
import { MetadataBearer as __MetadataBearer } from "@smithy/types"; | ||
|
||
import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; | ||
import { commonParams } from "../endpoint/EndpointParameters"; | ||
import { StopIngestionJobRequest, StopIngestionJobResponse } from "../models/models_0"; | ||
import { de_StopIngestionJobCommand, se_StopIngestionJobCommand } from "../protocols/Aws_restJson1"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export type { __MetadataBearer }; | ||
export { $Command }; | ||
/** | ||
* @public | ||
* | ||
* The input for {@link StopIngestionJobCommand}. | ||
*/ | ||
export interface StopIngestionJobCommandInput extends StopIngestionJobRequest {} | ||
/** | ||
* @public | ||
* | ||
* The output of {@link StopIngestionJobCommand}. | ||
*/ | ||
export interface StopIngestionJobCommandOutput extends StopIngestionJobResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Stops a currently running data ingestion job. You can send a <code>StartIngestionJob</code> request again to ingest the rest of your data when you are ready.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { BedrockAgentClient, StopIngestionJobCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import | ||
* // const { BedrockAgentClient, StopIngestionJobCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import | ||
* const client = new BedrockAgentClient(config); | ||
* const input = { // StopIngestionJobRequest | ||
* knowledgeBaseId: "STRING_VALUE", // required | ||
* dataSourceId: "STRING_VALUE", // required | ||
* ingestionJobId: "STRING_VALUE", // required | ||
* }; | ||
* const command = new StopIngestionJobCommand(input); | ||
* const response = await client.send(command); | ||
* // { // StopIngestionJobResponse | ||
* // ingestionJob: { // IngestionJob | ||
* // knowledgeBaseId: "STRING_VALUE", // required | ||
* // dataSourceId: "STRING_VALUE", // required | ||
* // ingestionJobId: "STRING_VALUE", // required | ||
* // description: "STRING_VALUE", | ||
* // status: "STARTING" || "IN_PROGRESS" || "COMPLETE" || "FAILED" || "STOPPING" || "STOPPED", // required | ||
* // statistics: { // IngestionJobStatistics | ||
* // numberOfDocumentsScanned: Number("long"), | ||
* // numberOfMetadataDocumentsScanned: Number("long"), | ||
* // numberOfNewDocumentsIndexed: Number("long"), | ||
* // numberOfModifiedDocumentsIndexed: Number("long"), | ||
* // numberOfMetadataDocumentsModified: Number("long"), | ||
* // numberOfDocumentsDeleted: Number("long"), | ||
* // numberOfDocumentsFailed: Number("long"), | ||
* // }, | ||
* // failureReasons: [ // FailureReasons | ||
* // "STRING_VALUE", | ||
* // ], | ||
* // startedAt: new Date("TIMESTAMP"), // required | ||
* // updatedAt: new Date("TIMESTAMP"), // required | ||
* // }, | ||
* // }; | ||
* | ||
* ``` | ||
* | ||
* @param StopIngestionJobCommandInput - {@link StopIngestionJobCommandInput} | ||
* @returns {@link StopIngestionJobCommandOutput} | ||
* @see {@link StopIngestionJobCommandInput} for command's `input` shape. | ||
* @see {@link StopIngestionJobCommandOutput} for command's `response` shape. | ||
* @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. | ||
* | ||
* @throws {@link AccessDeniedException} (client fault) | ||
* <p>The request is denied because of missing access permissions.</p> | ||
* | ||
* @throws {@link ConflictException} (client fault) | ||
* <p>There was a conflict performing an operation.</p> | ||
* | ||
* @throws {@link InternalServerException} (server fault) | ||
* <p>An internal server error occurred. Retry your request.</p> | ||
* | ||
* @throws {@link ResourceNotFoundException} (client fault) | ||
* <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p> | ||
* | ||
* @throws {@link ThrottlingException} (client fault) | ||
* <p>The number of requests exceeds the limit. Resubmit your request later.</p> | ||
* | ||
* @throws {@link ValidationException} (client fault) | ||
* <p>Input validation failed. Check your request parameters and retry the request.</p> | ||
* | ||
* @throws {@link BedrockAgentServiceException} | ||
* <p>Base exception class for all service exceptions from BedrockAgent service.</p> | ||
* | ||
* @public | ||
*/ | ||
export class StopIngestionJobCommand extends $Command | ||
.classBuilder< | ||
StopIngestionJobCommandInput, | ||
StopIngestionJobCommandOutput, | ||
BedrockAgentClientResolvedConfig, | ||
ServiceInputTypes, | ||
ServiceOutputTypes | ||
>() | ||
.ep(commonParams) | ||
.m(function (this: any, Command: any, cs: any, config: BedrockAgentClientResolvedConfig, o: any) { | ||
return [ | ||
getSerdePlugin(config, this.serialize, this.deserialize), | ||
getEndpointPlugin(config, Command.getEndpointParameterInstructions()), | ||
]; | ||
}) | ||
.s("AmazonBedrockAgentBuildTimeLambda", "StopIngestionJob", {}) | ||
.n("BedrockAgentClient", "StopIngestionJobCommand") | ||
.f(void 0, void 0) | ||
.ser(se_StopIngestionJobCommand) | ||
.de(de_StopIngestionJobCommand) | ||
.build() { | ||
/** @internal type navigation helper, not in runtime. */ | ||
protected declare static __types: { | ||
api: { | ||
input: StopIngestionJobRequest; | ||
output: StopIngestionJobResponse; | ||
}; | ||
sdk: { | ||
input: StopIngestionJobCommandInput; | ||
output: StopIngestionJobCommandOutput; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.