Skip to content

Commit

Permalink
Merge pull request #34 from CiscoISE/develop-3.2-beta
Browse files Browse the repository at this point in the history
ISE 3.2 beta
  • Loading branch information
bvargasre authored Nov 8, 2023
2 parents 139ea4e + 9f3a4f0 commit 7ec2245
Show file tree
Hide file tree
Showing 36 changed files with 2,424 additions and 1,318 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.0] - 2023-11-07
### Added
- `ciscoise-go-sdk` now supports ISE 3.2-Beta API.
- New services included: `configuration, edda, dataconnect_services, subscriber`

## [1.1.22] - 2023-08-09
- Support for nested children conditions was added.
- Adding parameter `RequestBasicPwdAuth` to `RequestAllowedProtocolsCreateAllowedProtocolAllowedProtocolsTeap` and `RequestAllowedProtocolsUpdateAllowedProtocolByIDAllowedProtocolsTeap` struct.
Expand Down Expand Up @@ -216,4 +221,5 @@ Following parameters were added to `RequestNetworkAccessAuthenticationRulesCreat
[1.1.20]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.1.19...v1.1.20
[1.1.21]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.1.20...v1.1.21
[1.1.22]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.1.21...v1.1.22
[Unreleased]: https://github.com/cisco-en-programmability/dnacenter-go-sdk/compare/v1.1.22...main
[1.2.0]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.1.22...v1.2.0
[Unreleased]: https://github.com/cisco-en-programmability/ciscoise-go-sdk/compare/v1.2.0...main
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ciscoise-go-sdk is a go client library for [Cisco Identity Services Engine (ISE)
## Introduction
The ciscoise-go-sdk makes it easier to work with the Cisco Identity Services Engine (ISE) RESTFul APIs from Go.

It supports version 3.1_Patch_1, but it is backward compatible with other versions as long as those versions use the same URLs and options as version 3.1_Patch_1.
It supports version 3.2-Beta, but it is backward compatible with other versions as long as those versions use the same URLs and options as version 3.2-Beta.

## Getting started

Expand Down Expand Up @@ -122,6 +122,7 @@ https://pkg.go.dev/github.com/CiscoISE/ciscoise-go-sdk
| 0.y.z | 3.1.0 |
| 1.0.z | 3.1.0 |
| 1.1.z | 3.1_Patch_1 |
| 1.2.z | 3.2-Beta |

## Changelog

Expand Down
6 changes: 3 additions & 3 deletions sdk/active_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ type ResponseActiveDirectoryGetUserGroupsERSActiveDirectoryGroups struct {
}

type ResponseActiveDirectoryGetUserGroupsERSActiveDirectoryGroupsGroups struct {
Name string `json:"name,omitempty"` // ISSUE groupName => name
Name string `json:"name,omitempty"` //
Sid string `json:"sid,omitempty"` //
Type string `json:"type,omitempty"` //
}
Expand All @@ -118,7 +118,7 @@ type ResponseActiveDirectoryIsUserMemberOfGroupsERSActiveDirectoryGroups struct
}

type ResponseActiveDirectoryIsUserMemberOfGroupsERSActiveDirectoryGroupsGroups struct {
Name string `json:"name,omitempty"` // ISSUE groupName => name
Name string `json:"name,omitempty"` //
Sid string `json:"sid,omitempty"` //
Type string `json:"type,omitempty"` //
}
Expand Down Expand Up @@ -146,7 +146,7 @@ type ResponseActiveDirectoryGetGroupsByDomainERSActiveDirectoryGroups struct {
}

type ResponseActiveDirectoryGetGroupsByDomainERSActiveDirectoryGroupsGroups struct {
Name string `json:"name,omitempty"` // Issue groupName => name
Name string `json:"name,omitempty"` //
Sid string `json:"sid,omitempty"` //
Type string `json:"type,omitempty"` //
}
Expand Down
20 changes: 9 additions & 11 deletions sdk/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ type Client struct {
CertificateTemplate *CertificateTemplateService
Certificates *CertificatesService
ClearThreatsAndVulnerabilities *ClearThreatsAndVulnerabilitiesService
Configuration *ConfigurationService
Consumer *ConsumerService
DataconnectServices *DataconnectServicesService
DeviceAdministrationAuthenticationRules *DeviceAdministrationAuthenticationRulesService
DeviceAdministrationAuthorizationExceptionRules *DeviceAdministrationAuthorizationExceptionRulesService
DeviceAdministrationAuthorizationGlobalExceptionRules *DeviceAdministrationAuthorizationGlobalExceptionRulesService
Expand All @@ -70,6 +72,7 @@ type Client struct {
DeviceAdministrationServiceNames *DeviceAdministrationServiceNamesService
DeviceAdministrationTimeDateConditions *DeviceAdministrationTimeDateConditionsService
DownloadableACL *DownloadableACLService
Edda *EddaService
EgressMatrixCell *EgressMatrixCellService
EndpointCertificate *EndpointCertificateService
EndpointIDentityGroup *EndpointIDentityGroupService
Expand Down Expand Up @@ -139,6 +142,7 @@ type Client struct {
SponsorGroupMember *SponsorGroupMemberService
SponsorPortal *SponsorPortalService
SponsoredGuestPortal *SponsoredGuestPortalService
Subscriber *SubscriberService
SupportBundleDownload *SupportBundleDownloadService
SupportBundleStatus *SupportBundleStatusService
SupportBundleTriggerConfiguration *SupportBundleTriggerConfigurationService
Expand All @@ -154,15 +158,11 @@ type Client struct {
VersionAndPatch *VersionAndPatchService
VersionInfo *VersionInfoService
Endpoint *EndpointService
NbarApp *NbarAppService
Portal *PortalService
Proxy *ProxyService
PxGridNode *PxGridNodeService
SgVnMapping *SgVnMappingService
Tasks *TasksService
Telemetry *TelemetryService
VirtualNetwork *VirtualNetworkService
VnVLANMapping *VnVLANMappingService
}

type service struct {
Expand Down Expand Up @@ -275,7 +275,9 @@ func NewClient() (*Client, error) {
c.CertificateTemplate = (*CertificateTemplateService)(&c.common)
c.Certificates = (*CertificatesService)(&c.common)
c.ClearThreatsAndVulnerabilities = (*ClearThreatsAndVulnerabilitiesService)(&c.common)
c.Configuration = (*ConfigurationService)(&c.common)
c.Consumer = (*ConsumerService)(&c.common)
c.DataconnectServices = (*DataconnectServicesService)(&c.common)
c.DeviceAdministrationAuthenticationRules = (*DeviceAdministrationAuthenticationRulesService)(&c.common)
c.DeviceAdministrationAuthorizationExceptionRules = (*DeviceAdministrationAuthorizationExceptionRulesService)(&c.common)
c.DeviceAdministrationAuthorizationGlobalExceptionRules = (*DeviceAdministrationAuthorizationGlobalExceptionRulesService)(&c.common)
Expand All @@ -290,6 +292,7 @@ func NewClient() (*Client, error) {
c.DeviceAdministrationServiceNames = (*DeviceAdministrationServiceNamesService)(&c.common)
c.DeviceAdministrationTimeDateConditions = (*DeviceAdministrationTimeDateConditionsService)(&c.common)
c.DownloadableACL = (*DownloadableACLService)(&c.common)
c.Edda = (*EddaService)(&c.common)
c.EgressMatrixCell = (*EgressMatrixCellService)(&c.common)
c.EndpointCertificate = (*EndpointCertificateService)(&c.common)
c.EndpointIDentityGroup = (*EndpointIDentityGroupService)(&c.common)
Expand Down Expand Up @@ -359,6 +362,7 @@ func NewClient() (*Client, error) {
c.SponsorGroupMember = (*SponsorGroupMemberService)(&c.common)
c.SponsorPortal = (*SponsorPortalService)(&c.common)
c.SponsoredGuestPortal = (*SponsoredGuestPortalService)(&c.common)
c.Subscriber = (*SubscriberService)(&c.common)
c.SupportBundleDownload = (*SupportBundleDownloadService)(&c.common)
c.SupportBundleStatus = (*SupportBundleStatusService)(&c.common)
c.SupportBundleTriggerConfiguration = (*SupportBundleTriggerConfigurationService)(&c.common)
Expand All @@ -371,24 +375,18 @@ func NewClient() (*Client, error) {
c.TelemetryInformation = (*TelemetryInformationService)(&c.common)
c.TrustSecConfiguration = (*TrustSecConfigurationService)(&c.common)
c.TrustSecSxp = (*TrustSecSxpService)(&c.common)
c.VersionAndPatch = (*VersionAndPatchService)(&c.common)
c.VersionInfo = (*VersionInfoService)(&c.common)
c.Endpoint = (*EndpointService)(&c.common)
c.NbarApp = (*NbarAppService)(&c.common)
c.Portal = (*PortalService)(&c.common)
c.Proxy = (*ProxyService)(&c.common)
c.PxGridNode = (*PxGridNodeService)(&c.common)
c.SgVnMapping = (*SgVnMappingService)(&c.common)
c.Tasks = (*TasksService)(&c.common)
c.Telemetry = (*TelemetryService)(&c.common)
c.VirtualNetwork = (*VirtualNetworkService)(&c.common)
c.VnVLANMapping = (*VnVLANMappingService)(&c.common)

client.SetBasicAuth(username, password)
return c, nil
}

//NewClientWithOptions is the client with options passed with parameters
// NewClientWithOptions is the client with options passed with parameters
func NewClientWithOptions(baseURL string, username string, password string, debug string, sslVerify string, useAPIGateway string, useCSRFToken string) (*Client, error) {
var err error
err = os.Setenv(ISE_BASE_URL, baseURL)
Expand Down
92 changes: 92 additions & 0 deletions sdk/configuration.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
package isegosdk

import (
"fmt"

"github.com/go-resty/resty/v2"
)

type ConfigurationService service

type ResponseConfigurationGetConfiguration struct {
EnableEPO *bool `json:"enableEPO,omitempty"` // To enable/disable LSD ownership settings
EnableRCM *bool `json:"enableRCM,omitempty"` // To enable/disable random mac(RCM) settings. Please note that this flag will be set to false if enableEPO flag is false
}

type ResponseConfigurationUpdateConfiguration struct {
EnableEPO *bool `json:"enableEPO,omitempty"` // To enable/disable LSD ownership settings
EnableRCM *bool `json:"enableRCM,omitempty"` // To enable/disable random mac(RCM) settings. Please note that this flag will be set to false if enableEPO flag is false
}

type RequestConfigurationUpdateConfiguration struct {
EnableEPO *bool `json:"enableEPO,omitempty"` // To enable/disable LSD ownership settings
EnableRCM *bool `json:"enableRCM,omitempty"` // To enable/disable random mac(RCM) settings. Please note that this flag will be set to false if enableEPO flag is false
}

//GetConfiguration Retrieve configuration information for LSD settings page
/* Retrieve configuration information for LSD settings page
*/
func (s *ConfigurationService) GetConfiguration() (*ResponseConfigurationGetConfiguration, *resty.Response, error) {
setHost(s.client, "_main")
path := "/api/v1/lsd/updateLsdSettings"

setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetResult(&ResponseConfigurationGetConfiguration{}).
SetError(&Error).
Get(path)

if err != nil {
return nil, nil, err

}

if response.IsError() {
return nil, response, fmt.Errorf("error with operation GetConfiguration")
}

getCSFRToken(response.Header())

result := response.Result().(*ResponseConfigurationGetConfiguration)
return result, response, err

}

//UpdateConfiguration Update LSD enable/disable settings for endppint ownership and rcm (random changing mac)
/* API to enable/disable LSD settings
*/
func (s *ConfigurationService) UpdateConfiguration(requestConfigurationUpdateConfiguration *RequestConfigurationUpdateConfiguration) (*ResponseConfigurationUpdateConfiguration, *resty.Response, error) {
setHost(s.client, "_main")
path := "/api/v1/lsd/updateLsdSettings"

setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetBody(requestConfigurationUpdateConfiguration).
SetResult(&ResponseConfigurationUpdateConfiguration{}).
SetError(&Error).
Put(path)

if err != nil {
if err.Error() == emptyStringToJSONError {
return &ResponseConfigurationUpdateConfiguration{}, response, nil
}
return nil, nil, err

}

if response.IsError() {
return nil, response, fmt.Errorf("error with operation UpdateConfiguration")
}

getCSFRToken(response.Header())

result := response.Result().(*ResponseConfigurationUpdateConfiguration)
return result, response, err

}
24 changes: 12 additions & 12 deletions sdk/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,35 @@ import (

type ConsumerService service

type RequestClearThreatsAndVulnerabilitiesCreateAccount struct {
type RequestConfigurationCreateAccount struct {
NodeName string `json:"nodeName,omitempty"` //
}

type RequestClearThreatsAndVulnerabilitiesActivateAccount struct {
type RequestConfigurationActivateAccount struct {
Description string `json:"description,omitempty"` //
}

type RequestClearThreatsAndVulnerabilitiesLookupService struct {
type RequestConfigurationLookupService struct {
Name string `json:"name,omitempty"` //
}

type RequestClearThreatsAndVulnerabilitiesAccessSecret struct {
type RequestConfigurationAccessSecret struct {
PeerNodeName string `json:"peerNodeName,omitempty"` //
}

//CreateAccount 🚧 AccountCreate
/* 🚧 AccountCreate
*/
func (s *ConsumerService) CreateAccount(requestClearThreatsAndVulnerabilitiesCreateAccount *RequestClearThreatsAndVulnerabilitiesCreateAccount) (*resty.Response, error) {
func (s *ConsumerService) CreateAccount(requestConfigurationCreateAccount *RequestConfigurationCreateAccount) (*resty.Response, error) {
setHost(s.client, "_px_grid")
path := "/pxgrid/ise/radius/control/AccountCreate"

setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetBody(requestClearThreatsAndVulnerabilitiesCreateAccount).
SetBody(requestConfigurationCreateAccount).
SetError(&Error).
Post(path)

Expand All @@ -58,15 +58,15 @@ func (s *ConsumerService) CreateAccount(requestClearThreatsAndVulnerabilitiesCre
/* 🚧 AccountActivate
*/
func (s *ConsumerService) ActivateAccount(requestClearThreatsAndVulnerabilitiesActivateAccount *RequestClearThreatsAndVulnerabilitiesActivateAccount) (*resty.Response, error) {
func (s *ConsumerService) ActivateAccount(requestConfigurationActivateAccount *RequestConfigurationActivateAccount) (*resty.Response, error) {
setHost(s.client, "_px_grid")
path := "/pxgrid/ise/radius/control/AccountActivate"

setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetBody(requestClearThreatsAndVulnerabilitiesActivateAccount).
SetBody(requestConfigurationActivateAccount).
SetError(&Error).
Post(path)

Expand All @@ -88,15 +88,15 @@ func (s *ConsumerService) ActivateAccount(requestClearThreatsAndVulnerabilitiesA
/* 🚧 ServiceLookup
*/
func (s *ConsumerService) LookupService(requestClearThreatsAndVulnerabilitiesLookupService *RequestClearThreatsAndVulnerabilitiesLookupService) (*resty.Response, error) {
func (s *ConsumerService) LookupService(requestConfigurationLookupService *RequestConfigurationLookupService) (*resty.Response, error) {
setHost(s.client, "_px_grid")
path := "/pxgrid/ise/radius/control/ServiceLookup"

setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetBody(requestClearThreatsAndVulnerabilitiesLookupService).
SetBody(requestConfigurationLookupService).
SetError(&Error).
Post(path)

Expand All @@ -118,15 +118,15 @@ func (s *ConsumerService) LookupService(requestClearThreatsAndVulnerabilitiesLoo
/* 🚧 AccessSecret
*/
func (s *ConsumerService) AccessSecret(requestClearThreatsAndVulnerabilitiesAccessSecret *RequestClearThreatsAndVulnerabilitiesAccessSecret) (*resty.Response, error) {
func (s *ConsumerService) AccessSecret(requestConfigurationAccessSecret *RequestConfigurationAccessSecret) (*resty.Response, error) {
setHost(s.client, "_px_grid")
path := "/pxgrid/ise/radius/control/AccessSecret"

setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetBody(requestClearThreatsAndVulnerabilitiesAccessSecret).
SetBody(requestConfigurationAccessSecret).
SetError(&Error).
Post(path)

Expand Down
Loading

0 comments on commit 7ec2245

Please sign in to comment.