|
| 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 { BedrockClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockClient"; |
| 8 | +import { commonParams } from "../endpoint/EndpointParameters"; |
| 9 | +import { |
| 10 | + CreateInferenceProfileRequest, |
| 11 | + CreateInferenceProfileRequestFilterSensitiveLog, |
| 12 | + CreateInferenceProfileResponse, |
| 13 | +} from "../models/models_0"; |
| 14 | +import { de_CreateInferenceProfileCommand, se_CreateInferenceProfileCommand } from "../protocols/Aws_restJson1"; |
| 15 | + |
| 16 | +/** |
| 17 | + * @public |
| 18 | + */ |
| 19 | +export type { __MetadataBearer }; |
| 20 | +export { $Command }; |
| 21 | +/** |
| 22 | + * @public |
| 23 | + * |
| 24 | + * The input for {@link CreateInferenceProfileCommand}. |
| 25 | + */ |
| 26 | +export interface CreateInferenceProfileCommandInput extends CreateInferenceProfileRequest {} |
| 27 | +/** |
| 28 | + * @public |
| 29 | + * |
| 30 | + * The output of {@link CreateInferenceProfileCommand}. |
| 31 | + */ |
| 32 | +export interface CreateInferenceProfileCommandOutput extends CreateInferenceProfileResponse, __MetadataBearer {} |
| 33 | + |
| 34 | +/** |
| 35 | + * <p>Creates an application inference profile to track metrics and costs when invoking a model. To create an application inference profile for a foundation model in one region, specify the ARN of the model in that region. To create an application inference profile for a foundation model across multiple regions, specify the ARN of the system-defined inference profile that contains the regions that you want to route requests to. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">Increase throughput and resilience with cross-region inference in Amazon Bedrock</a>. in the Amazon Bedrock User Guide.</p> |
| 36 | + * @example |
| 37 | + * Use a bare-bones client and the command you need to make an API call. |
| 38 | + * ```javascript |
| 39 | + * import { BedrockClient, CreateInferenceProfileCommand } from "@aws-sdk/client-bedrock"; // ES Modules import |
| 40 | + * // const { BedrockClient, CreateInferenceProfileCommand } = require("@aws-sdk/client-bedrock"); // CommonJS import |
| 41 | + * const client = new BedrockClient(config); |
| 42 | + * const input = { // CreateInferenceProfileRequest |
| 43 | + * inferenceProfileName: "STRING_VALUE", // required |
| 44 | + * description: "STRING_VALUE", |
| 45 | + * clientRequestToken: "STRING_VALUE", |
| 46 | + * modelSource: { // InferenceProfileModelSource Union: only one key present |
| 47 | + * copyFrom: "STRING_VALUE", |
| 48 | + * }, |
| 49 | + * tags: [ // TagList |
| 50 | + * { // Tag |
| 51 | + * key: "STRING_VALUE", // required |
| 52 | + * value: "STRING_VALUE", // required |
| 53 | + * }, |
| 54 | + * ], |
| 55 | + * }; |
| 56 | + * const command = new CreateInferenceProfileCommand(input); |
| 57 | + * const response = await client.send(command); |
| 58 | + * // { // CreateInferenceProfileResponse |
| 59 | + * // inferenceProfileArn: "STRING_VALUE", // required |
| 60 | + * // status: "ACTIVE", |
| 61 | + * // }; |
| 62 | + * |
| 63 | + * ``` |
| 64 | + * |
| 65 | + * @param CreateInferenceProfileCommandInput - {@link CreateInferenceProfileCommandInput} |
| 66 | + * @returns {@link CreateInferenceProfileCommandOutput} |
| 67 | + * @see {@link CreateInferenceProfileCommandInput} for command's `input` shape. |
| 68 | + * @see {@link CreateInferenceProfileCommandOutput} for command's `response` shape. |
| 69 | + * @see {@link BedrockClientResolvedConfig | config} for BedrockClient's `config` shape. |
| 70 | + * |
| 71 | + * @throws {@link AccessDeniedException} (client fault) |
| 72 | + * <p>The request is denied because of missing access permissions.</p> |
| 73 | + * |
| 74 | + * @throws {@link ConflictException} (client fault) |
| 75 | + * <p>Error occurred because of a conflict while performing an operation.</p> |
| 76 | + * |
| 77 | + * @throws {@link InternalServerException} (server fault) |
| 78 | + * <p>An internal server error occurred. Retry your request.</p> |
| 79 | + * |
| 80 | + * @throws {@link ResourceNotFoundException} (client fault) |
| 81 | + * <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p> |
| 82 | + * |
| 83 | + * @throws {@link ServiceQuotaExceededException} (client fault) |
| 84 | + * <p>The number of requests exceeds the service quota. Resubmit your request later.</p> |
| 85 | + * |
| 86 | + * @throws {@link ThrottlingException} (client fault) |
| 87 | + * <p>The number of requests exceeds the limit. Resubmit your request later.</p> |
| 88 | + * |
| 89 | + * @throws {@link TooManyTagsException} (client fault) |
| 90 | + * <p>The request contains more tags than can be associated with a resource (50 tags per resource). |
| 91 | + * The maximum number of tags includes both existing tags and those included in your current request. </p> |
| 92 | + * |
| 93 | + * @throws {@link ValidationException} (client fault) |
| 94 | + * <p>Input validation failed. Check your request parameters and retry the request.</p> |
| 95 | + * |
| 96 | + * @throws {@link BedrockServiceException} |
| 97 | + * <p>Base exception class for all service exceptions from Bedrock service.</p> |
| 98 | + * |
| 99 | + * @public |
| 100 | + */ |
| 101 | +export class CreateInferenceProfileCommand extends $Command |
| 102 | + .classBuilder< |
| 103 | + CreateInferenceProfileCommandInput, |
| 104 | + CreateInferenceProfileCommandOutput, |
| 105 | + BedrockClientResolvedConfig, |
| 106 | + ServiceInputTypes, |
| 107 | + ServiceOutputTypes |
| 108 | + >() |
| 109 | + .ep(commonParams) |
| 110 | + .m(function (this: any, Command: any, cs: any, config: BedrockClientResolvedConfig, o: any) { |
| 111 | + return [ |
| 112 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 113 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 114 | + ]; |
| 115 | + }) |
| 116 | + .s("AmazonBedrockControlPlaneService", "CreateInferenceProfile", {}) |
| 117 | + .n("BedrockClient", "CreateInferenceProfileCommand") |
| 118 | + .f(CreateInferenceProfileRequestFilterSensitiveLog, void 0) |
| 119 | + .ser(se_CreateInferenceProfileCommand) |
| 120 | + .de(de_CreateInferenceProfileCommand) |
| 121 | + .build() { |
| 122 | + /** @internal type navigation helper, not in runtime. */ |
| 123 | + protected declare static __types: { |
| 124 | + api: { |
| 125 | + input: CreateInferenceProfileRequest; |
| 126 | + output: CreateInferenceProfileResponse; |
| 127 | + }; |
| 128 | + sdk: { |
| 129 | + input: CreateInferenceProfileCommandInput; |
| 130 | + output: CreateInferenceProfileCommandOutput; |
| 131 | + }; |
| 132 | + }; |
| 133 | +} |
0 commit comments