Skip to content

Commit

Permalink
feat(client-memorydb): This release adds support for MemoryDB Reserve…
Browse files Browse the repository at this point in the history
…d nodes which provides a significant discount compared to on-demand node pricing. Reserved nodes are not physical nodes, but rather a billing discount applied to the use of on-demand nodes in your account.
  • Loading branch information
awstools committed Dec 27, 2022
1 parent 6fe57fe commit bd42342
Show file tree
Hide file tree
Showing 27 changed files with 2,885 additions and 123 deletions.
112 changes: 111 additions & 1 deletion clients/client-memorydb/src/MemoryDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ import {
DescribeParametersCommandInput,
DescribeParametersCommandOutput,
} from "./commands/DescribeParametersCommand";
import {
DescribeReservedNodesCommand,
DescribeReservedNodesCommandInput,
DescribeReservedNodesCommandOutput,
} from "./commands/DescribeReservedNodesCommand";
import {
DescribeReservedNodesOfferingsCommand,
DescribeReservedNodesOfferingsCommandInput,
DescribeReservedNodesOfferingsCommandOutput,
} from "./commands/DescribeReservedNodesOfferingsCommand";
import {
DescribeServiceUpdatesCommand,
DescribeServiceUpdatesCommandInput,
Expand Down Expand Up @@ -116,6 +126,11 @@ import {
ListAllowedNodeTypeUpdatesCommandOutput,
} from "./commands/ListAllowedNodeTypeUpdatesCommand";
import { ListTagsCommand, ListTagsCommandInput, ListTagsCommandOutput } from "./commands/ListTagsCommand";
import {
PurchaseReservedNodesOfferingCommand,
PurchaseReservedNodesOfferingCommandInput,
PurchaseReservedNodesOfferingCommandOutput,
} from "./commands/PurchaseReservedNodesOfferingCommand";
import {
ResetParameterGroupCommand,
ResetParameterGroupCommandInput,
Expand Down Expand Up @@ -771,6 +786,70 @@ export class MemoryDB extends MemoryDBClient {
}
}

/**
* <p>Returns information about reserved nodes for this account, or about a specified reserved node.</p>
*/
public describeReservedNodes(
args: DescribeReservedNodesCommandInput,
options?: __HttpHandlerOptions
): Promise<DescribeReservedNodesCommandOutput>;
public describeReservedNodes(
args: DescribeReservedNodesCommandInput,
cb: (err: any, data?: DescribeReservedNodesCommandOutput) => void
): void;
public describeReservedNodes(
args: DescribeReservedNodesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DescribeReservedNodesCommandOutput) => void
): void;
public describeReservedNodes(
args: DescribeReservedNodesCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DescribeReservedNodesCommandOutput) => void),
cb?: (err: any, data?: DescribeReservedNodesCommandOutput) => void
): Promise<DescribeReservedNodesCommandOutput> | void {
const command = new DescribeReservedNodesCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Lists available reserved node offerings.</p>
*/
public describeReservedNodesOfferings(
args: DescribeReservedNodesOfferingsCommandInput,
options?: __HttpHandlerOptions
): Promise<DescribeReservedNodesOfferingsCommandOutput>;
public describeReservedNodesOfferings(
args: DescribeReservedNodesOfferingsCommandInput,
cb: (err: any, data?: DescribeReservedNodesOfferingsCommandOutput) => void
): void;
public describeReservedNodesOfferings(
args: DescribeReservedNodesOfferingsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DescribeReservedNodesOfferingsCommandOutput) => void
): void;
public describeReservedNodesOfferings(
args: DescribeReservedNodesOfferingsCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DescribeReservedNodesOfferingsCommandOutput) => void),
cb?: (err: any, data?: DescribeReservedNodesOfferingsCommandOutput) => void
): Promise<DescribeReservedNodesOfferingsCommandOutput> | void {
const command = new DescribeReservedNodesOfferingsCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Returns details of the service updates</p>
*/
Expand Down Expand Up @@ -997,6 +1076,38 @@ export class MemoryDB extends MemoryDBClient {
}
}

/**
* <p>Allows you to purchase a reserved node offering. Reserved nodes are not eligible for cancellation and are non-refundable.</p>
*/
public purchaseReservedNodesOffering(
args: PurchaseReservedNodesOfferingCommandInput,
options?: __HttpHandlerOptions
): Promise<PurchaseReservedNodesOfferingCommandOutput>;
public purchaseReservedNodesOffering(
args: PurchaseReservedNodesOfferingCommandInput,
cb: (err: any, data?: PurchaseReservedNodesOfferingCommandOutput) => void
): void;
public purchaseReservedNodesOffering(
args: PurchaseReservedNodesOfferingCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: PurchaseReservedNodesOfferingCommandOutput) => void
): void;
public purchaseReservedNodesOffering(
args: PurchaseReservedNodesOfferingCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: PurchaseReservedNodesOfferingCommandOutput) => void),
cb?: (err: any, data?: PurchaseReservedNodesOfferingCommandOutput) => void
): Promise<PurchaseReservedNodesOfferingCommandOutput> | void {
const command = new PurchaseReservedNodesOfferingCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Modifies the parameters of a parameter group to the engine or system default value. You can reset specific parameters by submitting a list of parameter names. To reset the entire parameter group, specify the AllParameters and ParameterGroupName parameters.</p>
*/
Expand Down Expand Up @@ -1035,7 +1146,6 @@ export class MemoryDB extends MemoryDBClient {
* When you add or remove tags on clusters, those actions will be replicated to all nodes in the cluster. For more information, see
*
* <a href="https://docs.aws.amazon.com/MemoryDB/latest/devguide/iam.resourcelevelpermissions.html">Resource-level permissions</a>.</p>
*
* <p>For example, you can use cost-allocation tags to your MemoryDB resources, Amazon generates a cost allocation report as a comma-separated value
* (CSV) file with your usage and costs aggregated by your tags. You can apply tags that represent business categories
* (such as cost centers, application names, or owners) to organize your costs across multiple services.
Expand Down
18 changes: 18 additions & 0 deletions clients/client-memorydb/src/MemoryDBClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ import {
DescribeParameterGroupsCommandOutput,
} from "./commands/DescribeParameterGroupsCommand";
import { DescribeParametersCommandInput, DescribeParametersCommandOutput } from "./commands/DescribeParametersCommand";
import {
DescribeReservedNodesCommandInput,
DescribeReservedNodesCommandOutput,
} from "./commands/DescribeReservedNodesCommand";
import {
DescribeReservedNodesOfferingsCommandInput,
DescribeReservedNodesOfferingsCommandOutput,
} from "./commands/DescribeReservedNodesOfferingsCommand";
import {
DescribeServiceUpdatesCommandInput,
DescribeServiceUpdatesCommandOutput,
Expand All @@ -95,6 +103,10 @@ import {
ListAllowedNodeTypeUpdatesCommandOutput,
} from "./commands/ListAllowedNodeTypeUpdatesCommand";
import { ListTagsCommandInput, ListTagsCommandOutput } from "./commands/ListTagsCommand";
import {
PurchaseReservedNodesOfferingCommandInput,
PurchaseReservedNodesOfferingCommandOutput,
} from "./commands/PurchaseReservedNodesOfferingCommand";
import {
ResetParameterGroupCommandInput,
ResetParameterGroupCommandOutput,
Expand Down Expand Up @@ -138,13 +150,16 @@ export type ServiceInputTypes =
| DescribeEventsCommandInput
| DescribeParameterGroupsCommandInput
| DescribeParametersCommandInput
| DescribeReservedNodesCommandInput
| DescribeReservedNodesOfferingsCommandInput
| DescribeServiceUpdatesCommandInput
| DescribeSnapshotsCommandInput
| DescribeSubnetGroupsCommandInput
| DescribeUsersCommandInput
| FailoverShardCommandInput
| ListAllowedNodeTypeUpdatesCommandInput
| ListTagsCommandInput
| PurchaseReservedNodesOfferingCommandInput
| ResetParameterGroupCommandInput
| TagResourceCommandInput
| UntagResourceCommandInput
Expand Down Expand Up @@ -175,13 +190,16 @@ export type ServiceOutputTypes =
| DescribeEventsCommandOutput
| DescribeParameterGroupsCommandOutput
| DescribeParametersCommandOutput
| DescribeReservedNodesCommandOutput
| DescribeReservedNodesOfferingsCommandOutput
| DescribeServiceUpdatesCommandOutput
| DescribeSnapshotsCommandOutput
| DescribeSubnetGroupsCommandOutput
| DescribeUsersCommandOutput
| FailoverShardCommandOutput
| ListAllowedNodeTypeUpdatesCommandOutput
| ListTagsCommandOutput
| PurchaseReservedNodesOfferingCommandOutput
| ResetParameterGroupCommandOutput
| TagResourceCommandOutput
| UntagResourceCommandOutput
Expand Down
114 changes: 114 additions & 0 deletions clients/client-memorydb/src/commands/DescribeReservedNodesCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
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 { MemoryDBClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MemoryDBClient";
import {
DescribeReservedNodesRequest,
DescribeReservedNodesRequestFilterSensitiveLog,
DescribeReservedNodesResponse,
DescribeReservedNodesResponseFilterSensitiveLog,
} from "../models/models_0";
import {
deserializeAws_json1_1DescribeReservedNodesCommand,
serializeAws_json1_1DescribeReservedNodesCommand,
} from "../protocols/Aws_json1_1";

export interface DescribeReservedNodesCommandInput extends DescribeReservedNodesRequest {}
export interface DescribeReservedNodesCommandOutput extends DescribeReservedNodesResponse, __MetadataBearer {}

/**
* <p>Returns information about reserved nodes for this account, or about a specified reserved node.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { MemoryDBClient, DescribeReservedNodesCommand } from "@aws-sdk/client-memorydb"; // ES Modules import
* // const { MemoryDBClient, DescribeReservedNodesCommand } = require("@aws-sdk/client-memorydb"); // CommonJS import
* const client = new MemoryDBClient(config);
* const command = new DescribeReservedNodesCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link DescribeReservedNodesCommandInput} for command's `input` shape.
* @see {@link DescribeReservedNodesCommandOutput} for command's `response` shape.
* @see {@link MemoryDBClientResolvedConfig | config} for MemoryDBClient's `config` shape.
*
*/
export class DescribeReservedNodesCommand extends $Command<
DescribeReservedNodesCommandInput,
DescribeReservedNodesCommandOutput,
MemoryDBClientResolvedConfig
> {
// 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: DescribeReservedNodesCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: MemoryDBClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<DescribeReservedNodesCommandInput, DescribeReservedNodesCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, DescribeReservedNodesCommand.getEndpointParameterInstructions())
);

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "MemoryDBClient";
const commandName = "DescribeReservedNodesCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: DescribeReservedNodesRequestFilterSensitiveLog,
outputFilterSensitiveLog: DescribeReservedNodesResponseFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(input: DescribeReservedNodesCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_json1_1DescribeReservedNodesCommand(input, context);
}

private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DescribeReservedNodesCommandOutput> {
return deserializeAws_json1_1DescribeReservedNodesCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
Loading

0 comments on commit bd42342

Please sign in to comment.