-
Notifications
You must be signed in to change notification settings - Fork 0
/
switchm_topreports.go
83 lines (74 loc) · 2.8 KB
/
switchm_topreports.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
package bigdog
// API Version: v9_1
import (
"context"
"net/http"
"time"
)
type SwitchMTopReportsService struct {
apiClient *VSZClient
}
func NewSwitchMTopReportsService(c *VSZClient) *SwitchMTopReportsService {
s := new(SwitchMTopReportsService)
s.apiClient = c
return s
}
func (ss *SwitchMService) SwitchMTopReportsService() *SwitchMTopReportsService {
return NewSwitchMTopReportsService(ss.apiClient)
}
// AddSwitchTopByFirmware
//
// Use this API command to retrieves top N switch count based on firmware version.
//
// Operation ID: addSwitchTopByFirmware
// Operation path: /switch/top/byFirmware
// Success code: 200 (OK)
//
// Request body:
// - body *SwitchMCommonQueryCriteriaSuperSet
func (s *SwitchMTopReportsService) AddSwitchTopByFirmware(ctx context.Context, body *SwitchMCommonQueryCriteriaSuperSet, mutators ...RequestMutator) (*SwitchMSwitchTopSwitchesByFirmwareQueryResultListAPIResponse, error) {
var (
req *APIRequest
httpResp *http.Response
execDur time.Duration
resp APIResponse
err error
respFn = newSwitchMSwitchTopSwitchesByFirmwareQueryResultListAPIResponse
)
req = apiRequestFromPool(APISourceVSZ, http.MethodPost, RouteSwitchMAddSwitchTopByFirmware, 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.(*SwitchMSwitchTopSwitchesByFirmwareQueryResultListAPIResponse), err
}
// AddSwitchTopByModel
//
// Use this API command to retrieve top N switch count based on switch model.
//
// Operation ID: addSwitchTopByModel
// Operation path: /switch/top/byModel
// Success code: 200 (OK)
//
// Request body:
// - body *SwitchMCommonQueryCriteriaSuperSet
func (s *SwitchMTopReportsService) AddSwitchTopByModel(ctx context.Context, body *SwitchMCommonQueryCriteriaSuperSet, mutators ...RequestMutator) (*SwitchMSwitchTopSwitchesByModelQueryResultListAPIResponse, error) {
var (
req *APIRequest
httpResp *http.Response
execDur time.Duration
resp APIResponse
err error
respFn = newSwitchMSwitchTopSwitchesByModelQueryResultListAPIResponse
)
req = apiRequestFromPool(APISourceVSZ, http.MethodPost, RouteSwitchMAddSwitchTopByModel, 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.(*SwitchMSwitchTopSwitchesByModelQueryResultListAPIResponse), err
}