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
Test
RAM authorization
|
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 |
| 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:
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:
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 |
| 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 |
| 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.