aboutsummaryrefslogtreecommitdiffstats
path: root/src/orchestrator/examples
diff options
context:
space:
mode:
authorLarry Sachs <larry.j.sachs@intel.com>2020-07-20 22:46:49 -0700
committerLarry Sachs <larry.j.sachs@intel.com>2020-07-24 14:05:40 -0700
commitb102d4ab1a47809f514213eb1f997d4f60893c9f (patch)
treea9e5d8e345d5e06bbff305f0d557f6452c040ff8 /src/orchestrator/examples
parent783ed87fb39a8aa25e303e97aff2170dca059068 (diff)
Adds PUT api to v2/projects
Add functionality to support the PUT api for v2/projects/{project-name} Also add unit tests for the PUT api Issue-ID: MULTICLOUD-1130 Change-Id: Ia271569c5f0dec3152952e64171fd5a182aaa333 Signed-off-by: Larry Sachs <larry.j.sachs@intel.com>
Diffstat (limited to 'src/orchestrator/examples')
-rw-r--r--src/orchestrator/examples/example_module.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/orchestrator/examples/example_module.go b/src/orchestrator/examples/example_module.go
index 9138b085..7edbb758 100644
--- a/src/orchestrator/examples/example_module.go
+++ b/src/orchestrator/examples/example_module.go
@@ -31,7 +31,14 @@ func ExampleClient_Project() {
return
}
// Perform operations on Project Module
- _, err := c.Project.CreateProject(moduleLib.Project{MetaData: moduleLib.ProjectMetaData{Name: "test", Description: "test", UserData1: "userData1", UserData2: "userData2"}})
+ // POST request (exists == false)
+ _, err := c.Project.CreateProject(moduleLib.Project{MetaData: moduleLib.ProjectMetaData{Name: "test", Description: "test", UserData1: "userData1", UserData2: "userData2"}}, false)
+ if err != nil {
+ log.Println(err)
+ return
+ }
+ // PUT request (exists == true)
+ _, err = c.Project.CreateProject(moduleLib.Project{MetaData: moduleLib.ProjectMetaData{Name: "test", Description: "test", UserData1: "userData1", UserData2: "userData2"}}, true)
if err != nil {
log.Println(err)
return