-
Notifications
You must be signed in to change notification settings - Fork 0
/
api-volume-rename.go
128 lines (106 loc) · 4.21 KB
/
api-volume-rename.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
package azgo
import (
"encoding/xml"
"reflect"
log "github.com/sirupsen/logrus"
)
// VolumeRenameRequest is a structure to represent a volume-rename Request ZAPI object
type VolumeRenameRequest struct {
XMLName xml.Name `xml:"volume-rename"`
NewVolumeNamePtr *string `xml:"new-volume-name"`
VolumePtr *string `xml:"volume"`
}
// VolumeRenameResponse is a structure to represent a volume-rename Response ZAPI object
type VolumeRenameResponse struct {
XMLName xml.Name `xml:"netapp"`
ResponseVersion string `xml:"version,attr"`
ResponseXmlns string `xml:"xmlns,attr"`
Result VolumeRenameResponseResult `xml:"results"`
}
// NewVolumeRenameResponse is a factory method for creating new instances of VolumeRenameResponse objects
func NewVolumeRenameResponse() *VolumeRenameResponse {
return &VolumeRenameResponse{}
}
// String returns a string representation of this object's fields and implements the Stringer interface
func (o VolumeRenameResponse) String() string {
return ToString(reflect.ValueOf(o))
}
// ToXML converts this object into an xml string representation
func (o *VolumeRenameResponse) ToXML() (string, error) {
output, err := xml.MarshalIndent(o, " ", " ")
if err != nil {
log.Errorf("error: %v", err)
}
return string(output), err
}
// VolumeRenameResponseResult is a structure to represent a volume-rename Response Result ZAPI object
type VolumeRenameResponseResult struct {
XMLName xml.Name `xml:"results"`
ResultStatusAttr string `xml:"status,attr"`
ResultReasonAttr string `xml:"reason,attr"`
ResultErrnoAttr string `xml:"errno,attr"`
}
// NewVolumeRenameRequest is a factory method for creating new instances of VolumeRenameRequest objects
func NewVolumeRenameRequest() *VolumeRenameRequest {
return &VolumeRenameRequest{}
}
// NewVolumeRenameResponseResult is a factory method for creating new instances of VolumeRenameResponseResult objects
func NewVolumeRenameResponseResult() *VolumeRenameResponseResult {
return &VolumeRenameResponseResult{}
}
// ToXML converts this object into an xml string representation
func (o *VolumeRenameRequest) 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 *VolumeRenameResponseResult) 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 VolumeRenameRequest) String() string {
return ToString(reflect.ValueOf(o))
}
// String returns a string representation of this object's fields and implements the Stringer interface
func (o VolumeRenameResponseResult) 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 *VolumeRenameRequest) ExecuteUsing(zr *ZapiRunner) (*VolumeRenameResponse, 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 *VolumeRenameRequest) executeWithoutIteration(zr *ZapiRunner) (*VolumeRenameResponse, error) {
result, err := zr.ExecuteUsing(o, "VolumeRenameRequest", NewVolumeRenameResponse())
if result == nil {
return nil, err
}
return result.(*VolumeRenameResponse), err
}
// NewVolumeName is a 'getter' method
func (o *VolumeRenameRequest) NewVolumeName() string {
r := *o.NewVolumeNamePtr
return r
}
// SetNewVolumeName is a fluent style 'setter' method that can be chained
func (o *VolumeRenameRequest) SetNewVolumeName(newValue string) *VolumeRenameRequest {
o.NewVolumeNamePtr = &newValue
return o
}
// Volume is a 'getter' method
func (o *VolumeRenameRequest) Volume() string {
r := *o.VolumePtr
return r
}
// SetVolume is a fluent style 'setter' method that can be chained
func (o *VolumeRenameRequest) SetVolume(newValue string) *VolumeRenameRequest {
o.VolumePtr = &newValue
return o
}