diff options
author | Ritu Sood <Ritu.Sood@intel.com> | 2020-04-21 21:39:21 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-04-21 21:39:21 +0000 |
commit | bad55d7f0156789799029bb6d27de2824786accd (patch) | |
tree | 1b1c7c3210721cd349d5552937a66b559105a3af /src/dcm/api/api.go | |
parent | 41e63a840a08cba73b4d606e162bb71d042a4e95 (diff) | |
parent | b0919a7cd6f49bcd2ae3e59c7a31e40f36cb7879 (diff) |
Merge "Implement Apply API for DCM"
Diffstat (limited to 'src/dcm/api/api.go')
-rw-r--r-- | src/dcm/api/api.go | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/dcm/api/api.go b/src/dcm/api/api.go index d050a5ba..87ad77b5 100644 --- a/src/dcm/api/api.go +++ b/src/dcm/api/api.go @@ -36,7 +36,19 @@ func NewRouter( if logicalCloudClient == nil { logicalCloudClient = module.NewLogicalCloudClient() } - logicalCloudHandler := logicalCloudHandler{client: logicalCloudClient} + + if clusterClient == nil { + clusterClient = module.NewClusterClient() + } + + if quotaClient == nil { + quotaClient = module.NewQuotaClient() + } + + logicalCloudHandler := logicalCloudHandler{client: logicalCloudClient, + clusterClient: clusterClient, + quotaClient: quotaClient, + } lcRouter := router.PathPrefix("/v2/projects/{project-name}").Subrouter() lcRouter.HandleFunc( "/logical-clouds", @@ -67,9 +79,7 @@ func NewRouter( logicalCloudHandler.associateHandler).Methods("GET")*/ // Set up Cluster API - if clusterClient == nil { - clusterClient = module.NewClusterClient() - } + clusterHandler := clusterHandler{client: clusterClient} clusterRouter := router.PathPrefix("/v2/projects/{project-name}").Subrouter() clusterRouter.HandleFunc( @@ -108,9 +118,7 @@ func NewRouter( userPermissionHandler.deleteHandler).Methods("DELETE") // Set up Quota API - if quotaClient == nil { - quotaClient = module.NewQuotaClient() - } + quotaHandler := quotaHandler{client: quotaClient} quotaRouter := router.PathPrefix("/v2/projects/{project-name}").Subrouter() quotaRouter.HandleFunc( |