Skip to content
Snippets Groups Projects
Commit 8dc01bac authored by Manuel Kieweg's avatar Manuel Kieweg
Browse files

Merge branch 'develop' into 'master'

Develop

See merge request cocsn/gosdn!90
parents f09ee28f ab88d73c
Branches
Tags
1 merge request!90Develop
Pipeline #67513 passed
Showing
with 731 additions and 821 deletions
run: run:
timeout: 5m timeout: 5m
issues-exit-code: 1 issues-exit-code: 1
# directories to be ignored by linters
skip-dirs:
- forks
- test
skip-dirs-default: true
skip-files:
- nucleus/http.go
# output settings -> code-climate for GitLab
output: output:
format: code-climate format: code-climate
print-issued-lines: true print-issued-lines: true
print-linter-name: true print-linter-name: true
uniq-by-line: true uniq-by-line: true
path-prefix: "" path-prefix: ""
# custom settings for linters
linters-settings: linters-settings:
gocyclo: gocyclo:
min-complexity: 15 min-complexity: 15
golint: golint:
min-confidence: 0.8 min-confidence: 0.8
# enable the specific needed linters
linters: linters:
disable-all: true disable-all: true
enable: enable:
......
golangci-lint run\ golangci-lint run\
--config .ci/.golangci-master.yml\ --config .ci/.golangci-master.yml\
--out-format code-climate |\ --out-format code-climate |\
jq -r '.[] | "\(.location.path):\(.location.lines.begin) \(.description)"' jq -r '.[] | "\(.location.path):\(.location.lines.begin) \(.description)"'
\ No newline at end of file
sast:
variables:
SAST_ANALYZER_IMAGE_TAG: '2'
SAST_EXCLUDED_PATHS: spec, test, tests, tmp
SEARCH_MAX_DEPTH: '4'
include:
- template: Security/SAST.gitlab-ci.yml
- template: Dependency-Scanning.gitlab-ci.yml
- template: Security/License-Scanning.gitlab-ci.yml
variables:
TF_ROOT: ${CI_PROJECT_DIR}/test/terraform
TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/integration
cache:
key: integration
paths:
- ${TF_ROOT}/.terraform
.terraform_prefab: &tf
image: registry.gitlab.com/gitlab-org/terraform-images/stable:latest
variables:
CI_DEBUG_TRACE: "false"
before_script:
- cd ${TF_ROOT}
- export TF_VAR_integration_username=terraform
- export TF_VAR_integration_access_token=${TERRAFORM_API_TOKEN}
- export TF_VAR_integration_registry=${CI_REGISTRY}
- export TF_VAR_tls_key=${DOCKER_TLS_KEY}
- export TF_VAR_tls_cert=${DOCKER_TLS_CERT}
- export TF_VAR_tls_ca_cert=${DOCKER_TLS_CA}
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'develop')
variables:
TF_VAR_container_tag: $CI_REGISTRY_IMAGE:merge-request
- if: $CI_COMMIT_BRANCH == "integration-test"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
init:
stage: .pre
script:
- gitlab-terraform init
<<: *tf
validate:
stage: test
script:
- gitlab-terraform validate
needs: ["init"]
<<: *tf
plan:
before_script:
- cd ${TF_ROOT}
stage: build
script:
- gitlab-terraform plan
- gitlab-terraform plan-json
artifacts:
name: plan
paths:
- ${TF_ROOT}/plan.cache
reports:
terraform: ${TF_ROOT}/plan.json
needs: ["validate"]
<<: *tf
apply:
stage: apply
script:
- gitlab-terraform apply
dependencies:
- plan
<<: *tf
destroy:
stage: .post
script:
- gitlab-terraform destroy
<<: *tf
\ No newline at end of file
integration-test:
image: golang:1.14
stage: integration-test
needs: [ "apply" ]
variables:
GOSDN_LOG: "nolog"
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH
allow_failure: true
- if: $CI_COMMIT_BRANCH == "integration-test"
allow_failure: true
script:
- sleep 1m
- go test -race ./test/integration -v -coverprofile=coverage.out
.test: &test
image: golang:1.14
stage: test
allow_failure: true
variables:
GOSDN_LOG: "nolog"
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
allow_failure: true
after_script:
- go tool cover -func=coverage.out
unit-test:
script:
- go test -short -race $(go list ./... | grep -v /forks/ | grep -v /api/ | grep -v /mocks ) -v -coverprofile=coverage.out
<<: *test
http-api-test:
script:
- cd ./nucleus
- go test -race -v -run Test_httpApi -coverprofile=coverage.out
<<: *test
\ No newline at end of file
package cli
import (
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
"context"
"fmt"
gpb "github.com/openconfig/gnmi/proto/gnmi"
"strings"
)
// Capabilities sends a gNMI Capabilities request to the specified target
// and prints the supported models to stdout
func Capabilities(a, u, p string) error {
cfg := gnmi.Config{
Addr: a,
Username: u,
Password: p,
Encoding: gpb.Encoding_JSON_IETF,
}
opts := &nucleus.GnmiTransportOptions{Config: cfg}
transport, err := nucleus.NewGnmiTransport(opts)
if err != nil {
return err
}
resp, err := transport.Capabilities(context.Background())
if err != nil {
return err
}
modelData := resp.(*gpb.CapabilityResponse).SupportedModels
b := strings.Builder{}
for _, elem := range modelData {
_, err := b.WriteString(elem.Name)
if err != nil {
return err
}
_, err = b.WriteString("\n")
if err != nil {
return err
}
}
fmt.Println(b.String())
return nil
}
package cli
import (
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
"context"
gpb "github.com/openconfig/gnmi/proto/gnmi"
log "github.com/sirupsen/logrus"
)
// Get sends a gNMI Get request to the specified target and prints the response to stdout
func Get(a, u, p string, args ...string) (*gpb.GetResponse, error) {
sbi := &nucleus.OpenConfig{}
opts := &nucleus.GnmiTransportOptions{
Config: gnmi.Config{
Addr: a,
Username: u,
Password: p,
Encoding: gpb.Encoding_JSON_IETF,
},
SetNode: sbi.SetNode(),
}
t, err := nucleus.NewGnmiTransport(opts)
if err != nil {
return nil, err
}
resp, err := t.Get(context.Background(), args...)
if err != nil {
return nil, err
}
log.Debug(resp)
r, ok := resp.(*gpb.GetResponse)
if !ok {
return nil, &nucleus.ErrInvalidTypeAssertion{}
}
return r, nil
}
package cli
import (
"errors"
"fmt"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
"io/ioutil"
"net/http"
"strings"
)
const apiRoot = "/api?"
var builder *strings.Builder
func init() {
builder = &strings.Builder{}
}
// HTTPGet sends sends requests from the CLI to the gosdn HTTP API and processes any response data
func HTTPGet(apiEndpoint, f string, args ...string) error {
for _, p := range args {
builder.WriteString("&")
builder.WriteString(p)
}
resp, err := http.Get(apiEndpoint + apiRoot + "q=" + f + builder.String())
if err != nil {
return err
}
builder.Reset()
switch resp.StatusCode {
case http.StatusOK:
defer resp.Body.Close()
bytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
return err
}
switch f {
case "init":
pnd := string(bytes[:36])
sbi := string(bytes[36:])
viper.Set("CLI_PND", pnd)
viper.Set("CLI_SBI", sbi)
err := viper.WriteConfig()
log.Error(err)
default:
fmt.Println(string(bytes))
}
case http.StatusCreated:
defer resp.Body.Close()
bytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
return err
}
uuid := string(bytes[19:55])
viper.Set("LAST_DEVICE_UUID", uuid)
fmt.Println(string(bytes))
default:
log.WithFields(log.Fields{
"status code": resp.StatusCode,
}).Error("operation unsuccessful")
return errors.New(resp.Status)
}
return nil
}
package cli
import (
model "code.fbi.h-da.de/cocsn/yang-models/generated/arista"
"github.com/openconfig/ygot/ytypes"
log "github.com/sirupsen/logrus"
)
var testSchema *ytypes.Schema
func init() {
var err error
testSchema, err = model.Schema()
if err != nil {
log.Fatal(err)
}
}
package cli
import (
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
"code.fbi.h-da.de/cocsn/gosdn/nucleus/util/proto"
"context"
pb "google.golang.org/protobuf/proto"
"os"
)
// Set sends a gNMI Set request to the specified target. Only one
// request per invocation supported.
func Set(a, u, p, typ string, args ...string) error {
opts := &nucleus.GnmiTransportOptions{
Config: gnmi.Config{
Addr: a,
Username: u,
Password: p,
},
}
t, err := nucleus.NewGnmiTransport(opts)
if err != nil {
return err
}
path := gnmi.SplitPath(args[0])
req := []interface{}{
&gnmi.Operation{
Type: typ,
Origin: "",
Target: "",
Path: path,
Val: args[1],
},
}
resp, err := t.Set(context.Background(), req...)
if err != nil {
return err
}
_, tap := os.LookupEnv("GOSDN_TAP")
if tap {
if err := proto.Write(resp.(pb.Message), "resp-set-system-config-hostname"); err != nil {
return err
}
}
return nil
}
package cli
import (
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
"context"
"fmt"
gpb "github.com/openconfig/gnmi/proto/gnmi"
log "github.com/sirupsen/logrus"
"os"
"os/signal"
"syscall"
"time"
)
// Subscribe starts a gNMI subscriber requersting the specified paths on the target and
// logs the response to stdout. Only 'stream' mode with 'sample' operation supported.
func Subscribe(a, u, p string, sample, heartbeat int64, args ...string) error {
sbi := &nucleus.OpenConfig{}
tOpts := &nucleus.GnmiTransportOptions{
Config: gnmi.Config{
Addr: a,
Username: u,
Password: p,
Encoding: gpb.Encoding_JSON_IETF,
},
SetNode: sbi.SetNode(),
RespChan: make(chan *gpb.SubscribeResponse),
}
device, err := nucleus.NewDevice(sbi, tOpts)
if err != nil {
return err
}
opts := &gnmi.SubscribeOptions{
UpdatesOnly: false,
Prefix: "",
Mode: "stream",
StreamMode: "sample",
SampleInterval: uint64(sample * time.Second.Nanoseconds()),
SuppressRedundant: false,
HeartbeatInterval: uint64(heartbeat * time.Second.Nanoseconds()),
Paths: gnmi.SplitPaths(args),
Origin: "",
Target: a,
}
done := make(chan os.Signal, 1)
signal.Notify(done, syscall.SIGILL, syscall.SIGTERM)
ctx := context.WithValue(context.Background(), nucleus.CtxKeyOpts, opts) //nolint
go func() {
if err := device.Transport.Subscribe(ctx); err != nil {
log.Fatal(err)
}
}()
fmt.Println("awaiting signal")
<-done
fmt.Println("exiting")
return nil
}
package cli
import (
"code.fbi.h-da.de/cocsn/gosdn/forks/google/gnmi"
oc "code.fbi.h-da.de/cocsn/yang-models/generated/openconfig"
"context"
pb "github.com/openconfig/gnmi/proto/gnmi"
"github.com/openconfig/goyang/pkg/yang"
"github.com/openconfig/ygot/util"
"github.com/openconfig/ygot/ygot"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
"net"
"reflect"
)
type server struct {
*gnmi.Server
}
func callback(newConfig ygot.ValidatedGoStruct) error {
// Apply the config to your device and return nil if success. return error if fails.
//
// Do something ...
return nil
}
func newServer(model *gnmi.Model, config []byte) (*server, error) {
s, err := gnmi.NewServer(model, config, callback)
if err != nil {
return nil, err
}
return &server{Server: s}, nil
}
// Get overrides the Get func of gnmi.Target to provide user auth.
func (s *server) Get(ctx context.Context, req *pb.GetRequest) (*pb.GetResponse, error) {
return s.Server.Get(ctx, req)
}
// Set overrides the Set func of gnmi.Target to provide user auth.
/*
func (s *server) Set(ctx context.Context, req *pb.SetRequest) (*pb.SetResponse, error) {
msg, ok := credentials.AuthorizeUser(ctx)
if !ok {
log.Infof("denied a Set request: %v", msg)
return nil, status.Error(codes.PermissionDenied, msg)
}
log.Infof("allowed a Set request: %v", msg)
return s.Server.Set(ctx, req)
}
*/
// Target starts a gNMI target listening on the specified port.
func Target(bindAddr string) error {
entries := make([]*yang.Entry, 0)
for _, e := range oc.SchemaTree {
entries = append(entries, e)
}
modelData, err := util.FindModelData(entries)
if err != nil {
return err
}
// Google stuff from here
model := gnmi.NewModel(
modelData,
reflect.TypeOf((*oc.Device)(nil)),
oc.SchemaTree["Device"],
oc.Unmarshal,
oc.ΛEnum)
g := grpc.NewServer()
var configData []byte
s, err := newServer(model, configData)
if err != nil {
return err
}
pb.RegisterGNMIServer(g, s)
reflection.Register(g)
log.Infof("starting to listen on %s", bindAddr)
listen, err := net.Listen("tcp", bindAddr)
if err != nil {
return err
}
log.Info("starting to serve")
if err := g.Serve(listen); err != nil {
return err
}
return nil
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.23.0
// protoc v3.13.0
// source: cliInterface/gosdnCLI.proto
package gosdn
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// The request message containing the user's name.
type HelloRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *HelloRequest) Reset() {
*x = HelloRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_cliInterface_gosdnCLI_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HelloRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HelloRequest) ProtoMessage() {}
func (x *HelloRequest) ProtoReflect() protoreflect.Message {
mi := &file_cliInterface_gosdnCLI_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.
func (*HelloRequest) Descriptor() ([]byte, []int) {
return file_cliInterface_gosdnCLI_proto_rawDescGZIP(), []int{0}
}
func (x *HelloRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// The response message containing the greetings
type HelloReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
GoSDNInfo string `protobuf:"bytes,2,opt,name=goSDNInfo,proto3" json:"goSDNInfo,omitempty"`
}
func (x *HelloReply) Reset() {
*x = HelloReply{}
if protoimpl.UnsafeEnabled {
mi := &file_cliInterface_gosdnCLI_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HelloReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HelloReply) ProtoMessage() {}
func (x *HelloReply) ProtoReflect() protoreflect.Message {
mi := &file_cliInterface_gosdnCLI_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use HelloReply.ProtoReflect.Descriptor instead.
func (*HelloReply) Descriptor() ([]byte, []int) {
return file_cliInterface_gosdnCLI_proto_rawDescGZIP(), []int{1}
}
func (x *HelloReply) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
func (x *HelloReply) GetGoSDNInfo() string {
if x != nil {
return x.GoSDNInfo
}
return ""
}
// Request to shutdown goSDN
type ShutdownRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *ShutdownRequest) Reset() {
*x = ShutdownRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_cliInterface_gosdnCLI_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ShutdownRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ShutdownRequest) ProtoMessage() {}
func (x *ShutdownRequest) ProtoReflect() protoreflect.Message {
mi := &file_cliInterface_gosdnCLI_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ShutdownRequest.ProtoReflect.Descriptor instead.
func (*ShutdownRequest) Descriptor() ([]byte, []int) {
return file_cliInterface_gosdnCLI_proto_rawDescGZIP(), []int{2}
}
func (x *ShutdownRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// The response message containing some shutdown notes of goSDN
type ShutdownReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
}
func (x *ShutdownReply) Reset() {
*x = ShutdownReply{}
if protoimpl.UnsafeEnabled {
mi := &file_cliInterface_gosdnCLI_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ShutdownReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ShutdownReply) ProtoMessage() {}
func (x *ShutdownReply) ProtoReflect() protoreflect.Message {
mi := &file_cliInterface_gosdnCLI_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ShutdownReply.ProtoReflect.Descriptor instead.
func (*ShutdownReply) Descriptor() ([]byte, []int) {
return file_cliInterface_gosdnCLI_proto_rawDescGZIP(), []int{3}
}
func (x *ShutdownReply) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
// Request with no meaning by now
type TAPIRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *TAPIRequest) Reset() {
*x = TAPIRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_cliInterface_gosdnCLI_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TAPIRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TAPIRequest) ProtoMessage() {}
func (x *TAPIRequest) ProtoReflect() protoreflect.Message {
mi := &file_cliInterface_gosdnCLI_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TAPIRequest.ProtoReflect.Descriptor instead.
func (*TAPIRequest) Descriptor() ([]byte, []int) {
return file_cliInterface_gosdnCLI_proto_rawDescGZIP(), []int{4}
}
func (x *TAPIRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// The response message containing a string with no meaning by now
type TAPIReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
}
func (x *TAPIReply) Reset() {
*x = TAPIReply{}
if protoimpl.UnsafeEnabled {
mi := &file_cliInterface_gosdnCLI_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TAPIReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TAPIReply) ProtoMessage() {}
func (x *TAPIReply) ProtoReflect() protoreflect.Message {
mi := &file_cliInterface_gosdnCLI_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TAPIReply.ProtoReflect.Descriptor instead.
func (*TAPIReply) Descriptor() ([]byte, []int) {
return file_cliInterface_gosdnCLI_proto_rawDescGZIP(), []int{5}
}
func (x *TAPIReply) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
var File_cliInterface_gosdnCLI_proto protoreflect.FileDescriptor
var file_cliInterface_gosdnCLI_proto_rawDesc = []byte{
0x0a, 0x1b, 0x63, 0x6c, 0x69, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2f, 0x67,
0x6f, 0x73, 0x64, 0x6e, 0x43, 0x4c, 0x49, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x63,
0x6c, 0x69, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x22, 0x22, 0x0a, 0x0c, 0x48,
0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22,
0x44, 0x0a, 0x0a, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a,
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x6f, 0x53, 0x44, 0x4e,
0x49, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x53, 0x44,
0x4e, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x25, 0x0a, 0x0f, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77,
0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x29, 0x0a, 0x0d,
0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a,
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x21, 0x0a, 0x0b, 0x54, 0x41, 0x50, 0x49, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x25, 0x0a, 0x09, 0x54, 0x41,
0x50, 0x49, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x32, 0xea, 0x02, 0x0a, 0x07, 0x47, 0x72, 0x70, 0x63, 0x43, 0x6c, 0x69, 0x12, 0x42, 0x0a,
0x08, 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x1a, 0x2e, 0x63, 0x6c, 0x69, 0x49,
0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x63, 0x6c, 0x69, 0x49, 0x6e, 0x74, 0x65, 0x72,
0x66, 0x61, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22,
0x00, 0x12, 0x48, 0x0a, 0x08, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x1d, 0x2e,
0x63, 0x6c, 0x69, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x53, 0x68, 0x75,
0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x63,
0x6c, 0x69, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x53, 0x68, 0x75, 0x74,
0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0b, 0x54,
0x41, 0x50, 0x49, 0x47, 0x65, 0x74, 0x45, 0x64, 0x67, 0x65, 0x12, 0x19, 0x2e, 0x63, 0x6c, 0x69,
0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x54, 0x41, 0x50, 0x49, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x63, 0x6c, 0x69, 0x49, 0x6e, 0x74, 0x65, 0x72,
0x66, 0x61, 0x63, 0x65, 0x2e, 0x54, 0x41, 0x50, 0x49, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00,
0x12, 0x47, 0x0a, 0x0f, 0x54, 0x41, 0x50, 0x49, 0x47, 0x65, 0x74, 0x45, 0x64, 0x67, 0x65, 0x4e,
0x6f, 0x64, 0x65, 0x12, 0x19, 0x2e, 0x63, 0x6c, 0x69, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61,
0x63, 0x65, 0x2e, 0x54, 0x41, 0x50, 0x49, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17,
0x2e, 0x63, 0x6c, 0x69, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x54, 0x41,
0x50, 0x49, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0b, 0x54, 0x41, 0x50,
0x49, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x19, 0x2e, 0x63, 0x6c, 0x69, 0x49, 0x6e,
0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x54, 0x41, 0x50, 0x49, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x63, 0x6c, 0x69, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61,
0x63, 0x65, 0x2e, 0x54, 0x41, 0x50, 0x49, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x50,
0x0a, 0x1e, 0x64, 0x65, 0x2e, 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x66, 0x62, 0x69, 0x2e, 0x67, 0x6f,
0x73, 0x64, 0x6e, 0x2e, 0x63, 0x6c, 0x69, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65,
0x42, 0x0c, 0x63, 0x6c, 0x69, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x50, 0x01,
0x5a, 0x1e, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x66, 0x62, 0x69, 0x2e, 0x68, 0x2d, 0x64,
0x61, 0x2e, 0x64, 0x65, 0x2f, 0x63, 0x6f, 0x63, 0x73, 0x6e, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_cliInterface_gosdnCLI_proto_rawDescOnce sync.Once
file_cliInterface_gosdnCLI_proto_rawDescData = file_cliInterface_gosdnCLI_proto_rawDesc
)
func file_cliInterface_gosdnCLI_proto_rawDescGZIP() []byte {
file_cliInterface_gosdnCLI_proto_rawDescOnce.Do(func() {
file_cliInterface_gosdnCLI_proto_rawDescData = protoimpl.X.CompressGZIP(file_cliInterface_gosdnCLI_proto_rawDescData)
})
return file_cliInterface_gosdnCLI_proto_rawDescData
}
var file_cliInterface_gosdnCLI_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_cliInterface_gosdnCLI_proto_goTypes = []interface{}{
(*HelloRequest)(nil), // 0: cliInterface.HelloRequest
(*HelloReply)(nil), // 1: cliInterface.HelloReply
(*ShutdownRequest)(nil), // 2: cliInterface.ShutdownRequest
(*ShutdownReply)(nil), // 3: cliInterface.ShutdownReply
(*TAPIRequest)(nil), // 4: cliInterface.TAPIRequest
(*TAPIReply)(nil), // 5: cliInterface.TAPIReply
}
var file_cliInterface_gosdnCLI_proto_depIdxs = []int32{
0, // 0: cliInterface.GrpcCli.SayHello:input_type -> cliInterface.HelloRequest
2, // 1: cliInterface.GrpcCli.Shutdown:input_type -> cliInterface.ShutdownRequest
4, // 2: cliInterface.GrpcCli.TAPIGetEdge:input_type -> cliInterface.TAPIRequest
4, // 3: cliInterface.GrpcCli.TAPIGetEdgeNode:input_type -> cliInterface.TAPIRequest
4, // 4: cliInterface.GrpcCli.TAPIGetLink:input_type -> cliInterface.TAPIRequest
1, // 5: cliInterface.GrpcCli.SayHello:output_type -> cliInterface.HelloReply
3, // 6: cliInterface.GrpcCli.Shutdown:output_type -> cliInterface.ShutdownReply
5, // 7: cliInterface.GrpcCli.TAPIGetEdge:output_type -> cliInterface.TAPIReply
5, // 8: cliInterface.GrpcCli.TAPIGetEdgeNode:output_type -> cliInterface.TAPIReply
5, // 9: cliInterface.GrpcCli.TAPIGetLink:output_type -> cliInterface.TAPIReply
5, // [5:10] is the sub-list for method output_type
0, // [0:5] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_cliInterface_gosdnCLI_proto_init() }
func file_cliInterface_gosdnCLI_proto_init() {
if File_cliInterface_gosdnCLI_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_cliInterface_gosdnCLI_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HelloRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cliInterface_gosdnCLI_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HelloReply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cliInterface_gosdnCLI_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ShutdownRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cliInterface_gosdnCLI_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ShutdownReply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cliInterface_gosdnCLI_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TAPIRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cliInterface_gosdnCLI_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TAPIReply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_cliInterface_gosdnCLI_proto_rawDesc,
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_cliInterface_gosdnCLI_proto_goTypes,
DependencyIndexes: file_cliInterface_gosdnCLI_proto_depIdxs,
MessageInfos: file_cliInterface_gosdnCLI_proto_msgTypes,
}.Build()
File_cliInterface_gosdnCLI_proto = out.File
file_cliInterface_gosdnCLI_proto_rawDesc = nil
file_cliInterface_gosdnCLI_proto_goTypes = nil
file_cliInterface_gosdnCLI_proto_depIdxs = nil
}
This diff is collapsed.
This diff is collapsed.
[[client]]
identifier = "ciena-mcp"
endpoint = "141.100.70.170:8080"
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment