Class CfnSamplingRule.SamplingRuleProperty.Builder
java.lang.Object
software.amazon.awscdk.services.xray.CfnSamplingRule.SamplingRuleProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnSamplingRule.SamplingRuleProperty>
- Enclosing interface:
CfnSamplingRule.SamplingRuleProperty
@Stability(Stable)
public static final class CfnSamplingRule.SamplingRuleProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnSamplingRule.SamplingRuleProperty>
A builder for
CfnSamplingRule.SamplingRuleProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionattributes
(Map<String, String> attributes) Sets the value ofCfnSamplingRule.SamplingRuleProperty.getAttributes()
attributes
(IResolvable attributes) Sets the value ofCfnSamplingRule.SamplingRuleProperty.getAttributes()
build()
Builds the configured instance.Sets the value ofCfnSamplingRule.SamplingRuleProperty.getFixedRate()
Sets the value ofCfnSamplingRule.SamplingRuleProperty.getHost()
httpMethod
(String httpMethod) Sets the value ofCfnSamplingRule.SamplingRuleProperty.getHttpMethod()
Sets the value ofCfnSamplingRule.SamplingRuleProperty.getPriority()
reservoirSize
(Number reservoirSize) Sets the value ofCfnSamplingRule.SamplingRuleProperty.getReservoirSize()
resourceArn
(String resourceArn) Sets the value ofCfnSamplingRule.SamplingRuleProperty.getResourceArn()
Sets the value ofCfnSamplingRule.SamplingRuleProperty.getRuleArn()
Sets the value ofCfnSamplingRule.SamplingRuleProperty.getRuleName()
serviceName
(String serviceName) Sets the value ofCfnSamplingRule.SamplingRuleProperty.getServiceName()
serviceType
(String serviceType) Sets the value ofCfnSamplingRule.SamplingRuleProperty.getServiceType()
Sets the value ofCfnSamplingRule.SamplingRuleProperty.getUrlPath()
Sets the value ofCfnSamplingRule.SamplingRuleProperty.getVersion()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
fixedRate
Sets the value ofCfnSamplingRule.SamplingRuleProperty.getFixedRate()
- Parameters:
fixedRate
- The percentage of matching requests to instrument, after the reservoir is exhausted. This parameter is required.- Returns:
this
-
host
Sets the value ofCfnSamplingRule.SamplingRuleProperty.getHost()
- Parameters:
host
- Matches the hostname from a request URL. This parameter is required.- Returns:
this
-
httpMethod
@Stability(Stable) public CfnSamplingRule.SamplingRuleProperty.Builder httpMethod(String httpMethod) Sets the value ofCfnSamplingRule.SamplingRuleProperty.getHttpMethod()
- Parameters:
httpMethod
- Matches the HTTP method of a request. This parameter is required.- Returns:
this
-
priority
Sets the value ofCfnSamplingRule.SamplingRuleProperty.getPriority()
- Parameters:
priority
- The priority of the sampling rule. This parameter is required.- Returns:
this
-
reservoirSize
@Stability(Stable) public CfnSamplingRule.SamplingRuleProperty.Builder reservoirSize(Number reservoirSize) Sets the value ofCfnSamplingRule.SamplingRuleProperty.getReservoirSize()
- Parameters:
reservoirSize
- A fixed number of matching requests to instrument per second, prior to applying the fixed rate. This parameter is required. The reservoir is not used directly by services, but applies to all services using the rule collectively.- Returns:
this
-
resourceArn
@Stability(Stable) public CfnSamplingRule.SamplingRuleProperty.Builder resourceArn(String resourceArn) Sets the value ofCfnSamplingRule.SamplingRuleProperty.getResourceArn()
- Parameters:
resourceArn
- Matches the ARN of the AWS resource on which the service runs. This parameter is required.- Returns:
this
-
serviceName
@Stability(Stable) public CfnSamplingRule.SamplingRuleProperty.Builder serviceName(String serviceName) Sets the value ofCfnSamplingRule.SamplingRuleProperty.getServiceName()
- Parameters:
serviceName
- Matches thename
that the service uses to identify itself in segments. This parameter is required.- Returns:
this
-
serviceType
@Stability(Stable) public CfnSamplingRule.SamplingRuleProperty.Builder serviceType(String serviceType) Sets the value ofCfnSamplingRule.SamplingRuleProperty.getServiceType()
- Parameters:
serviceType
- Matches theorigin
that the service uses to identify its type in segments. This parameter is required.- Returns:
this
-
urlPath
Sets the value ofCfnSamplingRule.SamplingRuleProperty.getUrlPath()
- Parameters:
urlPath
- Matches the path from a request URL. This parameter is required.- Returns:
this
-
attributes
@Stability(Stable) public CfnSamplingRule.SamplingRuleProperty.Builder attributes(IResolvable attributes) Sets the value ofCfnSamplingRule.SamplingRuleProperty.getAttributes()
- Parameters:
attributes
- Matches attributes derived from the request. Map Entries: Maximum number of 5 items.Key Length Constraints: Minimum length of 1. Maximum length of 32.
Value Length Constraints: Minimum length of 1. Maximum length of 32.
- Returns:
this
-
attributes
@Stability(Stable) public CfnSamplingRule.SamplingRuleProperty.Builder attributes(Map<String, String> attributes) Sets the value ofCfnSamplingRule.SamplingRuleProperty.getAttributes()
- Parameters:
attributes
- Matches attributes derived from the request. Map Entries: Maximum number of 5 items.Key Length Constraints: Minimum length of 1. Maximum length of 32.
Value Length Constraints: Minimum length of 1. Maximum length of 32.
- Returns:
this
-
ruleArn
Sets the value ofCfnSamplingRule.SamplingRuleProperty.getRuleArn()
- Parameters:
ruleArn
- The ARN of the sampling rule. Specify a rule by either name or ARN, but not both.Specifying a sampling rule by name is recommended, as specifying by ARN will be deprecated in future.
- Returns:
this
-
ruleName
Sets the value ofCfnSamplingRule.SamplingRuleProperty.getRuleName()
- Parameters:
ruleName
- The name of the sampling rule. Specify a rule by either name or ARN, but not both.- Returns:
this
-
version
Sets the value ofCfnSamplingRule.SamplingRuleProperty.getVersion()
- Parameters:
version
- The version of the sampling rule.Version
can only be set when creating a new sampling rule.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnSamplingRule.SamplingRuleProperty>
- Returns:
- a new instance of
CfnSamplingRule.SamplingRuleProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-