Adding remove flows on disable flag
Change-Id: Ia31266c3a959bb1049051de7c6e108e3a6cc6d20
diff --git a/database/common.go b/database/common.go
index 653fccc..ea8f3b6 100644
--- a/database/common.go
+++ b/database/common.go
@@ -63,6 +63,7 @@
PortAlarmDataPath string = DevicePortPath + "portalarmdata/"
SubAlarmDataPath string = DevicePath + "sub-alarm-data/"
ServicesMigrateReqPath string = DevicePath + "migrateServicesReq/"
+ OltFlowServicePath string = "olt-flow-service/"
)
//PresentVersionMap - map of present version for all database tables
@@ -97,6 +98,7 @@
PortAlarmDataPath: "v1",
SubAlarmDataPath: "v1",
ServicesMigrateReqPath: "v1",
+ OltFlowServicePath: "v1",
}
//PreviousVersionMap - map of previous version for all database tables
@@ -131,6 +133,7 @@
PortAlarmDataPath: "v1",
SubAlarmDataPath: "v1",
ServicesMigrateReqPath: "v1",
+ OltFlowServicePath: "v1",
}
//DBVersionMap - Version of tables present in DB
diff --git a/database/database.go b/database/database.go
index 664dce9..cf673eb 100644
--- a/database/database.go
+++ b/database/database.go
@@ -1042,7 +1042,22 @@
logger.Infow(ctx, "Deleting all the Update Vnet Requests for device", log.Fields{"device": deviceID})
return nil
}
+// PutOltFlowService to add OltFlowService info
+func (db *Database) PutOltFlowService(ctx context.Context, value string) error {
+ key := GetKeyPath(OltFlowServicePath)
+ if err := db.kvc.Put(ctx, key, value); err != nil {
+ logger.Warnw(ctx, "Put OltFlowService failed", log.Fields{"key": key})
+ return err
+ }
+ return nil
+}
+
+// GetOltFlowService to get OltFlowService info
+func (db *Database) GetOltFlowService(ctx context.Context) (string, error) {
+ key := GetKeyPath(OltFlowServicePath)
+ 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
diff --git a/database/dbintf.go b/database/dbintf.go
index 8a6a43b..5de5761 100644
--- a/database/dbintf.go
+++ b/database/dbintf.go
@@ -153,6 +153,8 @@
GetAllMigrateServicesReq(ctx context.Context, deviceID string) (map[string]*kvstore.KVPair, error)
DelMigrateServicesReq(ctx context.Context, deviceID string, vlan string) error
DelAllMigrateServicesReq(ctx context.Context, deviceID string) error
+ PutOltFlowService(ctx context.Context, value string) error
+ GetOltFlowService(ctx context.Context) (string, error)
}
//GetDatabase - returns databse operation based on configuration