PutEnableFwSwitch
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
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 requester. |
192.0.XX.XX |
| Lang |
string |
No |
The language of the response message. Valid values:
|
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:
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:
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 |
| Msg |
string |
The message when the asset is not synchronized. Valid values:
|
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.