All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliyun.sdk.service.cbn20170912.models.CreateTrafficMarkingPolicyRequest Maven / Gradle / Ivy

// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sdk.service.cbn20170912.models;

import darabonba.core.RequestModel;
import darabonba.core.TeaModel;
import com.aliyun.sdk.gateway.pop.models.*;

/**
 * {@link CreateTrafficMarkingPolicyRequest} extends {@link RequestModel}
 *
 * 

CreateTrafficMarkingPolicyRequest

*/ public class CreateTrafficMarkingPolicyRequest extends Request { @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ClientToken") private String clientToken; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("DryRun") private Boolean dryRun; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("MarkingDscp") @com.aliyun.core.annotation.Validation(required = true) private Integer markingDscp; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("OwnerAccount") private String ownerAccount; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("OwnerId") private Long ownerId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("Priority") @com.aliyun.core.annotation.Validation(required = true) private Integer priority; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ResourceOwnerAccount") private String resourceOwnerAccount; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ResourceOwnerId") private Long resourceOwnerId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("TrafficMarkingPolicyDescription") private String trafficMarkingPolicyDescription; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("TrafficMarkingPolicyName") private String trafficMarkingPolicyName; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("TrafficMatchRules") private java.util.List < TrafficMatchRules> trafficMatchRules; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("TransitRouterId") @com.aliyun.core.annotation.Validation(required = true) private String transitRouterId; private CreateTrafficMarkingPolicyRequest(Builder builder) { super(builder); this.clientToken = builder.clientToken; this.dryRun = builder.dryRun; this.markingDscp = builder.markingDscp; this.ownerAccount = builder.ownerAccount; this.ownerId = builder.ownerId; this.priority = builder.priority; this.resourceOwnerAccount = builder.resourceOwnerAccount; this.resourceOwnerId = builder.resourceOwnerId; this.trafficMarkingPolicyDescription = builder.trafficMarkingPolicyDescription; this.trafficMarkingPolicyName = builder.trafficMarkingPolicyName; this.trafficMatchRules = builder.trafficMatchRules; this.transitRouterId = builder.transitRouterId; } public static Builder builder() { return new Builder(); } public static CreateTrafficMarkingPolicyRequest create() { return builder().build(); } @Override public Builder toBuilder() { return new Builder(this); } /** * @return clientToken */ public String getClientToken() { return this.clientToken; } /** * @return dryRun */ public Boolean getDryRun() { return this.dryRun; } /** * @return markingDscp */ public Integer getMarkingDscp() { return this.markingDscp; } /** * @return ownerAccount */ public String getOwnerAccount() { return this.ownerAccount; } /** * @return ownerId */ public Long getOwnerId() { return this.ownerId; } /** * @return priority */ public Integer getPriority() { return this.priority; } /** * @return resourceOwnerAccount */ public String getResourceOwnerAccount() { return this.resourceOwnerAccount; } /** * @return resourceOwnerId */ public Long getResourceOwnerId() { return this.resourceOwnerId; } /** * @return trafficMarkingPolicyDescription */ public String getTrafficMarkingPolicyDescription() { return this.trafficMarkingPolicyDescription; } /** * @return trafficMarkingPolicyName */ public String getTrafficMarkingPolicyName() { return this.trafficMarkingPolicyName; } /** * @return trafficMatchRules */ public java.util.List < TrafficMatchRules> getTrafficMatchRules() { return this.trafficMatchRules; } /** * @return transitRouterId */ public String getTransitRouterId() { return this.transitRouterId; } public static final class Builder extends Request.Builder { private String clientToken; private Boolean dryRun; private Integer markingDscp; private String ownerAccount; private Long ownerId; private Integer priority; private String resourceOwnerAccount; private Long resourceOwnerId; private String trafficMarkingPolicyDescription; private String trafficMarkingPolicyName; private java.util.List < TrafficMatchRules> trafficMatchRules; private String transitRouterId; private Builder() { super(); } private Builder(CreateTrafficMarkingPolicyRequest request) { super(request); this.clientToken = request.clientToken; this.dryRun = request.dryRun; this.markingDscp = request.markingDscp; this.ownerAccount = request.ownerAccount; this.ownerId = request.ownerId; this.priority = request.priority; this.resourceOwnerAccount = request.resourceOwnerAccount; this.resourceOwnerId = request.resourceOwnerId; this.trafficMarkingPolicyDescription = request.trafficMarkingPolicyDescription; this.trafficMarkingPolicyName = request.trafficMarkingPolicyName; this.trafficMatchRules = request.trafficMatchRules; this.transitRouterId = request.transitRouterId; } /** * The client token that is used to ensure the idempotence of the request. *

* * You can use the client to generate the value, but you must make sure that it is unique among all requests. The client token can contain only ASCII characters. * * > If you do not set this parameter, **ClientToken** is set to the value of **RequestId**. The value of **RequestId** for each API request may be different. */ public Builder clientToken(String clientToken) { this.putQueryParameter("ClientToken", clientToken); this.clientToken = clientToken; return this; } /** * Specifies whether to perform a dry run. Valid values: *

* * * **true**: performs a dry run. The system checks the required parameters, request format, and limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned. * * **false** (default): performs a dry run and sends the request. */ public Builder dryRun(Boolean dryRun) { this.putQueryParameter("DryRun", dryRun); this.dryRun = dryRun; return this; } /** * The differentiated services code point (DSCP) value to be added to packets that match the traffic classification rule. Valid values: **0** to **63**. *

* * The DSCP value of each traffic marking policy on a transit router must be unique. */ public Builder markingDscp(Integer markingDscp) { this.putQueryParameter("MarkingDscp", markingDscp); this.markingDscp = markingDscp; return this; } /** * OwnerAccount. */ public Builder ownerAccount(String ownerAccount) { this.putQueryParameter("OwnerAccount", ownerAccount); this.ownerAccount = ownerAccount; return this; } /** * OwnerId. */ public Builder ownerId(Long ownerId) { this.putQueryParameter("OwnerId", ownerId); this.ownerId = ownerId; return this; } /** * The priority value of the traffic marking policy. Valid values: **1** to **100**. *

* * The priority value of each traffic marking policy on a transit router must be unique. A smaller value specifies a higher priority. */ public Builder priority(Integer priority) { this.putQueryParameter("Priority", priority); this.priority = priority; return this; } /** * ResourceOwnerAccount. */ public Builder resourceOwnerAccount(String resourceOwnerAccount) { this.putQueryParameter("ResourceOwnerAccount", resourceOwnerAccount); this.resourceOwnerAccount = resourceOwnerAccount; return this; } /** * ResourceOwnerId. */ public Builder resourceOwnerId(Long resourceOwnerId) { this.putQueryParameter("ResourceOwnerId", resourceOwnerId); this.resourceOwnerId = resourceOwnerId; return this; } /** * The description of the traffic marking policy. *

* * This parameter is optional. If you enter a description, it must be 1 to 256 characters in length, and cannot start with http:// or https://. */ public Builder trafficMarkingPolicyDescription(String trafficMarkingPolicyDescription) { this.putQueryParameter("TrafficMarkingPolicyDescription", trafficMarkingPolicyDescription); this.trafficMarkingPolicyDescription = trafficMarkingPolicyDescription; return this; } /** * The name of the traffic marking policy. *

* * The name can be empty or 1 to 128 characters in length, and cannot start with http:// or https://. */ public Builder trafficMarkingPolicyName(String trafficMarkingPolicyName) { this.putQueryParameter("TrafficMarkingPolicyName", trafficMarkingPolicyName); this.trafficMarkingPolicyName = trafficMarkingPolicyName; return this; } /** * The traffic classification rules in the traffic marking policy. *

* * Data packets that meet the traffic classification rule is assigned the DSCP value of quality of service (QoS) policy. * * You can create up to 50 traffic classification rules. */ public Builder trafficMatchRules(java.util.List < TrafficMatchRules> trafficMatchRules) { this.putQueryParameter("TrafficMatchRules", trafficMatchRules); this.trafficMatchRules = trafficMatchRules; return this; } /** * The ID of the transit router. */ public Builder transitRouterId(String transitRouterId) { this.putQueryParameter("TransitRouterId", transitRouterId); this.transitRouterId = transitRouterId; return this; } @Override public CreateTrafficMarkingPolicyRequest build() { return new CreateTrafficMarkingPolicyRequest(this); } } public static class TrafficMatchRules extends TeaModel { @com.aliyun.core.annotation.NameInMap("DstCidr") private String dstCidr; @com.aliyun.core.annotation.NameInMap("DstPortRange") private java.util.List < Integer > dstPortRange; @com.aliyun.core.annotation.NameInMap("MatchDscp") private Integer matchDscp; @com.aliyun.core.annotation.NameInMap("Protocol") private String protocol; @com.aliyun.core.annotation.NameInMap("SrcCidr") private String srcCidr; @com.aliyun.core.annotation.NameInMap("SrcPortRange") private java.util.List < Integer > srcPortRange; @com.aliyun.core.annotation.NameInMap("TrafficMatchRuleDescription") private String trafficMatchRuleDescription; @com.aliyun.core.annotation.NameInMap("TrafficMatchRuleName") private String trafficMatchRuleName; private TrafficMatchRules(Builder builder) { this.dstCidr = builder.dstCidr; this.dstPortRange = builder.dstPortRange; this.matchDscp = builder.matchDscp; this.protocol = builder.protocol; this.srcCidr = builder.srcCidr; this.srcPortRange = builder.srcPortRange; this.trafficMatchRuleDescription = builder.trafficMatchRuleDescription; this.trafficMatchRuleName = builder.trafficMatchRuleName; } public static Builder builder() { return new Builder(); } public static TrafficMatchRules create() { return builder().build(); } /** * @return dstCidr */ public String getDstCidr() { return this.dstCidr; } /** * @return dstPortRange */ public java.util.List < Integer > getDstPortRange() { return this.dstPortRange; } /** * @return matchDscp */ public Integer getMatchDscp() { return this.matchDscp; } /** * @return protocol */ public String getProtocol() { return this.protocol; } /** * @return srcCidr */ public String getSrcCidr() { return this.srcCidr; } /** * @return srcPortRange */ public java.util.List < Integer > getSrcPortRange() { return this.srcPortRange; } /** * @return trafficMatchRuleDescription */ public String getTrafficMatchRuleDescription() { return this.trafficMatchRuleDescription; } /** * @return trafficMatchRuleName */ public String getTrafficMatchRuleName() { return this.trafficMatchRuleName; } public static final class Builder { private String dstCidr; private java.util.List < Integer > dstPortRange; private Integer matchDscp; private String protocol; private String srcCidr; private java.util.List < Integer > srcPortRange; private String trafficMatchRuleDescription; private String trafficMatchRuleName; /** * The destination CIDR block that is used to match packets. *

* * Packets whose destination IP addresses fall into the specified destination CIDR block meet the traffic classification rule. If you do not specify a destination CIDR block, all packets meet the traffic classification rule. * * You can create up to 50 traffic classification rules in each call You can specify a destination CIDR block for each traffic classification rule. */ public Builder dstCidr(String dstCidr) { this.dstCidr = dstCidr; return this; } /** * The destination port range that is used to match packets. Valid values: **-1** and **1** to **65535**. *

* * Packets whose destination ports fall within the destination port range meet the traffic classification rule. If you do not specify destination port range, all packets meet the traffic classification rule. * * You can enter up to two port numbers. Take note of the following rules: * * * If you enter only one port number, such as 1, packets whose destination port is 1 meet the traffic classification rule. * * If you enter two port numbers, such as 1 and 200, packets whose destination ports fall into 1 and 200 meet the traffic classification rule. * * If you enter two port numbers and one of them is -1, the other port number must also be -1. In this case, all packets meet the traffic classification rule. * * You can create up to 50 traffic classification rules in each call. You can specify a destination port range for each traffic classification rule. */ public Builder dstPortRange(java.util.List < Integer > dstPortRange) { this.dstPortRange = dstPortRange; return this; } /** * The DSCP value that is used to match packets. Valid values: **0** to **63**. *

* * Packets that carry the specified DSCP value meet the traffic classification rule. If you do not specify a DSCP value, all packets meet the traffic classification rule. * * > The DSCP value that you specify for this parameter is the DSCP value that packets carry before they are transmitted over the inter-region connection. * * You can create up to 50 traffic classification rules in each call. You can specify a DSCP value for each traffic classification rule. */ public Builder matchDscp(Integer matchDscp) { this.matchDscp = matchDscp; return this; } /** * The protocol that is used to match packets. *

* * Traffic classification rules support the following protocols: **HTTP**, **HTTPS**, **TCP**, **UDP**, **SSH**, and **Telnet**. For more information, log on to the [CEN console](https://cen.console.aliyun.com/cen/list). * * **Some protocols use a fixed port. Click to view protocols and ports.** * * * If the protocol is **ICMP**, the destination port must be **-1**. * * If the protocol is **GRE**, the destination port must be **1**. * * If the protocol is **SSH**, the destination port must be **22**. * * If the protocol is **Telnet**, the destination port must be **23**. * * If the protocol is **HTTP**, the destination port must be **80**. * * If the protocol is **HTTPS**, the destination port must be **443**. * * If the protocol is **MS SQL**, the destination port must be **1443**. * * If the protocol is **Oracle**, the destination port must be **1521**. * * If the protocol is **Mysql**, the destination port must be **3306**. * * If the protocol is **RDP**, the destination port must be **3389**. * * If the protocol is **Postgre SQL**, the destination port must be **5432**. * * If the protocol is **Redis**, the destination port must be **6379**. * * You can create up to 50 traffic classification rules in each call. You can specify a protocol for each traffic classification rule. */ public Builder protocol(String protocol) { this.protocol = protocol; return this; } /** * The source CIDR block that is used to match packets. *

* * Packets whose source IP addresses fall into the specified source CIDR block meet the traffic classification rule. If you do not specify a source CIDR block, all packets meet the traffic classification rule. * * You can create up to 50 traffic classification rules in each call. You can specify a source CIDR block for each traffic classification rule. */ public Builder srcCidr(String srcCidr) { this.srcCidr = srcCidr; return this; } /** * The source port range that is used to match packets. Valid values: **-1** and **1** to **65535**. *

* * Packets whose source ports fall into the source port range meet the traffic classification rule. If you do not specify a source port range, all packets meet the traffic classification rule. * * You can enter up to two port numbers. Take note of the following rules: * * * If you enter only one port number, such as 1, packets whose source port is 1 meet the traffic classification rule. * * If you enter two port numbers, such as 1 and 200, packets whose source ports fall into 1 and 200 meet the traffic classification rule. * * If you enter two port numbers and one of them is -1, the other port number must also be -1. In this case, all packets meet the traffic classification rule. * * You can create up to 50 traffic classification rules in each call. You can specify a source port range for each traffic classification rule. */ public Builder srcPortRange(java.util.List < Integer > srcPortRange) { this.srcPortRange = srcPortRange; return this; } /** * The description of the traffic classification rule. *

* * You can create up to 50 traffic classification rules in each call. You can specify a description for each traffic classification rule. * * This parameter is optional. If you enter a description, it must be 1 to 256 characters in length, and cannot start with http:// or https://. */ public Builder trafficMatchRuleDescription(String trafficMatchRuleDescription) { this.trafficMatchRuleDescription = trafficMatchRuleDescription; return this; } /** * The name of the traffic classification rule. *

* * You can create up to 50 traffic classification rules in each call. You can specify a name for each traffic classification rule. * * The name can be empty or 1 to 128 characters in length, and cannot start with http:// or https://. */ public Builder trafficMatchRuleName(String trafficMatchRuleName) { this.trafficMatchRuleName = trafficMatchRuleName; return this; } public TrafficMatchRules build() { return new TrafficMatchRules(this); } } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy