diff options
author | Konrad Bańka <k.banka@samsung.com> | 2021-02-23 20:35:59 +0100 |
---|---|---|
committer | Konrad Bańka <k.banka@samsung.com> | 2021-02-23 22:53:33 +0100 |
commit | f026b794a6be909731470af5398b03af375e7b78 (patch) | |
tree | c75bd6d3cb0d55ceb9df3bbfec5fb623fcabe3a2 /src/k8splugin/internal/app/instance.go | |
parent | 33ec73cffb875eb8cc1fbad8d33f1385621250ba (diff) |
Move Day2 Config Values API to new endpoint
Issue-ID: MULTICLOUD-1280
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: Ibeb0920b4ce083f4294b83c887fc7c793a2c3df5
Diffstat (limited to 'src/k8splugin/internal/app/instance.go')
-rw-r--r-- | src/k8splugin/internal/app/instance.go | 12 |
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) { |