net config restinterface along with mvlan delete rest api

Change-Id: I4d8f5829d4e8b08be7981716cb3cde26cc5a507c
diff --git a/database/common.go b/database/common.go
index ea8f3b6..6d7b4a7 100644
--- a/database/common.go
+++ b/database/common.go
@@ -11,7 +11,7 @@
 * 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.
-*/
+ */
 // This implementation of database assumes that it is working for
 // Open ONU adapter. Thus, it assumes some base path for all the
 // database operations. For all database operations, the key passed is
@@ -64,6 +64,7 @@
 	SubAlarmDataPath       string = DevicePath + "sub-alarm-data/"
 	ServicesMigrateReqPath string = DevicePath + "migrateServicesReq/"
 	OltFlowServicePath     string = "olt-flow-service/"
+	DeviceConfigPath       string = "device-config/"
 )
 
 //PresentVersionMap - map of present version for all database tables
@@ -99,6 +100,7 @@
 	SubAlarmDataPath:       "v1",
 	ServicesMigrateReqPath: "v1",
 	OltFlowServicePath:     "v1",
+	DeviceConfigPath:       "v1",
 }
 
 //PreviousVersionMap - map of previous version for all database tables
@@ -134,6 +136,7 @@
 	SubAlarmDataPath:       "v1",
 	ServicesMigrateReqPath: "v1",
 	OltFlowServicePath:     "v1",
+	DeviceConfigPath:       "v1",
 }
 
 //DBVersionMap - Version of tables present in DB
diff --git a/database/database.go b/database/database.go
index cf673eb..75f4802 100644
--- a/database/database.go
+++ b/database/database.go
@@ -11,7 +11,7 @@
 * 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.
-*/
+ */
 // This implementation of database assumes that it is working for
 // Open ONU adapter. Thus, it assumes some base path for all the
 // database operations. For all database operations, the key passed is
@@ -22,14 +22,16 @@
 import (
 	"context"
 	"errors"
+	"fmt"
 	"net"
 	"strconv"
 	"time"
-	"fmt"
 
+	"voltha-go-controller/internal/pkg/errorcodes"
 	"voltha-go-controller/internal/pkg/of"
-	"github.com/opencord/voltha-lib-go/v7/pkg/db/kvstore"
 	"voltha-go-controller/log"
+
+	"github.com/opencord/voltha-lib-go/v7/pkg/db/kvstore"
 )
 
 var logger log.CLogger
@@ -39,7 +41,7 @@
 	storeType string
 	address   string
 	//timeout   uint32
-	kvc       kvstore.Client
+	kvc kvstore.Client
 }
 
 // Initialize the database module. The database module runs as a singleton
@@ -494,7 +496,7 @@
 // GetHealth to get health info
 func (db *Database) GetHealth(ctx context.Context) (string, error) {
 	key := GetKeyPath(HealthPath)
-	return db.Get(ctx,key)
+	return db.Get(ctx, key)
 }
 
 // PutHealth to add health info
@@ -741,6 +743,23 @@
 	}
 }
 
+// GetServices to get multiple services info
+func (db *Database) GetDeviceConfig(ctx context.Context) (map[string]*kvstore.KVPair, error) {
+	key := GetKeyPath(DeviceConfigPath)
+	return db.List(ctx, key)
+}
+
+// PutSBDeviceConfig to add device info
+func (db *Database) PutDeviceConfig(ctx context.Context, serialNum string, value string) error {
+	key := GetKeyPath(DeviceConfigPath) + serialNum
+
+	if err := db.kvc.Put(ctx, key, value); err != nil {
+		logger.Warnw(ctx, "Put Device Config failed", log.Fields{"key": key})
+		return errorcodes.ErrFailedToUpdateDB
+	}
+	return nil
+}
+
 // DelNbDevicePort to delete device port
 func (db *Database) DelNbDevicePort(ctx context.Context, device string, ponPortID uint32) {
 	key := GetKeyPath(NbDevicePath) + device + "/pon-port/" + fmt.Sprintf("%v", ponPortID)
@@ -1059,10 +1078,10 @@
 	return db.Get(ctx, key)
 }
 func init() {
-        // Setup this package so that it's log level can be modified at run time
-        var err error
-        logger, err = log.AddPackageWithDefaultParam()
-        if err != nil {
-                panic(err)
-        }
+	// Setup this package so that it's log level can be modified at run time
+	var err error
+	logger, err = log.AddPackageWithDefaultParam()
+	if err != nil {
+		panic(err)
+	}
 }
diff --git a/database/dbintf.go b/database/dbintf.go
index 5de5761..6100d35 100644
--- a/database/dbintf.go
+++ b/database/dbintf.go
@@ -11,15 +11,16 @@
 * 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 database
 
 import (
-	"net"
 	"context"
+	"net"
 
 	"voltha-go-controller/internal/pkg/of"
+
 	"github.com/opencord/voltha-lib-go/v7/pkg/db/kvstore"
 )
 
@@ -115,6 +116,8 @@
 	GetAllPonChannelCounters(ctx context.Context, device string, ponID string) (map[string]*kvstore.KVPair, error)
 	GetPonChannelCounter(ctx context.Context, device string, ponID string, channel string) (string, error)
 	PutNbDevicePort(ctx context.Context, device string, ponPortID uint32, value string)
+	GetDeviceConfig(ctx context.Context) (map[string]*kvstore.KVPair, error)
+	PutDeviceConfig(ctx context.Context, serialNum string, value string) error
 	PutPonChannelCounter(ctx context.Context, device string, ponID string, channel string, value string) error
 	DelPonChannelCounter(ctx context.Context, device string, ponID string, channel string) error
 	DelAllPONCounters(ctx context.Context, device string) error