|
| 1 | +// smithy-typescript generated code |
| 2 | +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { getSerdePlugin } from "@smithy/middleware-serde"; |
| 4 | +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; |
| 5 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 6 | +import { |
| 7 | + FinalizeHandlerArguments, |
| 8 | + Handler, |
| 9 | + HandlerExecutionContext, |
| 10 | + HttpHandlerOptions as __HttpHandlerOptions, |
| 11 | + MetadataBearer as __MetadataBearer, |
| 12 | + MiddlewareStack, |
| 13 | + SerdeContext as __SerdeContext, |
| 14 | + SMITHY_CONTEXT_KEY, |
| 15 | +} from "@smithy/types"; |
| 16 | + |
| 17 | +import { EKSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EKSClient"; |
| 18 | +import { DescribeInsightRequest, DescribeInsightResponse } from "../models/models_0"; |
| 19 | +import { de_DescribeInsightCommand, se_DescribeInsightCommand } from "../protocols/Aws_restJson1"; |
| 20 | + |
| 21 | +/** |
| 22 | + * @public |
| 23 | + */ |
| 24 | +export { __MetadataBearer, $Command }; |
| 25 | +/** |
| 26 | + * @public |
| 27 | + * |
| 28 | + * The input for {@link DescribeInsightCommand}. |
| 29 | + */ |
| 30 | +export interface DescribeInsightCommandInput extends DescribeInsightRequest {} |
| 31 | +/** |
| 32 | + * @public |
| 33 | + * |
| 34 | + * The output of {@link DescribeInsightCommand}. |
| 35 | + */ |
| 36 | +export interface DescribeInsightCommandOutput extends DescribeInsightResponse, __MetadataBearer {} |
| 37 | + |
| 38 | +/** |
| 39 | + * @public |
| 40 | + * <p>Returns details about an insight that you specify using its ID.</p> |
| 41 | + * @example |
| 42 | + * Use a bare-bones client and the command you need to make an API call. |
| 43 | + * ```javascript |
| 44 | + * import { EKSClient, DescribeInsightCommand } from "@aws-sdk/client-eks"; // ES Modules import |
| 45 | + * // const { EKSClient, DescribeInsightCommand } = require("@aws-sdk/client-eks"); // CommonJS import |
| 46 | + * const client = new EKSClient(config); |
| 47 | + * const input = { // DescribeInsightRequest |
| 48 | + * clusterName: "STRING_VALUE", // required |
| 49 | + * id: "STRING_VALUE", // required |
| 50 | + * }; |
| 51 | + * const command = new DescribeInsightCommand(input); |
| 52 | + * const response = await client.send(command); |
| 53 | + * // { // DescribeInsightResponse |
| 54 | + * // insight: { // Insight |
| 55 | + * // id: "STRING_VALUE", |
| 56 | + * // name: "STRING_VALUE", |
| 57 | + * // category: "UPGRADE_READINESS", |
| 58 | + * // kubernetesVersion: "STRING_VALUE", |
| 59 | + * // lastRefreshTime: new Date("TIMESTAMP"), |
| 60 | + * // lastTransitionTime: new Date("TIMESTAMP"), |
| 61 | + * // description: "STRING_VALUE", |
| 62 | + * // insightStatus: { // InsightStatus |
| 63 | + * // status: "PASSING" || "WARNING" || "ERROR" || "UNKNOWN", |
| 64 | + * // reason: "STRING_VALUE", |
| 65 | + * // }, |
| 66 | + * // recommendation: "STRING_VALUE", |
| 67 | + * // additionalInfo: { // AdditionalInfoMap |
| 68 | + * // "<keys>": "STRING_VALUE", |
| 69 | + * // }, |
| 70 | + * // resources: [ // InsightResourceDetails |
| 71 | + * // { // InsightResourceDetail |
| 72 | + * // insightStatus: { |
| 73 | + * // status: "PASSING" || "WARNING" || "ERROR" || "UNKNOWN", |
| 74 | + * // reason: "STRING_VALUE", |
| 75 | + * // }, |
| 76 | + * // kubernetesResourceUri: "STRING_VALUE", |
| 77 | + * // arn: "STRING_VALUE", |
| 78 | + * // }, |
| 79 | + * // ], |
| 80 | + * // categorySpecificSummary: { // InsightCategorySpecificSummary |
| 81 | + * // deprecationDetails: [ // DeprecationDetails |
| 82 | + * // { // DeprecationDetail |
| 83 | + * // usage: "STRING_VALUE", |
| 84 | + * // replacedWith: "STRING_VALUE", |
| 85 | + * // stopServingVersion: "STRING_VALUE", |
| 86 | + * // startServingReplacementVersion: "STRING_VALUE", |
| 87 | + * // clientStats: [ // ClientStats |
| 88 | + * // { // ClientStat |
| 89 | + * // userAgent: "STRING_VALUE", |
| 90 | + * // numberOfRequestsLast30Days: Number("int"), |
| 91 | + * // lastRequestTime: new Date("TIMESTAMP"), |
| 92 | + * // }, |
| 93 | + * // ], |
| 94 | + * // }, |
| 95 | + * // ], |
| 96 | + * // }, |
| 97 | + * // }, |
| 98 | + * // }; |
| 99 | + * |
| 100 | + * ``` |
| 101 | + * |
| 102 | + * @param DescribeInsightCommandInput - {@link DescribeInsightCommandInput} |
| 103 | + * @returns {@link DescribeInsightCommandOutput} |
| 104 | + * @see {@link DescribeInsightCommandInput} for command's `input` shape. |
| 105 | + * @see {@link DescribeInsightCommandOutput} for command's `response` shape. |
| 106 | + * @see {@link EKSClientResolvedConfig | config} for EKSClient's `config` shape. |
| 107 | + * |
| 108 | + * @throws {@link InvalidParameterException} (client fault) |
| 109 | + * <p>The specified parameter is invalid. Review the available parameters for the API |
| 110 | + * request.</p> |
| 111 | + * |
| 112 | + * @throws {@link InvalidRequestException} (client fault) |
| 113 | + * <p>The request is invalid given the state of the cluster. Check the state of the cluster |
| 114 | + * and the associated operations.</p> |
| 115 | + * |
| 116 | + * @throws {@link ResourceNotFoundException} (client fault) |
| 117 | + * <p>The specified resource could not be found. You can view your available clusters with |
| 118 | + * <code>ListClusters</code>. You can view your available managed node groups with |
| 119 | + * <code>ListNodegroups</code>. Amazon EKS clusters and node groups are Amazon Web Services Region specific.</p> |
| 120 | + * |
| 121 | + * @throws {@link ServerException} (server fault) |
| 122 | + * <p>These errors are usually caused by a server-side issue.</p> |
| 123 | + * |
| 124 | + * @throws {@link EKSServiceException} |
| 125 | + * <p>Base exception class for all service exceptions from EKS service.</p> |
| 126 | + * |
| 127 | + */ |
| 128 | +export class DescribeInsightCommand extends $Command< |
| 129 | + DescribeInsightCommandInput, |
| 130 | + DescribeInsightCommandOutput, |
| 131 | + EKSClientResolvedConfig |
| 132 | +> { |
| 133 | + public static getEndpointParameterInstructions(): EndpointParameterInstructions { |
| 134 | + return { |
| 135 | + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, |
| 136 | + Endpoint: { type: "builtInParams", name: "endpoint" }, |
| 137 | + Region: { type: "builtInParams", name: "region" }, |
| 138 | + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, |
| 139 | + }; |
| 140 | + } |
| 141 | + |
| 142 | + /** |
| 143 | + * @public |
| 144 | + */ |
| 145 | + constructor(readonly input: DescribeInsightCommandInput) { |
| 146 | + super(); |
| 147 | + } |
| 148 | + |
| 149 | + /** |
| 150 | + * @internal |
| 151 | + */ |
| 152 | + resolveMiddleware( |
| 153 | + clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, |
| 154 | + configuration: EKSClientResolvedConfig, |
| 155 | + options?: __HttpHandlerOptions |
| 156 | + ): Handler<DescribeInsightCommandInput, DescribeInsightCommandOutput> { |
| 157 | + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); |
| 158 | + this.middlewareStack.use( |
| 159 | + getEndpointPlugin(configuration, DescribeInsightCommand.getEndpointParameterInstructions()) |
| 160 | + ); |
| 161 | + |
| 162 | + const stack = clientStack.concat(this.middlewareStack); |
| 163 | + |
| 164 | + const { logger } = configuration; |
| 165 | + const clientName = "EKSClient"; |
| 166 | + const commandName = "DescribeInsightCommand"; |
| 167 | + const handlerExecutionContext: HandlerExecutionContext = { |
| 168 | + logger, |
| 169 | + clientName, |
| 170 | + commandName, |
| 171 | + inputFilterSensitiveLog: (_: any) => _, |
| 172 | + outputFilterSensitiveLog: (_: any) => _, |
| 173 | + [SMITHY_CONTEXT_KEY]: { |
| 174 | + service: "AWSWesleyFrontend", |
| 175 | + operation: "DescribeInsight", |
| 176 | + }, |
| 177 | + }; |
| 178 | + const { requestHandler } = configuration; |
| 179 | + return stack.resolve( |
| 180 | + (request: FinalizeHandlerArguments<any>) => |
| 181 | + requestHandler.handle(request.request as __HttpRequest, options || {}), |
| 182 | + handlerExecutionContext |
| 183 | + ); |
| 184 | + } |
| 185 | + |
| 186 | + /** |
| 187 | + * @internal |
| 188 | + */ |
| 189 | + private serialize(input: DescribeInsightCommandInput, context: __SerdeContext): Promise<__HttpRequest> { |
| 190 | + return se_DescribeInsightCommand(input, context); |
| 191 | + } |
| 192 | + |
| 193 | + /** |
| 194 | + * @internal |
| 195 | + */ |
| 196 | + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DescribeInsightCommandOutput> { |
| 197 | + return de_DescribeInsightCommand(output, context); |
| 198 | + } |
| 199 | +} |
0 commit comments