Skip to content

Commit ac89806

Browse files
author
awstools
committed
feat(client-bedrock-agent): This release adds support to stop an ongoing ingestion job using the StopIngestionJob API in Agents for Amazon Bedrock.
1 parent cb499b9 commit ac89806

13 files changed

+457
-111
lines changed

clients/client-bedrock-agent/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,14 @@ StartIngestionJob
602602

603603
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/StartIngestionJobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/StartIngestionJobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/StartIngestionJobCommandOutput/)
604604

605+
</details>
606+
<details>
607+
<summary>
608+
StopIngestionJob
609+
</summary>
610+
611+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/StopIngestionJobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/StopIngestionJobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/StopIngestionJobCommandOutput/)
612+
605613
</details>
606614
<details>
607615
<summary>

clients/client-bedrock-agent/src/BedrockAgent.ts

+23
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ import {
209209
StartIngestionJobCommandInput,
210210
StartIngestionJobCommandOutput,
211211
} from "./commands/StartIngestionJobCommand";
212+
import {
213+
StopIngestionJobCommand,
214+
StopIngestionJobCommandInput,
215+
StopIngestionJobCommandOutput,
216+
} from "./commands/StopIngestionJobCommand";
212217
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
213218
import {
214219
UntagResourceCommand,
@@ -304,6 +309,7 @@ const commands = {
304309
PrepareAgentCommand,
305310
PrepareFlowCommand,
306311
StartIngestionJobCommand,
312+
StopIngestionJobCommand,
307313
TagResourceCommand,
308314
UntagResourceCommand,
309315
UpdateAgentCommand,
@@ -1049,6 +1055,23 @@ export interface BedrockAgent {
10491055
cb: (err: any, data?: StartIngestionJobCommandOutput) => void
10501056
): void;
10511057

1058+
/**
1059+
* @see {@link StopIngestionJobCommand}
1060+
*/
1061+
stopIngestionJob(
1062+
args: StopIngestionJobCommandInput,
1063+
options?: __HttpHandlerOptions
1064+
): Promise<StopIngestionJobCommandOutput>;
1065+
stopIngestionJob(
1066+
args: StopIngestionJobCommandInput,
1067+
cb: (err: any, data?: StopIngestionJobCommandOutput) => void
1068+
): void;
1069+
stopIngestionJob(
1070+
args: StopIngestionJobCommandInput,
1071+
options: __HttpHandlerOptions,
1072+
cb: (err: any, data?: StopIngestionJobCommandOutput) => void
1073+
): void;
1074+
10521075
/**
10531076
* @see {@link TagResourceCommand}
10541077
*/

clients/client-bedrock-agent/src/BedrockAgentClient.ts

+3
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ import {
139139
import { PrepareAgentCommandInput, PrepareAgentCommandOutput } from "./commands/PrepareAgentCommand";
140140
import { PrepareFlowCommandInput, PrepareFlowCommandOutput } from "./commands/PrepareFlowCommand";
141141
import { StartIngestionJobCommandInput, StartIngestionJobCommandOutput } from "./commands/StartIngestionJobCommand";
142+
import { StopIngestionJobCommandInput, StopIngestionJobCommandOutput } from "./commands/StopIngestionJobCommand";
142143
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
143144
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
144145
import {
@@ -224,6 +225,7 @@ export type ServiceInputTypes =
224225
| PrepareAgentCommandInput
225226
| PrepareFlowCommandInput
226227
| StartIngestionJobCommandInput
228+
| StopIngestionJobCommandInput
227229
| TagResourceCommandInput
228230
| UntagResourceCommandInput
229231
| UpdateAgentActionGroupCommandInput
@@ -290,6 +292,7 @@ export type ServiceOutputTypes =
290292
| PrepareAgentCommandOutput
291293
| PrepareFlowCommandOutput
292294
| StartIngestionJobCommandOutput
295+
| StopIngestionJobCommandOutput
293296
| TagResourceCommandOutput
294297
| UntagResourceCommandOutput
295298
| UpdateAgentActionGroupCommandOutput

clients/client-bedrock-agent/src/commands/CreateKnowledgeBaseCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface CreateKnowledgeBaseCommandInput extends CreateKnowledgeBaseRequ
2828
export interface CreateKnowledgeBaseCommandOutput extends CreateKnowledgeBaseResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Creates a knowledge base that contains data sources from which information can be queried and used by LLMs. To create a knowledge base, you must first set up your data sources and configure a supported vector store. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup.html">Set up your data for ingestion</a>.</p>
31+
* <p>Creates a knowledge base. A knowledge base contains your data sources so that Large Language Models (LLMs) can use your data. To create a knowledge base, you must first set up your data sources and configure a supported vector store. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/knowlege-base-prereq.html">Set up a knowledge base</a>.</p>
3232
* <note>
3333
* <p>If you prefer to let Amazon Bedrock create and manage a vector store for you in Amazon OpenSearch Service, use the console. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-create">Create a knowledge base</a>.</p>
3434
* </note>

clients/client-bedrock-agent/src/commands/GetIngestionJobCommand.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface GetIngestionJobCommandInput extends GetIngestionJobRequest {}
2828
export interface GetIngestionJobCommandOutput extends GetIngestionJobResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Gets information about a ingestion job, in which a data source is added to a knowledge base.</p>
31+
* <p>Gets information about a data ingestion job. Data sources are ingested into your knowledge base so that Large Lanaguage Models (LLMs) can use your data.</p>
3232
* @example
3333
* Use a bare-bones client and the command you need to make an API call.
3434
* ```javascript
@@ -48,7 +48,7 @@ export interface GetIngestionJobCommandOutput extends GetIngestionJobResponse, _
4848
* // dataSourceId: "STRING_VALUE", // required
4949
* // ingestionJobId: "STRING_VALUE", // required
5050
* // description: "STRING_VALUE",
51-
* // status: "STARTING" || "IN_PROGRESS" || "COMPLETE" || "FAILED", // required
51+
* // status: "STARTING" || "IN_PROGRESS" || "COMPLETE" || "FAILED" || "STOPPING" || "STOPPED", // required
5252
* // statistics: { // IngestionJobStatistics
5353
* // numberOfDocumentsScanned: Number("long"),
5454
* // numberOfMetadataDocumentsScanned: Number("long"),

clients/client-bedrock-agent/src/commands/ListIngestionJobsCommand.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface ListIngestionJobsCommandInput extends ListIngestionJobsRequest
2828
export interface ListIngestionJobsCommandOutput extends ListIngestionJobsResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Lists the ingestion jobs for a data source and information about each of them.</p>
31+
* <p>Lists the data ingestion jobs for a data source. The list also includes information about each job.</p>
3232
* @example
3333
* Use a bare-bones client and the command you need to make an API call.
3434
* ```javascript
@@ -63,7 +63,7 @@ export interface ListIngestionJobsCommandOutput extends ListIngestionJobsRespons
6363
* // dataSourceId: "STRING_VALUE", // required
6464
* // ingestionJobId: "STRING_VALUE", // required
6565
* // description: "STRING_VALUE",
66-
* // status: "STARTING" || "IN_PROGRESS" || "COMPLETE" || "FAILED", // required
66+
* // status: "STARTING" || "IN_PROGRESS" || "COMPLETE" || "FAILED" || "STOPPING" || "STOPPED", // required
6767
* // startedAt: new Date("TIMESTAMP"), // required
6868
* // updatedAt: new Date("TIMESTAMP"), // required
6969
* // statistics: { // IngestionJobStatistics

clients/client-bedrock-agent/src/commands/ListKnowledgeBasesCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface ListKnowledgeBasesCommandInput extends ListKnowledgeBasesReques
2828
export interface ListKnowledgeBasesCommandOutput extends ListKnowledgeBasesResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Lists the knowledge bases in an account and information about each of them.</p>
31+
* <p>Lists the knowledge bases in an account. The list also includesinformation about each knowledge base.</p>
3232
* @example
3333
* Use a bare-bones client and the command you need to make an API call.
3434
* ```javascript

clients/client-bedrock-agent/src/commands/StartIngestionJobCommand.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface StartIngestionJobCommandInput extends StartIngestionJobRequest
2828
export interface StartIngestionJobCommandOutput extends StartIngestionJobResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Begins an ingestion job, in which a data source is added to a knowledge base.</p>
31+
* <p>Begins a data ingestion job. Data sources are ingested into your knowledge base so that Large Language Models (LLMs) can use your data.</p>
3232
* @example
3333
* Use a bare-bones client and the command you need to make an API call.
3434
* ```javascript
@@ -49,7 +49,7 @@ export interface StartIngestionJobCommandOutput extends StartIngestionJobRespons
4949
* // dataSourceId: "STRING_VALUE", // required
5050
* // ingestionJobId: "STRING_VALUE", // required
5151
* // description: "STRING_VALUE",
52-
* // status: "STARTING" || "IN_PROGRESS" || "COMPLETE" || "FAILED", // required
52+
* // status: "STARTING" || "IN_PROGRESS" || "COMPLETE" || "FAILED" || "STOPPING" || "STOPPED", // required
5353
* // statistics: { // IngestionJobStatistics
5454
* // numberOfDocumentsScanned: Number("long"),
5555
* // numberOfMetadataDocumentsScanned: Number("long"),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { StopIngestionJobRequest, StopIngestionJobResponse } from "../models/models_0";
10+
import { de_StopIngestionJobCommand, se_StopIngestionJobCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link StopIngestionJobCommand}.
21+
*/
22+
export interface StopIngestionJobCommandInput extends StopIngestionJobRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link StopIngestionJobCommand}.
27+
*/
28+
export interface StopIngestionJobCommandOutput extends StopIngestionJobResponse, __MetadataBearer {}
29+
30+
/**
31+
* <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>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { BedrockAgentClient, StopIngestionJobCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import
36+
* // const { BedrockAgentClient, StopIngestionJobCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import
37+
* const client = new BedrockAgentClient(config);
38+
* const input = { // StopIngestionJobRequest
39+
* knowledgeBaseId: "STRING_VALUE", // required
40+
* dataSourceId: "STRING_VALUE", // required
41+
* ingestionJobId: "STRING_VALUE", // required
42+
* };
43+
* const command = new StopIngestionJobCommand(input);
44+
* const response = await client.send(command);
45+
* // { // StopIngestionJobResponse
46+
* // ingestionJob: { // IngestionJob
47+
* // knowledgeBaseId: "STRING_VALUE", // required
48+
* // dataSourceId: "STRING_VALUE", // required
49+
* // ingestionJobId: "STRING_VALUE", // required
50+
* // description: "STRING_VALUE",
51+
* // status: "STARTING" || "IN_PROGRESS" || "COMPLETE" || "FAILED" || "STOPPING" || "STOPPED", // required
52+
* // statistics: { // IngestionJobStatistics
53+
* // numberOfDocumentsScanned: Number("long"),
54+
* // numberOfMetadataDocumentsScanned: Number("long"),
55+
* // numberOfNewDocumentsIndexed: Number("long"),
56+
* // numberOfModifiedDocumentsIndexed: Number("long"),
57+
* // numberOfMetadataDocumentsModified: Number("long"),
58+
* // numberOfDocumentsDeleted: Number("long"),
59+
* // numberOfDocumentsFailed: Number("long"),
60+
* // },
61+
* // failureReasons: [ // FailureReasons
62+
* // "STRING_VALUE",
63+
* // ],
64+
* // startedAt: new Date("TIMESTAMP"), // required
65+
* // updatedAt: new Date("TIMESTAMP"), // required
66+
* // },
67+
* // };
68+
*
69+
* ```
70+
*
71+
* @param StopIngestionJobCommandInput - {@link StopIngestionJobCommandInput}
72+
* @returns {@link StopIngestionJobCommandOutput}
73+
* @see {@link StopIngestionJobCommandInput} for command's `input` shape.
74+
* @see {@link StopIngestionJobCommandOutput} for command's `response` shape.
75+
* @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape.
76+
*
77+
* @throws {@link AccessDeniedException} (client fault)
78+
* <p>The request is denied because of missing access permissions.</p>
79+
*
80+
* @throws {@link ConflictException} (client fault)
81+
* <p>There was a conflict performing an operation.</p>
82+
*
83+
* @throws {@link InternalServerException} (server fault)
84+
* <p>An internal server error occurred. Retry your request.</p>
85+
*
86+
* @throws {@link ResourceNotFoundException} (client fault)
87+
* <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p>
88+
*
89+
* @throws {@link ThrottlingException} (client fault)
90+
* <p>The number of requests exceeds the limit. Resubmit your request later.</p>
91+
*
92+
* @throws {@link ValidationException} (client fault)
93+
* <p>Input validation failed. Check your request parameters and retry the request.</p>
94+
*
95+
* @throws {@link BedrockAgentServiceException}
96+
* <p>Base exception class for all service exceptions from BedrockAgent service.</p>
97+
*
98+
* @public
99+
*/
100+
export class StopIngestionJobCommand extends $Command
101+
.classBuilder<
102+
StopIngestionJobCommandInput,
103+
StopIngestionJobCommandOutput,
104+
BedrockAgentClientResolvedConfig,
105+
ServiceInputTypes,
106+
ServiceOutputTypes
107+
>()
108+
.ep(commonParams)
109+
.m(function (this: any, Command: any, cs: any, config: BedrockAgentClientResolvedConfig, o: any) {
110+
return [
111+
getSerdePlugin(config, this.serialize, this.deserialize),
112+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
113+
];
114+
})
115+
.s("AmazonBedrockAgentBuildTimeLambda", "StopIngestionJob", {})
116+
.n("BedrockAgentClient", "StopIngestionJobCommand")
117+
.f(void 0, void 0)
118+
.ser(se_StopIngestionJobCommand)
119+
.de(de_StopIngestionJobCommand)
120+
.build() {
121+
/** @internal type navigation helper, not in runtime. */
122+
protected declare static __types: {
123+
api: {
124+
input: StopIngestionJobRequest;
125+
output: StopIngestionJobResponse;
126+
};
127+
sdk: {
128+
input: StopIngestionJobCommandInput;
129+
output: StopIngestionJobCommandOutput;
130+
};
131+
};
132+
}

clients/client-bedrock-agent/src/commands/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export * from "./ListTagsForResourceCommand";
4949
export * from "./PrepareAgentCommand";
5050
export * from "./PrepareFlowCommand";
5151
export * from "./StartIngestionJobCommand";
52+
export * from "./StopIngestionJobCommand";
5253
export * from "./TagResourceCommand";
5354
export * from "./UntagResourceCommand";
5455
export * from "./UpdateAgentActionGroupCommand";

0 commit comments

Comments
 (0)