Commit 396a8547 authored by Manuel Kieweg's avatar Manuel Kieweg 🤷
Browse files

Merge branch 'rewrite-readme' into 'master'

Rewrite readme

See merge request cocsn/gosdn!133
parents 20cad98d 7c3468ba
# GoSDN
# goSDN [![coverage report](https://code.fbi.h-da.de/cocsn/gosdn/badges/master/coverage.svg)](https://code.fbi.h-da.de/cocsn/gosdn/-/commits/master) [![pipeline status](https://code.fbi.h-da.de/cocsn/gosdn/badges/master/pipeline.svg)](https://code.fbi.h-da.de/cocsn/gosdn/-/commits/master)
### CI Status Master
[![coverage report](https://code.fbi.h-da.de/cocsn/gosdn/badges/master/coverage.svg)](https://code.fbi.h-da.de/cocsn/gosdn/-/commits/master)
[![pipeline status](https://code.fbi.h-da.de/cocsn/gosdn/badges/master/pipeline.svg)](https://code.fbi.h-da.de/cocsn/gosdn/-/commits/master)
`goSDN` is a prototypical approach to build a model driven multi-vendor SDN controller.
### CI Status Develop
# Table of Contents
[![coverage report](https://code.fbi.h-da.de/cocsn/gosdn/badges/develop/coverage.svg)](https://code.fbi.h-da.de/cocsn/gosdn/-/commits/develop)
[![pipeline status](https://code.fbi.h-da.de/cocsn/gosdn/badges/develop/pipeline.svg)](https://code.fbi.h-da.de/cocsn/gosdn/-/commits/develop)
- [Overview](#overview)
- [Concepts](#concepts)
- [Installing](#installing)
- [Getting Started](#getting-started)
* [k8s](#k8s)
* [Using the goSDN CLI](#using-the-cli)
* [Example](#example)
- [Contributing](CONTRIBUTING.md)
- [License](LICENSE)
- [CI Status](#ci-status)
The GIT repo for the GoSDN design and implementation. GoSDN is intended to be controller for Software Defined Networks (SDN) that follows a modern software architecture design and a well-documented implementation in the go language.
# Overview
## Generate Code Stubs
`goSDN` is also an application that will allow you to manage your multi-vendor network using one unified controller.
YANG code stubs are located in the `yang-processor` directory. They are generated by calling `go generate` from their respective sub directories.
`goSDN` provides:
* Model driven device representation
* Native multi vendor support
* Multi controller environments
# Concepts
The `goSDN` core - also called `nucleus` - is a lightweight library that manages principal network domains and provides southbound interface operations for orchestrated networking devices.
## Principal Networking Domain (PND)
The PND is the single source of truth within a network. Its state is held and maintained by the controller. Any configuration of an OND has to be applied by the PND.
## Orchestrated Networking Device (OND)
Any device directly configured by `goSDN`
# Installing
You can install the latest release of `goSDN` locally using the `go get` command. Since the repository and some dependencies are not publicly available you have to modify your git config first:
```sh
> git config --global url."git@code.fbi.h-da.de:".insteadOf "https://code.fbi.h-da.de"
> go get code.fbi.h-da.de/cocsn/gosdn/cmd/gosdn
```
gosdn
+-- yang-processor
+-- ciena //Ciena code stubs
+-- tapi //TAPI code stubs
+-- yang //All YANG modules
To install the development version you need to clone the repo and use `go install` to build and install the binary:
```sh
# If you haven't cloned the repo yet
> git config --global url."git@code.fbi.h-da.de:".insteadOf "https://code.fbi.h-da.de"
> cd $GOPATH/src
> git clone git@code.fbi.h-da.de:cocsn/gosdn.git
# checkout the develop branch (or any other branch)
> cd $GOPATH/src/code.fbi.h-da.de/cocsn/gosdn
> git checkout develop
> go install ./cmd/gosdn
```
## Documentation
Now you can start `goSDN` locally using the `gosdn` command or [use the CLI](#using-the-cli) to interact with a running `goSDN` instance.
# Getting Started
## k8s
We have an instance of `goSDN` for each the latest master and current develop branch running on the department's k8s cluster. These endpoints can be accessed using the `gosdn cli` command. If anything breaks please file an [issue](https://code.fbi.h-da.de/cocsn/gosdn/-/issues/new).
## Using the CLI
The `gosdn cli` command allows you to interact with a running `goSDN` controller. Use `gosdn help cli` to print the available commands and flags.
## Example
[![asciicast](https://asciinema.org/a/dfrDlFQt5DPlG9HDyetdmeEW8.svg)](https://asciinema.org/a/dfrDlFQt5DPlG9HDyetdmeEW8)
# CI Status
The latest documentatiion generated on the master branch can be downloaded [here](https://code.fbi.h-da.de/cocsn/gosdn/-/jobs).
| Master | Develop |
| ------ | ------ |
| [![coverage report](https://code.fbi.h-da.de/cocsn/gosdn/badges/master/coverage.svg)](https://code.fbi.h-da.de/cocsn/gosdn/-/commits/master) | [![coverage report](https://code.fbi.h-da.de/cocsn/gosdn/badges/develop/coverage.svg)](https://code.fbi.h-da.de/cocsn/gosdn/-/commits/develop) |
| [![pipeline status](https://code.fbi.h-da.de/cocsn/gosdn/badges/master/pipeline.svg)](https://code.fbi.h-da.de/cocsn/gosdn/-/commits/master) | [![pipeline status](https://code.fbi.h-da.de/cocsn/gosdn/badges/develop/pipeline.svg)](https://code.fbi.h-da.de/cocsn/gosdn/-/commits/develop) |
......@@ -43,7 +43,9 @@ func HTTPGet(apiEndpoint, f string, args ...string) error {
viper.Set("CLI_PND", pnd)
viper.Set("CLI_SBI", sbi)
err := viper.WriteConfig()
log.Error(err)
if err != nil {
log.Error(err)
}
default:
fmt.Println(string(bytes))
}
......
......@@ -40,7 +40,10 @@ import (
var addDeviceCmd = &cobra.Command{
Use: "add-device",
Short: "adds a device to the controller",
Long: ``,
Long: `Adds a device to the controller.
Device address and user credentials need to be provided
if they diverge from the default credentials.`,
RunE: func(cmd *cobra.Command, args []string) error {
return cli.HTTPGet(
apiEndpoint,
......
......@@ -41,7 +41,7 @@ var capabilitiesCmd = &cobra.Command{
Use: "capabilities",
Short: "capabilities request",
Long: `Sends a gNMI Capabilities request to the specified target
// and prints the supported models to stdout.`,
and prints the supported models to stdout.`,
RunE: func(cmd *cobra.Command, args []string) error {
return cli.Capabilities(username, password, address)
},
......
......@@ -42,8 +42,9 @@ var apiEndpoint string
// cliCmd represents the cli command
var cliCmd = &cobra.Command{
Use: "cli",
Short: "",
Long: ``,
Short: "initialises the cli",
Long: `Initialises the CLI. The first PND UUID and SBI UUID
are written to the config file for subsequent requests.`,
RunE: func(cmd *cobra.Command, args []string) error {
return cli.HTTPGet(apiEndpoint, "init")
},
......@@ -52,7 +53,6 @@ var cliCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(cliCmd)
cliCmd.PersistentFlags().StringVar(&uuid, "uuid", "", "uuid of the requested device")
cliCmd.PersistentFlags().StringVar(&apiEndpoint, "api-endpoint", "http://gosdn-develop.apps.ocp.fbi.h-da.de/api", "address of the target")
cliCmd.PersistentFlags().StringVar(&apiEndpoint, "controller", "http://gosdn-develop.apps.ocp.fbi.h-da.de/api", "address of the controller")
}
......@@ -39,8 +39,10 @@ import (
// cliSetCmd represents the cliSet command
var cliSetCmd = &cobra.Command{
Use: "set",
Args: cobra.ExactArgs(2),
Short: "set a value on a device",
Long: ``,
Long: `Set a path value for a given device. Only one path and
only one value supported for now`,
RunE: func(cmd *cobra.Command, args []string) error {
return cli.HTTPGet(
apiEndpoint,
......@@ -57,4 +59,6 @@ var cliSetCmd = &cobra.Command{
func init() {
cliCmd.AddCommand(cliSetCmd)
cliSetCmd.Flags().StringVar(&uuid, "uuid", "", "uuid of the requested device")
}
......@@ -40,7 +40,8 @@ import (
var getCmd = &cobra.Command{
Use: "gosdn get",
Short: "get request",
Long: `Sends a gNMI Get request to the specified target and prints the response to stdout`,
Long: `Sends a gNMI Get request to the specified target and
prints the response to stdout`,
RunE: func(cmd *cobra.Command, args []string) error {
_, err := cli.Get(address, username, password, args...)
return err
......
......@@ -39,13 +39,16 @@ import (
// getDeviceCmd represents the getDevice command
var getDeviceCmd = &cobra.Command{
Use: "get-device",
Args: cobra.ExactArgs(1),
Short: "gets device information from the controller",
Long: ``,
Long: `Gets device information from the controller.
Device UUID needs to be specified as positional argument.`,
RunE: func(cmd *cobra.Command, args []string) error {
return cli.HTTPGet(
apiEndpoint,
"getDevice",
"uuid="+uuid,
"uuid="+args[0],
"sbi="+cliSbi,
"pnd="+cliPnd,
)
......
......@@ -40,7 +40,7 @@ import (
var getIdsCmd = &cobra.Command{
Use: "get-ids",
Short: "gets device IDs from the controller",
Long: ``,
Long: `Gets device IDs from the controller and lists them.`,
RunE: func(cmd *cobra.Command, args []string) error {
return cli.HTTPGet(apiEndpoint, "getIDs")
},
......
......@@ -40,7 +40,9 @@ import (
var initCmd = &cobra.Command{
Use: "init",
Short: "initialise SBI and PND",
Long: ``,
Long: `Initialise SBI and PND and saves values to config file.
Same as invoking "gosdn cli" without any arguments`,
RunE: func(cmd *cobra.Command, args []string) error {
return cli.HTTPGet(apiEndpoint, "init")
},
......
/*
Copyright © 2021 da/net research group <danet.fbi.h-da.de>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
package cmd
import (
"errors"
"github.com/spf13/cobra"
)
// legacyCmd represents the legacy command
var legacyCmd = &cobra.Command{
Use: "legacy",
Short: "multiple ygot utils - not yet implemented",
Long: ``,
RunE: func(cmd *cobra.Command, args []string) error {
return errors.New("not implemented")
},
}
func init() {
pathCmd.AddCommand(legacyCmd)
}
/*
Copyright © 2021 da/net research group <danet.fbi.h-da.de>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
package cmd
import (
"errors"
"github.com/spf13/cobra"
)
// pathCmd represents the path command
var pathCmd = &cobra.Command{
Use: "path",
Short: "multiple ygot utils - not yet implemented",
Long: ``,
RunE: func(cmd *cobra.Command, args []string) error {
return errors.New("not implemented")
},
}
func init() {
rootCmd.AddCommand(pathCmd)
}
......@@ -39,8 +39,11 @@ import (
// requestCmd represents the request command
var requestCmd = &cobra.Command{
Use: "request",
Args: cobra.ExactArgs(1),
Short: "requests a path from a specified device on the controller",
Long: ``,
Long: `Requests a path from a specified device on the controller.
The request path is passed as positional argument.`,
RunE: func(cmd *cobra.Command, args []string) error {
return cli.HTTPGet(
apiEndpoint,
......@@ -55,4 +58,6 @@ var requestCmd = &cobra.Command{
func init() {
cliCmd.AddCommand(requestCmd)
requestCmd.Flags().StringVar(&uuid, "uuid", "", "uuid of the requested device")
}
......@@ -39,8 +39,12 @@ import (
// requestAllCmd represents the requestAll command
var requestAllCmd = &cobra.Command{
Use: "request-all",
Args: cobra.ExactArgs(1),
Short: "requests specified path from all devices on the controller",
Long: ``,
Long: `Requests a path from all devices on the controller known by
the controller.
The request path is passed as positional argument.`,
RunE: func(cmd *cobra.Command, args []string) error {
return cli.HTTPGet(
apiEndpoint,
......
......@@ -32,11 +32,12 @@ POSSIBILITY OF SUCH DAMAGE.
package cmd
import (
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
"context"
"os"
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"os"
"github.com/spf13/viper"
)
......@@ -54,7 +55,8 @@ var cliSbi string
var rootCmd = &cobra.Command{
Use: "gosdn",
Short: "starts the gosdn controller",
Long: `Set GOSDN_DEBUG environment variable to enable debug logging.`,
Long: `Starts the gosdn controller and listens on port 8080
for REST API calls.`,
RunE: func(cmd *cobra.Command, args []string) error {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
......@@ -74,14 +76,10 @@ func Execute() {
func init() {
cobra.OnInitialize(initConfig)
// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is ./configs/gosdn.toml)")
rootCmd.PersistentFlags().StringVarP(&username, "username", "u", "admin", "username for a gnmi resource")
rootCmd.PersistentFlags().StringVarP(&password, "password", "p", "arista", "password for a gnmi resource")
rootCmd.PersistentFlags().StringVarP(&address, "address", "a", "ceos-cocsn.apps.ocp.fbi.h-da.de:6030", "address to a gnmi resource")
rootCmd.PersistentFlags().StringVarP(&address, "address", "a", "ceos-cocsn.apps.ocp.fbi.h-da.de:6030", "address of a gnmi target")
rootCmd.PersistentFlags().StringVarP(&loglevel, "log-level", "l", "", "log level 'debug' or 'trace'")
rootCmd.Flags().StringVar(&grpcPort, "grpc-port", "55055", "port for gRPC NBI")
......@@ -110,7 +108,10 @@ func initConfig() {
cliPnd = viper.GetString("CLI_PND")
cliSbi = viper.GetString("CLI_SBI")
loglevel = viper.GetString("GOSDN_LOG")
ll := viper.GetString("GOSDN_LOG")
if ll != "" {
loglevel = ll
}
log.SetReportCaller(true)
switch loglevel {
case "trace":
......
......@@ -43,7 +43,7 @@ var setCmd = &cobra.Command{
Use: "set",
Short: "set request",
Long: `Sends a gNMI Set request to the specified target. Only one
request per invocation supported.`,
request per invocation supported.`,
RunE: func(cmd *cobra.Command, args []string) error {
return cli.Set(address, username, password, typ, args...)
},
......
......@@ -45,7 +45,7 @@ var subscribeCmd = &cobra.Command{
Short: "subscribe to target",
Long: `Starts a gNMI subscriber requesting the specified paths on the target and logs the response to stdout.
Only 'stream' mode with 'sample' operation supported.`,
Only 'stream' mode with 'sample' operation supported.`,
RunE: func(cmd *cobra.Command, args []string) error {
return cli.Subscribe(address, username, password, sampleInterval, heartbeatInterval, args...)
},
......
......@@ -260,7 +260,6 @@ github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgo
github.com/klauspost/pgzip v1.2.4/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
github.com/klauspost/reedsolomon v1.9.3/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
......@@ -379,8 +378,9 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs=
github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo=
......@@ -545,6 +545,7 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
......
......@@ -61,19 +61,26 @@ func httpHandler(writer http.ResponseWriter, request *http.Request) {
return
}
id, err := uuid.Parse(query.Get("uuid"))
if err != nil {
log.Error(err)
if err.Error() != "invalid UUID length: 0" {
log.Error(err)
}
}
pid, err := uuid.Parse(query.Get("pnd"))
if err != nil {
log.Error(err)
if err.Error() != "invalid UUID length: 0" {
log.Error(err)
}
}
sid, err := uuid.Parse(query.Get("sbi"))
if err != nil {
log.Error(err)
if err.Error() != "invalid UUID length: 0" {
log.Error(err)
}
}
var pnd PrincipalNetworkDomain
......@@ -166,10 +173,17 @@ func httpHandler(writer http.ResponseWriter, request *http.Request) {
fmt.Fprintf(writer, "%v: %v\n", i+1, id)
}
}
writeIDs("PNDs", c.pndc.UUIDs())
pnds := c.pndc.UUIDs()
writeIDs("PNDs", pnds)
writeIDs("SBIs", c.sbic.UUIDs())
if pnd != nil {
writeIDs("Devices", pnd.(*pndImplementation).devices.UUIDs())
for _,id := range pnds{
p, err := c.pndc.get(id)
if err != nil {
writer.WriteHeader(http.StatusInternalServerError)
log.Error(err)
return
}
writeIDs("Devices", p.(*pndImplementation).devices.UUIDs())
}
case "init":
writeIDs := func(typ string, ids []uuid.UUID) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment