aboutsummaryrefslogtreecommitdiffstats
path: root/src/orchestrator/pkg/module/app_intent.go
diff options
context:
space:
mode:
authorEric Multanen <eric.w.multanen@intel.com>2020-09-30 22:38:59 -0700
committerEric Multanen <eric.w.multanen@intel.com>2020-10-02 23:41:52 -0700
commit1fc90f15489ae3eafeb5994f5285f09750feae4c (patch)
treebb42ac610b2fbc13e5cfc746bb32f3b8ccabd2b3 /src/orchestrator/pkg/module/app_intent.go
parentd4b89af411ec7444b554a8b0ddeb7e239fa0fc73 (diff)
Ovnaction and vfw updates for deploy api change
Update the ovnaction controller APIs to support the api change of including the deployment intent group in the URL. Also fixup: - vfw and other test cases to support the change - updates to emcoctl tool and examples Issue-ID: MULTICLOUD-1218 Signed-off-by: Eric Multanen <eric.w.multanen@intel.com> Change-Id: Icadacb5ec6d7c238bb3bf8a44a39c30692ecebee
Diffstat (limited to 'src/orchestrator/pkg/module/app_intent.go')
-rw-r--r--src/orchestrator/pkg/module/app_intent.go78
1 files changed, 39 insertions, 39 deletions
diff --git a/src/orchestrator/pkg/module/app_intent.go b/src/orchestrator/pkg/module/app_intent.go
index f2f4e070..6b394513 100644
--- a/src/orchestrator/pkg/module/app_intent.go
+++ b/src/orchestrator/pkg/module/app_intent.go
@@ -67,22 +67,22 @@ type AppIntentQueryKey struct {
// AppIntentKey is used as primary key
type AppIntentKey struct {
- Name string `json:"appintent"`
- Project string `json:"project"`
- CompositeApp string `json:"compositeapp"`
- Version string `json:"compositeappversion"`
- Intent string `json:"genericplacement"`
- DeploymentIntentGroupName string `json:"deploymentintentgroupname"`
+ Name string `json:"appintent"`
+ Project string `json:"project"`
+ CompositeApp string `json:"compositeapp"`
+ Version string `json:"compositeappversion"`
+ Intent string `json:"genericplacement"`
+ DeploymentIntentGroupName string `json:"deploymentintentgroup"`
}
// AppIntentFindByAppKey required for query
type AppIntentFindByAppKey struct {
- Project string `json:"project"`
- CompositeApp string `json:"compositeapp"`
- CompositeAppVersion string `json:"compositeappversion"`
- Intent string `json:"genericplacement"`
- DeploymentIntentGroupName string `json:"deploymentintentgroupname"`
- AppName string `json:"app-name"`
+ Project string `json:"project"`
+ CompositeApp string `json:"compositeapp"`
+ CompositeAppVersion string `json:"compositeappversion"`
+ Intent string `json:"genericplacement"`
+ DeploymentIntentGroupName string `json:"deploymentintentgroup"`
+ AppName string `json:"app-name"`
}
// ApplicationsAndClusterInfo type represents the list of
@@ -151,17 +151,17 @@ func (c *AppIntentClient) CreateAppIntent(a AppIntent, p string, ca string, v st
}
// check if the deploymentIntentGrpName exists
- _, err = NewDeploymentIntentGroupClient().GetDeploymentIntentGroup(digName,p, ca, v)
+ _, err = NewDeploymentIntentGroupClient().GetDeploymentIntentGroup(digName, p, ca, v)
if err != nil {
return AppIntent{}, pkgerrors.New("Unable to find the deployment-intent-group-name")
}
akey := AppIntentKey{
- Name: a.MetaData.Name,
- Project: p,
- CompositeApp: ca,
- Version: v,
- Intent: i,
+ Name: a.MetaData.Name,
+ Project: p,
+ CompositeApp: ca,
+ Version: v,
+ Intent: i,
DeploymentIntentGroupName: digName,
}
@@ -173,7 +173,7 @@ func (c *AppIntentClient) CreateAppIntent(a AppIntent, p string, ca string, v st
if err != nil {
return AppIntent{}, pkgerrors.Wrap(err, "Create DB entry error")
}
-
+
return a, nil
}
@@ -181,11 +181,11 @@ func (c *AppIntentClient) CreateAppIntent(a AppIntent, p string, ca string, v st
func (c *AppIntentClient) GetAppIntent(ai string, p string, ca string, v string, i string, digName string) (AppIntent, error) {
k := AppIntentKey{
- Name: ai,
- Project: p,
- CompositeApp: ca,
- Version: v,
- Intent: i,
+ Name: ai,
+ Project: p,
+ CompositeApp: ca,
+ Version: v,
+ Intent: i,
DeploymentIntentGroupName: digName,
}
@@ -213,12 +213,12 @@ all the intents for the app.
*/
func (c *AppIntentClient) GetAllIntentsByApp(aN, p, ca, v, i, digName string) (SpecData, error) {
k := AppIntentFindByAppKey{
- Project: p,
- CompositeApp: ca,
- CompositeAppVersion: v,
- Intent: i,
+ Project: p,
+ CompositeApp: ca,
+ CompositeAppVersion: v,
+ Intent: i,
DeploymentIntentGroupName: digName,
- AppName: aN,
+ AppName: aN,
}
result, err := db.DBconn.Find(c.storeName, k, c.tagMetaData)
if err != nil {
@@ -239,11 +239,11 @@ and GenericPlacementIntentName,DeploymentIntentGroupName. Returns the Applicatio
*/
func (c *AppIntentClient) GetAllAppIntents(p, ca, v, i, digName string) (ApplicationsAndClusterInfo, error) {
k := AppIntentKey{
- Name: "",
- Project: p,
- CompositeApp: ca,
- Version: v,
- Intent: i,
+ Name: "",
+ Project: p,
+ CompositeApp: ca,
+ Version: v,
+ Intent: i,
DeploymentIntentGroupName: digName,
}
result, err := db.DBconn.Find(c.storeName, k, c.tagMetaData)
@@ -276,11 +276,11 @@ func (c *AppIntentClient) GetAllAppIntents(p, ca, v, i, digName string) (Applica
// DeleteAppIntent delete an AppIntent
func (c *AppIntentClient) DeleteAppIntent(ai string, p string, ca string, v string, i string, digName string) error {
k := AppIntentKey{
- Name: ai,
- Project: p,
- CompositeApp: ca,
- Version: v,
- Intent: i,
+ Name: ai,
+ Project: p,
+ CompositeApp: ca,
+ Version: v,
+ Intent: i,
DeploymentIntentGroupName: digName,
}