@@ -81,6 +81,11 @@ type ImportSpec struct {
81
81
Host string `json:"host"`
82
82
}
83
83
84
+ type ApplyResult struct {
85
+ Commit string `json:"commit"`
86
+ ApplyTask string `json:"apply_task"`
87
+ }
88
+
84
89
// ListDrafts returns all active drafts
85
90
// https://developer.broadcom.com/xapis/vsphere-automation-api/latest/api/esx/settings/clusters/cluster/configuration/drafts
86
91
func (c * Manager ) ListDrafts (clusterId string ) (map [string ]Draft , error ) {
@@ -101,27 +106,28 @@ func (c *Manager) GetDraft(clusterId, draftId string) (Draft, error) {
101
106
102
107
// DeleteDraft deletes a draft
103
108
// https://developer.broadcom.com/xapis/vsphere-automation-api/latest/api/esx/settings/clusters/cluster/configuration/drafts
104
- func (c * Manager ) DeleteDraft (clusterId , draftId string ) ( Draft , error ) {
109
+ func (c * Manager ) DeleteDraft (clusterId , draftId string ) error {
105
110
path := c .Resource (fmt .Sprintf (DraftPath , clusterId , draftId ))
106
111
req := path .Request (http .MethodDelete )
107
- var res Draft
108
- return res , c .Do (context .Background (), req , & res )
112
+ return c .Do (context .Background (), req , nil )
109
113
}
110
114
111
115
// CreateDraft creates a draft with the provided configuration
112
116
// https://developer.broadcom.com/xapis/vsphere-automation-api/latest/api/esx/settings/clusters/cluster/configuration/drafts
113
- func (c * Manager ) CreateDraft (clusterId string , spec CreateSpec ) error {
117
+ func (c * Manager ) CreateDraft (clusterId string , spec CreateSpec ) ( string , error ) {
114
118
path := c .Resource (fmt .Sprintf (BasePath , clusterId ))
115
119
req := path .Request (http .MethodPost , spec )
116
- return c .Do (context .Background (), req , nil )
120
+ var res string
121
+ return res , c .Do (context .Background (), req , & res )
117
122
}
118
123
119
124
// ApplyDraft commits the draft with the specified ID
120
125
// https://developer.broadcom.com/xapis/vsphere-automation-api/latest/api/esx/settings/clusters/cluster/configuration/drafts
121
- func (c * Manager ) ApplyDraft (clusterId , draftId string ) error {
126
+ func (c * Manager ) ApplyDraft (clusterId , draftId string ) ( ApplyResult , error ) {
122
127
path := c .Resource (fmt .Sprintf (DraftPath , clusterId , draftId )).WithAction ("apply" )
123
128
req := path .Request (http .MethodPost )
124
- return c .Do (context .Background (), req , nil )
129
+ var res ApplyResult
130
+ return res , c .Do (context .Background (), req , & res )
125
131
}
126
132
127
133
// UpdateDraft updates the configuration of the draft with the specified ID
0 commit comments