summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/internal/app/instance.go
diff options
context:
space:
mode:
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) {