-
Notifications
You must be signed in to change notification settings - Fork 0
/
switchm_wiredclients.go
153 lines (140 loc) · 5.18 KB
/
switchm_wiredclients.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
package bigdog
// API Version: v9_1
import (
"context"
"encoding/json"
"net/http"
"net/url"
"time"
)
type SwitchMWiredClientsService struct {
apiClient *VSZClient
}
func NewSwitchMWiredClientsService(c *VSZClient) *SwitchMWiredClientsService {
s := new(SwitchMWiredClientsService)
s.apiClient = c
return s
}
func (ss *SwitchMService) SwitchMWiredClientsService() *SwitchMWiredClientsService {
return NewSwitchMWiredClientsService(ss.apiClient)
}
// AddSwitchClients
//
// Use this API command to retrieve all the wired clients connected to switch, currently managed by SmartZone.
//
// Operation ID: addSwitchClients
// Operation path: /switch/clients
// Success code: 200 (OK)
//
// Request body:
// - body *SwitchMCommonQueryCriteriaSuperSet
func (s *SwitchMWiredClientsService) AddSwitchClients(ctx context.Context, body *SwitchMCommonQueryCriteriaSuperSet, mutators ...RequestMutator) (*SwitchMSwitchConnectedDevicesQueryListAPIResponse, error) {
var (
req *APIRequest
httpResp *http.Response
execDur time.Duration
resp APIResponse
err error
respFn = newSwitchMSwitchConnectedDevicesQueryListAPIResponse
)
req = apiRequestFromPool(APISourceVSZ, http.MethodPost, RouteSwitchMAddSwitchClients, true)
defer recycleAPIRequest(req)
req.Header.Set(headerKeyContentType, headerValueApplicationJSON)
req.Header.Set(headerKeyAccept, "*/*")
req.SetBody(body)
httpResp, execDur, err = s.apiClient.Do(ctx, req, mutators...)
resp, err = handleAPIResponse(req, http.StatusOK, httpResp, execDur, respFn, s.apiClient.autoHydrate, s.apiClient.ev, err)
return resp.(*SwitchMSwitchConnectedDevicesQueryListAPIResponse), err
}
// AddSwitchClientsAp
//
// Use this API command to retrieve all the Ruckus APs connected to switch, currently managed by SmartZone.
//
// Operation ID: addSwitchClientsAp
// Operation path: /switch/clients/ap
// Success code: 200 (OK)
//
// Request body:
// - body *SwitchMCommonQueryCriteriaSuperSet
func (s *SwitchMWiredClientsService) AddSwitchClientsAp(ctx context.Context, body *SwitchMCommonQueryCriteriaSuperSet, mutators ...RequestMutator) (*SwitchMSwitchConnectedAPsQueryListAPIResponse, error) {
var (
req *APIRequest
httpResp *http.Response
execDur time.Duration
resp APIResponse
err error
respFn = newSwitchMSwitchConnectedAPsQueryListAPIResponse
)
req = apiRequestFromPool(APISourceVSZ, http.MethodPost, RouteSwitchMAddSwitchClientsAp, true)
defer recycleAPIRequest(req)
req.Header.Set(headerKeyContentType, headerValueApplicationJSON)
req.Header.Set(headerKeyAccept, "*/*")
req.SetBody(body)
httpResp, execDur, err = s.apiClient.Do(ctx, req, mutators...)
resp, err = handleAPIResponse(req, http.StatusOK, httpResp, execDur, respFn, s.apiClient.autoHydrate, s.apiClient.ev, err)
return resp.(*SwitchMSwitchConnectedAPsQueryListAPIResponse), err
}
// AddSwitchClientsAPExport
//
// Download CSV of AP's discovered via LLDP
//
// Operation ID: addSwitchClientsAPExport
// Operation path: /switch/clients/ap/export
// Success code: 200 (OK)
//
// Request body:
// - body *SwitchMCommonQueryCriteriaSuperSet
func (s *SwitchMWiredClientsService) AddSwitchClientsAPExport(ctx context.Context, body *SwitchMCommonQueryCriteriaSuperSet, mutators ...RequestMutator) (*FileAPIResponse, error) {
var (
req *APIRequest
httpResp *http.Response
execDur time.Duration
resp APIResponse
err error
respFn = newFileAPIResponse
)
req = apiRequestFromPool(APISourceVSZ, http.MethodPost, RouteSwitchMAddSwitchClientsAPExport, true)
defer recycleAPIRequest(req)
req.Header.Set(headerKeyContentType, "application/x-www-form-urlencoded")
req.Header.Set(headerKeyAccept, "*/*")
if b, err := json.Marshal(body); err != nil {
return resp.(*FileAPIResponse), err
} else {
req.SetBody(url.Values{"json": []string{string(b)}})
}
httpResp, execDur, err = s.apiClient.Do(ctx, req, mutators...)
resp, err = handleAPIResponse(req, http.StatusOK, httpResp, execDur, respFn, s.apiClient.autoHydrate, s.apiClient.ev, err)
return resp.(*FileAPIResponse), err
}
// AddSwitchClientsExport
//
// Download CSV of wired clients discovered via LLDP
//
// Operation ID: addSwitchClientsExport
// Operation path: /switch/clients/export
// Success code: 200 (OK)
//
// Request body:
// - body *SwitchMCommonQueryCriteriaSuperSet
func (s *SwitchMWiredClientsService) AddSwitchClientsExport(ctx context.Context, body *SwitchMCommonQueryCriteriaSuperSet, mutators ...RequestMutator) (*FileAPIResponse, error) {
var (
req *APIRequest
httpResp *http.Response
execDur time.Duration
resp APIResponse
err error
respFn = newFileAPIResponse
)
req = apiRequestFromPool(APISourceVSZ, http.MethodPost, RouteSwitchMAddSwitchClientsExport, true)
defer recycleAPIRequest(req)
req.Header.Set(headerKeyContentType, "application/x-www-form-urlencoded")
req.Header.Set(headerKeyAccept, "*/*")
if b, err := json.Marshal(body); err != nil {
return resp.(*FileAPIResponse), err
} else {
req.SetBody(url.Values{"json": []string{string(b)}})
}
httpResp, execDur, err = s.apiClient.Do(ctx, req, mutators...)
resp, err = handleAPIResponse(req, http.StatusOK, httpResp, execDur, respFn, s.apiClient.autoHydrate, s.apiClient.ev, err)
return resp.(*FileAPIResponse), err
}