forked from NetApp/netappdvp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eseries_structs.go
100 lines (85 loc) · 3.24 KB
/
eseries_structs.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
// Copyright 2016 NetApp, Inc. All Rights Reserved.
package eseries
import ()
var GenericResponseOkay int = 200
var GenericResponseSuccess int = 201
var GenericResponseNoContent int = 204
var GenericResponseNotFound int = 404
var GenericResponseOffline int = 424
var GenericResponseMalformed int = 422
//Add array to Web Services Proxy
type MsgConnect struct {
ControllerAddresses []string `json:"controllerAddresses"`
Password string `json:"password,omitempty"`
}
type MsgConnectResponse struct {
ArrayID string `json:"id"`
AlreadyExists bool `json:"alreadyExists"`
}
//Obtain volume group information
type VolumeGroupExResponse struct {
SequenceNumber int `json:"sequenceNum"`
IsOffline bool `json:"offline"`
WorldWideName string `json:"worldWideName"`
VolumeGroupRef string `json:"volumeGroupRef"`
VolumeLabel string `json:"label"`
FreeSpace string `json:"freeSpace"` //Documentation says this is an int but really it is a string!
}
//Create a volume
type MsgVolumeEx struct {
VolumeGroupRef string `json:"poolId"`
Name string `json:"name"`
SizeUnit string `json:"sizeUnit"` //bytes, b, kb, mb, gb, tb, pb, eb, zb, yb
Size int `json:"size"`
SegmentSize int `json:"segSize"`
DataAssurance bool `json:"dataAssuranceEnabled,omitempty"`
OwningController string `json:"owningControllerId,omitempty"`
}
type MsgVolumeExResponse struct {
IsOffline bool `json:"offline"`
Label string `json:"label"`
VolumeSize string `json:"capacity"`
SegmentSize int `json:"segmentSize"`
VolumeRef string `json:"volumeRef"`
VolumeGroupRef string `json:"volumeGroupRef"`
ListOfMappings []LUNMapping `json:"listOfMappings"`
IsMapped bool `json:"mapped"`
}
//Obtain information about all hosts on array
type HostExResponse struct {
HostRef string `json:"hostRef"`
Label string `json:"label"`
Initiators []HostExInitiator `json:"initiators"`
}
type HostExInitiator struct {
InitiatorRef string `json:"initiatorRef"`
NodeName HostExScsiNodeName `json:"nodeName"`
Label string `json:"label"`
}
type HostExScsiNodeName struct {
IoInterfaceType string `json:"ioInterfaceType"` //scsi, fc, sata, iscsi, ib, fcoe, __UNDEFINED
IscsiNodeName string `json:"iscsiNodeName"` //IQN from host
}
type HostExHostPort struct {
//TODO - I think this would be used to support Fiber Channel
}
//Request to map a created volume to a host
type VolumeMappingCreateRequest struct {
MappableObjectId string `json:"mappableObjectId"`
TargetID string `json:"targetId"`
LunNumber int `json:"lun,omitempty"`
}
//Structure that reflects LUN information
type LUNMapping struct {
LunMappingRef string `json:"lunMappingRef"`
LunNumber int `json:"lun"`
VolumeRef string `json:"volumeRef"`
HostRef string `json:"mapRef"`
}
//Used for errors on RESTful calls to return what went wrong
type CallResponseError struct {
ErrorMsg string `json:"errorMessage"`
LocalizedMsg string `json:"localizedMessage"`
ReturnCode string `json:"retcode"`
CodeType string `json:"codeType"` //'symbol', 'webservice', 'systemerror', 'devicemgrerror'
}