summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/internal/app/instance.go
diff options
context:
space:
mode:
authorBin Yang <bin.yang@windriver.com>2021-02-24 13:04:48 +0000
committerGerrit Code Review <gerrit@onap.org>2021-02-24 13:04:48 +0000
commit2f09583725c8481ea3d7505ed2394c180af5ef03 (patch)
tree1f7e0322c553f711ba7bbc8c116c7d70dd445937 /src/k8splugin/internal/app/instance.go
parent69f17bdaf539b3ad89f0c3770ea624b512b80fbd (diff)
parentf026b794a6be909731470af5398b03af375e7b78 (diff)
Merge "Move Day2 Config Values API to new endpoint"
Diffstat (limited to 'src/k8splugin/internal/app/instance.go')
-rw-r--r--src/k8splugin/internal/app/instance.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/k8splugin/internal/app/instance.go b/src/k8splugin/internal/app/instance.go
index a6e213c1..69ade3a8 100644
--- a/src/k8splugin/internal/app/instance.go
+++ b/src/k8splugin/internal/app/instance.go
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Intel Corporation, Inc
- * Copyright © 2020 Samsung Electronics
+ * 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.
@@ -111,6 +111,16 @@ func NewInstanceClient() *InstanceClient {
}
}
+// Simplified function to retrieve model data from instance ID
+func resolveModelFromInstance(instanceID string) (rbName, rbVersion, profileName, releaseName string, err error) {
+ v := NewInstanceClient()
+ resp, err := v.Get(instanceID)
+ if err != nil {
+ return "", "", "", "", pkgerrors.Wrap(err, "Getting instance")
+ }
+ return resp.Request.RBName, resp.Request.RBVersion, resp.Request.ProfileName, resp.ReleaseName, nil
+}
+
// Create an instance of rb on the cluster in the database
func (v *InstanceClient) Create(i InstanceRequest) (InstanceResponse, error) {