From 7f1b4000e91ddce6dd1d13fc2ef919b049fe42bf Mon Sep 17 00:00:00 2001 From: Shreyas Date: Thu, 13 Oct 2022 10:34:09 -0400 Subject: [PATCH] [bugfix] Fixed payload issue by adding vpcGroup and type to it --- client/cloudCtxProfile_service.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/cloudCtxProfile_service.go b/client/cloudCtxProfile_service.go index 4cb51afe..dbf90b75 100644 --- a/client/cloudCtxProfile_service.go +++ b/client/cloudCtxProfile_service.go @@ -66,6 +66,12 @@ func (sm *ServiceManager) CreateCloudContextProfile(name string, tenant string, log.Printf("\n\n\n\n[DEBUG]nkdemo%s\n\n\n\n", jsonPayload.String()) jsonPayload.Set(name, cloudCtxProfile.ClassName, "attributes", "name") + if cloudCtxProfile.VpcGroup != "" { + jsonPayload.Set(cloudCtxProfile.VpcGroup, cloudCtxProfile.ClassName, "attributes", "vpcGroup") + } + if cloudCtxProfile.Type != "" { + jsonPayload.Set(cloudCtxProfile.Type, cloudCtxProfile.ClassName, "attributes", "type") + } req, err := sm.client.MakeRestRequest("POST", fmt.Sprintf("/api/node/mo/%s/%s.json", parentDn, rn), jsonPayload, true) if err != nil { return nil, err @@ -144,6 +150,12 @@ func (sm *ServiceManager) UpdateCloudContextProfile(name string, tenant string, jsonPayload.ArrayAppend(vrfCon.Data(), cloudCtxProfile.ClassName, "children") jsonPayload.Set(name, cloudCtxProfile.ClassName, "attributes", "name") + if cloudCtxProfile.VpcGroup != "" { + jsonPayload.Set(cloudCtxProfile.VpcGroup, cloudCtxProfile.ClassName, "attributes", "vpcGroup") + } + if cloudCtxProfile.Type != "" { + jsonPayload.Set(cloudCtxProfile.Type, cloudCtxProfile.ClassName, "attributes", "type") + } req, err := sm.client.MakeRestRequest("POST", fmt.Sprintf("/api/node/mo/%s/%s.json", parentDn, rn), jsonPayload, true) if err != nil { return nil, err