From 9c63ce2a7b2b66b3e3fce5d1f553f327148df83f Mon Sep 17 00:00:00 2001 From: Srivahni Chivukula Date: Wed, 11 Mar 2020 13:59:21 -0700 Subject: Modified project api to use new mongodb methods Issue-ID: MULTICLOUD-994 Signed-off-by: Srivahni Chivukula Change-Id: I8e7e17a1dab164c4ea7d50743b20f0e08958a957 --- src/orchestrator/pkg/module/project.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/orchestrator/pkg/module') 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;") } -- cgit 1.2.3-korg