/
version_and_patch.go
54 lines (39 loc) · 1.52 KB
/
version_and_patch.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
package isegosdk
import (
"fmt"
"github.com/go-resty/resty/v2"
)
type VersionAndPatchService service
type ResponseVersionAndPatchGetIseVersionAndPatch struct {
OperationResult *ResponseVersionAndPatchGetIseVersionAndPatchOperationResult `json:"OperationResult,omitempty"` //
}
type ResponseVersionAndPatchGetIseVersionAndPatchOperationResult struct {
ResultValue *[]ResponseVersionAndPatchGetIseVersionAndPatchOperationResultResultValue `json:"resultValue,omitempty"` //
}
type ResponseVersionAndPatchGetIseVersionAndPatchOperationResultResultValue struct {
Value string `json:"value,omitempty"` //
Name string `json:"name,omitempty"` //
}
//GetIseVersionAndPatch Get Cisco ISE version and patch information
/* This API allows the client to get Cisco ISE version and patch information.
*/
func (s *VersionAndPatchService) GetIseVersionAndPatch() (*ResponseVersionAndPatchGetIseVersionAndPatch, *resty.Response, error) {
setHost(s.client, "_ers")
path := "/ers/config/op/systemconfig/iseversion"
setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetResult(&ResponseVersionAndPatchGetIseVersionAndPatch{}).
SetError(&Error).
Get(path)
if err != nil {
return nil, nil, err
}
if response.IsError() {
return nil, response, fmt.Errorf("error with operation GetIseVersionAndPatch")
}
getCSFRToken(response.Header())
result := response.Result().(*ResponseVersionAndPatchGetIseVersionAndPatch)
return result, response, err
}