Skip to content

Commit

Permalink
[bugfix] Fixed payload issue by adding vpcGroup and type to it
Browse files Browse the repository at this point in the history
  • Loading branch information
shrsr authored and lhercot committed Oct 13, 2022
1 parent d6f4e27 commit 7f1b400
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client/cloudCtxProfile_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7f1b400

Please sign in to comment.