import { Command as $Command } from "@smithy/core/client"; import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { CreateSamplingRuleRequest, CreateSamplingRuleResult } from "../models/models_0"; import type { ServiceInputTypes, ServiceOutputTypes, XRayClientResolvedConfig } from "../XRayClient"; /** * @public */ export type { __MetadataBearer }; export { $Command }; /** * @public * * The input for {@link CreateSamplingRuleCommand}. */ export interface CreateSamplingRuleCommandInput extends CreateSamplingRuleRequest { } /** * @public * * The output of {@link CreateSamplingRuleCommand}. */ export interface CreateSamplingRuleCommandOutput extends CreateSamplingRuleResult, __MetadataBearer { } declare const CreateSamplingRuleCommand_base: { new (input: CreateSamplingRuleCommandInput): import("@smithy/core/client").CommandImpl; new (input: CreateSamplingRuleCommandInput): import("@smithy/core/client").CommandImpl; getEndpointParameterInstructions(): { [x: string]: unknown; }; }; /** *

Creates a rule to control sampling behavior for instrumented applications. Services * retrieve rules with GetSamplingRules, and evaluate each rule in ascending * order of priority for each request. If a rule matches, the service * records a trace, borrowing it from the reservoir size. After 10 seconds, the service * reports back to X-Ray with GetSamplingTargets to get updated versions of * each in-use rule. The updated rule contains a trace quota that the service can use instead * of borrowing from the reservoir.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { XRayClient, CreateSamplingRuleCommand } from "@aws-sdk/client-xray"; // ES Modules import * // const { XRayClient, CreateSamplingRuleCommand } = require("@aws-sdk/client-xray"); // CommonJS import * // import type { XRayClientConfig } from "@aws-sdk/client-xray"; * const config = {}; // type is XRayClientConfig * const client = new XRayClient(config); * const input = { // CreateSamplingRuleRequest * SamplingRule: { // SamplingRule * RuleName: "STRING_VALUE", * RuleARN: "STRING_VALUE", * ResourceARN: "STRING_VALUE", // required * Priority: Number("int"), // required * FixedRate: Number("double"), // required * ReservoirSize: Number("int"), // required * ServiceName: "STRING_VALUE", // required * ServiceType: "STRING_VALUE", // required * Host: "STRING_VALUE", // required * HTTPMethod: "STRING_VALUE", // required * URLPath: "STRING_VALUE", // required * Version: Number("int"), // required * Attributes: { // AttributeMap * "": "STRING_VALUE", * }, * SamplingRateBoost: { // SamplingRateBoost * MaxRate: Number("double"), // required * CooldownWindowMinutes: Number("int"), // required * }, * }, * Tags: [ // TagList * { // Tag * Key: "STRING_VALUE", // required * Value: "STRING_VALUE", // required * }, * ], * }; * const command = new CreateSamplingRuleCommand(input); * const response = await client.send(command); * // { // CreateSamplingRuleResult * // SamplingRuleRecord: { // SamplingRuleRecord * // SamplingRule: { // SamplingRule * // RuleName: "STRING_VALUE", * // RuleARN: "STRING_VALUE", * // ResourceARN: "STRING_VALUE", // required * // Priority: Number("int"), // required * // FixedRate: Number("double"), // required * // ReservoirSize: Number("int"), // required * // ServiceName: "STRING_VALUE", // required * // ServiceType: "STRING_VALUE", // required * // Host: "STRING_VALUE", // required * // HTTPMethod: "STRING_VALUE", // required * // URLPath: "STRING_VALUE", // required * // Version: Number("int"), // required * // Attributes: { // AttributeMap * // "": "STRING_VALUE", * // }, * // SamplingRateBoost: { // SamplingRateBoost * // MaxRate: Number("double"), // required * // CooldownWindowMinutes: Number("int"), // required * // }, * // }, * // CreatedAt: new Date("TIMESTAMP"), * // ModifiedAt: new Date("TIMESTAMP"), * // }, * // }; * * ``` * * @param CreateSamplingRuleCommandInput - {@link CreateSamplingRuleCommandInput} * @returns {@link CreateSamplingRuleCommandOutput} * @see {@link CreateSamplingRuleCommandInput} for command's `input` shape. * @see {@link CreateSamplingRuleCommandOutput} for command's `response` shape. * @see {@link XRayClientResolvedConfig | config} for XRayClient's `config` shape. * * @throws {@link InvalidRequestException} (client fault) *

The request is missing required parameters or has invalid parameters.

* * @throws {@link RuleLimitExceededException} (client fault) *

You have reached the maximum number of sampling rules.

* * @throws {@link ThrottledException} (client fault) *

The request exceeds the maximum number of requests per second.

* * @throws {@link XRayServiceException} *

Base exception class for all service exceptions from XRay service.

* * * @public */ export declare class CreateSamplingRuleCommand extends CreateSamplingRuleCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: CreateSamplingRuleRequest; output: CreateSamplingRuleResult; }; sdk: { input: CreateSamplingRuleCommandInput; output: CreateSamplingRuleCommandOutput; }; }; }