summaryrefslogtreecommitdiffstats
path: root/src/orchestrator/pkg
diff options
context:
space:
mode:
authorSrivahni Chivukula <srivahni.chivukula@intel.com>2020-03-11 13:59:21 -0700
committerSrivahni Chivukula <srivahni.chivukula@intel.com>2020-03-12 19:01:41 +0000
commit9c63ce2a7b2b66b3e3fce5d1f553f327148df83f (patch)
treec4ca75cbb14686be9fa95b3445610953dcd2d978 /src/orchestrator/pkg
parentdef02dfebada38bde91dc98db85eff3d8923a923 (diff)
Modified project api to use new mongodb methods
Issue-ID: MULTICLOUD-994 Signed-off-by: Srivahni Chivukula <srivahni.chivukula@intel.com> Change-Id: I8e7e17a1dab164c4ea7d50743b20f0e08958a957
Diffstat (limited to 'src/orchestrator/pkg')
-rw-r--r--src/orchestrator/pkg/module/project.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/orchestrator/pkg/module/project.go b/src/orchestrator/pkg/module/project.go
index a95251b5..a6f59254 100644
--- a/src/orchestrator/pkg/module/project.go
+++ b/src/orchestrator/pkg/module/project.go
@@ -90,7 +90,7 @@ func (v *ProjectClient) CreateProject(p Project) (Project, error) {
return Project{}, pkgerrors.New("Project already exists")
}
- err = db.DBconn.Create(v.storeName, key, v.tagMeta, p)
+ err = db.DBconn.Insert(v.storeName, key, nil, v.tagMeta, p)
if err != nil {
return Project{}, pkgerrors.Wrap(err, "Creating DB Entry")
}
@@ -105,7 +105,7 @@ func (v *ProjectClient) GetProject(name string) (Project, error) {
key := ProjectKey{
ProjectName: name,
}
- value, err := db.DBconn.Read(v.storeName, key, v.tagMeta)
+ value, err := db.DBconn.Find(v.storeName, key, v.tagMeta)
if err != nil {
return Project{}, pkgerrors.Wrap(err, "Get Project")
}
@@ -113,7 +113,7 @@ func (v *ProjectClient) GetProject(name string) (Project, error) {
//value is a byte array
if value != nil {
proj := Project{}
- err = db.DBconn.Unmarshal(value, &proj)
+ err = db.DBconn.Unmarshal(value[0], &proj)
if err != nil {
return Project{}, pkgerrors.Wrap(err, "Unmarshaling Value")
}
@@ -130,7 +130,7 @@ func (v *ProjectClient) DeleteProject(name string) error {
key := ProjectKey{
ProjectName: name,
}
- err := db.DBconn.Delete(v.storeName, key, v.tagMeta)
+ err := db.DBconn.Remove(v.storeName, key)
if err != nil {
return pkgerrors.Wrap(err, "Delete Project Entry;")
}