-
Notifications
You must be signed in to change notification settings - Fork 218
/
storage_pool_create_responses.go
308 lines (245 loc) · 9.98 KB
/
storage_pool_create_responses.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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
// Code generated by go-swagger; DO NOT EDIT.
package storage
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/netapp/trident/storage_drivers/ontap/api/rest/models"
)
// StoragePoolCreateReader is a Reader for the StoragePoolCreate structure.
type StoragePoolCreateReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *StoragePoolCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 201:
result := NewStoragePoolCreateCreated()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 202:
result := NewStoragePoolCreateAccepted()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewStoragePoolCreateDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewStoragePoolCreateCreated creates a StoragePoolCreateCreated with default headers values
func NewStoragePoolCreateCreated() *StoragePoolCreateCreated {
return &StoragePoolCreateCreated{}
}
/*
StoragePoolCreateCreated describes a response with status code 201, with default header values.
Created
*/
type StoragePoolCreateCreated struct {
/* Useful for tracking the resource location
*/
Location string
Payload *models.StoragePoolResponse
}
// IsSuccess returns true when this storage pool create created response has a 2xx status code
func (o *StoragePoolCreateCreated) IsSuccess() bool {
return true
}
// IsRedirect returns true when this storage pool create created response has a 3xx status code
func (o *StoragePoolCreateCreated) IsRedirect() bool {
return false
}
// IsClientError returns true when this storage pool create created response has a 4xx status code
func (o *StoragePoolCreateCreated) IsClientError() bool {
return false
}
// IsServerError returns true when this storage pool create created response has a 5xx status code
func (o *StoragePoolCreateCreated) IsServerError() bool {
return false
}
// IsCode returns true when this storage pool create created response a status code equal to that given
func (o *StoragePoolCreateCreated) IsCode(code int) bool {
return code == 201
}
func (o *StoragePoolCreateCreated) Error() string {
return fmt.Sprintf("[POST /storage/pools][%d] storagePoolCreateCreated %+v", 201, o.Payload)
}
func (o *StoragePoolCreateCreated) String() string {
return fmt.Sprintf("[POST /storage/pools][%d] storagePoolCreateCreated %+v", 201, o.Payload)
}
func (o *StoragePoolCreateCreated) GetPayload() *models.StoragePoolResponse {
return o.Payload
}
func (o *StoragePoolCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Location
hdrLocation := response.GetHeader("Location")
if hdrLocation != "" {
o.Location = hdrLocation
}
o.Payload = new(models.StoragePoolResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewStoragePoolCreateAccepted creates a StoragePoolCreateAccepted with default headers values
func NewStoragePoolCreateAccepted() *StoragePoolCreateAccepted {
return &StoragePoolCreateAccepted{}
}
/*
StoragePoolCreateAccepted describes a response with status code 202, with default header values.
Accepted
*/
type StoragePoolCreateAccepted struct {
/* Useful for tracking the resource location
*/
Location string
Payload *models.JobLinkResponse
}
// IsSuccess returns true when this storage pool create accepted response has a 2xx status code
func (o *StoragePoolCreateAccepted) IsSuccess() bool {
return true
}
// IsRedirect returns true when this storage pool create accepted response has a 3xx status code
func (o *StoragePoolCreateAccepted) IsRedirect() bool {
return false
}
// IsClientError returns true when this storage pool create accepted response has a 4xx status code
func (o *StoragePoolCreateAccepted) IsClientError() bool {
return false
}
// IsServerError returns true when this storage pool create accepted response has a 5xx status code
func (o *StoragePoolCreateAccepted) IsServerError() bool {
return false
}
// IsCode returns true when this storage pool create accepted response a status code equal to that given
func (o *StoragePoolCreateAccepted) IsCode(code int) bool {
return code == 202
}
func (o *StoragePoolCreateAccepted) Error() string {
return fmt.Sprintf("[POST /storage/pools][%d] storagePoolCreateAccepted %+v", 202, o.Payload)
}
func (o *StoragePoolCreateAccepted) String() string {
return fmt.Sprintf("[POST /storage/pools][%d] storagePoolCreateAccepted %+v", 202, o.Payload)
}
func (o *StoragePoolCreateAccepted) GetPayload() *models.JobLinkResponse {
return o.Payload
}
func (o *StoragePoolCreateAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Location
hdrLocation := response.GetHeader("Location")
if hdrLocation != "" {
o.Location = hdrLocation
}
o.Payload = new(models.JobLinkResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewStoragePoolCreateDefault creates a StoragePoolCreateDefault with default headers values
func NewStoragePoolCreateDefault(code int) *StoragePoolCreateDefault {
return &StoragePoolCreateDefault{
_statusCode: code,
}
}
/*
StoragePoolCreateDefault describes a response with status code -1, with default header values.
ONTAP Error Response Codes
| Error Code | Description |
| ---------- | ----------- |
| 11206666 | Storage pool is unhealthy. |
| 11208658 | A storage pool already uses the specified name. |
| 11208660 | Disk does not exist. |
| 11208661 | Disk is not a spare disk. |
| 11208662 | Disk is not an SSD. |
| 11208663 | Disk is reserved for core dump. |
| 11208664 | Could not determine checksum type of disk. |
| 11208666 | Could not determine usable size of disk. |
| 11208668 | Could not determine connectivity between controller and disk. |
| 11208670 | Could not determine original owner of disk. |
| 11208671 | Could not determine SyncMirror pool of disk. |
| 11208673 | Could not determine HA mode of node. |
| 11208674 | Could not determine HA partner of node. |
| 11208675 | Disks specified in the disk list are not visible to node. |
| 11208678 | The disk list contains disks from nodes which are not in HA pair. |
| 11208679 | Sharing disk is not enabled on node. |
| 11208680 | Internal error. Cannot determine configuration for node. |
| 11208681 | Node is not online. |
| 11208682 | Internal error. Sharing configuration mismatch. |
| 11208684 | Unable to share disk. |
| 11208686 | Disk cannot be shared. |
| 11208687 | Unable to retrieve expected sharing configuration. |
| 11208688 | Storage pool create job failed. |
| 11208690 | Not all nodes sharing the storage pool view disk as a shared disk. |
| 11208691 | Not enough matching spares available. |
| 11208692 | A disk list or count is a required parameter for storage pool creation. |
| 11208693 | Invalid number of disks specified. |
| 11208698 | Internal error. Missing node name. |
| 11208699 | Internal error. Missing partner name for node configured for HA. |
| 11208701 | Node is a standalone node. Do not specify other nodes with a standalone node. |
| 11208703 | Incorrect number of nodes specified. Specify one node or both nodes in an HA pair. |
| 11208704 | Specified nodes are not part of HA relationship. Specify one node or both nodes in an HA pair. |
| 11208705 | Disk is a data center SSD, which cannot be used in storage pools. |
| 11208706 | Disk is a SSD-ZNS, which cannot be used in storage pools. |
| 11215756 | Missing a required field for POST request. |
*/
type StoragePoolCreateDefault struct {
_statusCode int
Payload *models.ErrorResponse
}
// Code gets the status code for the storage pool create default response
func (o *StoragePoolCreateDefault) Code() int {
return o._statusCode
}
// IsSuccess returns true when this storage pool create default response has a 2xx status code
func (o *StoragePoolCreateDefault) IsSuccess() bool {
return o._statusCode/100 == 2
}
// IsRedirect returns true when this storage pool create default response has a 3xx status code
func (o *StoragePoolCreateDefault) IsRedirect() bool {
return o._statusCode/100 == 3
}
// IsClientError returns true when this storage pool create default response has a 4xx status code
func (o *StoragePoolCreateDefault) IsClientError() bool {
return o._statusCode/100 == 4
}
// IsServerError returns true when this storage pool create default response has a 5xx status code
func (o *StoragePoolCreateDefault) IsServerError() bool {
return o._statusCode/100 == 5
}
// IsCode returns true when this storage pool create default response a status code equal to that given
func (o *StoragePoolCreateDefault) IsCode(code int) bool {
return o._statusCode == code
}
func (o *StoragePoolCreateDefault) Error() string {
return fmt.Sprintf("[POST /storage/pools][%d] storage_pool_create default %+v", o._statusCode, o.Payload)
}
func (o *StoragePoolCreateDefault) String() string {
return fmt.Sprintf("[POST /storage/pools][%d] storage_pool_create default %+v", o._statusCode, o.Payload)
}
func (o *StoragePoolCreateDefault) GetPayload() *models.ErrorResponse {
return o.Payload
}
func (o *StoragePoolCreateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.ErrorResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}