-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add example for developing agents with custom VPP plugins (#1665)
- Loading branch information
1 parent
218575e
commit 639daee
Showing
18 changed files
with
1,581 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 17 additions & 16 deletions
33
examples/custom_model/proto/model.pb.go → ...custom_api_model/proto/custom/model.pb.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
examples/custom_model/proto/model.proto → ...custom_api_model/proto/custom/model.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
syntax = "proto3"; | ||
|
||
package mymodel; | ||
package custom; | ||
|
||
message MyModel { | ||
string name = 1; | ||
int32 mynum = 2; | ||
int32 value = 2; | ||
} |
27 changes: 27 additions & 0 deletions
27
examples/customize/custom_api_model/proto/custom/models.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) 2020 Cisco and/or its affiliates. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at: | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package custom | ||
|
||
import ( | ||
"go.ligato.io/vpp-agent/v3/pkg/models" | ||
) | ||
|
||
func init() { | ||
models.Register(&MyModel{}, models.Spec{ | ||
Module: "custom", | ||
Type: "mymodel", | ||
Version: "v1", | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Custom VPP plugin | ||
|
||
The Custom VPP plugin example contains a working example of custom agent which | ||
adds support for a custom VPP plugin. This example can serve as a skeleton | ||
code for developing custom agents adding new VPP functionality that is not | ||
part of official VPP Agent. | ||
|
||
## Structure | ||
|
||
- [binapi](binapi/) - contains generated Go code of VPP binary API for a specific VPP version | ||
- [proto](proto/) - contains Protobuf definition and model registration for the Northbound API | ||
- [syslog](syslog/) - contains Ligato plugin Syslog that initializes vppcalls handler and registers KV descriptors that describe the Syslog models and their behaviour (CRUD operations, validation, dependencies, etc.) | ||
- [main.go](main.go) - contains the agent example that wires all the components together and runs the agent |
Oops, something went wrong.