PutEnableFwSwitch

Updated at:

Enables the firewall switch.

Operation description

This operation enables the firewall switch. Traffic passes through Cloud Firewall only after the firewall switch is enabled.

QPS limit

The QPS limit for a single user is 5 requests per second. If the limit is exceeded, API calls are throttled, which may affect your business. Call this API at a reasonable frequency.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

yundun-cloudfirewall:PutEnableFwSwitch

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

SourceIp deprecated

string

No

The source IP address of the requester.

192.0.XX.XX

Lang

string

No

The language of the response message. Valid values:

  • zh: Chinese.

  • en: English.

zh

IpaddrList

array

No

The list of IP addresses.

Note

The IpaddrList, RegionList, and ResourceTypeList parameters cannot all be empty. You must specify at least one of these parameters.

["192.0.X.X","192.0.X.X"]

string

No

The list of IP addresses.

Note

The IpaddrList, RegionList, and ResourceTypeList parameters cannot all be empty. You must specify at least one of these parameters.

192.0.XX.XX

RegionList

array

No

The list of regions.

Note

The IpaddrList, RegionList, and ResourceTypeList parameters cannot all be empty. You must specify at least one of these parameters.

["cn-hangzhou","cn-shanghai"]

string

No

The list of regions.

Note

The IpaddrList, RegionList, and ResourceTypeList parameters cannot all be empty. You must specify at least one of these parameters.

cn-hangzhou,cn-shanghai

ResourceTypeList

array

No

The list of asset types. Valid values:

  • BastionHostEgressIP: the egress IP address of Bastionhost.

  • BastionHostIngressIP: the ingress IP address of Bastionhost.

  • EcsEIP: the EIP of an ECS instance.

  • EcsPublicIP: the public IP address of an ECS instance.

  • EIP: the elastic IP address (EIP).

  • EniEIP: the EIP of an elastic network interface (ENI).

  • NatEIP: the EIP of a NAT gateway.

  • SlbEIP: the EIP of an SLB instance (CLB EIP).

  • SlbPublicIP: the public IP address of an SLB instance (CLB public IP address).

  • NatPublicIP: the public IP address of a NAT gateway.

  • HAVIP: the high-availability virtual IP address (HAVIP).

  • NlbEIP: the EIP of a Network Load Balancer (NLB) instance.

  • ApiGatewayEIP: the public IP address of API Gateway.

  • AlbEIP: the EIP of an Application Load Balancer (ALB) instance.

  • AiGatewayEIP: the public IP address of AI Gateway.

  • GaEIP: the EIP of a Global Accelerator (GA) instance.

  • SwasEIP: the public IP address of a Simple Application Server instance.

  • EcdEIP: the public IP address of an Elastic Desktop Service (EDS) instance.

  • BastionHostIP: the IP address of Bastionhost.

Note

The IpaddrList, RegionList, and ResourceTypeList parameters cannot all be empty. You must specify at least one of these parameters.

["EcsPublicIp","NatEip"]

string

No

The list of asset types. Valid values:

  • BastionHostEgressIP: the egress IP address of Bastionhost.

  • BastionHostIngressIP: the ingress IP address of Bastionhost.

  • EcsEIP: the EIP of an ECS instance.

  • EcsPublicIP: the public IP address of an ECS instance.

  • EIP: the elastic IP address (EIP).

  • EniEIP: the EIP of an elastic network interface (ENI).

  • NatEIP: the EIP of a NAT gateway.

  • SlbEIP: the EIP of an SLB instance (CLB EIP).

  • SlbPublicIP: the public IP address of an SLB instance (CLB public IP address).

  • NatPublicIP: the public IP address of a NAT gateway.

  • HAVIP: the high-availability virtual IP address (HAVIP).

  • NlbEIP: the EIP of a Network Load Balancer (NLB) instance.

  • ApiGatewayEIP: the public IP address of API Gateway.

  • AlbEIP: the EIP of an Application Load Balancer (ALB) instance.

  • AiGatewayEIP: the public IP address of AI Gateway.

  • GaEIP: the EIP of a Global Accelerator (GA) instance.

  • SwasEIP: the public IP address of a Simple Application Server instance.

  • EcdEIP: the public IP address of an Elastic Desktop Service (EDS) instance.

  • BastionHostIP: the IP address of Bastionhost.

Note

The IpaddrList, RegionList, and ResourceTypeList parameters cannot all be empty. You must specify at least one of these parameters.

EcsPublicIp,NatEip

MemberUid

string

No

The unique identifier of the member.

1234

IpVersion

string

No

The IP version.

4

ClientToken

string

No

The client token that is used to ensure the idempotence of the request. The token is generated by the client and must be unique across different requests. The data type is String, and it is case-sensitive. The format is [0-9a-zA-Z-_]{1,64}. We recommend that you use a UUID. The server ensures idempotence within the validity period (600 seconds). Repeated requests with the same ClientToken and the same business parameters return the same result as the first request. If the ClientToken is the same but the business parameters are different, the server returns an HTTP 400 error and the IdempotentParameterMismatch error code.

ddadxefexxxx

DryRun

boolean

No

Specifies whether to only precheck the request. If you set this parameter to true, the system only performs prechecks on parameter validity, identity permissions, resource existence, quota limits, and dependencies. The system does not create, update, or delete actual resources, trigger actual asynchronous traffic redirection tasks, or generate downstream side effects such as billing, notifications, or callbacks. If the precheck succeeds, the response includes DryRun=true, which distinguishes it from an actual call response. If the precheck fails, the system returns a machine-readable error code, such as ErrorParamsInvalid for invalid parameters, ErrorAuthentication for insufficient permissions, or ErrorInstanceOpenIpNumExceed for insufficient quota. If you set this parameter to false (default), the system initiates a normal request and performs the enable operation.

true

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

B2841452-CB8D-4F7D-B247-38E1CF7334F8

AbnormalResourceStatusList

array<object>

The list of status information when assets are not synchronized.

object

Resource

string

The IP address of the asset.

203.0.113.0

Status

string

The status when the asset is not synchronized. Valid values:

  • ip_not_sync: The asset is not synchronized.

ip_not_sync

Msg

string

The message when the asset is not synchronized. Valid values:

  • cloudfirewall do not sync this ip address: Cloud Firewall does not synchronize this asset IP address.

cloudfirewall do not sync this ip address

DryRun

boolean

Indicates whether the response is a successful dry run precheck. A value of true indicates that only the precheck is completed and no actual changes are made. This field is not returned or is set to false for actual calls.

true

Examples

Success response

JSON format

{
  "RequestId": "B2841452-CB8D-4F7D-B247-38E1CF7334F8",
  "AbnormalResourceStatusList": [
    {
      "Resource": "203.0.113.0",
      "Status": "ip_not_sync",
      "Msg": "cloudfirewall do not sync this ip address"
    }
  ],
  "DryRun": true
}

Error codes

HTTP status code

Error code

Error message

Description

400 ErrorInstanceOpenIpNumExceed The maximum number of protected assets has been reached. The maximum number of protected assets has been reached.
400 ErrorInstanceStatusNotNormal This operation is not supported when the instance is in the current state. This operation is not supported when the instance is in the current state.
400 ErrorParamsNotEnough Parameters are insufficient. Parameters are insufficient.
400 ErrorDBTxError A database transaction error occurred. The error message returned because an internal error has occurred in the database transaction.
400 ErrorParamsInvalid Invalid Params The parameter is invalid.
400 ErrorInstanceOpenIpRegionNumExceed open ip region num exceed. Your zone protection quota is insufficient.
400 ErrorBandwidthPenalty Cloud Firewall bandwidth is being overused. Cloud Firewall bandwidth is being overused.
400 ErrorGeneralInstanceSpecFull Cloud Firewall instance specifications are full. Cloud Firewall instance specifications are full.
400 IdempotentParameterMismatch The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical. This request uses the same client token as the previous request, but not the same. Do not reuse client tokens in different requests unless the request is the same.
400 InvalidClientToken ClientToken format invalid. Only ASCII letters, digits, hyphens and underscores are allowed, max 64 characters.
401 ErrorAuthentication An authentication error occurred. An authentication error occurred.
409 IdempotentToken.Processing A previous request with the same ClientToken is still being processed.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.