github.com/vmware/govmomi@v0.51.0/cns/methods/methods.go (about) 1 // © Broadcom. All Rights Reserved. 2 // The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. 3 // SPDX-License-Identifier: Apache-2.0 4 5 package methods 6 7 import ( 8 "context" 9 10 "github.com/vmware/govmomi/cns/types" 11 "github.com/vmware/govmomi/vim25/soap" 12 ) 13 14 type CnsCreateVolumeBody struct { 15 Req *types.CnsCreateVolume `xml:"urn:vsan CnsCreateVolume,omitempty"` 16 Res *types.CnsCreateVolumeResponse `xml:"urn:vsan CnsCreateVolumeResponse,omitempty"` 17 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 18 } 19 20 func (b *CnsCreateVolumeBody) Fault() *soap.Fault { return b.Fault_ } 21 22 func CnsCreateVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsCreateVolume) (*types.CnsCreateVolumeResponse, error) { 23 var reqBody, resBody CnsCreateVolumeBody 24 25 reqBody.Req = req 26 27 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 28 return nil, err 29 } 30 31 return resBody.Res, nil 32 } 33 34 type CnsUpdateVolumeBody struct { 35 Req *types.CnsUpdateVolumeMetadata `xml:"urn:vsan CnsUpdateVolumeMetadata,omitempty"` 36 Res *types.CnsUpdateVolumeMetadataResponse `xml:"urn:vsan CnsUpdateVolumeMetadataResponse,omitempty"` 37 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 38 } 39 40 func (b *CnsUpdateVolumeBody) Fault() *soap.Fault { return b.Fault_ } 41 42 func CnsUpdateVolumeMetadata(ctx context.Context, r soap.RoundTripper, req *types.CnsUpdateVolumeMetadata) (*types.CnsUpdateVolumeMetadataResponse, error) { 43 var reqBody, resBody CnsUpdateVolumeBody 44 45 reqBody.Req = req 46 47 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 48 return nil, err 49 } 50 51 return resBody.Res, nil 52 } 53 54 type CnsDeleteVolumeBody struct { 55 Req *types.CnsDeleteVolume `xml:"urn:vsan CnsDeleteVolume,omitempty"` 56 Res *types.CnsDeleteVolumeResponse `xml:"urn:vsan CnsDeleteVolumeResponse,omitempty"` 57 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 58 } 59 60 func (b *CnsDeleteVolumeBody) Fault() *soap.Fault { return b.Fault_ } 61 62 func CnsDeleteVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsDeleteVolume) (*types.CnsDeleteVolumeResponse, error) { 63 var reqBody, resBody CnsDeleteVolumeBody 64 65 reqBody.Req = req 66 67 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 68 return nil, err 69 } 70 71 return resBody.Res, nil 72 } 73 74 type CnsExtendVolumeBody struct { 75 Req *types.CnsExtendVolume `xml:"urn:vsan CnsExtendVolume,omitempty"` 76 Res *types.CnsExtendVolumeResponse `xml:"urn:vsan CnsExtendVolumeResponse,omitempty"` 77 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 78 } 79 80 func (b *CnsExtendVolumeBody) Fault() *soap.Fault { return b.Fault_ } 81 82 func CnsExtendVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsExtendVolume) (*types.CnsExtendVolumeResponse, error) { 83 var reqBody, resBody CnsExtendVolumeBody 84 85 reqBody.Req = req 86 87 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 88 return nil, err 89 } 90 91 return resBody.Res, nil 92 } 93 94 type CnsAttachVolumeBody struct { 95 Req *types.CnsAttachVolume `xml:"urn:vsan CnsAttachVolume,omitempty"` 96 Res *types.CnsAttachVolumeResponse `xml:"urn:vsan CnsAttachVolumeResponse,omitempty"` 97 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 98 } 99 100 func (b *CnsAttachVolumeBody) Fault() *soap.Fault { return b.Fault_ } 101 102 func CnsAttachVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsAttachVolume) (*types.CnsAttachVolumeResponse, error) { 103 var reqBody, resBody CnsAttachVolumeBody 104 105 reqBody.Req = req 106 107 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 108 return nil, err 109 } 110 111 return resBody.Res, nil 112 } 113 114 type CnsDetachVolumeBody struct { 115 Req *types.CnsDetachVolume `xml:"urn:vsan CnsDetachVolume,omitempty"` 116 Res *types.CnsDetachVolumeResponse `xml:"urn:vsan CnsDetachVolumeResponse,omitempty"` 117 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 118 } 119 120 func (b *CnsDetachVolumeBody) Fault() *soap.Fault { return b.Fault_ } 121 122 func CnsDetachVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsDetachVolume) (*types.CnsDetachVolumeResponse, error) { 123 var reqBody, resBody CnsDetachVolumeBody 124 125 reqBody.Req = req 126 127 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 128 return nil, err 129 } 130 131 return resBody.Res, nil 132 } 133 134 type CnsQueryVolumeBody struct { 135 Req *types.CnsQueryVolume `xml:"urn:vsan CnsQueryVolume,omitempty"` 136 Res *types.CnsQueryVolumeResponse `xml:"urn:vsan CnsQueryVolumeResponse,omitempty"` 137 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 138 } 139 140 func (b *CnsQueryVolumeBody) Fault() *soap.Fault { return b.Fault_ } 141 142 func CnsQueryVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsQueryVolume) (*types.CnsQueryVolumeResponse, error) { 143 var reqBody, resBody CnsQueryVolumeBody 144 145 reqBody.Req = req 146 147 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 148 return nil, err 149 } 150 151 return resBody.Res, nil 152 } 153 154 type CnsQueryVolumeInfoBody struct { 155 Req *types.CnsQueryVolumeInfo `xml:"urn:vsan CnsQueryVolumeInfo,omitempty"` 156 Res *types.CnsQueryVolumeInfoResponse `xml:"urn:vsan CnsQueryVolumeInfoResponse,omitempty"` 157 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 158 } 159 160 func (b *CnsQueryVolumeInfoBody) Fault() *soap.Fault { return b.Fault_ } 161 162 func CnsQueryVolumeInfo(ctx context.Context, r soap.RoundTripper, req *types.CnsQueryVolumeInfo) (*types.CnsQueryVolumeInfoResponse, error) { 163 var reqBody, resBody CnsQueryVolumeInfoBody 164 165 reqBody.Req = req 166 167 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 168 return nil, err 169 } 170 171 return resBody.Res, nil 172 } 173 174 type CnsQueryAllVolumeBody struct { 175 Req *types.CnsQueryAllVolume `xml:"urn:vsan CnsQueryAllVolume,omitempty"` 176 Res *types.CnsQueryAllVolumeResponse `xml:"urn:vsan CnsQueryAllVolumeResponse,omitempty"` 177 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 178 } 179 180 func (b *CnsQueryAllVolumeBody) Fault() *soap.Fault { return b.Fault_ } 181 182 func CnsQueryAllVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsQueryAllVolume) (*types.CnsQueryAllVolumeResponse, error) { 183 var reqBody, resBody CnsQueryAllVolumeBody 184 185 reqBody.Req = req 186 187 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 188 return nil, err 189 } 190 191 return resBody.Res, nil 192 } 193 194 type CnsRelocateVolumeBody struct { 195 Req *types.CnsRelocateVolume `xml:"urn:vsan CnsRelocateVolume,omitempty"` 196 Res *types.CnsRelocateVolumeResponse `xml:"urn:vsan CnsRelocateVolumeResponse,omitempty"` 197 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 198 } 199 200 func (b *CnsRelocateVolumeBody) Fault() *soap.Fault { return b.Fault_ } 201 202 func CnsRelocateVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsRelocateVolume) (*types.CnsRelocateVolumeResponse, error) { 203 var reqBody, resBody CnsRelocateVolumeBody 204 reqBody.Req = req 205 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 206 return nil, err 207 } 208 209 return resBody.Res, nil 210 } 211 212 type CnsConfigureVolumeACLsBody struct { 213 Req *types.CnsConfigureVolumeACLs `xml:"urn:vsan CnsConfigureVolumeACLs,omitempty"` 214 Res *types.CnsConfigureVolumeACLsResponse `xml:"urn:vsan CnsConfigureVolumeACLsResponse,omitempty"` 215 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 216 } 217 218 func (b *CnsConfigureVolumeACLsBody) Fault() *soap.Fault { return b.Fault_ } 219 220 func CnsConfigureVolumeACLs(ctx context.Context, r soap.RoundTripper, req *types.CnsConfigureVolumeACLs) (*types.CnsConfigureVolumeACLsResponse, error) { 221 var reqBody, resBody CnsConfigureVolumeACLsBody 222 223 reqBody.Req = req 224 225 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 226 return nil, err 227 } 228 229 return resBody.Res, nil 230 } 231 232 type CnsQueryAsyncBody struct { 233 Req *types.CnsQueryAsync `xml:"urn:vsan CnsQueryAsync,omitempty"` 234 Res *types.CnsQueryAsyncResponse `xml:"urn:vsan CnsQueryAsyncResponse,omitempty"` 235 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 236 } 237 238 func (b *CnsQueryAsyncBody) Fault() *soap.Fault { return b.Fault_ } 239 240 func CnsQueryAsync(ctx context.Context, r soap.RoundTripper, req *types.CnsQueryAsync) (*types.CnsQueryAsyncResponse, error) { 241 var reqBody, resBody CnsQueryAsyncBody 242 243 reqBody.Req = req 244 245 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 246 return nil, err 247 } 248 249 return resBody.Res, nil 250 } 251 252 // CNS CreateSnapshots API 253 254 type CnsCreateSnapshotsBody struct { 255 Req *types.CnsCreateSnapshots `xml:"urn:vsan CnsCreateSnapshots,omitempty"` 256 Res *types.CnsCreateSnapshotsResponse `xml:"urn:vsan CnsCreateSnapshotsResponse,omitempty"` 257 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 258 } 259 260 func (b *CnsCreateSnapshotsBody) Fault() *soap.Fault { return b.Fault_ } 261 262 func CnsCreateSnapshots(ctx context.Context, r soap.RoundTripper, req *types.CnsCreateSnapshots) (*types.CnsCreateSnapshotsResponse, error) { 263 var reqBody, resBody CnsCreateSnapshotsBody 264 265 reqBody.Req = req 266 267 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 268 return nil, err 269 } 270 271 return resBody.Res, nil 272 } 273 274 // CNS DeleteSnapshot API 275 276 type CnsDeleteSnapshotBody struct { 277 Req *types.CnsDeleteSnapshots `xml:"urn:vsan CnsDeleteSnapshots,omitempty"` 278 Res *types.CnsDeleteSnapshotsResponse `xml:"urn:vsan CnsDeleteSnapshotsResponse,omitempty"` 279 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 280 } 281 282 func (b *CnsDeleteSnapshotBody) Fault() *soap.Fault { return b.Fault_ } 283 284 func CnsDeleteSnapshots(ctx context.Context, r soap.RoundTripper, req *types.CnsDeleteSnapshots) (*types.CnsDeleteSnapshotsResponse, error) { 285 var reqBody, resBody CnsDeleteSnapshotBody 286 287 reqBody.Req = req 288 289 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 290 return nil, err 291 } 292 293 return resBody.Res, nil 294 } 295 296 // CNS QuerySnapshots API 297 298 type CnsQuerySnapshotsBody struct { 299 Req *types.CnsQuerySnapshots `xml:"urn:vsan CnsQuerySnapshots,omitempty"` 300 Res *types.CnsQuerySnapshotsResponse `xml:"urn:vsan CnsQuerySnapshotsResponse,omitempty"` 301 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 302 } 303 304 func (b *CnsQuerySnapshotsBody) Fault() *soap.Fault { return b.Fault_ } 305 306 func CnsQuerySnapshots(ctx context.Context, r soap.RoundTripper, req *types.CnsQuerySnapshots) (*types.CnsQuerySnapshotsResponse, error) { 307 var reqBody, resBody CnsQuerySnapshotsBody 308 309 reqBody.Req = req 310 311 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 312 return nil, err 313 } 314 315 return resBody.Res, nil 316 } 317 318 type CnsReconfigVolumePolicyBody struct { 319 Req *types.CnsReconfigVolumePolicy `xml:"urn:vsan CnsReconfigVolumePolicy,omitempty"` 320 Res *types.CnsReconfigVolumePolicyResponse `xml:"urn:vsan CnsReconfigVolumePolicyResponse,omitempty"` 321 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 322 } 323 324 func (b *CnsReconfigVolumePolicyBody) Fault() *soap.Fault { return b.Fault_ } 325 326 func CnsReconfigVolumePolicy(ctx context.Context, r soap.RoundTripper, req *types.CnsReconfigVolumePolicy) (*types.CnsReconfigVolumePolicyResponse, error) { 327 var reqBody, resBody CnsReconfigVolumePolicyBody 328 329 reqBody.Req = req 330 331 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 332 return nil, err 333 } 334 335 return resBody.Res, nil 336 } 337 338 type CnsSyncDatastoreBody struct { 339 Req *types.CnsSyncDatastore `xml:"urn:vsan CnsSyncDatastore,omitempty"` 340 Res *types.CnsSyncDatastoreResponse `xml:"urn:vsan CnsSyncDatastoreResponse,omitempty"` 341 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 342 } 343 344 func (b *CnsSyncDatastoreBody) Fault() *soap.Fault { return b.Fault_ } 345 346 // Note: To be used only by VMware's internal support tools. 347 func CnsSyncDatastore(ctx context.Context, r soap.RoundTripper, req *types.CnsSyncDatastore) (*types.CnsSyncDatastoreResponse, error) { 348 var reqBody, resBody CnsSyncDatastoreBody 349 350 reqBody.Req = req 351 352 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 353 return nil, err 354 } 355 356 return resBody.Res, nil 357 }