From f026b794a6be909731470af5398b03af375e7b78 Mon Sep 17 00:00:00 2001 From: Konrad Bańka Date: Tue, 23 Feb 2021 20:35:59 +0100 Subject: Move Day2 Config Values API to new endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue-ID: MULTICLOUD-1280 Signed-off-by: Konrad Bańka Change-Id: Ibeb0920b4ce083f4294b83c887fc7c793a2c3df5 --- src/k8splugin/internal/app/instance.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/k8splugin/internal/app/instance.go') 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) { -- cgit 1.2.3-korg