-
Notifications
You must be signed in to change notification settings - Fork 0
/
api-volume-clone-create.go
232 lines (194 loc) · 7.7 KB
/
api-volume-clone-create.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
package azgo
import (
"encoding/xml"
"reflect"
log "github.com/sirupsen/logrus"
)
// VolumeCloneCreateRequest is a structure to represent a volume-clone-create Request ZAPI object
type VolumeCloneCreateRequest struct {
XMLName xml.Name `xml:"volume-clone-create"`
CachingPolicyPtr *string `xml:"caching-policy"`
ParentSnapshotPtr *string `xml:"parent-snapshot"`
ParentVolumePtr *string `xml:"parent-volume"`
ParentVserverPtr *string `xml:"parent-vserver"`
QosPolicyGroupNamePtr *string `xml:"qos-policy-group-name"`
SpaceReservePtr *string `xml:"space-reserve"`
UseSnaprestoreLicensePtr *bool `xml:"use-snaprestore-license"`
VolumePtr *string `xml:"volume"`
VolumeTypePtr *string `xml:"volume-type"`
VserverPtr *string `xml:"vserver"`
}
// VolumeCloneCreateResponse is a structure to represent a volume-clone-create Response ZAPI object
type VolumeCloneCreateResponse struct {
XMLName xml.Name `xml:"netapp"`
ResponseVersion string `xml:"version,attr"`
ResponseXmlns string `xml:"xmlns,attr"`
Result VolumeCloneCreateResponseResult `xml:"results"`
}
// NewVolumeCloneCreateResponse is a factory method for creating new instances of VolumeCloneCreateResponse objects
func NewVolumeCloneCreateResponse() *VolumeCloneCreateResponse {
return &VolumeCloneCreateResponse{}
}
// String returns a string representation of this object's fields and implements the Stringer interface
func (o VolumeCloneCreateResponse) String() string {
return ToString(reflect.ValueOf(o))
}
// ToXML converts this object into an xml string representation
func (o *VolumeCloneCreateResponse) ToXML() (string, error) {
output, err := xml.MarshalIndent(o, " ", " ")
if err != nil {
log.Errorf("error: %v", err)
}
return string(output), err
}
// VolumeCloneCreateResponseResult is a structure to represent a volume-clone-create Response Result ZAPI object
type VolumeCloneCreateResponseResult struct {
XMLName xml.Name `xml:"results"`
ResultStatusAttr string `xml:"status,attr"`
ResultReasonAttr string `xml:"reason,attr"`
ResultErrnoAttr string `xml:"errno,attr"`
}
// NewVolumeCloneCreateRequest is a factory method for creating new instances of VolumeCloneCreateRequest objects
func NewVolumeCloneCreateRequest() *VolumeCloneCreateRequest {
return &VolumeCloneCreateRequest{}
}
// NewVolumeCloneCreateResponseResult is a factory method for creating new instances of VolumeCloneCreateResponseResult objects
func NewVolumeCloneCreateResponseResult() *VolumeCloneCreateResponseResult {
return &VolumeCloneCreateResponseResult{}
}
// ToXML converts this object into an xml string representation
func (o *VolumeCloneCreateRequest) ToXML() (string, error) {
output, err := xml.MarshalIndent(o, " ", " ")
if err != nil {
log.Errorf("error: %v", err)
}
return string(output), err
}
// ToXML converts this object into an xml string representation
func (o *VolumeCloneCreateResponseResult) ToXML() (string, error) {
output, err := xml.MarshalIndent(o, " ", " ")
if err != nil {
log.Errorf("error: %v", err)
}
return string(output), err
}
// String returns a string representation of this object's fields and implements the Stringer interface
func (o VolumeCloneCreateRequest) String() string {
return ToString(reflect.ValueOf(o))
}
// String returns a string representation of this object's fields and implements the Stringer interface
func (o VolumeCloneCreateResponseResult) String() string {
return ToString(reflect.ValueOf(o))
}
// ExecuteUsing converts this object to a ZAPI XML representation and uses the supplied ZapiRunner to send to a filer
func (o *VolumeCloneCreateRequest) ExecuteUsing(zr *ZapiRunner) (*VolumeCloneCreateResponse, error) {
return o.executeWithoutIteration(zr)
}
// executeWithoutIteration converts this object to a ZAPI XML representation and uses the supplied ZapiRunner to send to a filer
func (o *VolumeCloneCreateRequest) executeWithoutIteration(zr *ZapiRunner) (*VolumeCloneCreateResponse, error) {
result, err := zr.ExecuteUsing(o, "VolumeCloneCreateRequest", NewVolumeCloneCreateResponse())
if result == nil {
return nil, err
}
return result.(*VolumeCloneCreateResponse), err
}
// CachingPolicy is a 'getter' method
func (o *VolumeCloneCreateRequest) CachingPolicy() string {
r := *o.CachingPolicyPtr
return r
}
// SetCachingPolicy is a fluent style 'setter' method that can be chained
func (o *VolumeCloneCreateRequest) SetCachingPolicy(newValue string) *VolumeCloneCreateRequest {
o.CachingPolicyPtr = &newValue
return o
}
// ParentSnapshot is a 'getter' method
func (o *VolumeCloneCreateRequest) ParentSnapshot() string {
r := *o.ParentSnapshotPtr
return r
}
// SetParentSnapshot is a fluent style 'setter' method that can be chained
func (o *VolumeCloneCreateRequest) SetParentSnapshot(newValue string) *VolumeCloneCreateRequest {
o.ParentSnapshotPtr = &newValue
return o
}
// ParentVolume is a 'getter' method
func (o *VolumeCloneCreateRequest) ParentVolume() string {
r := *o.ParentVolumePtr
return r
}
// SetParentVolume is a fluent style 'setter' method that can be chained
func (o *VolumeCloneCreateRequest) SetParentVolume(newValue string) *VolumeCloneCreateRequest {
o.ParentVolumePtr = &newValue
return o
}
// ParentVserver is a 'getter' method
func (o *VolumeCloneCreateRequest) ParentVserver() string {
r := *o.ParentVserverPtr
return r
}
// SetParentVserver is a fluent style 'setter' method that can be chained
func (o *VolumeCloneCreateRequest) SetParentVserver(newValue string) *VolumeCloneCreateRequest {
o.ParentVserverPtr = &newValue
return o
}
// QosPolicyGroupName is a 'getter' method
func (o *VolumeCloneCreateRequest) QosPolicyGroupName() string {
r := *o.QosPolicyGroupNamePtr
return r
}
// SetQosPolicyGroupName is a fluent style 'setter' method that can be chained
func (o *VolumeCloneCreateRequest) SetQosPolicyGroupName(newValue string) *VolumeCloneCreateRequest {
o.QosPolicyGroupNamePtr = &newValue
return o
}
// SpaceReserve is a 'getter' method
func (o *VolumeCloneCreateRequest) SpaceReserve() string {
r := *o.SpaceReservePtr
return r
}
// SetSpaceReserve is a fluent style 'setter' method that can be chained
func (o *VolumeCloneCreateRequest) SetSpaceReserve(newValue string) *VolumeCloneCreateRequest {
o.SpaceReservePtr = &newValue
return o
}
// UseSnaprestoreLicense is a 'getter' method
func (o *VolumeCloneCreateRequest) UseSnaprestoreLicense() bool {
r := *o.UseSnaprestoreLicensePtr
return r
}
// SetUseSnaprestoreLicense is a fluent style 'setter' method that can be chained
func (o *VolumeCloneCreateRequest) SetUseSnaprestoreLicense(newValue bool) *VolumeCloneCreateRequest {
o.UseSnaprestoreLicensePtr = &newValue
return o
}
// Volume is a 'getter' method
func (o *VolumeCloneCreateRequest) Volume() string {
r := *o.VolumePtr
return r
}
// SetVolume is a fluent style 'setter' method that can be chained
func (o *VolumeCloneCreateRequest) SetVolume(newValue string) *VolumeCloneCreateRequest {
o.VolumePtr = &newValue
return o
}
// VolumeType is a 'getter' method
func (o *VolumeCloneCreateRequest) VolumeType() string {
r := *o.VolumeTypePtr
return r
}
// SetVolumeType is a fluent style 'setter' method that can be chained
func (o *VolumeCloneCreateRequest) SetVolumeType(newValue string) *VolumeCloneCreateRequest {
o.VolumeTypePtr = &newValue
return o
}
// Vserver is a 'getter' method
func (o *VolumeCloneCreateRequest) Vserver() string {
r := *o.VserverPtr
return r
}
// SetVserver is a fluent style 'setter' method that can be chained
func (o *VolumeCloneCreateRequest) SetVserver(newValue string) *VolumeCloneCreateRequest {
o.VserverPtr = &newValue
return o
}