diff options
author | Igor D.C <igor.duarte.cardoso@intel.com> | 2020-09-30 21:30:06 +0000 |
---|---|---|
committer | Igor D.C <igor.duarte.cardoso@intel.com> | 2020-10-01 17:20:15 +0000 |
commit | 80107dc294c86a452c6108ffca6f281b4dbb9192 (patch) | |
tree | c246b3a46307dc851a8a2866655609d42e210c23 /src/dcm/api/api.go | |
parent | 5e114cd8a05986b7762fb9db22a43d61bb9fe00e (diff) |
Subtle refactoring in a few functions
In DCM.
Essentially refactored two different areas:
- rename apply/terminate functions in module to clarify what they do
- split gets from getAlls in API code of the 5 DCM resource types
And cleaned up here and there.
Issue-ID: MULTICLOUD-1143
Change-Id: I9b72c77ba34a1febd5df4a339e87968ddc4a7891
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
Diffstat (limited to 'src/dcm/api/api.go')
-rw-r--r-- | src/dcm/api/api.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/dcm/api/api.go b/src/dcm/api/api.go index cd8589dd..10856ba2 100644 --- a/src/dcm/api/api.go +++ b/src/dcm/api/api.go @@ -21,7 +21,6 @@ import ( // NewRouter creates a router that registers the various urls that are // supported - func NewRouter( logicalCloudClient module.LogicalCloudManager, clusterClient module.ClusterManager, @@ -55,7 +54,7 @@ func NewRouter( logicalCloudHandler.createHandler).Methods("POST") lcRouter.HandleFunc( "/logical-clouds", - logicalCloudHandler.getHandler).Methods("GET") + logicalCloudHandler.getAllHandler).Methods("GET") lcRouter.HandleFunc( "/logical-clouds/{logical-cloud-name}", logicalCloudHandler.getHandler).Methods("GET") @@ -80,7 +79,7 @@ func NewRouter( clusterHandler.createHandler).Methods("POST") clusterRouter.HandleFunc( "/logical-clouds/{logical-cloud-name}/cluster-references", - clusterHandler.getHandler).Methods("GET") + clusterHandler.getAllHandler).Methods("GET") clusterRouter.HandleFunc( "/logical-clouds/{logical-cloud-name}/cluster-references/{cluster-reference}", clusterHandler.getHandler).Methods("GET") @@ -105,6 +104,9 @@ func NewRouter( "/logical-clouds/{logical-cloud-name}/user-permissions", userPermissionHandler.createHandler).Methods("POST") upRouter.HandleFunc( + "/logical-clouds/{logical-cloud-name}/user-permissions", + userPermissionHandler.getAllHandler).Methods("GET") + upRouter.HandleFunc( "/logical-clouds/{logical-cloud-name}/user-permissions/{permission-name}", userPermissionHandler.getHandler).Methods("GET") upRouter.HandleFunc( @@ -121,6 +123,9 @@ func NewRouter( "/logical-clouds/{logical-cloud-name}/cluster-quotas", quotaHandler.createHandler).Methods("POST") quotaRouter.HandleFunc( + "/logical-clouds/{logical-cloud-name}/cluster-quotas", + quotaHandler.getAllHandler).Methods("GET") + quotaRouter.HandleFunc( "/logical-clouds/{logical-cloud-name}/cluster-quotas/{quota-name}", quotaHandler.getHandler).Methods("GET") quotaRouter.HandleFunc( @@ -140,6 +145,9 @@ func NewRouter( "/logical-clouds/{logical-cloud-name}/kv-pairs", keyValueHandler.createHandler).Methods("POST") kvRouter.HandleFunc( + "/logical-clouds/{logical-cloud-name}/kv-pairs", + keyValueHandler.getAllHandler).Methods("GET") + kvRouter.HandleFunc( "/logical-clouds/{logical-cloud-name}/kv-pairs/{kv-pair-name}", keyValueHandler.getHandler).Methods("GET") kvRouter.HandleFunc( |