diff options
author | Konrad Bańka <k.banka@samsung.com> | 2021-02-24 18:28:56 +0100 |
---|---|---|
committer | Konrad Bańka <k.banka@samsung.com> | 2021-02-24 21:43:07 +0100 |
commit | 74dfd71d3628c52e63f66c079244638c675b2b9c (patch) | |
tree | 1162640670a7bf6b3f8f3ab29b58da8bd064cff1 /src/k8splugin/api/api.go | |
parent | 69f17bdaf539b3ad89f0c3770ea624b512b80fbd (diff) |
Provide Query API for CNF Instances
Query API doesn't directly use Status API code, in order to allow for
querying derived resources that might not be typically returned by
Status API like replicasets for deployment.
Issue-ID: MULTICLOUD-1305
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: If15adce23845880f3e6771cc8eab78a78ab13517
Diffstat (limited to 'src/k8splugin/api/api.go')
-rw-r--r-- | src/k8splugin/api/api.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/k8splugin/api/api.go b/src/k8splugin/api/api.go index c836fc65..e55d833b 100644 --- a/src/k8splugin/api/api.go +++ b/src/k8splugin/api/api.go @@ -1,5 +1,6 @@ /* Copyright 2018 Intel Corporation. +Copyright © 2021 Samsung Electronics Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -47,6 +48,11 @@ func NewRouter(defClient rb.DefinitionManager, instRouter.HandleFunc("/instance/{instID}", instHandler.getHandler).Methods("GET") instRouter.HandleFunc("/instance/{instID}/status", instHandler.statusHandler).Methods("GET") + instRouter.HandleFunc("/instance/{instID}/query", instHandler.queryHandler). + Queries("ApiVersion", "{ApiVersion}", + "Kind", "{Kind}", + "Name", "{Name}", + "Labels", "{Labels}").Methods("GET") instRouter.HandleFunc("/instance/{instID}", instHandler.deleteHandler).Methods("DELETE") // (TODO): Fix update method // instRouter.HandleFunc("/{vnfInstanceId}", UpdateHandler).Methods("PUT") |