-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-timestream-write): This release adds the ability to inges…
…t batched historical data or migrate data in bulk from S3 into Timestream using CSV files.
- Loading branch information
awstools
committed
Feb 27, 2023
1 parent
58828d8
commit 0435738
Showing
30 changed files
with
4,523 additions
and
942 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
405 changes: 274 additions & 131 deletions
405
clients/client-timestream-write/src/TimestreamWrite.ts
Large diffs are not rendered by default.
Oops, something went wrong.
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
126 changes: 126 additions & 0 deletions
126
clients/client-timestream-write/src/commands/CreateBatchLoadTaskCommand.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,126 @@ | ||
// smithy-typescript generated code | ||
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; | ||
import { getEndpointDiscoveryPlugin } from "@aws-sdk/middleware-endpoint-discovery"; | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@aws-sdk/types"; | ||
|
||
import { | ||
CreateBatchLoadTaskRequest, | ||
CreateBatchLoadTaskRequestFilterSensitiveLog, | ||
CreateBatchLoadTaskResponse, | ||
CreateBatchLoadTaskResponseFilterSensitiveLog, | ||
} from "../models/models_0"; | ||
import { | ||
deserializeAws_json1_0CreateBatchLoadTaskCommand, | ||
serializeAws_json1_0CreateBatchLoadTaskCommand, | ||
} from "../protocols/Aws_json1_0"; | ||
import { ServiceInputTypes, ServiceOutputTypes, TimestreamWriteClientResolvedConfig } from "../TimestreamWriteClient"; | ||
|
||
export interface CreateBatchLoadTaskCommandInput extends CreateBatchLoadTaskRequest {} | ||
export interface CreateBatchLoadTaskCommandOutput extends CreateBatchLoadTaskResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Creates a new Timestream batch load task. A batch load task processes data from | ||
* a CSV source in an S3 location and writes to a Timestream table. A mapping from | ||
* source to target is defined in a batch load task. Errors and events are written to a report | ||
* at an S3 location. For the report, if the KMS key is not specified, the | ||
* batch load task will be encrypted with a Timestream managed KMS key | ||
* located in your account. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon Web Services managed | ||
* keys</a>. <a href="https://docs.aws.amazon.com/timestream/latest/developerguide/ts-limits.html">Service quotas apply</a>. For | ||
* details, see <a href="https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.create-batch-load.html">code | ||
* sample</a>.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { TimestreamWriteClient, CreateBatchLoadTaskCommand } from "@aws-sdk/client-timestream-write"; // ES Modules import | ||
* // const { TimestreamWriteClient, CreateBatchLoadTaskCommand } = require("@aws-sdk/client-timestream-write"); // CommonJS import | ||
* const client = new TimestreamWriteClient(config); | ||
* const command = new CreateBatchLoadTaskCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link CreateBatchLoadTaskCommandInput} for command's `input` shape. | ||
* @see {@link CreateBatchLoadTaskCommandOutput} for command's `response` shape. | ||
* @see {@link TimestreamWriteClientResolvedConfig | config} for TimestreamWriteClient's `config` shape. | ||
* | ||
*/ | ||
export class CreateBatchLoadTaskCommand extends $Command< | ||
CreateBatchLoadTaskCommandInput, | ||
CreateBatchLoadTaskCommandOutput, | ||
TimestreamWriteClientResolvedConfig | ||
> { | ||
// 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" }, | ||
}; | ||
} | ||
|
||
constructor(readonly input: CreateBatchLoadTaskCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: TimestreamWriteClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<CreateBatchLoadTaskCommandInput, CreateBatchLoadTaskCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
this.middlewareStack.use( | ||
getEndpointPlugin(configuration, CreateBatchLoadTaskCommand.getEndpointParameterInstructions()) | ||
); | ||
this.middlewareStack.use( | ||
getEndpointDiscoveryPlugin(configuration, { clientStack, options, isDiscoveredEndpointRequired: true }) | ||
); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "TimestreamWriteClient"; | ||
const commandName = "CreateBatchLoadTaskCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: CreateBatchLoadTaskRequestFilterSensitiveLog, | ||
outputFilterSensitiveLog: CreateBatchLoadTaskResponseFilterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: CreateBatchLoadTaskCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_json1_0CreateBatchLoadTaskCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateBatchLoadTaskCommandOutput> { | ||
return deserializeAws_json1_0CreateBatchLoadTaskCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
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
Oops, something went wrong.