All Products
Search
Document Center

Cloud Firewall:PutEnableFwSwitch

Last Updated:Sep 21, 2026

Enables a firewall switch.

Operation description

Enables a firewall switch. Traffic passes through Cloud Firewall only after the firewall switch is enabled.

QPS limit

The single-user QPS limit for this operation is 5 calls per second. If this limit is exceeded, the API calls are throttled, which may affect your business. Call this operation as appropriate.

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 request.

192.0.XX.XX

Lang

string

No

The language type of the received message. Valid values:

  • zh: Chinese

  • en: English

zh

IpaddrList

array

No

The IP address list.

Note

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

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

string

No

The IP address list.

Note

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

192.0.XX.XX

RegionList

array

No

The region list.

Note

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

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

string

No

The region list.

Note

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

cn-hangzhou,cn-shanghai

ResourceTypeList

array

No

The asset type list.

Valid values:

  • BastionHostEgressIP: bastion host egress IP address.

  • BastionHostIngressIP: bastion host ingress IP address.

  • EcsEIP: ECS EIP.

  • EcsPublicIP: public IP addresses of Elastic Compute Service (ECS) instances.

  • EIP: elastic IP address.

  • EniEIP: network interface controller (NIC) EIP.

  • NatEIP: NAT EIP.

  • SlbEIP: SLB EIP (CLB EIP).

  • SlbPublicIP: SLB public IP address (CLB public IP address).

  • NatPublicIP: NAT public IP address.

  • HAVIP: high active virtual IP address.

  • NlbEIP: NLB EIP.

  • ApiGatewayEIP: API Gateway public IP address.

  • AlbEIP: ALB EIP.

  • AiGatewayEIP: AI Gateway public IP address.

  • GaEIP: GA EIP.

  • SwasEIP: simple application server public IP address.

  • EcdEIP: Elastic Desktop Service public IP address.

  • BastionHostIP: bastion host IP address.

Note

The IpaddrList, RegionList, and ResourceTypeList parameters cannot all be empty. You must set a value for at least one of these parameters. Settings for at least one parameter are required.

["EcsPublicIp","NatEip"]

string

No

The asset type list.

Valid values:

  • BastionHostEgressIP: bastion host egress IP address.

  • BastionHostIngressIP: bastion host ingress IP address.

  • EcsEIP: ECS EIP.

  • EcsPublicIP: public IP addresses of Elastic Compute Service (ECS) instances.

  • EIP: elastic IP address.

  • EniEIP: network interface controller (NIC) EIP.

  • NatEIP: NAT EIP.

  • SlbEIP: SLB EIP (CLB EIP).

  • SlbPublicIP: SLB public IP address (CLB public IP address).

  • NatPublicIP: NAT public IP address.

  • HAVIP: high active virtual IP address.

  • NlbEIP: NLB EIP.

  • ApiGatewayEIP: API Gateway public IP address.

  • AlbEIP: ALB EIP.

  • AiGatewayEIP: AI Gateway public IP address.

  • GaEIP: GA EIP.

  • SwasEIP: simple application server public IP address.

  • EcdEIP: Elastic Desktop Service public IP address.

  • BastionHostIP: bastion host IP address.

Note

The IpaddrList, RegionList, and ResourceTypeList parameters cannot all be empty. You must set a value for at least one of these parameters. Settings for at least one parameter are required.

EcsPublicIp,NatEip

MemberUid

string

No

The unique identifier of the member account.

1234

IpVersion

string

No

The IP version.

4

ClientToken

string

No

The client token that ensures the idempotency of the request. Generated by the client, the token must be unique across different requests. The value is a case-sensitive string in the format of [0-9a-zA-Z-_]{1,64}. We recommend that you use a UUID. The server guarantees idempotency 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, an HTTP 400 error with the IdempotentParameterMismatch error code is returned.

ddadxefexxxx

DryRun

boolean

No

Specifies whether to perform only a dry run of the request. If you set this parameter to true, the system performs pre-checks such as parameter validation, identity and permission verification, resource existence, and quota limits without creating, updating, or deleting actual resources, triggering asynchronous traffic diversion tasks, or generating downstream side effects such as billing, notifications, or callbacks. If the dry run succeeds, the response contains DryRun=true, which distinguishes it from an actual call response. If the dry run fails, a machine-readable error code is returned, such as ErrorParamsInvalid for invalid parameters, ErrorAuthentication for insufficient permissions, or ErrorInstanceOpenIpNumExceed for insufficient quota. If you set this parameter to false (default), the request is sent and the enable operation is performed.

true

Response elements

Element

Type

Description

Example

object

AbnormalResourceStatusList

array<object>

The status information list for assets that are not synchronized.

object

Msg

string

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

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

cloudfirewall do not sync this ip address

Resource

string

The asset IP address.

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

DryRun

boolean

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

true

RequestId

string

The request ID.

B2841452-CB8D-4F7D-B247-38E1CF7334F8

Examples

Success response

JSON format

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

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.