-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathftp.go
192 lines (155 loc) · 6.74 KB
/
ftp.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
package objects
// THIS FILE IS AUTO GENERATED BY bin/gen.go! DO NOT EDIT!
import (
"fmt"
"github.com/esurdam/go-sophos"
)
// Ftp is a generated struct representing the Sophos Ftp Endpoint
// GET /api/nodes/ftp
type Ftp struct {
AllowedClients []interface{} `json:"allowed_clients"`
AllowedServers []string `json:"allowed_servers"`
CffAv int64 `json:"cff_av"`
CffAvEngines string `json:"cff_av_engines"`
CffFileExtensions []interface{} `json:"cff_file_extensions"`
Exceptions []interface{} `json:"exceptions"`
MaxFileSize int64 `json:"max_file_size"`
MsWinMode int64 `json:"ms_win_mode"`
OperationMode string `json:"operation_mode"`
RestrictedServers []string `json:"restricted_servers"`
Status int64 `json:"status"`
TransparentSkip []interface{} `json:"transparent_skip"`
TransparentSkipAutoPf int64 `json:"transparent_skip_auto_pf"`
}
var _ sophos.Endpoint = &Ftp{}
var defsFtp = map[string]sophos.RestObject{
"FtpException": &FtpException{},
"FtpGroup": &FtpGroup{},
}
// RestObjects implements the sophos.Node interface and returns a map of Ftp's Objects
func (Ftp) RestObjects() map[string]sophos.RestObject { return defsFtp }
// GetPath implements sophos.RestGetter
func (*Ftp) GetPath() string { return "/api/nodes/ftp" }
// RefRequired implements sophos.RestGetter
func (*Ftp) RefRequired() (string, bool) { return "", false }
var defFtp = &sophos.Definition{Description: "ftp", Name: "ftp", Link: "/api/definitions/ftp"}
// Definition returns the /api/definitions struct of Ftp
func (Ftp) Definition() sophos.Definition { return *defFtp }
// ApiRoutes returns all known Ftp Paths
func (Ftp) ApiRoutes() []string {
return []string{
"/api/objects/ftp/exception/",
"/api/objects/ftp/exception/{ref}",
"/api/objects/ftp/exception/{ref}/usedby",
"/api/objects/ftp/group/",
"/api/objects/ftp/group/{ref}",
"/api/objects/ftp/group/{ref}/usedby",
}
}
// References returns the Ftp's references. These strings serve no purpose other than to demonstrate which
// Reference keys are used for this Endpoint
func (Ftp) References() []string {
return []string{
"REF_FtpException",
"REF_FtpGroup",
}
}
// FtpExceptions is an Sophos Endpoint subType and implements sophos.RestObject
type FtpExceptions []FtpException
// FtpException represents a UTM FTP filter exception
type FtpException struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
Client []string `json:"client"`
Comment string `json:"comment"`
Name string `json:"name"`
Server []string `json:"server"`
Skiplist []string `json:"skiplist"`
// Status default value is false
Status bool `json:"status"`
}
var _ sophos.RestGetter = &FtpException{}
// GetPath implements sophos.RestObject and returns the FtpExceptions GET path
// Returns all available ftp/exception objects
func (*FtpExceptions) GetPath() string { return "/api/objects/ftp/exception/" }
// RefRequired implements sophos.RestObject
func (*FtpExceptions) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the FtpExceptions GET path
// Returns all available exception types
func (f *FtpException) GetPath() string {
return fmt.Sprintf("/api/objects/ftp/exception/%s", f.Reference)
}
// RefRequired implements sophos.RestObject
func (f *FtpException) RefRequired() (string, bool) { return f.Reference, true }
// DeletePath implements sophos.RestObject and returns the FtpException DELETE path
// Creates or updates the complete object exception
func (*FtpException) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ftp/exception/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the FtpException PATCH path
// Changes to parts of the object exception types
func (*FtpException) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ftp/exception/%s", ref)
}
// PostPath implements sophos.RestObject and returns the FtpException POST path
// Create a new ftp/exception object
func (*FtpException) PostPath() string {
return "/api/objects/ftp/exception/"
}
// PutPath implements sophos.RestObject and returns the FtpException PUT path
// Creates or updates the complete object exception
func (*FtpException) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ftp/exception/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*FtpException) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ftp/exception/%s/usedby", ref)
}
// FtpGroups is an Sophos Endpoint subType and implements sophos.RestObject
type FtpGroups []FtpGroup
// FtpGroup represents a UTM group
type FtpGroup struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
Comment string `json:"comment"`
Name string `json:"name"`
}
var _ sophos.RestGetter = &FtpGroup{}
// GetPath implements sophos.RestObject and returns the FtpGroups GET path
// Returns all available ftp/group objects
func (*FtpGroups) GetPath() string { return "/api/objects/ftp/group/" }
// RefRequired implements sophos.RestObject
func (*FtpGroups) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the FtpGroups GET path
// Returns all available group types
func (f *FtpGroup) GetPath() string { return fmt.Sprintf("/api/objects/ftp/group/%s", f.Reference) }
// RefRequired implements sophos.RestObject
func (f *FtpGroup) RefRequired() (string, bool) { return f.Reference, true }
// DeletePath implements sophos.RestObject and returns the FtpGroup DELETE path
// Creates or updates the complete object group
func (*FtpGroup) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ftp/group/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the FtpGroup PATCH path
// Changes to parts of the object group types
func (*FtpGroup) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ftp/group/%s", ref)
}
// PostPath implements sophos.RestObject and returns the FtpGroup POST path
// Create a new ftp/group object
func (*FtpGroup) PostPath() string {
return "/api/objects/ftp/group/"
}
// PutPath implements sophos.RestObject and returns the FtpGroup PUT path
// Creates or updates the complete object group
func (*FtpGroup) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ftp/group/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*FtpGroup) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ftp/group/%s/usedby", ref)
}