github.com/vmware/govmomi@v0.37.2/cns/methods/methods.go (about)

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