Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Anti-DDoS] Refactor & API Update #496

Open
wants to merge 33 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a778220
Move Test
Aloento Aug 15, 2022
c651ed7
ListDailyLogs
Aloento Aug 15, 2022
2e307cc
ListDailyReport
Aloento Aug 15, 2022
3b0eff4
ListDDosStatus
Aloento Aug 15, 2022
1326ad3
ListNewConfigs
Aloento Aug 15, 2022
e46c6ce
ListWeeklyReports
Aloento Aug 15, 2022
7aa6f9f
ShowDDos
Aloento Aug 15, 2022
653eed0
ShowDDosStatus
Aloento Aug 15, 2022
cfa844b
UpdateDDos
Aloento Aug 15, 2022
9a35deb
ShowAlertConfig
Aloento Aug 15, 2022
3c23073
CreateDefaultConfig
Aloento Aug 15, 2022
3319464
ShowNewTaskStatus
Aloento Aug 15, 2022
8283160
https://github.com/opentelekomcloud/gophertelekomcloud/issues/394
Aloento Aug 15, 2022
74ec8ff
if err != nil {
Aloento Aug 15, 2022
6bc7240
if err != nil {
Aloento Aug 16, 2022
5cc0357
.Body
Aloento Aug 16, 2022
e86a672
.Body
Aloento Aug 16, 2022
ba7a86a
Merge remote-tracking branch 'origin/devel' into antiddos
Aloento Aug 16, 2022
ad9b514
remove ,
Aloento Aug 23, 2022
931ef75
remove ,
Aloento Aug 23, 2022
830794a
return err
Aloento Aug 23, 2022
ed54f76
move back
Aloento Aug 24, 2022
a2e0377
move back
Aloento Aug 24, 2022
755efee
TaskResponse
Aloento Aug 29, 2022
1928828
WeekData
Aloento Aug 29, 2022
0aadc0c
Merge branch 'devel' into antiddos
Aloento Sep 2, 2022
837beac
Merge branch 'devel' into antiddos
Aloento Sep 7, 2022
2dcaafa
Merge remote-tracking branch 'origin/devel' into antiddos
Aloento Oct 13, 2022
1182308
fix
Aloento Oct 13, 2022
1772278
Merge branch 'devel' into antiddos
Aloento Oct 25, 2022
88e3d10
fix
Aloento Oct 25, 2022
50d47e9
Merge branch 'devel' into antiddos
Aloento Jan 30, 2023
ff6f1d3
Merge branch 'devel' into antiddos
Aloento Jun 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 0 additions & 167 deletions openstack/antiddos/v1/antiddos/API-en.md

This file was deleted.

49 changes: 49 additions & 0 deletions openstack/antiddos/v1/antiddos/create_default_config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package antiddos

import (
"github.com/opentelekomcloud/gophertelekomcloud"
"github.com/opentelekomcloud/gophertelekomcloud/internal/build"
"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
)

type ConfigOpts struct {
// Whether to enable L7 defense
EnableL7 bool `json:"enable_L7"`
// Position ID of traffic. The value ranges from 1 to 9.
TrafficPosId int `json:"traffic_pos_id"`
// Position ID of number of HTTP requests. The value ranges from 1 to 15.
HttpRequestPosId int `json:"http_request_pos_id"`
// Position ID of access limit during cleaning. The value ranges from 1 to 8.
CleaningAccessPosId int `json:"cleaning_access_pos_id"`
// Application type ID. Possible values: 0 1
AppTypeId int `json:"app_type_id"`
}

func CreateDefaultConfig(client *golangsdk.ServiceClient, opts ConfigOpts) (*TaskResponse, error) {
b, err := build.RequestBody(opts, "")
if err != nil {
return nil, err
}

// POST /v1/{project_id}/antiddos/default-config
raw, err := client.Post(client.ServiceURL("antiddos", "default-config"), b, nil, &golangsdk.RequestOpts{
OkCodes: []int{200},
})
if err != nil {
return nil, err
}

var res TaskResponse
err = extract.Into(raw.Body, &res)
return &res, err
}

type TaskResponse struct {
// Internal error code
ErrorCode string `json:"error_code"`
// Internal error description
ErrorMessage string `json:"error_msg"`
// ID of a task. This ID can be used to query the status of the task.
// This field is reserved for use in task auditing later. It is temporarily unused.
TaskId string `json:"task_id"`
}
20 changes: 20 additions & 0 deletions openstack/antiddos/v1/antiddos/delete_default_config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package antiddos

import (
"github.com/opentelekomcloud/gophertelekomcloud"
"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
)

func DeleteDefaultConfig(client *golangsdk.ServiceClient) (*TaskResponse, error) {
// DELETE /v1/{project_id}/antiddos/default-config
raw, err := client.Delete(client.ServiceURL("antiddos", "default-config"), &golangsdk.RequestOpts{
OkCodes: []int{200},
})
if err != nil {
return nil, err
}

var res TaskResponse
err = extract.Into(raw.Body, &res)
return &res, err
}
99 changes: 0 additions & 99 deletions openstack/antiddos/v1/antiddos/doc.go

This file was deleted.

Loading