DDoS Instance
Query DDoS basic protection list
- Query basic protection information for all public IPs under a user account
- Support queries by public IP address and public IP type
- Results support marker-based pagination, with a default page size of 1000, which can be specified via the maxKeys parameter.
Function declaration
1type ListDdosRequest struct {
2 Ips string `json:"-"`
3 Type string `json:"-"`
4 Marker string `json:"-"`
5 MaxKeys int32 `json:"-"`
6}
7type ListDdosResponse struct {
8 DdosList *[]DdosModel `json:"ddosList,omitempty"`
9 Marker string `json:"marker,omitempty"`
10 IsTruncated bool `json:"isTruncated,omitempty"`
11 NextMarker string `json:"nextMarker,omitempty"`
12 MaxKeys int32 `json:"maxKeys,omitempty"`
13}
14type DdosModel struct {
15 Ip string `json:"ip,omitempty"`
16 Status string `json:"status,omitempty"`
17 BindInstanceType string `json:"bindInstanceType,omitempty"`
18 BindInstanceId string `json:"bindInstanceId,omitempty"`
19 IpCleanMbps int64 `json:"ipCleanMbps,omitempty"`
20 IpCleanPps int64 `json:"ipCleanPps,omitempty"`
21 ThresholdType string `json:"thresholdType,omitempty"`
22 MaximumThreshold int64 `json:"maximumThreshold,omitempty"`
23}
24func (c *Client) ListDdos(request *ListDdosRequest) (*ListDdosResponse, error)
Parameter Meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/Jlhag6ez3
Response value
Operation succeeded:
1{
2 "marker": "x.x.x.x",
3 "maxKeys": 1000,
4 "nextMarker": "",
5 "isTruncated": false,
6 "ddosList": [
7 {
8 "ip": "x.x.x.x",
9 "status": "available",
10 "bindInstanceType": "BCC",
11 "bindInstanceId": "i-IyWRtII8",
12 "bindInstanceName": "xxx",
13 "ipCleanMbps": 200,
14 "ipCleanPps": 100000,
15 "thresholdType": "bandwidth",
16 "maximumThreshold": 5
17 },
18 ...
19 ]
20}
Operation failed:
Throw an exception. For the exception list, refer to https://cloud.baidu.com/doc/EIP/s/nkcu555a4
Code example
For specific code examples, refer to example_ddos_list_ddos.go
Query list of DDoS basic protection attacks
- Query DDoS basic protection attack records for a specified public IP
Function declaration
1type ListDdosAttackRecordRequest struct {
2 Ip string `json:"-"`
3 StartTime string `json:"-"`
4 Marker string `json:"-"`
5 MaxKeys int32 `json:"-"`
6}
7type ListDdosAttackRecordResponse struct {
8 AttackRecordList *[]DdosAttackRecordModel `json:"attackRecordList,omitempty"`
9}
10type DdosAttackRecordModel struct {
11 Ip string `json:"ip,omitempty"`
12 StartTime string `json:"startTime,omitempty"`
13 EndTime string `json:"endTime,omitempty"`
14 AttackType []string `json:"attackType,omitempty"`
15 AttackPeakMbps int64 `json:"attackPeakMbps,omitempty"`
16 AttackPeakPps int64 `json:"attackPeakPps,omitempty"`
17 AttackPeakQps int64 `json:"attackPeakQps,omitempty"`
18 AttackStatus string `json:"attackStatus,omitempty"`
19}
20func (c *Client) ListDdosAttackRecord(request *ListDdosAttackRecordRequest) (*ListDdosAttackRecordResponse, error)
Parameter Meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/tlhaglzfn
Response value
Operation succeeded:
1{
2 "marker": "123456",
3 "maxKeys": 1000,
4 "nextMarker": "",
5 "isTruncated": false,
6 "attackRecordList": [
7 {
8 "ip": "x.x.x.x",
9 "startTime": "2022-11-06T04:34:49Z",
10 "endTime": "2022-11-16T04:34:49Z",
11 "attackType": [
12 "ATTACK_TYPE_CONNECTION"
13 ],
14 "attackPeakMbps": 801.89
15 "attackPeakPps": xxx,
16 "attackPeakQps": xxx
17 },
18 ...
19 ]
20}
Operation failed:
Throw an exception. For the exception list, refer to https://cloud.baidu.com/doc/EIP/s/nkcu555a4
Code example
For specific code examples, please refer to example_ddos_list_ddos_attack_record.go
Modify DDoS basic protection threshold
- Modify protection threshold for a specified public IP
Function declaration
1type ModifyDdosThresholdRequest struct {
2 Ip string `json:"-"`
3 ClientToken string `json:"-"`
4 ThresholdType string `json:"thresholdType"`
5 IpCleanMbps int64 `json:"ipCleanMbps"`
6 IpCleanPps int64 `json:"ipCleanPps"`
7}
8func (c *Client) ModifyDdosThreshold(request *ModifyDdosThresholdRequest) error
Parameter Meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/alhagbhi0
Response value
Operation succeeded:
There are no special response parameters
Operation failed:
Throw an exception. For the exception list, refer to https://cloud.baidu.com/doc/EIP/s/nkcu555a4
Code example
For specific code examples, please refer to example_ddos_modify_ddos_threshold.go
