Skip to content

Commit 7a3647c

Browse files
committed
api: fix action parameters
Signed-off-by: Stoyan Zhelyazkov <[email protected]>
1 parent 8ee9995 commit 7a3647c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

vapi/esx/settings/clusters/configuration/configuraton.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (c *Manager) GetConfiguration(clusterId string) (Info, error) {
107107
// ExportConfiguration returns the cluster configuration
108108
// https://developer.broadcom.com/xapis/vsphere-automation-api/latest/api/esx/settings/clusters/cluster/configuration
109109
func (c *Manager) ExportConfiguration(clusterId string) (ExportResult, error) {
110-
path := c.Resource(fmt.Sprintf(BasePath, clusterId)).WithAction("exportConfig")
110+
path := c.Resource(fmt.Sprintf(BasePath, clusterId)).WithParam("action", "exportConfig")
111111
req := path.Request(http.MethodPost)
112112
var res ExportResult
113113
return res, c.Do(context.Background(), req, &res)

vapi/esx/settings/clusters/configuration/drafts/drafts.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (c *Manager) CreateDraft(clusterId string, spec CreateSpec) (string, error)
124124
// ApplyDraft commits the draft with the specified ID
125125
// https://developer.broadcom.com/xapis/vsphere-automation-api/latest/api/esx/settings/clusters/cluster/configuration/drafts
126126
func (c *Manager) ApplyDraft(clusterId, draftId string) (ApplyResult, error) {
127-
path := c.Resource(fmt.Sprintf(DraftPath, clusterId, draftId)).WithAction("apply")
127+
path := c.Resource(fmt.Sprintf(DraftPath, clusterId, draftId)).WithParam("action", "apply")
128128
req := path.Request(http.MethodPost)
129129
var res ApplyResult
130130
return res, c.Do(context.Background(), req, &res)
@@ -133,15 +133,15 @@ func (c *Manager) ApplyDraft(clusterId, draftId string) (ApplyResult, error) {
133133
// UpdateDraft updates the configuration of the draft with the specified ID
134134
// https://developer.broadcom.com/xapis/vsphere-automation-api/latest/api/esx/settings/clusters/cluster/configuration/drafts
135135
func (c *Manager) UpdateDraft(clusterId, draftId string, spec UpdateSpec) error {
136-
path := c.Resource(fmt.Sprintf(DraftPath, clusterId, draftId)).WithAction("update")
136+
path := c.Resource(fmt.Sprintf(DraftPath, clusterId, draftId)).WithParam("action", "update")
137137
req := path.Request(http.MethodPost, spec)
138138
return c.Do(context.Background(), req, nil)
139139
}
140140

141141
// ImportFromHost sets a reference host to use as the source for the draft configuration
142142
// https://developer.broadcom.com/xapis/vsphere-automation-api/latest/api/esx/settings/clusters/cluster/configuration/drafts
143143
func (c *Manager) ImportFromHost(clusterId, draftId string, spec ImportSpec) (string, error) {
144-
path := c.Resource(fmt.Sprintf(DraftPath, clusterId, draftId)).WithAction("importFromHost").WithParam("vmw-task", "true")
144+
path := c.Resource(fmt.Sprintf(DraftPath, clusterId, draftId)).WithParam("action", "importFromHost").WithParam("vmw-task", "true")
145145
req := path.Request(http.MethodPost, spec)
146146
var res string
147147
return res, c.Do(context.Background(), req, &res)
@@ -150,7 +150,7 @@ func (c *Manager) ImportFromHost(clusterId, draftId string, spec ImportSpec) (st
150150
// Precheck runs pre-checks for the provided draft on the specified cluster
151151
// https://developer.broadcom.com/xapis/vsphere-automation-api/latest/api/esx/settings/clusters/cluster/configuration/drafts
152152
func (c *Manager) Precheck(clusterId, draftId string) (string, error) {
153-
path := c.Resource(fmt.Sprintf(DraftPath, clusterId, draftId)).WithAction("precheck").WithParam("vmw-task", "true")
153+
path := c.Resource(fmt.Sprintf(DraftPath, clusterId, draftId)).WithParam("action", "precheck").WithParam("vmw-task", "true")
154154
req := path.Request(http.MethodPost)
155155
var res string
156156
return res, c.Do(context.Background(), req, &res)

0 commit comments

Comments
 (0)