Skip to content

Commit

Permalink
Merge branch 'sanfern-dev-go-version-upgrade' of https://github.com/s…
Browse files Browse the repository at this point in the history
…anfern/l3afd into sanfern-dev-go-version-upgrade
  • Loading branch information
sanfern committed Oct 14, 2022
2 parents 72353f6 + c3412ac commit 90424b3
Show file tree
Hide file tree
Showing 9 changed files with 365 additions and 22 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
echo "$res"
exit 1
fi
- name: Vet
run: |
go vet ./...
Expand Down
4 changes: 2 additions & 2 deletions apis/handlers/addprog.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
)

// AddEbpfPrograms add new eBPF programs on node
// @Summary Adding new eBPF Programs on node
// @Description Adding new eBPF Programs on node
// @Summary Adds new eBPF Programs on node
// @Description Adds new eBPF Programs on node
// @Accept json
// @Produce json
// @Param cfgs body []models.L3afBPFPrograms true "BPF programs"
Expand Down
4 changes: 2 additions & 2 deletions apis/handlers/deleteprog.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
)

// DeleteEbpfPrograms remove eBPF programs on node
// @Summary remove eBPF Programs on node
// @Description remove eBPF Programs on node
// @Summary Removes eBPF Programs on node
// @Description Removes eBPF Programs on node
// @Accept json
// @Produce json
// @Param cfgs body []models.L3afBPFProgramNames true "BPF program names"
Expand Down
115 changes: 112 additions & 3 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,69 @@ const docTemplate = `{
"summary": "Returns details of the configuration of eBPF Programs for all interfaces on a node",
"responses": {
"200": {
"description": ""
"description": "OK"
}
}
}
},
"/l3af/configs/v1/add": {
"post": {
"description": "Adds new eBPF Programs on node",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "Adds new eBPF Programs on node",
"parameters": [
{
"description": "BPF programs",
"name": "cfgs",
"in": "body",
"required": true,
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.L3afBPFPrograms"
}
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/l3af/configs/v1/delete": {
"post": {
"description": "Removes eBPF Programs on node",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "Removes eBPF Programs on node",
"parameters": [
{
"description": "BPF program names",
"name": "cfgs",
"in": "body",
"required": true,
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.L3afBPFProgramNames"
}
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
Expand Down Expand Up @@ -59,7 +121,7 @@ const docTemplate = `{
],
"responses": {
"200": {
"description": ""
"description": "OK"
}
}
}
Expand All @@ -85,7 +147,7 @@ const docTemplate = `{
],
"responses": {
"200": {
"description": ""
"description": "OK"
}
}
}
Expand Down Expand Up @@ -135,6 +197,10 @@ const docTemplate = `{
"description": "User program cpu limits",
"type": "integer"
},
"ebpf_package_repo_url": {
"description": "Download url for Program",
"type": "string"
},
"id": {
"description": "Program id",
"type": "integer"
Expand Down Expand Up @@ -204,6 +270,32 @@ const docTemplate = `{
}
}
},
"models.BPFProgramNames": {
"type": "object",
"properties": {
"tc_egress": {
"description": "names of the TC egress eBPF programs",
"type": "array",
"items": {
"type": "string"
}
},
"tc_ingress": {
"description": "names of the TC ingress eBPF programs",
"type": "array",
"items": {
"type": "string"
}
},
"xdp_ingress": {
"description": "names of the XDP ingress eBPF programs",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"models.BPFPrograms": {
"type": "object",
"properties": {
Expand All @@ -230,6 +322,23 @@ const docTemplate = `{
}
}
},
"models.L3afBPFProgramNames": {
"type": "object",
"properties": {
"bpf_programs": {
"description": "List of eBPF program names to remove",
"$ref": "#/definitions/models.BPFProgramNames"
},
"host_name": {
"description": "Host name or pod name",
"type": "string"
},
"iface": {
"description": "Interface name",
"type": "string"
}
}
},
"models.L3afBPFPrograms": {
"type": "object",
"properties": {
Expand Down
115 changes: 112 additions & 3 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,69 @@
"summary": "Returns details of the configuration of eBPF Programs for all interfaces on a node",
"responses": {
"200": {
"description": ""
"description": "OK"
}
}
}
},
"/l3af/configs/v1/add": {
"post": {
"description": "Adds new eBPF Programs on node",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "Adds new eBPF Programs on node",
"parameters": [
{
"description": "BPF programs",
"name": "cfgs",
"in": "body",
"required": true,
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.L3afBPFPrograms"
}
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/l3af/configs/v1/delete": {
"post": {
"description": "Removes eBPF Programs on node",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "Removes eBPF Programs on node",
"parameters": [
{
"description": "BPF program names",
"name": "cfgs",
"in": "body",
"required": true,
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.L3afBPFProgramNames"
}
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
Expand Down Expand Up @@ -51,7 +113,7 @@
],
"responses": {
"200": {
"description": ""
"description": "OK"
}
}
}
Expand All @@ -77,7 +139,7 @@
],
"responses": {
"200": {
"description": ""
"description": "OK"
}
}
}
Expand Down Expand Up @@ -127,6 +189,10 @@
"description": "User program cpu limits",
"type": "integer"
},
"ebpf_package_repo_url": {
"description": "Download url for Program",
"type": "string"
},
"id": {
"description": "Program id",
"type": "integer"
Expand Down Expand Up @@ -196,6 +262,32 @@
}
}
},
"models.BPFProgramNames": {
"type": "object",
"properties": {
"tc_egress": {
"description": "names of the TC egress eBPF programs",
"type": "array",
"items": {
"type": "string"
}
},
"tc_ingress": {
"description": "names of the TC ingress eBPF programs",
"type": "array",
"items": {
"type": "string"
}
},
"xdp_ingress": {
"description": "names of the XDP ingress eBPF programs",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"models.BPFPrograms": {
"type": "object",
"properties": {
Expand All @@ -222,6 +314,23 @@
}
}
},
"models.L3afBPFProgramNames": {
"type": "object",
"properties": {
"bpf_programs": {
"description": "List of eBPF program names to remove",
"$ref": "#/definitions/models.BPFProgramNames"
},
"host_name": {
"description": "Host name or pod name",
"type": "string"
},
"iface": {
"description": "Interface name",
"type": "string"
}
}
},
"models.L3afBPFPrograms": {
"type": "object",
"properties": {
Expand Down

0 comments on commit 90424b3

Please sign in to comment.