From af105954c83e472db3bf21a8f57a63268927d7a6 Mon Sep 17 00:00:00 2001 From: bvargasre Date: Wed, 24 Apr 2024 14:19:41 -0600 Subject: [PATCH] New version 3.3 patch 1 --- CHANGELOG.md | 8 +- README.md | 5 +- sdk/active_directories.go | 49 + sdk/ad_groups.go | 51 ++ sdk/api_client.go | 43 +- sdk/certificates.go | 656 +++++++------ sdk/configuration.go | 4 +- sdk/custom_attributes.go | 195 ++++ sdk/duo_identity_sync.go | 423 +++++++++ sdk/duo_mfa.go | 327 +++++++ sdk/edda.go | 518 ----------- sdk/enable_mfa.go | 50 + sdk/endpoint_stop_replication_service.go | 99 ++ sdk/endpoints.go | 640 +++++++++++++ sdk/full_upgrade.go | 447 +++++++++ sdk/is_mfa_enabled.go | 45 + sdk/licensing.go | 186 ++-- sdk/native_ipsec.go | 1069 ++++++++++++++++++++++ sdk/nbar_app.go | 147 ++- sdk/node_deployment.go | 206 ++--- sdk/node_group.go | 56 +- sdk/node_services.go | 132 +-- sdk/pan_ha.go | 8 +- sdk/patching.go | 23 +- sdk/proxy.go | 2 +- sdk/px_grid_direct.go | 665 ++++++++++++++ sdk/self_registered_portal.go | 6 +- sdk/sg_vn_mapping.go | 73 +- sdk/sgt_range_reservation.go | 257 ++++++ sdk/subscriber.go | 226 ++--- sdk/tasks.go | 2 +- sdk/telemetry.go | 6 +- sdk/user_equipment.go | 508 ++++++++++ sdk/virtual_network.go | 113 ++- sdk/vn_vlan_mapping.go | 66 +- 35 files changed, 5892 insertions(+), 1419 deletions(-) create mode 100644 sdk/active_directories.go create mode 100644 sdk/ad_groups.go create mode 100644 sdk/custom_attributes.go create mode 100644 sdk/duo_identity_sync.go create mode 100644 sdk/duo_mfa.go delete mode 100644 sdk/edda.go create mode 100644 sdk/enable_mfa.go create mode 100644 sdk/endpoint_stop_replication_service.go create mode 100644 sdk/endpoints.go create mode 100644 sdk/full_upgrade.go create mode 100644 sdk/is_mfa_enabled.go create mode 100644 sdk/native_ipsec.go create mode 100644 sdk/px_grid_direct.go create mode 100644 sdk/sgt_range_reservation.go create mode 100644 sdk/user_equipment.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cfef3b..01ea9d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.3.0] - 2024-04-24 +### Added +- `ciscoise-go-sdk` now supports ISE 3.3 patch 1 API. +- New services included: `active_directories, ad_groups, custom_attributes, duo_identity_sync, duo_mfa, enable_mfa, endpoint_stop_replication_service, endpoints, full_upgrade, is_mfa_enabled, native_ipsec, px_grid_direct, sgt_range_reservation, user_equipment` + ## [1.2.0] - 2023-11-07 ### Added - `ciscoise-go-sdk` now supports ISE 3.2-Beta API. @@ -222,4 +227,5 @@ Following parameters were added to `RequestNetworkAccessAuthenticationRulesCreat [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 [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 +[1.3.0]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.2.0...v1.3.0 +[Unreleased]: https://github.com/cisco-en-programmability/ciscoise-go-sdk/compare/v1.3.0...main diff --git a/README.md b/README.md index 072e555..2d9ef0a 100644 --- a/README.md +++ b/README.md @@ -121,8 +121,9 @@ 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 | +| 1.1.z | 3.1 Patch 1 | +| 1.2.z | 3.2 Beta | +| 1.3.z | 3.3 patch 1 | ## Changelog diff --git a/sdk/active_directories.go b/sdk/active_directories.go new file mode 100644 index 0000000..a17a9c5 --- /dev/null +++ b/sdk/active_directories.go @@ -0,0 +1,49 @@ +package isegosdk + +import ( + "fmt" + + "github.com/go-resty/resty/v2" +) + +type ActiveDirectoriesService service + +type ResponseActiveDirectoriesGetActiveDirectories []ResponseItemActiveDirectoriesGetActiveDirectories // Array of ResponseActiveDirectoriesGetActiveDirectories + +type ResponseItemActiveDirectoriesGetActiveDirectories struct { + DirectoryID string `json:"directoryID,omitempty"` // Active Directory ID + Domain string `json:"domain,omitempty"` // Active Directory domain name + Name string `json:"name,omitempty"` // Name of the Active Directory +} + +//GetActiveDirectories Get the list of all configured Active Directories +/* Duo-IdentitySync Get the list of all configured Active Directories + + */ +func (s *ActiveDirectoriesService) GetActiveDirectories() (*ResponseActiveDirectoriesGetActiveDirectories, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-identitysync/activedirectories" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseActiveDirectoriesGetActiveDirectories{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetActiveDirectories") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseActiveDirectoriesGetActiveDirectories) + return result, response, err + +} diff --git a/sdk/ad_groups.go b/sdk/ad_groups.go new file mode 100644 index 0000000..162939b --- /dev/null +++ b/sdk/ad_groups.go @@ -0,0 +1,51 @@ +package isegosdk + +import ( + "fmt" + "strings" + + "github.com/go-resty/resty/v2" +) + +type ADGroupsService service + +type ResponseADGroupsGetAdgroups []ResponseItemADGroupsGetAdgroups // Array of ResponseADGroupsGetAdgroups + +type ResponseItemADGroupsGetAdgroups struct { + Name string `json:"name,omitempty"` // Active Directory Group ID + Source string `json:"source,omitempty"` // Source of the Active Directory Group +} + +//GetAdgroups Get the list of all AD groups for the specified Active Directory +/* Duo-IdentitySync Get the list of all AD groups for the specified Active Directory + +@param activeDirectory activeDirectory path parameter. List of AD groups for the specified Active Directory +*/ +func (s *ADGroupsService) GetAdgroups(activeDirectory string) (*ResponseADGroupsGetAdgroups, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-identitysync/adgroups/{activeDirectory}" + path = strings.Replace(path, "{activeDirectory}", fmt.Sprintf("%v", activeDirectory), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseADGroupsGetAdgroups{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetAdgroups") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseADGroupsGetAdgroups) + return result, response, err + +} diff --git a/sdk/api_client.go b/sdk/api_client.go index 58a3894..9f09fcd 100644 --- a/sdk/api_client.go +++ b/sdk/api_client.go @@ -43,7 +43,9 @@ type Client struct { // API Services AciBindings *AciBindingsService AciSettings *AciSettingsService + ADGroups *ADGroupsService AncEndpoint *AncEndpointService + ActiveDirectories *ActiveDirectoriesService ActiveDirectory *ActiveDirectoryService AdminUser *AdminUserService AllowedProtocols *AllowedProtocolsService @@ -72,8 +74,10 @@ type Client struct { DeviceAdministrationServiceNames *DeviceAdministrationServiceNamesService DeviceAdministrationTimeDateConditions *DeviceAdministrationTimeDateConditionsService DownloadableACL *DownloadableACLService - Edda *EddaService + DuoIDentitySync *DuoIDentitySyncService + DuoMfa *DuoMfaService EgressMatrixCell *EgressMatrixCellService + EndpointStopReplicationService *EndpointStopReplicationServiceService EndpointCertificate *EndpointCertificateService EndpointIDentityGroup *EndpointIDentityGroupService ExternalRadiusServer *ExternalRadiusServerService @@ -93,6 +97,7 @@ type Client struct { Mdm *MdmService Misc *MiscService MyDevicePortal *MyDevicePortalService + NativeIPsec *NativeIPsecService NativeSupplicantProfile *NativeSupplicantProfileService NetworkAccessAuthenticationRules *NetworkAccessAuthenticationRulesService NetworkAccessAuthorizationExceptionRules *NetworkAccessAuthorizationExceptionRulesService @@ -138,6 +143,7 @@ type Client struct { SecurityGroupsACLs *SecurityGroupsACLsService SelfRegisteredPortal *SelfRegisteredPortalService SessionDirectory *SessionDirectoryService + SgtRangeReservation *SgtRangeReservationService SponsorGroup *SponsorGroupService SponsorGroupMember *SponsorGroupMemberService SponsorPortal *SponsorPortalService @@ -155,14 +161,25 @@ type Client struct { TelemetryInformation *TelemetryInformationService TrustSecConfiguration *TrustSecConfigurationService TrustSecSxp *TrustSecSxpService + UserEquipment *UserEquipmentService VersionAndPatch *VersionAndPatchService VersionInfo *VersionInfoService + CustomAttributes *CustomAttributesService + EnableMFA *EnableMFAService Endpoint *EndpointService + Endpoints *EndpointsService + FullUpgrade *FullUpgradeService + IsMFAEnabled *IsMFAEnabledService + NbarApp *NbarAppService Portal *PortalService Proxy *ProxyService + PxGridDirect *PxGridDirectService PxGridNode *PxGridNodeService + SgVnMapping *SgVnMappingService Tasks *TasksService Telemetry *TelemetryService + VirtualNetwork *VirtualNetworkService + VnVLANMapping *VnVLANMappingService } type service struct { @@ -208,6 +225,9 @@ func getPort(group string) string { if group == "_px_grid" { return ":8910" } + if group == "_px_grid_direct" { + return ":44330" + } return "" } @@ -263,7 +283,9 @@ func NewClient() (*Client, error) { } c.AciBindings = (*AciBindingsService)(&c.common) c.AciSettings = (*AciSettingsService)(&c.common) + c.ADGroups = (*ADGroupsService)(&c.common) c.AncEndpoint = (*AncEndpointService)(&c.common) + c.ActiveDirectories = (*ActiveDirectoriesService)(&c.common) c.ActiveDirectory = (*ActiveDirectoryService)(&c.common) c.AdminUser = (*AdminUserService)(&c.common) c.AllowedProtocols = (*AllowedProtocolsService)(&c.common) @@ -292,8 +314,10 @@ 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.DuoIDentitySync = (*DuoIDentitySyncService)(&c.common) + c.DuoMfa = (*DuoMfaService)(&c.common) c.EgressMatrixCell = (*EgressMatrixCellService)(&c.common) + c.EndpointStopReplicationService = (*EndpointStopReplicationServiceService)(&c.common) c.EndpointCertificate = (*EndpointCertificateService)(&c.common) c.EndpointIDentityGroup = (*EndpointIDentityGroupService)(&c.common) c.ExternalRadiusServer = (*ExternalRadiusServerService)(&c.common) @@ -313,6 +337,7 @@ func NewClient() (*Client, error) { c.Mdm = (*MdmService)(&c.common) c.Misc = (*MiscService)(&c.common) c.MyDevicePortal = (*MyDevicePortalService)(&c.common) + c.NativeIPsec = (*NativeIPsecService)(&c.common) c.NativeSupplicantProfile = (*NativeSupplicantProfileService)(&c.common) c.NetworkAccessAuthenticationRules = (*NetworkAccessAuthenticationRulesService)(&c.common) c.NetworkAccessAuthorizationExceptionRules = (*NetworkAccessAuthorizationExceptionRulesService)(&c.common) @@ -358,6 +383,7 @@ func NewClient() (*Client, error) { c.SecurityGroupsACLs = (*SecurityGroupsACLsService)(&c.common) c.SelfRegisteredPortal = (*SelfRegisteredPortalService)(&c.common) c.SessionDirectory = (*SessionDirectoryService)(&c.common) + c.SgtRangeReservation = (*SgtRangeReservationService)(&c.common) c.SponsorGroup = (*SponsorGroupService)(&c.common) c.SponsorGroupMember = (*SponsorGroupMemberService)(&c.common) c.SponsorPortal = (*SponsorPortalService)(&c.common) @@ -375,12 +401,25 @@ func NewClient() (*Client, error) { c.TelemetryInformation = (*TelemetryInformationService)(&c.common) c.TrustSecConfiguration = (*TrustSecConfigurationService)(&c.common) c.TrustSecSxp = (*TrustSecSxpService)(&c.common) + c.UserEquipment = (*UserEquipmentService)(&c.common) + c.VersionAndPatch = (*VersionAndPatchService)(&c.common) + c.VersionInfo = (*VersionInfoService)(&c.common) + c.CustomAttributes = (*CustomAttributesService)(&c.common) + c.EnableMFA = (*EnableMFAService)(&c.common) c.Endpoint = (*EndpointService)(&c.common) + c.Endpoints = (*EndpointsService)(&c.common) + c.FullUpgrade = (*FullUpgradeService)(&c.common) + c.IsMFAEnabled = (*IsMFAEnabledService)(&c.common) + c.NbarApp = (*NbarAppService)(&c.common) c.Portal = (*PortalService)(&c.common) c.Proxy = (*ProxyService)(&c.common) + c.PxGridDirect = (*PxGridDirectService)(&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 diff --git a/sdk/certificates.go b/sdk/certificates.go index 21bbd38..b9b75df 100644 --- a/sdk/certificates.go +++ b/sdk/certificates.go @@ -11,30 +11,30 @@ import ( type CertificatesService service type GetCsrsQueryParams struct { - Page int `url:"page,omitempty"` //Page number - Size int `url:"size,omitempty"` //Number of objects returned per page - Sort string `url:"sort,omitempty"` //sort type - asc or desc - SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted - Filter []string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
- FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter + Page int `url:"page,omitempty"` //Page number + Size int `url:"size,omitempty"` //Number of objects returned per page + Sort string `url:"sort,omitempty"` //sort type - asc or desc + SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted + Filter string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
+ FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter } type GetSystemCertificatesQueryParams struct { - Page int `url:"page,omitempty"` //Page number - Size int `url:"size,omitempty"` //Number of objects returned per page - Sort string `url:"sort,omitempty"` //sort type - asc or desc - SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted - Filter []string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
- FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter + Page int `url:"page,omitempty"` //Page number + Size int `url:"size,omitempty"` //Number of objects returned per page + Sort string `url:"sort,omitempty"` //sort type - asc or desc + SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted + Filter string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
+ FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter } type GetTrustedCertificatesQueryParams struct { - Page int `url:"page,omitempty"` //Page number - Size int `url:"size,omitempty"` //Number of objects returned per page - Sort string `url:"sort,omitempty"` //sort type - asc or desc - SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted - Filter []string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
- FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter + Page int `url:"page,omitempty"` //Page number + Size int `url:"size,omitempty"` //Number of objects returned per page + Sort string `url:"sort,omitempty"` //sort type - asc or desc + SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted + Filter string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
+ FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter } type ResponseCertificatesGetCsrs struct { @@ -63,6 +63,7 @@ type ResponseCertificatesGetCsrsResponse struct { ID string `json:"id,omitempty"` // ID of the certificate. KeySize string `json:"keySize,omitempty"` // Size of the cryptographic key used. Link *ResponseCertificatesGetCsrsResponseLink `json:"link,omitempty"` // + SanNames string `json:"sanNames,omitempty"` // String representation of subject alternative names. SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"` // Algorithm used for encrypting CSR Subject string `json:"subject,omitempty"` // Subject of the certificate. Includes Common Name (CN), Organizational Unit (OU), etc. TimeStamp string `json:"timeStamp,omitempty"` // Timestamp of the certificate generation. @@ -122,6 +123,7 @@ type ResponseCertificatesGetCsrByIDResponse struct { ID string `json:"id,omitempty"` // ID of the certificate. KeySize string `json:"keySize,omitempty"` // Size of the cryptographic key used. Link *ResponseCertificatesGetCsrByIDResponseLink `json:"link,omitempty"` // + SanNames string `json:"sanNames,omitempty"` // String representation of subject alternative names. SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"` // Algorithm used for encrypting CSR Subject string `json:"subject,omitempty"` // Subject of the certificate. Includes Common Name (CN), Organizational Unit (OU), etc. TimeStamp string `json:"timeStamp,omitempty"` // Timestamp of the certificate generation. @@ -155,7 +157,7 @@ type ResponseCertificatesRegenerateIseRootCa struct { } type ResponseCertificatesRegenerateIseRootCaResponse struct { - ID string `json:"id,omitempty"` // ID which can be used to track status of Cisco ISE root CA chain regeneration + ID string `json:"id,omitempty"` // ID which can be used to track the status of Cisco ISE root CA chain regeneration Link *ResponseCertificatesRegenerateIseRootCaResponseLink `json:"link,omitempty"` // Message string `json:"message,omitempty"` // } @@ -175,7 +177,7 @@ type ResponseCertificatesRenewCerts struct { type ResponseCertificatesRenewCertificates = ResponseCertificatesRenewCerts type ResponseCertificatesRenewCertsResponse struct { - ID string `json:"id,omitempty"` // ID which can be used to track status of certificate regeneration + ID string `json:"id,omitempty"` // ID which can be used to track the status of certificate regeneration Link *ResponseCertificatesRenewCertsResponseLink `json:"link,omitempty"` // Message string `json:"message,omitempty"` // } @@ -208,7 +210,7 @@ type ResponseCertificatesGenerateSelfSignedCertificate struct { } type ResponseCertificatesGenerateSelfSignedCertificateResponse struct { - ID string `json:"id,omitempty"` // ID of the generated sefl signed system certificate + ID string `json:"id,omitempty"` // ID of the generated self-signed system certificate Message string `json:"message,omitempty"` // Response message on generation of self-signed system certificate Status string `json:"status,omitempty"` // HTTP response status after import } @@ -256,7 +258,7 @@ type ResponseCertificatesGetSystemCertificatesResponse struct { ID string `json:"id,omitempty"` // ID of system certificate IssuedBy string `json:"issuedBy,omitempty"` // Common Name of the certificate issuer IssuedTo string `json:"issuedTo,omitempty"` // Common Name of the certificate subject - KeySize *int `json:"keySize,omitempty"` // Length of key used for encrypting system certificate + KeySize *int `json:"keySize,omitempty"` // Length of the key used for encrypting system certificate Link *ResponseCertificatesGetSystemCertificatesResponseLink `json:"link,omitempty"` // PortalsUsingTheTag string `json:"portalsUsingTheTag,omitempty"` // SelfSigned *bool `json:"selfSigned,omitempty"` // @@ -285,7 +287,7 @@ type ResponseCertificatesGetSystemCertificateByIDResponse struct { ID string `json:"id,omitempty"` // ID of system certificate IssuedBy string `json:"issuedBy,omitempty"` // Common Name of the certificate issuer IssuedTo string `json:"issuedTo,omitempty"` // Common Name of the certificate subject - KeySize *int `json:"keySize,omitempty"` // Length of key used for encrypting system certificate + KeySize *int `json:"keySize,omitempty"` // Length of the key used for encrypting system certificate Link *ResponseCertificatesGetSystemCertificateByIDResponseLink `json:"link,omitempty"` // PortalsUsingTheTag string `json:"portalsUsingTheTag,omitempty"` // SelfSigned *bool `json:"selfSigned,omitempty"` // @@ -376,7 +378,7 @@ type ResponseCertificatesGetTrustedCertificatesResponse struct { InternalCa *bool `json:"internalCA,omitempty"` // IssuedBy string `json:"issuedBy,omitempty"` // The entity that verified the information and signed the certificate IssuedTo string `json:"issuedTo,omitempty"` // Entity to which trust certificate is issued - KeySize string `json:"keySize,omitempty"` // The length of key used for encrypting trust certificate + KeySize string `json:"keySize,omitempty"` // Length of the key used for encrypting trust certificate Link *ResponseCertificatesGetTrustedCertificatesResponseLink `json:"link,omitempty"` // NonAutomaticCRLUpdatePeriod string `json:"nonAutomaticCRLUpdatePeriod,omitempty"` // Non automatic CRL update period NonAutomaticCRLUpdateUnits string `json:"nonAutomaticCRLUpdateUnits,omitempty"` // Unit of time of non automatic CRL update @@ -440,7 +442,7 @@ type ResponseCertificatesGetTrustedCertificateByIDResponse struct { IsReferredInPolicy *bool `json:"isReferredInPolicy,omitempty"` // IssuedBy string `json:"issuedBy,omitempty"` // The entity that verified the information and signed the certificate IssuedTo string `json:"issuedTo,omitempty"` // Entity to which trust certificate is issued - KeySize string `json:"keySize,omitempty"` // The length of key used for encrypting trust certificate + KeySize string `json:"keySize,omitempty"` // Length of the key used for encrypting trust certificate Link *ResponseCertificatesGetTrustedCertificateByIDResponseLink `json:"link,omitempty"` // NonAutomaticCRLUpdatePeriod string `json:"nonAutomaticCRLUpdatePeriod,omitempty"` // Non automatic CRL update period NonAutomaticCRLUpdateUnits string `json:"nonAutomaticCRLUpdateUnits,omitempty"` // Unit of time of non automatic CRL update @@ -522,14 +524,14 @@ type RequestCertificatesRenewCertificates = RequestCertificatesRenewCerts type RequestCertificatesBindCsr struct { Admin *bool `json:"admin,omitempty"` // Use certificate to authenticate the Cisco ISE Admin Portal - AllowExtendedValidity *bool `json:"allowExtendedValidity,omitempty"` // Allow import of certificates with validity greater than 398 days (required) - AllowOutOfDateCert *bool `json:"allowOutOfDateCert,omitempty"` // Allow out of date certificates (required) - AllowReplacementOfCertificates *bool `json:"allowReplacementOfCertificates,omitempty"` // Allow Replacement of certificates (required) - AllowReplacementOfPortalGroupTag *bool `json:"allowReplacementOfPortalGroupTag,omitempty"` // Allow Replacement of Portal Group Tag (required) - Data string `json:"data,omitempty"` // Signed certificate data (required) + AllowExtendedValidity *bool `json:"allowExtendedValidity,omitempty"` // Allow import of certificates with validity greater than 398 days + AllowOutOfDateCert *bool `json:"allowOutOfDateCert,omitempty"` // Allow out of date certificates + AllowReplacementOfCertificates *bool `json:"allowReplacementOfCertificates,omitempty"` // Allow Replacement of certificates + AllowReplacementOfPortalGroupTag *bool `json:"allowReplacementOfPortalGroupTag,omitempty"` // Allow Replacement of Portal Group Tag + Data string `json:"data,omitempty"` // Signed certificate data Eap *bool `json:"eap,omitempty"` // Use certificate for EAP protocols that use SSL/TLS tunneling - HostName string `json:"hostName,omitempty"` // Name of Host whose CSR ID has been provided (required) - ID string `json:"id,omitempty"` // ID of the generated CSR (required) + HostName string `json:"hostName,omitempty"` // Name of Host whose CSR ID has been provided + ID string `json:"id,omitempty"` // ID of the generated CSR Ims *bool `json:"ims,omitempty"` // Use certificate for the Cisco ISE Messaging Service Name string `json:"name,omitempty"` // Friendly Name of the certificate Portal *bool `json:"portal,omitempty"` // Use for portal @@ -542,6 +544,7 @@ type RequestCertificatesBindCsr struct { type RequestCertificatesExportSystemCert struct { Export string `json:"export,omitempty"` // + HostName string `json:"hostName,omitempty"` // Hostname of the Cisco ISE node in which self-signed certificate should be generated. ID string `json:"id,omitempty"` // Password string `json:"password,omitempty"` // } @@ -586,22 +589,22 @@ type RequestCertificatesGenerateSelfSignedCertificate struct { type RequestCertificatesImportSystemCert struct { Admin *bool `json:"admin,omitempty"` // Use certificate to authenticate the Cisco ISE Admin Portal - AllowExtendedValidity *bool `json:"allowExtendedValidity,omitempty"` // Allow import of certificates with validity greater than 398 days (required) - AllowOutOfDateCert *bool `json:"allowOutOfDateCert,omitempty"` // Allow out of date certificates (required) + AllowExtendedValidity *bool `json:"allowExtendedValidity,omitempty"` // Allow import of certificates with validity greater than 398 days + AllowOutOfDateCert *bool `json:"allowOutOfDateCert,omitempty"` // Allow out of date certificates AllowPortalTagTransferForSameSubject *bool `json:"allowPortalTagTransferForSameSubject,omitempty"` // Allow overwriting the portal tag from matching certificate of same subject - AllowReplacementOfCertificates *bool `json:"allowReplacementOfCertificates,omitempty"` // Allow Replacement of certificates (required) - AllowReplacementOfPortalGroupTag *bool `json:"allowReplacementOfPortalGroupTag,omitempty"` // Allow Replacement of Portal Group Tag (required) + AllowReplacementOfCertificates *bool `json:"allowReplacementOfCertificates,omitempty"` // Allow Replacement of certificates + AllowReplacementOfPortalGroupTag *bool `json:"allowReplacementOfPortalGroupTag,omitempty"` // Allow Replacement of Portal Group Tag AllowRoleTransferForSameSubject *bool `json:"allowRoleTransferForSameSubject,omitempty"` // Allow transfer of roles for certificate with matching subject - AllowSHA1Certificates *bool `json:"allowSHA1Certificates,omitempty"` // Allow SHA1 based certificates (required) + AllowSHA1Certificates *bool `json:"allowSHA1Certificates,omitempty"` // Allow SHA1 based certificates AllowWildCardCertificates *bool `json:"allowWildCardCertificates,omitempty"` // Allow Wildcard certificates - Data string `json:"data,omitempty"` // Certificate Content (required) + Data string `json:"data,omitempty"` // Certificate Content Eap *bool `json:"eap,omitempty"` // Use certificate for EAP protocols that use SSL/TLS tunneling Ims *bool `json:"ims,omitempty"` // Use certificate for the Cisco ISE Messaging Service Name string `json:"name,omitempty"` // Name of the certificate - Password string `json:"password,omitempty"` // Certificate Password (required). + Password string `json:"password,omitempty"` // Certificate Password . Portal *bool `json:"portal,omitempty"` // Use for portal PortalGroupTag string `json:"portalGroupTag,omitempty"` // Set Group tag - PrivateKeyData string `json:"privateKeyData,omitempty"` // Private Key data (required) + PrivateKeyData string `json:"privateKeyData,omitempty"` // Private Key data Pxgrid *bool `json:"pxgrid,omitempty"` // Use certificate for the pxGrid Controller Radius *bool `json:"radius,omitempty"` // Use certificate for the RADSec server Saml *bool `json:"saml,omitempty"` // Use certificate for SAML Signing @@ -614,7 +617,7 @@ type RequestCertificatesImportSystemCertificate = RequestCertificatesImportSyste type RequestCertificatesUpdateSystemCert struct { Admin *bool `json:"admin,omitempty"` // Use certificate to authenticate the Cisco ISE Admin Portal AllowPortalTagTransferForSameSubject *bool `json:"allowPortalTagTransferForSameSubject,omitempty"` // Allow overwriting the portal tag from matching certificate of same subject - AllowReplacementOfPortalGroupTag *bool `json:"allowReplacementOfPortalGroupTag,omitempty"` // Allow Replacement of Portal Group Tag (required) + AllowReplacementOfPortalGroupTag *bool `json:"allowReplacementOfPortalGroupTag,omitempty"` // Allow Replacement of Portal Group Tag AllowRoleTransferForSameSubject *bool `json:"allowRoleTransferForSameSubject,omitempty"` // Allow transfer of roles for certificate with matching subject Description string `json:"description,omitempty"` // Description of System Certificate Eap *bool `json:"eap,omitempty"` // Use certificate for EAP protocols that use SSL/TLS tunneling @@ -634,10 +637,10 @@ type RequestCertificatesUpdateSystemCert struct { type RequestCertificatesUpdateSystemCertificate = RequestCertificatesUpdateSystemCert type RequestCertificatesImportTrustCert struct { - AllowBasicConstraintCaFalse *bool `json:"allowBasicConstraintCAFalse,omitempty"` // Allow certificates with Basic Constraints CA Field as False (required) - AllowOutOfDateCert *bool `json:"allowOutOfDateCert,omitempty"` // Allow out of date certificates (required) - AllowSHA1Certificates *bool `json:"allowSHA1Certificates,omitempty"` // Allow SHA1 based certificates (required) - Data string `json:"data,omitempty"` // Certificate content (required) + AllowBasicConstraintCaFalse *bool `json:"allowBasicConstraintCAFalse,omitempty"` // Allow certificates with Basic Constraints CA Field as False + AllowOutOfDateCert *bool `json:"allowOutOfDateCert,omitempty"` // Allow out of date certificates + AllowSHA1Certificates *bool `json:"allowSHA1Certificates,omitempty"` // Allow SHA1 based certificates + Data string `json:"data,omitempty"` // Certificate content Description string `json:"description,omitempty"` // Description of the certificate Name string `json:"name,omitempty"` // Name of the certificate TrustForCertificateBasedAdminAuth *bool `json:"trustForCertificateBasedAdminAuth,omitempty"` // Trust for Certificate based Admin authentication @@ -676,10 +679,10 @@ type RequestCertificatesUpdateTrustedCertificate struct { TrustForIseAuth *bool `json:"trustForIseAuth,omitempty"` // Trust for authentication within Cisco ISE } -//GetCsrs Get all Certificate Signing Requests from PAN. -/* This API supports Filtering, Sorting and Pagination. +//GetCsrs Get all Certificate Signing Requests from PAN +/* This API supports filtering, sorting and pagination. -Filtering and Sorting supported on below mentioned attributes: +Filtering and sorting are supported for the following attributes: friendlyName @@ -728,8 +731,8 @@ func (s *CertificatesService) GetCsrs(getCSRsQueryParams *GetCsrsQueryParams) (* } -//ExportCsr Export a CSR, given a CSR ID and a hostname. -/* Response of this API carries a CSR corresponding to the requested ID +//ExportCsr Export a CSR for a given CSR ID and hostname +/* Response of this API carries a CSR corresponding to the requested ID. @param hostname hostname path parameter. Hostname to which the CSR belongs. @param id id path parameter. ID of the CSR to be exported. @@ -766,8 +769,8 @@ func (s *CertificatesService) ExportCsr(hostname string, id string) (FileDownloa } -//GetCsrByID Get Certificate Signing Request (CSR) by ID -/* This API displays details of a Certificate Signing Request of a particular node for given HostName and ID. +//GetCsrByID Get the certificate signing request for a given ID +/* This API displays details of a certificate signing request of a particular node for a given hostname and ID. @param hostName hostName path parameter. Name of the host of which CSR's should be returned @param id id path parameter. ID of the Certificate Signing Request returned @@ -803,9 +806,9 @@ func (s *CertificatesService) GetCsrByID(hostName string, id string) (*ResponseC } //GetSystemCertificates Get all system certificates of a particular node -/* This API supports Filtering, Sorting and Pagination. +/* This API supports filtering, sorting and pagination. -Filtering and Sorting supported on below mentioned attributes: +Filtering and sorting supported for the following attributes: friendlyName @@ -832,7 +835,7 @@ Supported Operators: EQ, NEQ, GT and LT -@param hostName hostName path parameter. Name of the host of which system certificates should be returned +@param hostName hostName path parameter. Name of the host for which the system certificates should be returned @param getSystemCertificatesQueryParams Filtering parameter */ func (s *CertificatesService) GetSystemCertificates(hostName string, getSystemCertificatesQueryParams *GetSystemCertificatesQueryParams) (*ResponseCertificatesGetSystemCertificates, *resty.Response, error) { @@ -867,7 +870,7 @@ func (s *CertificatesService) GetSystemCertificates(hostName string, getSystemCe } //GetSystemCertificateByID Get system certificate of a particular node by ID -/* This API provides details of a System Certificate of a particular node based on given HostName and ID. +/* This API provides details of a system certificate of a particular node based on given hostname and ID. @param hostName hostName path parameter. Name of the host of which system certificates should be returned @param id id path parameter. ID of the system certificate @@ -905,7 +908,7 @@ func (s *CertificatesService) GetSystemCertificateByID(hostName string, id strin //GetTrustedCertificates Get list of all trusted certificates /* This API supports Filtering, Sorting and Pagination. -Filtering and Sorting supported on below mentioned attributes: +Filtering and Sorting are supported for the following attributes: friendlyName @@ -942,6 +945,9 @@ Supported Operators: EQ, NEQ +Note: + ISE internal CA certificates will not be exported. + @param getTrustedCertificatesQueryParams Filtering parameter */ func (s *CertificatesService) GetTrustedCertificates(getTrustedCertificatesQueryParams *GetTrustedCertificatesQueryParams) (*ResponseCertificatesGetTrustedCertificates, *resty.Response, error) { @@ -974,8 +980,8 @@ func (s *CertificatesService) GetTrustedCertificates(getTrustedCertificatesQuery } -//ExportTrustedCert Export a trust certificate given a certificate id. -/* The response of this API carries a trusted certificate file mapped to the requested ID +//ExportTrustedCert Export a trust certificate by a given certificate ID +/* The response of this API carries a trusted certificate file mapped to the requested ID. @param id id path parameter. ID of the Trusted Certificate to be exported. */ @@ -1010,7 +1016,7 @@ func (s *CertificatesService) ExportTrustedCert(id string) (FileDownload, *resty } -//Alias of ExportTrustedCert Export a trust certificate given a certificate id. +// Alias of ExportTrustedCert Export a trust certificate by a given certificate ID func (s *CertificatesService) ExportTrustedCertificate(id string) (FileDownload, *resty.Response, error) { return s.ExportTrustedCert(id) } @@ -1049,12 +1055,10 @@ func (s *CertificatesService) GetTrustedCertificateByID(id string) (*ResponseCer } -//GenerateCsr Generate a Certificate Signing Request (CSR). +//GenerateCsr Generate a Certificate Signing Request (CSR) /* - Generate a certificate signing request for Multi-Use, Admin, EAP Authentication, RADIUS DTLS, PxGrid, SAML, Portal and IMS Services. - -Following parameters are present in POST request body + Following parameters are present in the POST request body @@ -1079,43 +1083,43 @@ List of Cisco ISE node hostnames for which CSRs should be generated allowWildCardCert -Allow use of WildCards in certificates +Allow use of wildCards in certificates "allowWildCardCert": false keyLength -* required +*required -Length of the key used for CSR generation (required). +Length of the key used for CSR generation. "keyLength": "512" keyType -* required +*required -Type of key used for CSR generation either RSA or ECDSA (required). +Type of key used for CSR generation either RSA or ECDSA. "keyType": "RSA" digestType -* required +*required -Hash algorithm used for signing CSR (required). +Hash algorithm used for signing CSR. "digestType": "SHA-256" usedFor -* required +*required -Certificate usage (required). +Certificate usage. "usedFor": "MULTI-USE" @@ -1130,9 +1134,9 @@ Certificate policy OID or list of OIDs that the certificate should conform to. U subjectCommonName -* required +*required -Certificate common name (CN) (required). +Certificate common name (CN). "subjectCommonName": "$FQDN$" @@ -1216,10 +1220,12 @@ Portal Group Tag when using certificate for PORTAL service NOTE: -For allowWildCardCert to be false, the below mentioned parameter is mandatory: +For +allowWildCardCert + to be false, the following parameter is mandatory: hostnames -When certificate is selected to be used for Portal Service, the below mentioned parameter is mandatory: +When certificate is selected to be used for Portal Service, the following parameter is mandatory: portalGroupTag @@ -1256,8 +1262,8 @@ func (s *CertificatesService) GenerateCsr(requestCertificatesGenerateCSR *Reques } -//GenerateIntermediateCaCsr Generate a Intermediate CA Certificate Signing Request (CSR). -/* CSR Generation for Intermediate Certificates. +//GenerateIntermediateCaCsr Generate an intermediate CA CSR (certificate signing request) +/* CSR generation for Intermediate Certificates. */ func (s *CertificatesService) GenerateIntermediateCaCsr() (*ResponseCertificatesGenerateIntermediateCaCsr, *resty.Response, error) { @@ -1290,9 +1296,9 @@ func (s *CertificatesService) GenerateIntermediateCaCsr() (*ResponseCertificates } -//RegenerateIseRootCa Regenerate entire internal CA certificate chain including root CA on the Primary PAN and subordinate CAs on the PSNs (Applicable only for internal CA service). -/* This API initiates regeneration of Cisco ISE root CA certificate chain. Response contains ID which can be used to track the status. -Setting "removeExistingISEIntermediateCSR" to true removes existing Cisco ISE Intermediate CSR +//RegenerateIseRootCa Regenerate entire internal CA certificate chain including root CA on the primary PAN and subordinate CAs on the PSNs (Applicable only for internal CA service) +/* This API initiates regeneration of Cisco ISE root CA certificate chain. The response contains an ID which can be used to track the status. +Setting "removeExistingISEIntermediateCSR" to true removes existing Cisco ISE Intermediate CSR. */ func (s *CertificatesService) RegenerateIseRootCa(requestCertificatesRegenerateISERootCA *RequestCertificatesRegenerateIseRootCa) (*ResponseCertificatesRegenerateIseRootCa, *resty.Response, error) { @@ -1326,8 +1332,8 @@ func (s *CertificatesService) RegenerateIseRootCa(requestCertificatesRegenerateI } -//RenewCerts Renew certificates of OCSP responder and Cisco ISE Messaging Service. -/* This API initiates regeneration of certificates. Response contains ID which can be used to track the status +//RenewCerts Renew certificates of OCSP responder and Cisco ISE Messaging Service +/* This API initiates regeneration of certificates. The response contains an ID which can be used to track the status. */ func (s *CertificatesService) RenewCerts(requestCertificatesRenewCerts *RequestCertificatesRenewCerts) (*ResponseCertificatesRenewCerts, *resty.Response, error) { @@ -1361,26 +1367,25 @@ func (s *CertificatesService) RenewCerts(requestCertificatesRenewCerts *RequestC } -//Alias of RenewCerts Renew certificates of OCSP responder and Cisco ISE Messaging Service. +// Alias of RenewCerts Renew certificates of OCSP responder and Cisco ISE Messaging Service func (s *CertificatesService) RenewCertificates(requestCertificatesRenewCerts *RequestCertificatesRenewCerts) (*ResponseCertificatesRenewCerts, *resty.Response, error) { return s.RenewCerts(requestCertificatesRenewCerts) } -//BindCsr Bind CA Signed Certificate. +//BindCsr Bind CA Signed Certificate /* - Bind CA Signed Certificate. NOTE: -This API requires an existing Certificate Signing Request, and the root certificate must already be trusted. +This API requires an existing certificate signing request, and the root certificate must already be trusted. NOTE: -The certificate may have a validity period longer than 398 days. It may be untrusted by many browsers. +The certificate may have a validity period greater than 398 days. It may be untrusted by many browsers. NOTE: Request parameters accepting True and False as input can be replaced by 1 and 0 respectively. -Following parameters are used in POST body +Following parameters are used in the POST body @@ -1404,10 +1409,10 @@ Friendly name of the certificate. data -* required +*required - Plain-text contents of the certificate file. Every space needs to be replaced with newline escape sequence (\n) (required). - Use + Plain-text contents of the certificate file. Every space needs to be replaced with a newline escape sequence (\n). + Use the command awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' <> to extract data from certificate file. @@ -1416,41 +1421,42 @@ awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' <> allowExtendedValidity -* required +*required -Allow the certificates greater than validity of 398 days (required). +Allow the certificates with validity greater than 398 days. "allowExtendedValidity": true allowOutOfDateCert -* required +*required - Allow out of date certificates (required). + Allow out of date certificates. SECURITY ALERT: -It is recommended to use -"allowOutOfDateCert": false - to avoid binding of expired certificates (not Secure). - +We recommend to set the parameter the parameter +allowOutOfDateCert + as +false + to avoid binding of expired certificates (not secure). "allowOutOfDateCert": true allowReplacementOfCertificates -* required +*required -Allow Replacement of certificates (required). +Allow Replacement of certificates. "allowReplacementOfCertificates": true allowReplacementOfPortalGroupTag -* required +*required -Allow Replacement of Portal Group Tag (required). +Allow Replacement of Portal Group Tag. "allowReplacementOfPortalGroupTag": true @@ -1547,9 +1553,9 @@ Admin False -Enabling Admin role for this certificate causes an application server restart on the selected node. +Enabling admin role for this certificate causes an application server restart on the selected node. Note: - Make sure required Certificate Chain is imported under Trusted Certificates + Make sure that the required certificate chain is imported under Trusted Certificates. @@ -1559,7 +1565,7 @@ False Only one system certificate can be used for EAP. Assigning EAP to this certificate removes the assignment from another certificate. Note: - Make sure required Certificate Chain is imported under Trusted Certificates + Make sure that the required certificate chain is imported under Trusted Certificates. @@ -1569,7 +1575,7 @@ False Only one system certificate can be used for DTLS. Assigning DTLS to this certificate removes the assignment from another certificate. Note: - Make sure required Certificate Chain is imported under Trusted Certificates + Make sure that the required certificate chain is imported under Trusted Certificates @@ -1579,7 +1585,7 @@ False SAML cannot be used with other Usage. Enabling SAML unchecks all other Usage. Note: - Make sure required Certificate Chain is imported under Trusted Certificates + Make sure that the required certificate chain is imported under Trusted Certificates. @@ -1617,13 +1623,10 @@ func (s *CertificatesService) BindCsr(requestCertificatesBindCSR *RequestCertifi } -//ExportSystemCert Export a system certificate given a certificate ID. +//ExportSystemCert Export a system certificate with a given a certificate ID /* - Export System Certificate. - -Following parameters are used in POST body - + Following parameters are used in the POST body @@ -1638,17 +1641,26 @@ EXAMPLE id -* required +*required -ID of a System Certificate (required). +ID of a System Certificate. "id": "CERT-ID" +hostName +*required + +Name of the host for which the system certificate should be exported + +"hostName": "ise-node-001" + + + export - One of the below option is required + One of the following options is required: "CERTIFICATE" : Export only certificate without private key @@ -1665,7 +1677,7 @@ Export both certificate and private key ( password -* required +*required Certificate password (required if "export" : CERTIFICATE_WITH_PRIVATE_KEY @@ -1686,21 +1698,17 @@ Maximum of 100 Characters - NOTE: -The response of this API carries a ZIP file containing the certificate and private key if +The response of this API carries a ZIP file containing the certificate and private key if the request contains "export" : "CERTIFICATE_WITH_PRIVATE_KEY" - in the request. If +. If the request body contains "export" : "CERTIFICATE" - in request body, the response carries a ZIP file containing only the certificate. - - +, the response carries a ZIP file containing only the certificate. WARNING: Exporting a private key is not a secure operation. It could lead to possible exposure of the private key. - */ func (s *CertificatesService) ExportSystemCert(requestCertificatesExportSystemCert *RequestCertificatesExportSystemCert) (FileDownload, *resty.Response, error) { setHost(s.client, "_ui") @@ -1733,27 +1741,26 @@ func (s *CertificatesService) ExportSystemCert(requestCertificatesExportSystemCe } -//Alias of ExportSystemCert Export a system certificate given a certificate ID. +// Alias of ExportSystemCert Export a system certificate with a given a certificate ID func (s *CertificatesService) ExportSystemCertificate(requestCertificatesExportSystemCert *RequestCertificatesExportSystemCert) (FileDownload, *resty.Response, error) { return s.ExportSystemCert(requestCertificatesExportSystemCert) } -//GenerateSelfSignedCertificate Generate self-signed certificate in Cisco ISE. +//GenerateSelfSignedCertificate Generate self-signed certificate in Cisco ISE /* - Generate Self-signed Certificate NOTE: -The certificate may have a validity period longer than 398 days. It may be untrusted by many browsers. +The certificate may have a validity period greater than 398 days. It may be untrusted by many browsers. NOTE: Request parameters accepting True and False as input can be replaced by 1 and 0 respectively. NOTE: -Wildcard certificate and SAML certificate can be generated only on PPAN or Standalone +Wildcard certificate and SAML certificate can be generated only on the primary PAN or a standalone node. -Following parameters are used in POST body +Following parameters are used in the POST body @@ -1769,9 +1776,9 @@ EXAMPLE hostName -* required +*required -Hostname or FQDN of the node in which certificate needs to be created (required). +Hostname or FQDN of the node in which the certificate needs to be created. "hostName": "ise-node-001" @@ -1790,8 +1797,9 @@ subjectCommonName Certificate common name (CN) NOTE: -1. CN is Mandatory if SAN not configured. -             2. Subject can contain a multi-valued CN. For multi-valued RDNs, follow the format "CN=value1, CN=value2" +CN is Mandatory if SAN not configured. +>Subject can contain a multi-valued CN. For multi-valued RDNs, follow the format "CN=value1, CN=value2" + "subjectCommonName": "$FQDN$" @@ -1813,7 +1821,7 @@ subjectOrg Certificate organization (O) NOTE: -Subject can contain a multi-valued O fields. For multi-valued RDNs, follow the format "O=value1, O=value2" +Subject can contain multi-valued O fields. For multi-valued RDNs, follow the format "O=value1, O=value2" "subjectOrg": "Cisco" @@ -1853,7 +1861,7 @@ Array of SAN (Subject Alternative Name) DNS entries sanIP -Array of SAN IP entries +Array of SAN IP address entries "sanIP": ["1.1.1.1"] @@ -1868,27 +1876,27 @@ Array of SAN URI entries keyType -* required +*required -Algorithm to use for certificate public key creation (required). +Algorithm to use for certificate public key creation. "keyType": "RSA" keyLength -* required +*required -Bit size of the public key (required). +Bit size of the public key. "keyLength": "4096" digestType -* required +*required -Digest to sign with (required). +Digest to sign with. "digestType": "SHA-384" @@ -1903,9 +1911,9 @@ Certificate policy OID or list of OIDs that the certificate should conform to. U expirationTTL -* required +*required - Certificate expiration value (required). + Certificate expiration value. NOTE: Expiration TTL should be within Unix time limit @@ -1915,9 +1923,9 @@ Expiration TTL should be within Unix time limit expirationTTLUnit -* required +*required -Certificate expiration unit (required). +Certificate expiration unit. "expirationTTLUnit": "years" @@ -1949,7 +1957,7 @@ Use certificate for RADSec server pxgrid -Use certificate for the pxGrid Controller +Use certificate for the pxGrid controller "pxgrid": false @@ -1980,9 +1988,9 @@ Portal Group Tag for using certificate with portal role allowReplacementOfPortalGroupTag -* required +*required -Allow Replacement of Portal Group Tag (required). +Allow Replacement of Portal Group Tag. "allowReplacementOfPortalGroupTag": true @@ -1997,60 +2005,65 @@ Allow use of WildCards in certificates allowReplacementOfCertificates -* required +*required -Allow replacement of certificates (required). +Allow replacement of certificates. "allowReplacementOfCertificates": true allowExtendedValidity -* required +*required -Allow generation of self-signed certificate with validity greater than 398 days (required). +Allow generation of self-signed certificate with validity greater than 398 days. "allowExtendedValidity": true allowRoleTransferForSameSubject -* required +*required -Allow the transfer of roles to certificates with same subject (required). - If the matching certificate on Cisco ISE has either admin or portal role and if request has admin or portal role selected along with allowRoleTransferForSameSubject parameter as true, self-signed certificate would be generated with both admin and portal role enabled +Allow the transfer of roles to certificates with same subject. + If the matching certificate on Cisco ISE has either admin or portal role and if the request has admin or portal role selected along with +allowRoleTransferForSameSubject + parameter as true, a self-signed certificate would be generated with both admin and portal role enabled. "allowRoleTransferForSameSubject": true allowPortalTagTransferForSameSubject -* required +*required -Acquire the group tag of the matching certificate (required). If the request portal groug tag is different from the group tag of matching certificate (If matching certificate in Cisco ISE has portal role enabled), self-signed certificate would be generated by acquiring the group tag of matching certificate if allowPortalTagTransferForSameSubject parameter is true +Acquire the group tag of the matching certificate. If the request portal groug tag is different from the group tag of the matching certificate (If matching certificate in Cisco ISE has portal role enabled), a self-signed certificate would be generated by acquiring the group tag of the matching certificate if the +allowPortalTagTransferForSameSubject + parameter is true. "allowPortalTagTransferForSameSubject": true allowSanDnsBadName -* required +*required - Allow generation of self-signed certificate with bad Common Name & SAN Values [like "example.org.","invalid.","test.","localhost" ,etc.] (required). + Allow generation of self-signed certificates with bad common name & SAN values such as "example.org.","invalid.","test.","localhost" and so on. SECURITY ALERT: -It is recommended to use -"allowSanDnsBadName": false - to avoid generation of certificates with bad Common Name & SAN Values which are not secure - +We recommend to set the parameter +allowSanDnsBadName + as +false + to avoid generation of certificates with bad Common Name & SAN Values which are not secure. "allowSanDnsBadName": true allowSanDnsNonResolvable -* required +*required -Allow generation of self-signed certificate with non resolvable Common Name or SAN Values (required). +Allow generation of self-signed certificate with non resolvable Common Name or SAN Values . "allowSanDnsNonResolvable": true @@ -2137,18 +2150,22 @@ func (s *CertificatesService) GenerateSelfSignedCertificate(requestCertificatesG } -//ImportSystemCert Import system certificate into Cisco ISE. +//ImportSystemCert Import system certificate in Cisco ISE /* - Import an X509 certificate as a system certificate. NOTE: -The certificate may have a validity period longer than 398 days. It may be untrusted by many browsers. -NOTE: + +This API is used to import a certificate on a specific node mentioned in the server section of the URL. To import a certificate on a secondary node, execute this RESTApi directly on a secondary node by specifying the server name of the secondary node in the URL + Example: "/api/v1/certs/system-certificate/import" + +The certificate may have a validity period of more than 398 days. It may be untrusted by many browsers. + Request parameters accepting True and False as input can be replaced by 1 and 0 respectively. -Following parameters are used in POST body + +Following parameters are used in the POST body @@ -2172,30 +2189,30 @@ Friendly name of the certificate. password -* required +*required -Password of the certificate to be imported (required). +Password of the certificate to be imported. "password": "certificate password" data -* required +*required - Plain-text contents of the certificate file. Every space needs to be replaced with newline escape sequence (\n) (required). - Use + Plain-text contents of the certificate file. Every space needs to be replaced with a newline escape sequence (\n). + Use the command awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' <> - to extract data from certificate file. + to extract data from the certificate file. "data": "Plain-text contents of the certificate file." privateKeyData -* required +*required - Plain-text contents of the private key file. Every space needs to be replaced with newline escape sequence (\n) (required). Use + Plain-text contents of the private key file. Every space needs to be replaced with a newline escape sequence (\n). Use the command awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' <> to extract privateKeyData from private key file. @@ -2204,37 +2221,39 @@ awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' <> allowOutOfDateCert -* required +*required - Allow out of date certificates (required). + Allow out of date certificates . SECURITY ALERT: -It is recommended to use -"allowOutOfDateCert": false - to avoid import of expired certificates (not Secure). - +We recommend to set the parameter +allowOutOfDateCert + as +false + to avoid the import of expired certificates (not Secure). "allowOutOfDateCert": true allowSHA1certificates -* required +*required - Allow import of certificate with signature that uses the SHA-1 hashing algorithm and is considered less secure (required). + Allow import of certificate with signature that uses the SHA-1 hashing algorithm and is considered less secure . SECURITY ALERT: -It is recommended to use -"allowSHA1certificates": false - to avoid import of SHA1 based certificates (less secure). - +We recommend to set the parameter +allowSHA1certificates +as +false + to avoid the import of SHA1 based certificates (less secure). "allowSHA1certificates": true allowExtendedValidity -* required +*required -Allow the certificates greater than validity of 398 days (required). +Allow the certificates greater than validity of 398 days. "allowExtendedValidity": true @@ -2242,7 +2261,10 @@ Allow the certificates greater than validity of 398 days (required). allowRoleTransferForSameSubject -Allow the transfer of roles to certificates with same subject +password +*required + +Allow the transfer of roles to certificates with the same subject "allowRoleTransferForSameSubject": true @@ -2250,6 +2272,9 @@ Allow the transfer of roles to certificates with same subject allowPortalTagTransferForSameSubject +password +*required + Acquire the group tag of the matching certificate "allowPortalTagTransferForSameSubject": true @@ -2258,7 +2283,7 @@ Acquire the group tag of the matching certificate admin -Use certificate to authenticate the Cisco ISE Admin Portal +Use the certificate to authenticate the Cisco ISE admin portal "admin": false @@ -2266,7 +2291,7 @@ Use certificate to authenticate the Cisco ISE Admin Portal eap -Use certificate for EAP protocols that use SSL/TLS tunneling +Use the certificate for EAP protocols that use SSL/TLS tunneling "eap": false @@ -2274,7 +2299,7 @@ Use certificate for EAP protocols that use SSL/TLS tunneling radius -Use certificate for RADSec server +Use the certificate for RADSec server "radius": false @@ -2282,7 +2307,7 @@ Use certificate for RADSec server pxgrid -Use certificate for the pxGrid Controller +Use the certificate for the pxGrid Controller "pxgrid": false @@ -2290,7 +2315,7 @@ Use certificate for the pxGrid Controller ims -Use certificate for the Cisco ISE Messaging Service +Use the certificate for the Cisco ISE messaging service "ims": false @@ -2298,7 +2323,7 @@ Use certificate for the Cisco ISE Messaging Service saml -Use certificate for SAML Signing +Use the certificate for SAML Signing "saml": false @@ -2306,7 +2331,7 @@ Use certificate for SAML Signing portal -Use certificate for portal +Use the certificate for portal "portal": false @@ -2321,9 +2346,9 @@ Portal Group Tag for using certificate with portal role allowReplacementOfPortalGroupTag -* required +*required -Allow Replacement of Portal Group Tag (required). +Allow Replacement of Portal Group Tag . "allowReplacementOfPortalGroupTag": true @@ -2331,7 +2356,7 @@ Allow Replacement of Portal Group Tag (required). allowWildCardcertificates -Allow use of WildCards in certificates +Allow use of wildcards in certificates "allowWildCardcertificates": false @@ -2368,7 +2393,7 @@ False Enabling Admin role for this certificate causes an application server restart on the selected node. Note: - Make sure required Certificate Chain is imported under Trusted Certificates + Make sure the required certificate chain is imported under Trusted Certificates @@ -2398,7 +2423,7 @@ False SAML cannot be used with other Usage. Enabling SAML unchecks all other Usage. Note: - Make sure required Certificate Chain is imported under Trusted Certificates + Make sure the required certificate chain is imported under Trusted Certificates @@ -2436,20 +2461,18 @@ func (s *CertificatesService) ImportSystemCert(requestCertificatesImportSystemCe } -//Alias of ImportSystemCert Import system certificate into Cisco ISE. +// Alias of ImportSystemCert Import system certificate in Cisco ISE func (s *CertificatesService) ImportSystemCertificate(requestCertificatesImportSystemCert *RequestCertificatesImportSystemCert) (*ResponseCertificatesImportSystemCert, *resty.Response, error) { return s.ImportSystemCert(requestCertificatesImportSystemCert) } -//ImportTrustCert Add root certificate to the Cisco ISE truststore. +//ImportTrustCert Add root certificate to the Cisco ISE truststore /* - -Import an X509 certificate as a trust certificate. +Import an X509 certificate as a trust certificate NOTE: -Request parameters accepting True and False as input can be replaced by 1 and 0 respectively. - -Following parameters are used in POST body +Request parameters accepting True and False as input can be replaced by 1< and 0< respectively. + Following parameters are used in the POST body: @@ -2481,54 +2504,61 @@ Description of the certificate data -* required +*required - Plain-text contents of the certificate file. Every space needs to be replaced with newline escape sequence (\n) (required). - Use + Plain-text contents of the certificate file. Every space needs to be replaced with a newline escape sequence (\n). + Use the command awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' <> - to extract data from certificate file. + to extract data from the certificate file. "data": "Plain-text contents of the certificate file." allowOutOfDateCert -* required +*required - Allow out of date certificates (required). + Allow out of date certificates. SECURITY ALERT: -It is recommended to use -"allowOutOfDateCert": false - to avoid import of expired certificates (not Secure). - +We recommend to set the parameter +allowOutOfDateCert + as +false + to avoid the import of expired certificates (not secure). "allowOutOfDateCert": true allowSHA1Certificates -* required +*required - Allow import of certificate with signature that uses SHA-1 hashing algorithm and is considered less secure (required). + Allow import of certificate with signature that uses SHA-1 hashing algorithm and is considered less secure. SECURITY ALERT: -It is recommended to use -"allowSHA1Certificates": false - to avoid import of SHA1 based certificates (less secure). - +We recommend to set the parameter +allowSHA1Certificates + as +false + to avoid the import of SHA1 based certificates (less secure). "allowSHA1Certificates": true allowBasicConstraintCAFalse -* required +*required - Allow certificates with Basic Constraints CA Field as False (required). + Allow certificates with Basic Constraints CA Field as False. SECURITY ALERT: -It is recommended to use -"allowBasicConstraintCAFalse": false - to avoid import of certificates with Basic Constraints CA Field as False (not Secure). - +We recommend to set the parameter +allowBasicConstraintCAFalse + as +false + to avoid the import of certificates with +Basic Constraints CA Field + set as +False + (not Secure). "allowBasicConstraintCAFalse": true @@ -2544,7 +2574,7 @@ Trust for authentication within Cisco ISE trustForClientAuth -Trust for client authentication and Syslog +Trust for client authentication and syslog "trustForClientAuth": false @@ -2552,7 +2582,7 @@ Trust for client authentication and Syslog trustForCertificateBasedAdminAuth -Trust for certificate based Admin authentication +Trust for certificate based admin authentication "trustForCertificateBasedAdminAuth": false @@ -2560,7 +2590,7 @@ Trust for certificate based Admin authentication trustForCiscoServicesAuth -Trust for authentication of Cisco Services +Trust for authentication of Cisco services "trustForCiscoServicesAuth": false @@ -2575,16 +2605,17 @@ Validate extensions for trust certificate -NOTE: -If name is not set, a default name with the following format is used: +NOTE +: If +name + is not set, a default name with the following format is used where +nnnnn + is a unique number: common-name#issuer#nnnnn + You can always change the friendly name later by editing the certificate. - where -"nnnnn" - is a unique number. You can always change the friendly name later by editing the certificate. - - You must choose how this certificate is trusted in Cisco ISE. The objective here is to distinguish between certificates that are used for trust within an Cisco ISE deployment and public certificates that are used to trust Cisco services. Typically, you do not want to use a given certificate for both purposes. +You must choose how this certificate is trusted in Cisco ISE. The objective here is to distinguish between certificates that are used for trust within a Cisco ISE deployment and public certificates that are used to trust Cisco services. We recommend not using a given certificate for both purposes. @@ -2609,7 +2640,7 @@ Client authentication and Syslog Use "trustForClientAuth":true - if the certificate is to be used for authentication of endpoints that contact Cisco ISE over the EAP protocol. Also check this box if certificate is used to trust a Syslog server. Make sure to have keyCertSign bit asserted under KeyUsage extension for this certificate. + if the certificate is to be used for authentication of endpoints that contact Cisco ISE over the EAP protocol. This is also used if the certificate is used to trust a Syslog server. Make sure to have keyCertSign bit asserted under KeyUsage extension for this certificate. Note: "" can be set true only if the "trustForIseAuth" has been set true. @@ -2621,7 +2652,12 @@ Use "trustForCertificateBasedAdminAuth":true if the certificate is used for trust within Cisco ISE, such as for secure communication between Cisco ISE nodes Note: - "trustForCertificateBasedAdminAuth" can be set true only if "trustForIseAuth" and "trustForClientAuth" are true. +trustForCertificateBasedAdminAuth + can be set true only if both +trustForIseAuth + and +trustForClientAuth + are true. @@ -2667,14 +2703,13 @@ func (s *CertificatesService) ImportTrustCert(requestCertificatesImportTrustCert } -//Alias of ImportTrustCert Add root certificate to the Cisco ISE truststore. +// Alias of ImportTrustCert Add root certificate to the Cisco ISE truststore func (s *CertificatesService) ImportTrustCertificate(requestCertificatesImportTrustCert *RequestCertificatesImportTrustCert) (*ResponseCertificatesImportTrustCert, *resty.Response, error) { return s.ImportTrustCert(requestCertificatesImportTrustCert) } -//UpdateSystemCert Update data for existing system certificate. +//UpdateSystemCert Update data for existing system certificate /* - Update a System Certificate. NOTE: @@ -2683,7 +2718,7 @@ Renewing a certificate causes an application server restart on the selected node NOTE: Request parameters accepting True and False as input can be replaced by 1 and 0 respectively. -Following parameters are used in POST body +Following parameters are used in the POST body @@ -2779,28 +2814,27 @@ Portal Group Tag for using certificate with portal role allowReplacementOfPortalGroupTag -* required +*required -Allow Replacement of Portal Group Tag (required). +Allow Replacement of Portal Group Tag. "allowReplacementOfPortalGroupTag": true -allowRoleTransferForSameSubjec -* required -t +allowRoleTransferForSameSubject +*required -Allow transfer of roles to certificates with same subject (required). +Allow transfer of roles to certificates with same subject. "allowRoleTransferForSameSubject": true allowPortalTagTransferForSameSubject -* required +*required -Acquire group tag of the matching certificate (required). +Acquire group tag of the matching certificate. "allowPortalTagTransferForSameSubject": true @@ -2857,7 +2891,7 @@ False Enabling Admin role for this certificate causes an application server restart on the selected node. Note: - Make sure required Certificate Chain is imported under Trusted Certificates + Make sure that the required certificate chain is imported under Trusted Certificates @@ -2867,7 +2901,7 @@ False Only one system certificate can be used for EAP. Assigning EAP to this certificate removes the assignment from another certificate. Note: - Make sure required Certificate Chain is imported under Trusted Certificates + Make sure that the required certificate chain is imported under Trusted Certificates @@ -2877,7 +2911,7 @@ False Only one system certificate can be used for DTLS. Assigning DTLS to this certificate removes the assignment from another certificate. Note: - Make sure required Certificate Chain is imported under Trusted Certificates + Make sure that the required certificate chain is imported under Trusted Certificates @@ -2885,16 +2919,16 @@ SAML False -SAML cannot be used with other Usage. Enabling SAML unchecks all other Usage. +SAML cannot be used with other usage. Enabling SAML unchecks all other usage. Note: - Make sure required Certificate Chain is imported under Trusted Certificates + Make sure that the required certificate chain is imported under Trusted Certificates @param id id path parameter. ID of the System Certificate to be updated -@param hostName hostName path parameter. Name of Host whose certificate needs to be updated +@param hostName hostName path parameter. Name of host whose certificate needs to be updated */ func (s *CertificatesService) UpdateSystemCert(id string, hostName string, requestCertificatesUpdateSystemCert *RequestCertificatesUpdateSystemCert) (*ResponseCertificatesUpdateSystemCert, *resty.Response, error) { setHost(s.client, "_ui") @@ -2930,18 +2964,15 @@ func (s *CertificatesService) UpdateSystemCert(id string, hostName string, reque } -//Alias of UpdateSystemCert Update data for existing system certificate. +// Alias of UpdateSystemCert Update data for existing system certificate func (s *CertificatesService) UpdateSystemCertificate(id string, hostName string, requestCertificatesUpdateSystemCert *RequestCertificatesUpdateSystemCert) (*ResponseCertificatesUpdateSystemCert, *resty.Response, error) { return s.UpdateSystemCert(id, hostName, requestCertificatesUpdateSystemCert) } -//UpdateTrustedCertificate Update trust certificate already present in Cisco ISE trust store. +//UpdateTrustedCertificate Update the trust certificate already present in the Cisco ISE trust store /* - Update a trusted certificate present in Cisco ISE trust store. - -Following parameters are used in PUT request body - + The following parameters are used in the PUT request body @@ -2956,9 +2987,9 @@ EXAMPLE name -* required +*required -Friendly name of the certificate (required). +Friendly name of the certificate. "name": "Trust Certificate" @@ -3167,7 +3198,7 @@ Use "trustForClientAuth":true if the certificate is to be used for authentication of endpoints that contact Cisco ISE over the EAP protocol. Also check this box if certificate is used to trust a Syslog server. Make sure to have keyCertSign bit asserted under KeyUsage extension for this certificate. Note: - "trustForClientAuth" can be set true only if the "trustForIseAuth" has been set true. + "trustForClientAuth" can be set true only if "trustForIseAuth" has been set true. @@ -3207,6 +3238,7 @@ Use "enableOCSPValidation":true to validate the certificate against OCSP service mentioned in the field selectedOCSPService +. @@ -3214,9 +3246,13 @@ OCSP Service name Use "selectedOCSPService":"Name of OCSP Service" - Name of the OCSP service against which the certificate should be validated + to mention the OCSP service name against which the certificate should be validated. Note: - "selectedOCSPService" value is used if "enableOCSPValidation" has been set true. + +selectedOCSPService + value is used if +enableOCSPValidation + has been set true. @@ -3224,9 +3260,13 @@ Reject the request if OCSP returns UNKNOWN status Use "rejectIfNoStatusFromOCSP":true - to reject the certificate if the OCSP service returns UNKNOWN status + to reject the certificate if the OCSP service returns UNKNOWN status. Note: - "rejectIfNoStatusFromOCSP:true" can be used only if "enableOCSPValidation" has been set true. + +"rejectIfNoStatusFromOCSP":true + can be used only if the parameter +enableOCSPValidation + has been set true. @@ -3236,7 +3276,11 @@ Reject the request if OCSP Responder is unreachable "rejectIfUnreachableFromOCSP":true to reject the certificate if the OCSP service is unreachable. Note: - "rejectIfUnreachableFromOCSP:true" can be used only if "enableOCSPValidation" has been set true. + +"rejectIfUnreachableFromOCSP":true + can be used only if +enableOCSPValidation + has been set true. @@ -3274,13 +3318,21 @@ Note: Retrieve CRL time Use -"automaticCRLUpdate":true and automaticCRLUpdatePeriod, automaticCRLUpdatePeriod +"automaticCRLUpdate":true +, +automaticCRLUpdatePeriod +, and +automaticCRLUpdatePeriod to set the time before which CRL is automatically retrieved prior to expiration Use -"nonAutomaticCRLUpdatePeriod, nonAutomaticCRLUpdateUnits +nonAutomaticCRLUpdatePeriod + and +nonAutomaticCRLUpdateUnits to set the time period for CRL retrieval in loop. Note: - All the above fields can be used only if "downloadCRL" has been set true. + All the above fields can be used only if +"downloadCRL" + has been set true. @@ -3290,7 +3342,12 @@ Use "crlDownloadFailureRetries" and "crlDownloadFailureRetriesUnits" to set retry time period if CRL download fails Note: - "crlDownloadFailureRetries" and "crlDownloadFailureRetriesUnits" can be used only if "downloadCRL" has been set true. +crlDownloadFailureRetries + and +crlDownloadFailureRetriesUnits + can be used only if +downloadCRL + has been set true. @@ -3300,7 +3357,10 @@ Use "enableServerIdentityCheck":true to verify that HTTPS or LDAPS server certificate name fits the configured server URL Note: - "enableServerIdentityCheck:true" can be used only if "downloadCRL" has been set true. +"enableServerIdentityCheck":true + can be used only if +downloadCRL + has been set true. @@ -3310,7 +3370,9 @@ Use "authenticateBeforeCRLReceived":true to bypass CRL Verification if CRL is not Received Note: - "authenticateBeforeCRLReceived:true" can be used only if "downloadCRL" has been set true. +"authenticateBeforeCRLReceived":true can be used only if +downloadCRL + has been set true. @@ -3320,7 +3382,10 @@ Ignore that CRL is not yet valid or has expired "ignoreCRLExpiration":true to ignore if CRL is not yet valid or expired Note: - "ignoreCRLExpiration:true" can be used only if "downloadCRL" has been set true. +"ignoreCRLExpiration":true + can be used only if +downloadCRL + has been set true. @@ -3329,7 +3394,6 @@ Note: Note: boolean properties accept integers values as well, with 0 considered as false and other values being considered as true - @param id id path parameter. ID of the trust certificate */ func (s *CertificatesService) UpdateTrustedCertificate(id string, requestCertificatesUpdateTrustedCertificate *RequestCertificatesUpdateTrustedCertificate) (*ResponseCertificatesUpdateTrustedCertificate, *resty.Response, error) { @@ -3365,8 +3429,8 @@ func (s *CertificatesService) UpdateTrustedCertificate(id string, requestCertifi } -//DeleteCsr Delete Certificate Signing Request (CSR) by ID -/* This API deletes a Certificate Signing Request of a particular node based on given HostName and ID. +//DeleteCsr Delete the certificate signing request for a given ID +/* This API deletes the certificate signing request of a particular node based on a given hostname and ID. @param hostName hostName path parameter. Name of the host of which CSR's should be deleted @param id id path parameter. ID of the Certificate Signing Request to be deleted @@ -3401,16 +3465,16 @@ func (s *CertificatesService) DeleteCsr(hostName string, id string) (*ResponseCe } -//Alias of DeleteCsr Delete Certificate Signing Request (CSR) by ID +// Alias of DeleteCsr Delete the certificate signing request for a given ID func (s *CertificatesService) DeleteCsrByID(hostName string, id string) (*ResponseCertificatesDeleteCsr, *resty.Response, error) { return s.DeleteCsr(hostName, id) } //DeleteSystemCertificateByID Delete System Certificate by ID and hostname -/* This API deletes a System Certificate of a particular node based on given HostName and ID. +/* This API deletes a system certificate of a particular node based on the given hostname and ID. -@param hostName hostName path parameter. Name of the host from which System Certificate needs to be deleted -@param id id path parameter. ID of the System Certificate to be deleted +@param hostName hostName path parameter. Name of the host from which system certificate needs to be deleted +@param id id path parameter. ID of the system certificate to be deleted */ func (s *CertificatesService) DeleteSystemCertificateByID(hostName string, id string) (*ResponseCertificatesDeleteSystemCertificateByID, *resty.Response, error) { setHost(s.client, "_ui") @@ -3442,7 +3506,7 @@ func (s *CertificatesService) DeleteSystemCertificateByID(hostName string, id st } -//DeleteTrustedCertificateByID Delete Trusted Certificate by ID +//DeleteTrustedCertificateByID Delete a trusted certificate based on a given ID /* This API deletes a Trust Certificate from Trusted Certificate Store based on a given ID. @param id id path parameter. ID of the Trusted Certificate to be deleted diff --git a/sdk/configuration.go b/sdk/configuration.go index 734dd5d..1c2a5d1 100644 --- a/sdk/configuration.go +++ b/sdk/configuration.go @@ -28,7 +28,7 @@ type RequestConfigurationUpdateConfiguration struct { */ func (s *ConfigurationService) GetConfiguration() (*ResponseConfigurationGetConfiguration, *resty.Response, error) { - setHost(s.client, "_main") + setHost(s.client, "_ui") path := "/api/v1/lsd/updateLsdSettings" setCSRFToken(s.client) @@ -60,7 +60,7 @@ func (s *ConfigurationService) GetConfiguration() (*ResponseConfigurationGetConf */ func (s *ConfigurationService) UpdateConfiguration(requestConfigurationUpdateConfiguration *RequestConfigurationUpdateConfiguration) (*ResponseConfigurationUpdateConfiguration, *resty.Response, error) { - setHost(s.client, "_main") + setHost(s.client, "_ui") path := "/api/v1/lsd/updateLsdSettings" setCSRFToken(s.client) diff --git a/sdk/custom_attributes.go b/sdk/custom_attributes.go new file mode 100644 index 0000000..170cd72 --- /dev/null +++ b/sdk/custom_attributes.go @@ -0,0 +1,195 @@ +package isegosdk + +import ( + "fmt" + "strings" + + "github.com/go-resty/resty/v2" +) + +type CustomAttributesService service + +type ResponseCustomAttributesList []ResponseItemCustomAttributesList // Array of ResponseCustomAttributesList + +type ResponseItemCustomAttributesList struct { + AttributeName string `json:"attributeName,omitempty"` // + AttributeType string `json:"attributeType,omitempty"` // +} + +// # Review unknown case +// # Review unknown case + +type ResponseCustomAttributesGet struct { + AttributeName string `json:"attributeName,omitempty"` // + AttributeType string `json:"attributeType,omitempty"` // +} + +// # Review unknown case + +type RequestCustomAttributesCreateCustomAttribute struct { + AttributeName string `json:"attributeName,omitempty"` // + AttributeType string `json:"attributeType,omitempty"` // +} + +type RequestCustomAttributesRename struct { + CurrentName string `json:"currentName,omitempty"` // + NewName string `json:"newName,omitempty"` // +} + +//List Get all custom attributes +/* Get all custom attributes + + */ +func (s *CustomAttributesService) List() (*ResponseCustomAttributesList, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/endpoint-custom-attribute" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseCustomAttributesList{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation List") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseCustomAttributesList) + return result, response, err + +} + +//Get Get custom attribute by name +/* Get custom attribute by name + +@param name name path parameter. Name of the custom attribute +*/ +func (s *CustomAttributesService) Get(name string) (*ResponseCustomAttributesGet, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/endpoint-custom-attribute/{name}" + path = strings.Replace(path, "{name}", fmt.Sprintf("%v", name), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseCustomAttributesGet{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation Get") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseCustomAttributesGet) + return result, response, err + +} + +//CreateCustomAttribute Create Custom Attribute +/* Create Custom Attribute + + */ +func (s *CustomAttributesService) CreateCustomAttribute(requestCustomAttributesCreateCustomAttribute *RequestCustomAttributesCreateCustomAttribute) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/endpoint-custom-attribute" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestCustomAttributesCreateCustomAttribute). + SetError(&Error). + Post(path) + + if err != nil { + return nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return response, fmt.Errorf("error with operation CreateCustomAttribute") + } + + return response, err + +} + +//Rename rename custom attribute +/* rename custom attribute + + */ +func (s *CustomAttributesService) Rename(requestCustomAttributesRename *RequestCustomAttributesRename) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/endpoint-custom-attribute/rename" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestCustomAttributesRename). + SetError(&Error). + Post(path) + + if err != nil { + return nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return response, fmt.Errorf("error with operation Rename") + } + + return response, err + +} + +//Delete Delete custom attribute by name +/* Delete custom attribute by name + +@param name name path parameter. The name of the custom attribute +*/ +func (s *CustomAttributesService) Delete(name string) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/endpoint-custom-attribute/{name}" + path = strings.Replace(path, "{name}", fmt.Sprintf("%v", name), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetError(&Error). + Delete(path) + + if err != nil { + return nil, err + + } + + if response.IsError() { + return response, fmt.Errorf("error with operation Delete") + } + + getCSFRToken(response.Header()) + + return response, err + +} diff --git a/sdk/duo_identity_sync.go b/sdk/duo_identity_sync.go new file mode 100644 index 0000000..eb15841 --- /dev/null +++ b/sdk/duo_identity_sync.go @@ -0,0 +1,423 @@ +package isegosdk + +import ( + "fmt" + "strings" + + "github.com/go-resty/resty/v2" +) + +type DuoIDentitySyncService service + +type ResponseDuoIDentitySyncGetIDentitysync struct { + Response *[]ResponseDuoIDentitySyncGetIDentitysyncResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseDuoIDentitySyncGetIDentitysyncResponse struct { + AdGroups *int `json:"adGroups,omitempty"` // Number of Active Directory Groups + Destination string `json:"destination,omitempty"` // Destination of Identitysync (Mfa Provider) + LastSync string `json:"lastSync,omitempty"` // Time of the last Sync + Name string `json:"name,omitempty"` // Name of the Identitysync configuration + Source string `json:"source,omitempty"` // Source of the Identitysync (Active Directory) + SyncStatus string `json:"syncStatus,omitempty"` // +} + +// # Review unknown case +// # Review unknown case +// # Review unknown case +// # Review unknown case + +type ResponseDuoIDentitySyncGetIDentitysyncBySyncName struct { + Response *ResponseDuoIDentitySyncGetIDentitysyncBySyncNameResponse `json:"response,omitempty"` // Identitysync configuration information + Version string `json:"version,omitempty"` // +} + +type ResponseDuoIDentitySyncGetIDentitysyncBySyncNameResponse struct { + IDentitySync *ResponseDuoIDentitySyncGetIDentitysyncBySyncNameResponseIDentitySync `json:"identitySync,omitempty"` // Identitysync configuration +} + +type ResponseDuoIDentitySyncGetIDentitysyncBySyncNameResponseIDentitySync struct { + AdGroups *[]ResponseDuoIDentitySyncGetIDentitysyncBySyncNameResponseIDentitySyncAdGroups `json:"adGroups,omitempty"` // + Configurations *ResponseDuoIDentitySyncGetIDentitysyncBySyncNameResponseIDentitySyncConfigurations `json:"configurations,omitempty"` // + LastSync string `json:"lastSync,omitempty"` // Time of the last Sync + SyncName string `json:"syncName,omitempty"` // Name of the Identitysync config + SyncSchedule *ResponseDuoIDentitySyncGetIDentitysyncBySyncNameResponseIDentitySyncSyncSchedule `json:"syncSchedule,omitempty"` // + SyncStatus string `json:"syncStatus,omitempty"` // +} + +type ResponseDuoIDentitySyncGetIDentitysyncBySyncNameResponseIDentitySyncAdGroups struct { + Name string `json:"name,omitempty"` // Active Directory Group ID + Sid string `json:"sid,omitempty"` // Active Directory Group Security Identifier (SID) + Source string `json:"source,omitempty"` // Source of the Active Directory Group +} + +type ResponseDuoIDentitySyncGetIDentitysyncBySyncNameResponseIDentitySyncConfigurations struct { + ActiveDirectories *[]ResponseDuoIDentitySyncGetIDentitysyncBySyncNameResponseIDentitySyncConfigurationsActiveDirectories `json:"activeDirectories,omitempty"` // +} + +type ResponseDuoIDentitySyncGetIDentitysyncBySyncNameResponseIDentitySyncConfigurationsActiveDirectories struct { + DirectoryID string `json:"directoryID,omitempty"` // Active Directory ID + Domain string `json:"domain,omitempty"` // Active Directory domain name + Name string `json:"name,omitempty"` // Name of the Active Directory +} + +type ResponseDuoIDentitySyncGetIDentitysyncBySyncNameResponseIDentitySyncSyncSchedule struct { + Interval *int `json:"interval,omitempty"` // Frequency of the sync schedule + IntervalUnit string `json:"intervalUnit,omitempty"` // Unit of the time interval + SchedulerSync string `json:"schedulerSync,omitempty"` // Type of Sync Schedule - If "Recurring", please specify schedule details + StartDate string `json:"startDate,omitempty"` // Start date and start time of the sync schedule +} + +// # Review unknown case +// # Review unknown case + +type RequestDuoIDentitySyncCreateIDentitysync struct { + IDentitySync *RequestDuoIDentitySyncCreateIDentitysyncIDentitySync `json:"identitySync,omitempty"` // Identitysync config information format +} + +type RequestDuoIDentitySyncCreateIDentitysyncIDentitySync struct { + AdGroups *[]RequestDuoIDentitySyncCreateIDentitysyncIDentitySyncAdGroups `json:"adGroups,omitempty"` // + Configurations *RequestDuoIDentitySyncCreateIDentitysyncIDentitySyncConfigurations `json:"configurations,omitempty"` // + LastSync string `json:"lastSync,omitempty"` // Time of the last Sync + SyncName string `json:"syncName,omitempty"` // Name of the Identitysync configuration + SyncSchedule *RequestDuoIDentitySyncCreateIDentitysyncIDentitySyncSyncSchedule `json:"syncSchedule,omitempty"` // + SyncStatus string `json:"syncStatus,omitempty"` // +} + +type RequestDuoIDentitySyncCreateIDentitysyncIDentitySyncAdGroups struct { + Name string `json:"name,omitempty"` // Active Directory Group ID + Source string `json:"source,omitempty"` // Source of the Active Directory Group +} + +type RequestDuoIDentitySyncCreateIDentitysyncIDentitySyncConfigurations struct { + ActiveDirectories *[]RequestDuoIDentitySyncCreateIDentitysyncIDentitySyncConfigurationsActiveDirectories `json:"activeDirectories,omitempty"` // +} + +type RequestDuoIDentitySyncCreateIDentitysyncIDentitySyncConfigurationsActiveDirectories struct { + DirectoryID string `json:"directoryID,omitempty"` // Active Directory ID + Domain string `json:"domain,omitempty"` // Active Directory domain name + Name string `json:"name,omitempty"` // Name of the Active Directory +} + +type RequestDuoIDentitySyncCreateIDentitysyncIDentitySyncSyncSchedule struct { + Interval *int `json:"interval,omitempty"` // Frequency of the sync schedule + IntervalUnit string `json:"intervalUnit,omitempty"` // Unit of the time interval + SchedulerSync string `json:"schedulerSync,omitempty"` // Type of Sync Schedule - If "Recurring", please specify schedule details + StartDate string `json:"startDate,omitempty"` // Start date and start time of the sync schedule +} + +type RequestDuoIDentitySyncUpdateStatus struct { + ErrorList *[]RequestDuoIDentitySyncUpdateStatusErrorList `json:"errorList,omitempty"` // + Status string `json:"status,omitempty"` // status of sync +} + +type RequestDuoIDentitySyncUpdateStatusErrorList struct { + Reason string `json:"reason,omitempty"` // Reason user failed sync + User *RequestDuoIDentitySyncUpdateStatusErrorListUser `json:"user,omitempty"` // User to be synced to Duo +} + +type RequestDuoIDentitySyncUpdateStatusErrorListUser struct { + Directoryname string `json:"directoryname,omitempty"` // active directory that duo user is contained in + Email string `json:"email,omitempty"` // email of Duo user + Firstname string `json:"firstname,omitempty"` // first name of Duo user + Groupname string `json:"groupname,omitempty"` // acrive directory group that duo user is contained in + Lastname string `json:"lastname,omitempty"` // last name of duo user + Notes string `json:"notes,omitempty"` // notes of Duo user + Realname string `json:"realname,omitempty"` // realname of Duo user + Status string `json:"status,omitempty"` // status of Duo user + Username string `json:"username,omitempty"` // username of Duo user +} + +type RequestDuoIDentitySyncUpdateIDentitysyncBySyncName struct { + IDentitySync *RequestDuoIDentitySyncUpdateIDentitysyncBySyncNameIDentitySync `json:"identitySync,omitempty"` // Identitysync config information format +} + +type RequestDuoIDentitySyncUpdateIDentitysyncBySyncNameIDentitySync struct { + AdGroups *[]RequestDuoIDentitySyncUpdateIDentitysyncBySyncNameIDentitySyncAdGroups `json:"adGroups,omitempty"` // + Configurations *RequestDuoIDentitySyncUpdateIDentitysyncBySyncNameIDentitySyncConfigurations `json:"configurations,omitempty"` // + LastSync string `json:"lastSync,omitempty"` // Time of the last Sync + SyncName string `json:"syncName,omitempty"` // Name of the Identitysync configuration + SyncSchedule *RequestDuoIDentitySyncUpdateIDentitysyncBySyncNameIDentitySyncSyncSchedule `json:"syncSchedule,omitempty"` // + SyncStatus string `json:"syncStatus,omitempty"` // +} + +type RequestDuoIDentitySyncUpdateIDentitysyncBySyncNameIDentitySyncAdGroups struct { + Name string `json:"name,omitempty"` // Active Directory Group ID + Source string `json:"source,omitempty"` // Source of the Active Directory Group +} + +type RequestDuoIDentitySyncUpdateIDentitysyncBySyncNameIDentitySyncConfigurations struct { + ActiveDirectories *[]RequestDuoIDentitySyncUpdateIDentitysyncBySyncNameIDentitySyncConfigurationsActiveDirectories `json:"activeDirectories,omitempty"` // +} + +type RequestDuoIDentitySyncUpdateIDentitysyncBySyncNameIDentitySyncConfigurationsActiveDirectories struct { + DirectoryID string `json:"directoryID,omitempty"` // Active Directory ID + Domain string `json:"domain,omitempty"` // Active Directory domain name + Name string `json:"name,omitempty"` // Name of the Active Directory +} + +type RequestDuoIDentitySyncUpdateIDentitysyncBySyncNameIDentitySyncSyncSchedule struct { + Interval *int `json:"interval,omitempty"` // Frequency of the sync schedule + IntervalUnit string `json:"intervalUnit,omitempty"` // Unit of the time interval + SchedulerSync string `json:"schedulerSync,omitempty"` // Type of Sync Schedule - If "Recurring", please specify schedule details + StartDate string `json:"startDate,omitempty"` // Start date and start time of the sync schedule +} + +//GetIDentitysync Get the list of all Identitysync configurations +/* Duo-IdentitySync Get the list of all Identitysync configurations + + */ +func (s *DuoIDentitySyncService) GetIDentitysync() (*ResponseDuoIDentitySyncGetIDentitysync, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-identitysync/identitysync" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseDuoIDentitySyncGetIDentitysync{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetIdentitysync") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseDuoIDentitySyncGetIDentitysync) + return result, response, err + +} + +//CancelSync Cancel the Sync between the ActiveDirectory and the Mfa Provider +/* Cancel the sync between the Active Directory and the corresponding Mfa provider associated with this Identitysync config. + +@param syncName syncName path parameter. Name of the Identitysync configuration used to cancel sync. +*/ +func (s *DuoIDentitySyncService) CancelSync(syncName string) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-identitysync/identitysync/sync/cancel/{syncName}" + path = strings.Replace(path, "{syncName}", fmt.Sprintf("%v", syncName), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetError(&Error). + Get(path) + + if err != nil { + return nil, err + + } + + if response.IsError() { + return response, fmt.Errorf("error with operation CancelSync") + } + + getCSFRToken(response.Header()) + + return response, err + +} + +//Sync Initiate the Sync between the ActiveDirectory and the Mfa Provider +/* Initiate the sync between the Active Directory and the corresponding Mfa provider associated with this Identitysync config. + +@param syncName syncName path parameter. Name of the Identitysync configuration used to initiate sync. +*/ +func (s *DuoIDentitySyncService) Sync(syncName string) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-identitysync/identitysync/sync/{syncName}" + path = strings.Replace(path, "{syncName}", fmt.Sprintf("%v", syncName), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetError(&Error). + Get(path) + + if err != nil { + return nil, err + + } + + if response.IsError() { + return response, fmt.Errorf("error with operation Sync") + } + + getCSFRToken(response.Header()) + + return response, err + +} + +//GetIDentitysyncBySyncName Get the specified Identitysync config +/* Duo-IdentitySync Get the Identitysync config specified in the syncName + +@param syncName syncName path parameter. This name is used to update, delete or retrieve the specific Identitysync config. +*/ +func (s *DuoIDentitySyncService) GetIDentitysyncBySyncName(syncName string) (*ResponseDuoIDentitySyncGetIDentitysyncBySyncName, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-identitysync/identitysync/{syncName}" + path = strings.Replace(path, "{syncName}", fmt.Sprintf("%v", syncName), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseDuoIDentitySyncGetIDentitysyncBySyncName{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetIdentitysyncBySyncName") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseDuoIDentitySyncGetIDentitysyncBySyncName) + return result, response, err + +} + +//CreateIDentitysync Create a new IdentitySync configuration +/* Duo-IdentitySync Create a new IdentitySync configuration + + */ +func (s *DuoIDentitySyncService) CreateIDentitysync(requestDuoIDentitySyncCreateIdentitysync *RequestDuoIDentitySyncCreateIDentitysync) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-identitysync/identitysync" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestDuoIDentitySyncCreateIdentitysync). + SetError(&Error). + Post(path) + + if err != nil { + return nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return response, fmt.Errorf("error with operation CreateIdentitysync") + } + + return response, err + +} + +//UpdateStatus Update Identity Sync Status +/* duo-identitysync update sync status. + +@param syncName syncName path parameter. Sync connection to be updated +*/ +func (s *DuoIDentitySyncService) UpdateStatus(syncName string, requestDuoIDentitySyncUpdateStatus *RequestDuoIDentitySyncUpdateStatus) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-identitysync/identitysync/status/{syncName}" + path = strings.Replace(path, "{syncName}", fmt.Sprintf("%v", syncName), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestDuoIDentitySyncUpdateStatus). + SetError(&Error). + Put(path) + + if err != nil { + return nil, err + + } + + if response.IsError() { + return response, fmt.Errorf("error with operation UpdateStatus") + } + + getCSFRToken(response.Header()) + + return response, err + +} + +//UpdateIDentitysyncBySyncName Update the specified Identitysync configuration +/* Duo-Identitysync Update the Identitysync configuration specified in the syncName. + +@param syncName syncName path parameter. This name is used to update, delete or retrieve the specific Identitysync config. +*/ +func (s *DuoIDentitySyncService) UpdateIDentitysyncBySyncName(syncName string, requestDuoIDentitySyncUpdateIdentitysyncBySyncName *RequestDuoIDentitySyncUpdateIDentitysyncBySyncName) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-identitysync/identitysync/{syncName}" + path = strings.Replace(path, "{syncName}", fmt.Sprintf("%v", syncName), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestDuoIDentitySyncUpdateIdentitysyncBySyncName). + SetError(&Error). + Put(path) + + if err != nil { + return nil, err + + } + + if response.IsError() { + return response, fmt.Errorf("error with operation UpdateIdentitysyncBySyncName") + } + + getCSFRToken(response.Header()) + + return response, err + +} + +//DeleteIDentitySyncBySyncName Delete the specified Identitysync configuration +/* Duo-Identitysync Delete the Identitysync configuration specified in the syncName. + +@param syncName syncName path parameter. This name is used to update, delete or retrieve the specific Identitysync config. +*/ +func (s *DuoIDentitySyncService) DeleteIDentitySyncBySyncName(syncName string) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-identitysync/identitysync/{syncName}" + path = strings.Replace(path, "{syncName}", fmt.Sprintf("%v", syncName), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetError(&Error). + Delete(path) + + if err != nil { + return nil, err + + } + + if response.IsError() { + return response, fmt.Errorf("error with operation DeleteIdentitySyncBySyncName") + } + + getCSFRToken(response.Header()) + + return response, err + +} diff --git a/sdk/duo_mfa.go b/sdk/duo_mfa.go new file mode 100644 index 0000000..35297c6 --- /dev/null +++ b/sdk/duo_mfa.go @@ -0,0 +1,327 @@ +package isegosdk + +import ( + "fmt" + "strings" + + "github.com/go-resty/resty/v2" +) + +type DuoMfaService service + +type ResponseDuoMfaGetMfa struct { + Response *[]ResponseDuoMfaGetMfaResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseDuoMfaGetMfaResponse struct { + APIHostName string `json:"apiHostName,omitempty"` // Duo API HostName + IDentitySync string `json:"identitySync,omitempty"` // Name of the Identity Sync configuration + Name string `json:"name,omitempty"` // Name of the Duo-MFA configuration + Provider string `json:"provider,omitempty"` // Name of the Mfa provider + Type string `json:"type,omitempty"` // Protocol type for which Mfa can be used +} + +// # Review unknown case +// # Review unknown case + +type ResponseDuoMfaGetMfaByconnectionName struct { + Response *ResponseDuoMfaGetMfaByconnectionNameResponse `json:"response,omitempty"` // Duo-MFA configuration information + Version string `json:"version,omitempty"` // +} + +type ResponseDuoMfaGetMfaByconnectionNameResponse struct { + Mfa *ResponseDuoMfaGetMfaByconnectionNameResponseMfa `json:"mfa,omitempty"` // Duo-MFA information +} + +type ResponseDuoMfaGetMfaByconnectionNameResponseMfa struct { + AccountConfigurations *ResponseDuoMfaGetMfaByconnectionNameResponseMfaAccountConfigurations `json:"accountConfigurations,omitempty"` // + ConnectionName string `json:"connectionName,omitempty"` // Name of the Duo-MFA configuration + Description string `json:"description,omitempty"` // Description of the Duo-MFA configuration + IDentitySync string `json:"identitySync,omitempty"` // Name of the Identity Sync configuration + Type string `json:"type,omitempty"` // Protocol type for which this Duo-MFA can be used +} + +type ResponseDuoMfaGetMfaByconnectionNameResponseMfaAccountConfigurations struct { + AdminAPI *ResponseDuoMfaGetMfaByconnectionNameResponseMfaAccountConfigurationsAdminAPI `json:"adminApi,omitempty"` // API type + APIHostName string `json:"apiHostName,omitempty"` // Duo API HostName + AuthenticationAPI *ResponseDuoMfaGetMfaByconnectionNameResponseMfaAccountConfigurationsAuthenticationAPI `json:"authenticationApi,omitempty"` // API type +} + +type ResponseDuoMfaGetMfaByconnectionNameResponseMfaAccountConfigurationsAdminAPI struct { + Ikey string `json:"ikey,omitempty"` // Integration Key + SKey string `json:"sKey,omitempty"` // Secret Key +} + +type ResponseDuoMfaGetMfaByconnectionNameResponseMfaAccountConfigurationsAuthenticationAPI struct { + Ikey string `json:"ikey,omitempty"` // Integration Key + SKey string `json:"sKey,omitempty"` // Secret Key +} + +// # Review unknown case +// # Review unknown case + +type RequestDuoMfaCreateMfa struct { + Mfa *RequestDuoMfaCreateMfaMfa `json:"mfa,omitempty"` // Duo-MFA information +} + +type RequestDuoMfaCreateMfaMfa struct { + AccountConfigurations *RequestDuoMfaCreateMfaMfaAccountConfigurations `json:"accountConfigurations,omitempty"` // + ConnectionName string `json:"connectionName,omitempty"` // Name of the Duo-MFA configuration + Description string `json:"description,omitempty"` // Description of the Duo-MFA configuration + IDentitySync string `json:"identitySync,omitempty"` // Name of the Identity Sync configuration + Type string `json:"type,omitempty"` // Protocol type for which this Duo-MFA can be used +} + +type RequestDuoMfaCreateMfaMfaAccountConfigurations struct { + AdminAPI *RequestDuoMfaCreateMfaMfaAccountConfigurationsAdminAPI `json:"adminApi,omitempty"` // API type + APIHostName string `json:"apiHostName,omitempty"` // Duo API HostName + AuthenticationAPI *RequestDuoMfaCreateMfaMfaAccountConfigurationsAuthenticationAPI `json:"authenticationApi,omitempty"` // API type +} + +type RequestDuoMfaCreateMfaMfaAccountConfigurationsAdminAPI struct { + Ikey string `json:"ikey,omitempty"` // Integration Key + SKey string `json:"sKey,omitempty"` // Secret Key +} + +type RequestDuoMfaCreateMfaMfaAccountConfigurationsAuthenticationAPI struct { + Ikey string `json:"ikey,omitempty"` // Integration Key + SKey string `json:"sKey,omitempty"` // Secret Key +} + +type RequestDuoMfaTestConnection struct { + AdminAPI *RequestDuoMfaTestConnectionAdminAPI `json:"adminApi,omitempty"` // API type + APIHostName string `json:"apiHostName,omitempty"` // Duo API HostName + AuthenticationAPI *RequestDuoMfaTestConnectionAuthenticationAPI `json:"authenticationApi,omitempty"` // API type +} + +type RequestDuoMfaTestConnectionAdminAPI struct { + Ikey string `json:"ikey,omitempty"` // Integration Key + SKey string `json:"sKey,omitempty"` // Secret Key +} + +type RequestDuoMfaTestConnectionAuthenticationAPI struct { + Ikey string `json:"ikey,omitempty"` // Integration Key + SKey string `json:"sKey,omitempty"` // Secret Key +} + +type RequestDuoMfaUpdateMFaByConnectionName struct { + Mfa *RequestDuoMfaUpdateMFaByConnectionNameMfa `json:"mfa,omitempty"` // Duo-MFA information +} + +type RequestDuoMfaUpdateMFaByConnectionNameMfa struct { + AccountConfigurations *RequestDuoMfaUpdateMFaByConnectionNameMfaAccountConfigurations `json:"accountConfigurations,omitempty"` // + ConnectionName string `json:"connectionName,omitempty"` // Name of the Duo-MFA configuration + Description string `json:"description,omitempty"` // Description of the Duo-MFA configuration + IDentitySync string `json:"identitySync,omitempty"` // Name of the Identity Sync configuration + Type string `json:"type,omitempty"` // Protocol type for which this Duo-MFA can be used +} + +type RequestDuoMfaUpdateMFaByConnectionNameMfaAccountConfigurations struct { + AdminAPI *RequestDuoMfaUpdateMFaByConnectionNameMfaAccountConfigurationsAdminAPI `json:"adminApi,omitempty"` // API type + APIHostName string `json:"apiHostName,omitempty"` // Duo API HostName + AuthenticationAPI *RequestDuoMfaUpdateMFaByConnectionNameMfaAccountConfigurationsAuthenticationAPI `json:"authenticationApi,omitempty"` // API type +} + +type RequestDuoMfaUpdateMFaByConnectionNameMfaAccountConfigurationsAdminAPI struct { + Ikey string `json:"ikey,omitempty"` // Integration Key + SKey string `json:"sKey,omitempty"` // Secret Key +} + +type RequestDuoMfaUpdateMFaByConnectionNameMfaAccountConfigurationsAuthenticationAPI struct { + Ikey string `json:"ikey,omitempty"` // Integration Key + SKey string `json:"sKey,omitempty"` // Secret Key +} + +//GetMfa Get the list of all Duo-MFA configurations +/* Duo-MFA List of Duo-MFA configurations + + */ +func (s *DuoMfaService) GetMfa() (*ResponseDuoMfaGetMfa, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-mfa/mfa" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseDuoMfaGetMfa{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetMfa") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseDuoMfaGetMfa) + return result, response, err + +} + +//GetMfaByconnectionName Get the specified Duo-MFA configuration +/* Duo-MFA Get the Duo-MFA configuration specified in the connectionName. + +@param connectionName connectionName path parameter. This name is used to update, delete or retrieve the specific Duo-MFA configuration. +*/ +func (s *DuoMfaService) GetMfaByconnectionName(connectionName string) (*ResponseDuoMfaGetMfaByconnectionName, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-mfa/mfa/{connectionName}" + path = strings.Replace(path, "{connectionName}", fmt.Sprintf("%v", connectionName), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseDuoMfaGetMfaByconnectionName{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetMfaByconnectionName") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseDuoMfaGetMfaByconnectionName) + return result, response, err + +} + +//CreateMfa Create a new Duo-MFA configuration +/* Duo-MFA Create a new Duo-MFA configuration + + */ +func (s *DuoMfaService) CreateMfa(requestDuoMfaCreateMfa *RequestDuoMfaCreateMfa) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-mfa/mfa" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestDuoMfaCreateMfa). + SetError(&Error). + Post(path) + + if err != nil { + return nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return response, fmt.Errorf("error with operation CreateMfa") + } + + return response, err + +} + +//TestConnection Verify the Auth and Admin API keys of the Duo Host +/* Duo-MFA Verify the Auth and Admin API keys of the Duo Host. + +@param connectionName connectionName path parameter. This name is used to retrieve secret keys for testing connection of the specified Duo-MFA configuration in case none are specified. +*/ +func (s *DuoMfaService) TestConnection(connectionName string, requestDuoMfaTestConnection *RequestDuoMfaTestConnection) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-mfa/mfa/testconnection/{connectionName}" + path = strings.Replace(path, "{connectionName}", fmt.Sprintf("%v", connectionName), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestDuoMfaTestConnection). + SetError(&Error). + Post(path) + + if err != nil { + return nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return response, fmt.Errorf("error with operation TestConnection") + } + + return response, err + +} + +//UpdateMFaByConnectionName Update the specified Duo-MFA configuration +/* Duo-MFA Update the Duo-MFA configuration specified in the connectionName. + +@param connectionName connectionName path parameter. This name is used to update, delete or retrieve the specific Duo-MFA configuration. +*/ +func (s *DuoMfaService) UpdateMFaByConnectionName(connectionName string, requestDuoMfaUpdateMFaByConnectionName *RequestDuoMfaUpdateMFaByConnectionName) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-mfa/mfa/{connectionName}" + path = strings.Replace(path, "{connectionName}", fmt.Sprintf("%v", connectionName), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestDuoMfaUpdateMFaByConnectionName). + SetError(&Error). + Put(path) + + if err != nil { + return nil, err + + } + + if response.IsError() { + return response, fmt.Errorf("error with operation UpdateMFaByConnectionName") + } + + getCSFRToken(response.Header()) + + return response, err + +} + +//DeleteMfaByConnectionName Delete the specified Duo-MFA configuration +/* Duo-MFA Delete the Duo-MFA configuration specified in the connectionName. + +@param connectionName connectionName path parameter. This name is used to update, delete or retrieve the specific Duo-MFA configuration. +*/ +func (s *DuoMfaService) DeleteMfaByConnectionName(connectionName string) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-mfa/mfa/{connectionName}" + path = strings.Replace(path, "{connectionName}", fmt.Sprintf("%v", connectionName), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetError(&Error). + Delete(path) + + if err != nil { + return nil, err + + } + + if response.IsError() { + return response, fmt.Errorf("error with operation DeleteMfaByConnectionName") + } + + getCSFRToken(response.Header()) + + return response, err + +} diff --git a/sdk/edda.go b/sdk/edda.go deleted file mode 100644 index 1ef4f95..0000000 --- a/sdk/edda.go +++ /dev/null @@ -1,518 +0,0 @@ -package isegosdk - -import ( - "fmt" - "strings" - - "github.com/go-resty/resty/v2" -) - -type EddaService service - -type ResponseEddaGetConnectorConfig struct { - Response *[]ResponseEddaGetConnectorConfigResponse `json:"response,omitempty"` // - Version string `json:"version,omitempty"` // -} - -type ResponseEddaGetConnectorConfigResponse struct { - Connector *ResponseEddaGetConnectorConfigResponseConnector `json:"connector,omitempty"` // connectorName -} - -type ResponseEddaGetConnectorConfigResponseConnector struct { - AdditionalProperties *ResponseEddaGetConnectorConfigResponseConnectorAdditionalProperties `json:"additionalProperties,omitempty"` // - Attributes *ResponseEddaGetConnectorConfigResponseConnectorAttributes `json:"attributes,omitempty"` // connectorName - ConnectorName string `json:"connectorName,omitempty"` // connectorName - ConnectorType string `json:"connectorType,omitempty"` // connector Type list - DeltasyncSchedule *ResponseEddaGetConnectorConfigResponseConnectorDeltasyncSchedule `json:"deltasyncSchedule,omitempty"` // - Description string `json:"description,omitempty"` // description - Enabled *bool `json:"enabled,omitempty"` // - FullsyncSchedule *ResponseEddaGetConnectorConfigResponseConnectorFullsyncSchedule `json:"fullsyncSchedule,omitempty"` // - Protocol string `json:"protocol,omitempty"` // protocol - SkipCertificateValidations *bool `json:"skipCertificateValidations,omitempty"` // - URL *ResponseEddaGetConnectorConfigResponseConnectorURL `json:"url,omitempty"` // -} - -type ResponseEddaGetConnectorConfigResponseConnectorAdditionalProperties interface{} - -type ResponseEddaGetConnectorConfigResponseConnectorAttributes struct { - AttributeMapping *[]ResponseEddaGetConnectorConfigResponseConnectorAttributesAttributeMapping `json:"attributeMapping,omitempty"` //

List of feature names

- BulkUniqueIDentifier string `json:"bulkUniqueIdentifier,omitempty"` // uniqueness to identify - TopLevelObject string `json:"topLevelObject,omitempty"` // root level of json - UniqueIDentifier string `json:"uniqueIdentifier,omitempty"` // uniqueness to identify - VersionIDentifier string `json:"versionIdentifier,omitempty"` // version uniqueness to identify -} - -type ResponseEddaGetConnectorConfigResponseConnectorAttributesAttributeMapping struct { - DictionaryAttribute string `json:"dictionaryAttribute,omitempty"` // - IncludeInDictionary *bool `json:"includeInDictionary,omitempty"` // - JSONAttribute string `json:"jsonAttribute,omitempty"` // -} - -type ResponseEddaGetConnectorConfigResponseConnectorDeltasyncSchedule struct { - Interval *int `json:"interval,omitempty"` // run at interval (hours) - IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units - StartDate string `json:"startDate,omitempty"` // start date and Time -} - -type ResponseEddaGetConnectorConfigResponseConnectorFullsyncSchedule struct { - Interval *int `json:"interval,omitempty"` // run at interval (hours) - IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units - StartDate string `json:"startDate,omitempty"` // start date and Time -} - -type ResponseEddaGetConnectorConfigResponseConnectorURL struct { - AccessKey string `json:"accessKey,omitempty"` // accesskey - AuthenticationType string `json:"authenticationType,omitempty"` // authentication Type list - BulkURL string `json:"bulkUrl,omitempty"` // bulkUrl - ClientID string `json:"clientId,omitempty"` // clientid - ClientSecret string `json:"clientSecret,omitempty"` // clientsecret - IncrementalURL string `json:"incrementalUrl,omitempty"` // incrementalUrl - Password string `json:"password,omitempty"` // password - RefreshToken string `json:"refreshToken,omitempty"` // refreshtoken - TokenHeader string `json:"tokenHeader,omitempty"` // tokenHeader - UserName string `json:"userName,omitempty"` // userName -} - -// # Review unknown case - -type ResponseEddaGetConnectorConfigByConnectorName struct { - Response *ResponseEddaGetConnectorConfigByConnectorNameResponse `json:"response,omitempty"` // ConnectorConfig information format - Version string `json:"version,omitempty"` // -} - -type ResponseEddaGetConnectorConfigByConnectorNameResponse struct { - Connector *ResponseEddaGetConnectorConfigByConnectorNameResponseConnector `json:"connector,omitempty"` // connectorName -} - -type ResponseEddaGetConnectorConfigByConnectorNameResponseConnector struct { - AdditionalProperties *ResponseEddaGetConnectorConfigByConnectorNameResponseConnectorAdditionalProperties `json:"additionalProperties,omitempty"` // - Attributes *ResponseEddaGetConnectorConfigByConnectorNameResponseConnectorAttributes `json:"attributes,omitempty"` // connectorName - ConnectorName string `json:"connectorName,omitempty"` // connectorName - ConnectorType string `json:"connectorType,omitempty"` // connector Type list - DeltasyncSchedule *ResponseEddaGetConnectorConfigByConnectorNameResponseConnectorDeltasyncSchedule `json:"deltasyncSchedule,omitempty"` // - Description string `json:"description,omitempty"` // description - Enabled *bool `json:"enabled,omitempty"` // - FullsyncSchedule *ResponseEddaGetConnectorConfigByConnectorNameResponseConnectorFullsyncSchedule `json:"fullsyncSchedule,omitempty"` // - Protocol string `json:"protocol,omitempty"` // protocol - SkipCertificateValidations *bool `json:"skipCertificateValidations,omitempty"` // - URL *ResponseEddaGetConnectorConfigByConnectorNameResponseConnectorURL `json:"url,omitempty"` // -} - -type ResponseEddaGetConnectorConfigByConnectorNameResponseConnectorAdditionalProperties interface{} - -type ResponseEddaGetConnectorConfigByConnectorNameResponseConnectorAttributes struct { - AttributeMapping *[]ResponseEddaGetConnectorConfigByConnectorNameResponseConnectorAttributesAttributeMapping `json:"attributeMapping,omitempty"` //

List of feature names

- BulkUniqueIDentifier string `json:"bulkUniqueIdentifier,omitempty"` // uniqueness to identify - TopLevelObject string `json:"topLevelObject,omitempty"` // root level of json - UniqueIDentifier string `json:"uniqueIdentifier,omitempty"` // uniqueness to identify - VersionIDentifier string `json:"versionIdentifier,omitempty"` // version uniqueness to identify -} - -type ResponseEddaGetConnectorConfigByConnectorNameResponseConnectorAttributesAttributeMapping struct { - DictionaryAttribute string `json:"dictionaryAttribute,omitempty"` // - IncludeInDictionary *bool `json:"includeInDictionary,omitempty"` // - JSONAttribute string `json:"jsonAttribute,omitempty"` // -} - -type ResponseEddaGetConnectorConfigByConnectorNameResponseConnectorDeltasyncSchedule struct { - Interval *int `json:"interval,omitempty"` // run at interval (hours) - IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units - StartDate string `json:"startDate,omitempty"` // start date and Time -} - -type ResponseEddaGetConnectorConfigByConnectorNameResponseConnectorFullsyncSchedule struct { - Interval *int `json:"interval,omitempty"` // run at interval (hours) - IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units - StartDate string `json:"startDate,omitempty"` // start date and Time -} - -type ResponseEddaGetConnectorConfigByConnectorNameResponseConnectorURL struct { - AccessKey string `json:"accessKey,omitempty"` // accesskey - AuthenticationType string `json:"authenticationType,omitempty"` // authentication Type list - BulkURL string `json:"bulkUrl,omitempty"` // bulkUrl - ClientID string `json:"clientId,omitempty"` // clientid - ClientSecret string `json:"clientSecret,omitempty"` // clientsecret - IncrementalURL string `json:"incrementalUrl,omitempty"` // incrementalUrl - Password string `json:"password,omitempty"` // password - RefreshToken string `json:"refreshToken,omitempty"` // refreshtoken - TokenHeader string `json:"tokenHeader,omitempty"` // tokenHeader - UserName string `json:"userName,omitempty"` // userName -} - -// # Review unknown case -// # Review unknown case - -type ResponseEddaGetEddaDictionaryReferences struct { - Response *ResponseEddaGetEddaDictionaryReferencesResponse `json:"response,omitempty"` // - Version string `json:"version,omitempty"` // -} - -type ResponseEddaGetEddaDictionaryReferencesResponse interface{} - -type ResponseEddaTestConnector struct { - ConnectorName string `json:"connectorName,omitempty"` // connectorName - Data string `json:"data,omitempty"` // Response data - Error string `json:"error,omitempty"` // error - Status string `json:"status,omitempty"` // status of the request - UniqueID string `json:"uniqueID,omitempty"` // uniqueness to identify -} - -type RequestEddaCreateConnectorConfig struct { - Connector *RequestEddaCreateConnectorConfigConnector `json:"connector,omitempty"` // connectorName -} - -type RequestEddaCreateConnectorConfigConnector struct { - AdditionalProperties *RequestEddaCreateConnectorConfigConnectorAdditionalProperties `json:"additionalProperties,omitempty"` // - Attributes *RequestEddaCreateConnectorConfigConnectorAttributes `json:"attributes,omitempty"` // connectorName - ConnectorName string `json:"connectorName,omitempty"` // connectorName - ConnectorType string `json:"connectorType,omitempty"` // connector Type list - DeltasyncSchedule *RequestEddaCreateConnectorConfigConnectorDeltasyncSchedule `json:"deltasyncSchedule,omitempty"` // - Description string `json:"description,omitempty"` // description - Enabled *bool `json:"enabled,omitempty"` // - FullsyncSchedule *RequestEddaCreateConnectorConfigConnectorFullsyncSchedule `json:"fullsyncSchedule,omitempty"` // - Protocol string `json:"protocol,omitempty"` // protocol - SkipCertificateValidations *bool `json:"skipCertificateValidations,omitempty"` // - URL *RequestEddaCreateConnectorConfigConnectorURL `json:"url,omitempty"` // -} - -type RequestEddaCreateConnectorConfigConnectorAdditionalProperties interface{} - -type RequestEddaCreateConnectorConfigConnectorAttributes struct { - AttributeMapping *[]RequestEddaCreateConnectorConfigConnectorAttributesAttributeMapping `json:"attributeMapping,omitempty"` //

List of feature names

- BulkUniqueIDentifier string `json:"bulkUniqueIdentifier,omitempty"` // uniqueness to identify - TopLevelObject string `json:"topLevelObject,omitempty"` // root level of json - UniqueIDentifier string `json:"uniqueIdentifier,omitempty"` // uniqueness to identify - VersionIDentifier string `json:"versionIdentifier,omitempty"` // version uniqueness to identify -} - -type RequestEddaCreateConnectorConfigConnectorAttributesAttributeMapping struct { - DictionaryAttribute string `json:"dictionaryAttribute,omitempty"` // - IncludeInDictionary *bool `json:"includeInDictionary,omitempty"` // - JSONAttribute string `json:"jsonAttribute,omitempty"` // -} - -type RequestEddaCreateConnectorConfigConnectorDeltasyncSchedule struct { - Interval *int `json:"interval,omitempty"` // run at interval (hours) - IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units - StartDate string `json:"startDate,omitempty"` // start date and Time -} - -type RequestEddaCreateConnectorConfigConnectorFullsyncSchedule struct { - Interval *int `json:"interval,omitempty"` // run at interval (hours) - IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units - StartDate string `json:"startDate,omitempty"` // start date and Time -} - -type RequestEddaCreateConnectorConfigConnectorURL struct { - AccessKey string `json:"accessKey,omitempty"` // accesskey - AuthenticationType string `json:"authenticationType,omitempty"` // authentication Type list - BulkURL string `json:"bulkUrl,omitempty"` // bulkUrl - ClientID string `json:"clientId,omitempty"` // clientid - ClientSecret string `json:"clientSecret,omitempty"` // clientsecret - IncrementalURL string `json:"incrementalUrl,omitempty"` // incrementalUrl - Password string `json:"password,omitempty"` // password - RefreshToken string `json:"refreshToken,omitempty"` // refreshtoken - TokenHeader string `json:"tokenHeader,omitempty"` // tokenHeader - UserName string `json:"userName,omitempty"` // userName -} - -type RequestEddaUpdateConnectorConfigByConnectorName struct { - Connector *RequestEddaUpdateConnectorConfigByConnectorNameConnector `json:"connector,omitempty"` // connectorName -} - -type RequestEddaUpdateConnectorConfigByConnectorNameConnector struct { - AdditionalProperties *RequestEddaUpdateConnectorConfigByConnectorNameConnectorAdditionalProperties `json:"additionalProperties,omitempty"` // - Attributes *RequestEddaUpdateConnectorConfigByConnectorNameConnectorAttributes `json:"attributes,omitempty"` // connectorName - ConnectorName string `json:"connectorName,omitempty"` // connectorName - ConnectorType string `json:"connectorType,omitempty"` // connector Type list - DeltasyncSchedule *RequestEddaUpdateConnectorConfigByConnectorNameConnectorDeltasyncSchedule `json:"deltasyncSchedule,omitempty"` // - Description string `json:"description,omitempty"` // description - Enabled *bool `json:"enabled,omitempty"` // - FullsyncSchedule *RequestEddaUpdateConnectorConfigByConnectorNameConnectorFullsyncSchedule `json:"fullsyncSchedule,omitempty"` // - Protocol string `json:"protocol,omitempty"` // protocol - SkipCertificateValidations *bool `json:"skipCertificateValidations,omitempty"` // - URL *RequestEddaUpdateConnectorConfigByConnectorNameConnectorURL `json:"url,omitempty"` // -} - -type RequestEddaUpdateConnectorConfigByConnectorNameConnectorAdditionalProperties interface{} - -type RequestEddaUpdateConnectorConfigByConnectorNameConnectorAttributes struct { - AttributeMapping *[]RequestEddaUpdateConnectorConfigByConnectorNameConnectorAttributesAttributeMapping `json:"attributeMapping,omitempty"` //

List of feature names

- BulkUniqueIDentifier string `json:"bulkUniqueIdentifier,omitempty"` // uniqueness to identify - TopLevelObject string `json:"topLevelObject,omitempty"` // root level of json - UniqueIDentifier string `json:"uniqueIdentifier,omitempty"` // uniqueness to identify - VersionIDentifier string `json:"versionIdentifier,omitempty"` // version uniqueness to identify -} - -type RequestEddaUpdateConnectorConfigByConnectorNameConnectorAttributesAttributeMapping struct { - DictionaryAttribute string `json:"dictionaryAttribute,omitempty"` // - IncludeInDictionary *bool `json:"includeInDictionary,omitempty"` // - JSONAttribute string `json:"jsonAttribute,omitempty"` // -} - -type RequestEddaUpdateConnectorConfigByConnectorNameConnectorDeltasyncSchedule struct { - Interval *int `json:"interval,omitempty"` // run at interval (hours) - IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units - StartDate string `json:"startDate,omitempty"` // start date and Time -} - -type RequestEddaUpdateConnectorConfigByConnectorNameConnectorFullsyncSchedule struct { - Interval *int `json:"interval,omitempty"` // run at interval (hours) - IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units - StartDate string `json:"startDate,omitempty"` // start date and Time -} - -type RequestEddaUpdateConnectorConfigByConnectorNameConnectorURL struct { - AccessKey string `json:"accessKey,omitempty"` // accesskey - AuthenticationType string `json:"authenticationType,omitempty"` // authentication Type list - BulkURL string `json:"bulkUrl,omitempty"` // bulkUrl - ClientID string `json:"clientId,omitempty"` // clientid - ClientSecret string `json:"clientSecret,omitempty"` // clientsecret - IncrementalURL string `json:"incrementalUrl,omitempty"` // incrementalUrl - Password string `json:"password,omitempty"` // password - RefreshToken string `json:"refreshToken,omitempty"` // refreshtoken - TokenHeader string `json:"tokenHeader,omitempty"` // tokenHeader - UserName string `json:"userName,omitempty"` // userName -} - -type RequestEddaTestConnector struct { - AuthType string `json:"authType,omitempty"` // authentication Type list - AuthValues *RequestEddaTestConnectorAuthValues `json:"authValues,omitempty"` // Request to test Connector - ConnectorName string `json:"connectorName,omitempty"` // connectorName - ResponseParsing string `json:"responseParsing,omitempty"` // uniqueness to identify - UniqueID string `json:"uniqueID,omitempty"` // uniqueness to identify - URL string `json:"url,omitempty"` // bulkUrl -} - -type RequestEddaTestConnectorAuthValues struct { - Password string `json:"password,omitempty"` // password - UserName string `json:"userName,omitempty"` // userName -} - -//GetConnectorConfig get All connectorConfig information -/* EDDA Get ALL connectorConfig information - - */ -func (s *EddaService) GetConnectorConfig() (*ResponseEddaGetConnectorConfig, *resty.Response, error) { - setHost(s.client, "_ui") - path := "/api/v1/edda/connector-config" - - setCSRFToken(s.client) - response, err := s.client.R(). - SetHeader("Content-Type", "application/json"). - SetHeader("Accept", "application/json"). - SetResult(&ResponseEddaGetConnectorConfig{}). - SetError(&Error). - Get(path) - - if err != nil { - return nil, nil, err - - } - - if response.IsError() { - return nil, response, fmt.Errorf("error with operation GetConnectorConfig") - } - - getCSFRToken(response.Header()) - - result := response.Result().(*ResponseEddaGetConnectorConfig) - return result, response, err - -} - -//GetConnectorConfigByConnectorName get connectorConfig information -/* EDDA Get connectorConfig information based on ConnectorName - -@param connectorName connectorName path parameter. update or delete or retrieve the connector config. -*/ -func (s *EddaService) GetConnectorConfigByConnectorName(connectorName string) (*ResponseEddaGetConnectorConfigByConnectorName, *resty.Response, error) { - setHost(s.client, "_ui") - path := "/api/v1/edda/connector-config/{connectorName}" - path = strings.Replace(path, "{connectorName}", fmt.Sprintf("%v", connectorName), -1) - - setCSRFToken(s.client) - response, err := s.client.R(). - SetHeader("Content-Type", "application/json"). - SetHeader("Accept", "application/json"). - SetResult(&ResponseEddaGetConnectorConfigByConnectorName{}). - SetError(&Error). - Get(path) - - if err != nil { - return nil, nil, err - - } - - if response.IsError() { - return nil, response, fmt.Errorf("error with operation GetConnectorConfigByConnectorName") - } - - getCSFRToken(response.Header()) - - result := response.Result().(*ResponseEddaGetConnectorConfigByConnectorName) - return result, response, err - -} - -//GetEddaDictionaryReferences Get a map of references to EDDA dictionaries -/* EDDA Get a map of references to EDDA dictionaries - - */ -func (s *EddaService) GetEddaDictionaryReferences() (*ResponseEddaGetEddaDictionaryReferences, *resty.Response, error) { - setHost(s.client, "_ui") - path := "/api/v1/edda/dictionary-references" - - setCSRFToken(s.client) - response, err := s.client.R(). - SetHeader("Content-Type", "application/json"). - SetHeader("Accept", "application/json"). - SetResult(&ResponseEddaGetEddaDictionaryReferences{}). - SetError(&Error). - Get(path) - - if err != nil { - return nil, nil, err - - } - - if response.IsError() { - return nil, response, fmt.Errorf("error with operation GetEddaDictionaryReferences") - } - - getCSFRToken(response.Header()) - - result := response.Result().(*ResponseEddaGetEddaDictionaryReferences) - return result, response, err - -} - -//CreateConnectorConfig Configure connectorconfig information -/* EDDA Configure connectorconfig information. - - */ -func (s *EddaService) CreateConnectorConfig(requestEddaCreateConnectorConfig *RequestEddaCreateConnectorConfig) (*resty.Response, error) { - setHost(s.client, "_ui") - path := "/api/v1/edda/connector-config" - - setCSRFToken(s.client) - response, err := s.client.R(). - SetHeader("Content-Type", "application/json"). - SetHeader("Accept", "application/json"). - SetBody(requestEddaCreateConnectorConfig). - SetError(&Error). - Post(path) - - if err != nil { - return nil, err - - } - - getCSFRToken(response.Header()) - if response.IsError() { - return response, fmt.Errorf("error with operation CreateConnectorConfig") - } - - return response, err - -} - -//TestConnector test the Connector -/* EDDA test the Connector. - - */ -func (s *EddaService) TestConnector(requestEddaTestConnector *RequestEddaTestConnector) (*ResponseEddaTestConnector, *resty.Response, error) { - setHost(s.client, "_ui") - path := "/api/v1/edda/test-connector" - - setCSRFToken(s.client) - response, err := s.client.R(). - SetHeader("Content-Type", "application/json"). - SetHeader("Accept", "application/json"). - SetBody(requestEddaTestConnector). - SetResult(&ResponseEddaTestConnector{}). - SetError(&Error). - Post(path) - - if err != nil { - if err.Error() == emptyStringToJSONError { - return &ResponseEddaTestConnector{}, response, nil - } - return nil, nil, err - - } - - getCSFRToken(response.Header()) - if response.IsError() { - return nil, response, fmt.Errorf("error with operation TestConnector") - } - - result := response.Result().(*ResponseEddaTestConnector) - return result, response, err - -} - -//UpdateConnectorConfigByConnectorName update connectoConfig information -/* EDDA update Configure connectorConfig information based on ConnectorName. - -@param connectorName connectorName path parameter. update or delete or retrieve the connector config. -*/ -func (s *EddaService) UpdateConnectorConfigByConnectorName(connectorName string, requestEddaUpdateConnectorConfigByConnectorName *RequestEddaUpdateConnectorConfigByConnectorName) (*resty.Response, error) { - setHost(s.client, "_ui") - path := "/api/v1/edda/connector-config/{connectorName}" - path = strings.Replace(path, "{connectorName}", fmt.Sprintf("%v", connectorName), -1) - - setCSRFToken(s.client) - response, err := s.client.R(). - SetHeader("Content-Type", "application/json"). - SetHeader("Accept", "application/json"). - SetBody(requestEddaUpdateConnectorConfigByConnectorName). - SetError(&Error). - Put(path) - - if err != nil { - return nil, err - - } - - if response.IsError() { - return response, fmt.Errorf("error with operation UpdateConnectorConfigByConnectorName") - } - - getCSFRToken(response.Header()) - - return response, err - -} - -//DeleteConnectorConfigByConnectorName Delete connectorConfig information -/* EDDA Delete Configure connectorConfig information based on ConnectorName. - -@param connectorName connectorName path parameter. update or delete or retrieve the connector config. -*/ -func (s *EddaService) DeleteConnectorConfigByConnectorName(connectorName string) (*resty.Response, error) { - setHost(s.client, "_ui") - path := "/api/v1/edda/connector-config/{connectorName}" - path = strings.Replace(path, "{connectorName}", fmt.Sprintf("%v", connectorName), -1) - - setCSRFToken(s.client) - response, err := s.client.R(). - SetHeader("Content-Type", "application/json"). - SetHeader("Accept", "application/json"). - SetError(&Error). - Delete(path) - - if err != nil { - return nil, err - - } - - if response.IsError() { - return response, fmt.Errorf("error with operation DeleteConnectorConfigByConnectorName") - } - - getCSFRToken(response.Header()) - - return response, err - -} diff --git a/sdk/enable_mfa.go b/sdk/enable_mfa.go new file mode 100644 index 0000000..0841672 --- /dev/null +++ b/sdk/enable_mfa.go @@ -0,0 +1,50 @@ +package isegosdk + +import ( + "fmt" + + "github.com/go-resty/resty/v2" +) + +type EnableMFAService service + +// # Review unknown case + +type RequestEnableMFAEnableMFA struct { + Mfa *RequestEnableMFAEnableMFAMfa `json:"mfa,omitempty"` // Duo-MFA feature config +} + +type RequestEnableMFAEnableMFAMfa struct { + Status *bool `json:"status,omitempty"` // Enable or Disable MFA +} + +//EnableMFA Enable MFA feature +/* Enable or Disable MFA feature + + */ +func (s *EnableMFAService) EnableMFA(requestEnableMFAEnableMFA *RequestEnableMFAEnableMFA) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-mfa/enable" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestEnableMFAEnableMFA). + SetError(&Error). + Put(path) + + if err != nil { + return nil, err + + } + + if response.IsError() { + return response, fmt.Errorf("error with operation EnableMFA") + } + + getCSFRToken(response.Header()) + + return response, err + +} diff --git a/sdk/endpoint_stop_replication_service.go b/sdk/endpoint_stop_replication_service.go new file mode 100644 index 0000000..07dc3dd --- /dev/null +++ b/sdk/endpoint_stop_replication_service.go @@ -0,0 +1,99 @@ +package isegosdk + +import ( + "fmt" + + "github.com/go-resty/resty/v2" +) + +type EndpointStopReplicationServiceService service + +type ResponseEndpointStopReplicationServiceGetStopReplicationStatus struct { + Response *ResponseEndpointStopReplicationServiceGetStopReplicationStatusResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseEndpointStopReplicationServiceGetStopReplicationStatusResponse struct { + IsEnabled *bool `json:"isEnabled,omitempty"` // +} + +type ResponseEndpointStopReplicationServiceSetStopReplicationService struct { + Success *ResponseEndpointStopReplicationServiceSetStopReplicationServiceSuccess `json:"success,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseEndpointStopReplicationServiceSetStopReplicationServiceSuccess struct { + Message string `json:"message,omitempty"` // +} + +type RequestEndpointStopReplicationServiceSetStopReplicationService struct { + IsEnabled *bool `json:"isEnabled,omitempty"` // +} + +//GetStopReplicationStatus Retrieve the status of Endpoint stop replication Service +/* This API retrieves the status of Endpoint stop replication Service + + */ +func (s *EndpointStopReplicationServiceService) GetStopReplicationStatus() (*ResponseEndpointStopReplicationServiceGetStopReplicationStatus, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/stop-replication" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseEndpointStopReplicationServiceGetStopReplicationStatus{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetStopReplicationStatus") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseEndpointStopReplicationServiceGetStopReplicationStatus) + return result, response, err + +} + +//SetStopReplicationService Update the status of Endpoint stop replication Service +/* This API updates the status of Endpoint stop replication Service. + + */ +func (s *EndpointStopReplicationServiceService) SetStopReplicationService(requestEndpointStopReplicationServiceSetStopReplicationService *RequestEndpointStopReplicationServiceSetStopReplicationService) (*ResponseEndpointStopReplicationServiceSetStopReplicationService, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/stop-replication" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestEndpointStopReplicationServiceSetStopReplicationService). + SetResult(&ResponseEndpointStopReplicationServiceSetStopReplicationService{}). + SetError(&Error). + Put(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseEndpointStopReplicationServiceSetStopReplicationService{}, response, nil + } + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation SetStopReplicationService") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseEndpointStopReplicationServiceSetStopReplicationService) + return result, response, err + +} diff --git a/sdk/endpoints.go b/sdk/endpoints.go new file mode 100644 index 0000000..fc0c7ee --- /dev/null +++ b/sdk/endpoints.go @@ -0,0 +1,640 @@ +package isegosdk + +import ( + "fmt" + "strings" + + "github.com/go-resty/resty/v2" + "github.com/google/go-querystring/query" +) + +type EndpointsService service + +type List1QueryParams struct { + Page int `url:"page,omitempty"` //Page number + Size int `url:"size,omitempty"` //Number of objects returned per page + Sort string `url:"sort,omitempty"` //sort type - asc or desc + SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted + Filter string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the 'filterType=or' query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
+ FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter +} + +type ResponseEndpointsList1 []ResponseItemEndpointsList1 // Array of ResponseEndpointsList_1 + +type ResponseItemEndpointsList1 struct { + ConnectedLinks *ResponseItemEndpointsList1ConnectedLinks `json:"connectedLinks,omitempty"` // + CustomAttributes *ResponseItemEndpointsList1CustomAttributes `json:"customAttributes,omitempty"` // + Description string `json:"description,omitempty"` // + DeviceType string `json:"deviceType,omitempty"` // + GroupID string `json:"groupId,omitempty"` // + HardwareRevision string `json:"hardwareRevision,omitempty"` // + ID string `json:"id,omitempty"` // + IDentityStore string `json:"identityStore,omitempty"` // + IDentityStoreID string `json:"identityStoreId,omitempty"` // + IPAddress string `json:"ipAddress,omitempty"` // + Mac string `json:"mac,omitempty"` // + MdmAttributes *ResponseItemEndpointsList1MdmAttributes `json:"mdmAttributes,omitempty"` // + Name string `json:"name,omitempty"` // + PortalUser string `json:"portalUser,omitempty"` // + ProductID string `json:"productId,omitempty"` // + ProfileID string `json:"profileId,omitempty"` // + Protocol string `json:"protocol,omitempty"` // + SerialNumber string `json:"serialNumber,omitempty"` // + SoftwareRevision string `json:"softwareRevision,omitempty"` // + StaticGroupAssignment *bool `json:"staticGroupAssignment,omitempty"` // + StaticProfileAssignment *bool `json:"staticProfileAssignment,omitempty"` // + Vendor string `json:"vendor,omitempty"` // +} + +type ResponseItemEndpointsList1ConnectedLinks interface{} + +type ResponseItemEndpointsList1CustomAttributes map[string]interface{} + +type ResponseItemEndpointsList1MdmAttributes interface{} + +// # Review unknown case + +type ResponseEndpointsUpdateBulkEndPoints struct { + ID string `json:"id,omitempty"` // +} + +type ResponseEndpointsCreateBulkEndPoints struct { + ID string `json:"id,omitempty"` // +} + +type ResponseEndpointsDeleteBulkEndPoints struct { + ID string `json:"id,omitempty"` // +} + +type ResponseEndpointsGetDeviceTypeSummary []ResponseItemEndpointsGetDeviceTypeSummary // Array of ResponseEndpointsGetDeviceTypeSummary + +type ResponseItemEndpointsGetDeviceTypeSummary struct { + DeviceType string `json:"deviceType,omitempty"` // + Total string `json:"total,omitempty"` // +} + +type ResponseEndpointsGet1 struct { + ConnectedLinks *ResponseEndpointsGet1ConnectedLinks `json:"connectedLinks,omitempty"` // + CustomAttributes *ResponseEndpointsGet1CustomAttributes `json:"customAttributes,omitempty"` // + Description string `json:"description,omitempty"` // + DeviceType string `json:"deviceType,omitempty"` // + GroupID string `json:"groupId,omitempty"` // + HardwareRevision string `json:"hardwareRevision,omitempty"` // + ID string `json:"id,omitempty"` // + IDentityStore string `json:"identityStore,omitempty"` // + IDentityStoreID string `json:"identityStoreId,omitempty"` // + IPAddress string `json:"ipAddress,omitempty"` // + Mac string `json:"mac,omitempty"` // + MdmAttributes *ResponseEndpointsGet1MdmAttributes `json:"mdmAttributes,omitempty"` // + Name string `json:"name,omitempty"` // + PortalUser string `json:"portalUser,omitempty"` // + ProductID string `json:"productId,omitempty"` // + ProfileID string `json:"profileId,omitempty"` // + Protocol string `json:"protocol,omitempty"` // + SerialNumber string `json:"serialNumber,omitempty"` // + SoftwareRevision string `json:"softwareRevision,omitempty"` // + StaticGroupAssignment *bool `json:"staticGroupAssignment,omitempty"` // + StaticProfileAssignment *bool `json:"staticProfileAssignment,omitempty"` // + Vendor string `json:"vendor,omitempty"` // +} + +type ResponseEndpointsGet1ConnectedLinks interface{} + +type ResponseEndpointsGet1CustomAttributes map[string]interface{} + +type ResponseEndpointsGet1MdmAttributes interface{} + +type ResponseEndpointsUpdateEndpoint struct { + ConnectedLinks *ResponseEndpointsUpdateEndpointConnectedLinks `json:"connectedLinks,omitempty"` // + CustomAttributes *ResponseEndpointsUpdateEndpointCustomAttributes `json:"customAttributes,omitempty"` // + Description string `json:"description,omitempty"` // + DeviceType string `json:"deviceType,omitempty"` // + GroupID string `json:"groupId,omitempty"` // + HardwareRevision string `json:"hardwareRevision,omitempty"` // + ID string `json:"id,omitempty"` // + IDentityStore string `json:"identityStore,omitempty"` // + IDentityStoreID string `json:"identityStoreId,omitempty"` // + IPAddress string `json:"ipAddress,omitempty"` // + Mac string `json:"mac,omitempty"` // + MdmAttributes *ResponseEndpointsUpdateEndpointMdmAttributes `json:"mdmAttributes,omitempty"` // + Name string `json:"name,omitempty"` // + PortalUser string `json:"portalUser,omitempty"` // + ProductID string `json:"productId,omitempty"` // + ProfileID string `json:"profileId,omitempty"` // + Protocol string `json:"protocol,omitempty"` // + SerialNumber string `json:"serialNumber,omitempty"` // + SoftwareRevision string `json:"softwareRevision,omitempty"` // + StaticGroupAssignment *bool `json:"staticGroupAssignment,omitempty"` // + StaticProfileAssignment *bool `json:"staticProfileAssignment,omitempty"` // + Vendor string `json:"vendor,omitempty"` // +} + +type ResponseEndpointsUpdateEndpointConnectedLinks interface{} + +type ResponseEndpointsUpdateEndpointCustomAttributes map[string]interface{} + +type ResponseEndpointsUpdateEndpointMdmAttributes interface{} + +// # Review unknown case + +type ResponseEndpointsCreateEndPointTask struct { + ID string `json:"id,omitempty"` // +} + +type RequestEndpointsCreateEndPoint struct { + ConnectedLinks *RequestEndpointsCreateEndPointConnectedLinks `json:"connectedLinks,omitempty"` // + CustomAttributes *RequestEndpointsCreateEndPointCustomAttributes `json:"customAttributes,omitempty"` // + Description string `json:"description,omitempty"` // + DeviceType string `json:"deviceType,omitempty"` // + GroupID string `json:"groupId,omitempty"` // + HardwareRevision string `json:"hardwareRevision,omitempty"` // + ID string `json:"id,omitempty"` // + IDentityStore string `json:"identityStore,omitempty"` // + IDentityStoreID string `json:"identityStoreId,omitempty"` // + IPAddress string `json:"ipAddress,omitempty"` // + Mac string `json:"mac,omitempty"` // + MdmAttributes *RequestEndpointsCreateEndPointMdmAttributes `json:"mdmAttributes,omitempty"` // + Name string `json:"name,omitempty"` // + PortalUser string `json:"portalUser,omitempty"` // + ProductID string `json:"productId,omitempty"` // + ProfileID string `json:"profileId,omitempty"` // + Protocol string `json:"protocol,omitempty"` // + SerialNumber string `json:"serialNumber,omitempty"` // + SoftwareRevision string `json:"softwareRevision,omitempty"` // + StaticGroupAssignment *bool `json:"staticGroupAssignment,omitempty"` // + StaticProfileAssignment *bool `json:"staticProfileAssignment,omitempty"` // + Vendor string `json:"vendor,omitempty"` // +} + +type RequestEndpointsCreateEndPointConnectedLinks interface{} + +type RequestEndpointsCreateEndPointCustomAttributes map[string]interface{} + +type RequestEndpointsCreateEndPointMdmAttributes interface{} + +type RequestEndpointsUpdateBulkEndPoints []RequestItemEndpointsUpdateBulkEndPoints // Array of RequestEndpointsUpdateBulkEndPoints + +type RequestItemEndpointsUpdateBulkEndPoints struct { + ConnectedLinks *RequestItemEndpointsUpdateBulkEndPointsConnectedLinks `json:"connectedLinks,omitempty"` // + CustomAttributes *RequestItemEndpointsUpdateBulkEndPointsCustomAttributes `json:"customAttributes,omitempty"` // + Description string `json:"description,omitempty"` // + DeviceType string `json:"deviceType,omitempty"` // + GroupID string `json:"groupId,omitempty"` // + HardwareRevision string `json:"hardwareRevision,omitempty"` // + ID string `json:"id,omitempty"` // + IDentityStore string `json:"identityStore,omitempty"` // + IDentityStoreID string `json:"identityStoreId,omitempty"` // + IPAddress string `json:"ipAddress,omitempty"` // + Mac string `json:"mac,omitempty"` // + MdmAttributes *RequestItemEndpointsUpdateBulkEndPointsMdmAttributes `json:"mdmAttributes,omitempty"` // + Name string `json:"name,omitempty"` // + PortalUser string `json:"portalUser,omitempty"` // + ProductID string `json:"productId,omitempty"` // + ProfileID string `json:"profileId,omitempty"` // + Protocol string `json:"protocol,omitempty"` // + SerialNumber string `json:"serialNumber,omitempty"` // + SoftwareRevision string `json:"softwareRevision,omitempty"` // + StaticGroupAssignment *bool `json:"staticGroupAssignment,omitempty"` // + StaticProfileAssignment *bool `json:"staticProfileAssignment,omitempty"` // + Vendor string `json:"vendor,omitempty"` // +} + +type RequestItemEndpointsUpdateBulkEndPointsConnectedLinks interface{} + +type RequestItemEndpointsUpdateBulkEndPointsCustomAttributes map[string]interface{} + +type RequestItemEndpointsUpdateBulkEndPointsMdmAttributes interface{} + +type RequestEndpointsCreateBulkEndPoints []RequestItemEndpointsCreateBulkEndPoints // Array of RequestEndpointsCreateBulkEndPoints + +type RequestItemEndpointsCreateBulkEndPoints struct { + ConnectedLinks *RequestItemEndpointsCreateBulkEndPointsConnectedLinks `json:"connectedLinks,omitempty"` // + CustomAttributes *RequestItemEndpointsCreateBulkEndPointsCustomAttributes `json:"customAttributes,omitempty"` // + Description string `json:"description,omitempty"` // + DeviceType string `json:"deviceType,omitempty"` // + GroupID string `json:"groupId,omitempty"` // + HardwareRevision string `json:"hardwareRevision,omitempty"` // + ID string `json:"id,omitempty"` // + IDentityStore string `json:"identityStore,omitempty"` // + IDentityStoreID string `json:"identityStoreId,omitempty"` // + IPAddress string `json:"ipAddress,omitempty"` // + Mac string `json:"mac,omitempty"` // + MdmAttributes *RequestItemEndpointsCreateBulkEndPointsMdmAttributes `json:"mdmAttributes,omitempty"` // + Name string `json:"name,omitempty"` // + PortalUser string `json:"portalUser,omitempty"` // + ProductID string `json:"productId,omitempty"` // + ProfileID string `json:"profileId,omitempty"` // + Protocol string `json:"protocol,omitempty"` // + SerialNumber string `json:"serialNumber,omitempty"` // + SoftwareRevision string `json:"softwareRevision,omitempty"` // + StaticGroupAssignment *bool `json:"staticGroupAssignment,omitempty"` // + StaticProfileAssignment *bool `json:"staticProfileAssignment,omitempty"` // + Vendor string `json:"vendor,omitempty"` // +} + +type RequestItemEndpointsCreateBulkEndPointsConnectedLinks interface{} + +type RequestItemEndpointsCreateBulkEndPointsCustomAttributes map[string]interface{} + +type RequestItemEndpointsCreateBulkEndPointsMdmAttributes interface{} + +type RequestEndpointsUpdateEndpoint struct { + ConnectedLinks *RequestEndpointsUpdateEndpointConnectedLinks `json:"connectedLinks,omitempty"` // + CustomAttributes *RequestEndpointsUpdateEndpointCustomAttributes `json:"customAttributes,omitempty"` // + Description string `json:"description,omitempty"` // + DeviceType string `json:"deviceType,omitempty"` // + GroupID string `json:"groupId,omitempty"` // + HardwareRevision string `json:"hardwareRevision,omitempty"` // + ID string `json:"id,omitempty"` // + IDentityStore string `json:"identityStore,omitempty"` // + IDentityStoreID string `json:"identityStoreId,omitempty"` // + IPAddress string `json:"ipAddress,omitempty"` // + Mac string `json:"mac,omitempty"` // + MdmAttributes *RequestEndpointsUpdateEndpointMdmAttributes `json:"mdmAttributes,omitempty"` // + Name string `json:"name,omitempty"` // + PortalUser string `json:"portalUser,omitempty"` // + ProductID string `json:"productId,omitempty"` // + ProfileID string `json:"profileId,omitempty"` // + Protocol string `json:"protocol,omitempty"` // + SerialNumber string `json:"serialNumber,omitempty"` // + SoftwareRevision string `json:"softwareRevision,omitempty"` // + StaticGroupAssignment *bool `json:"staticGroupAssignment,omitempty"` // + StaticProfileAssignment *bool `json:"staticProfileAssignment,omitempty"` // + Vendor string `json:"vendor,omitempty"` // +} + +type RequestEndpointsUpdateEndpointConnectedLinks interface{} + +type RequestEndpointsUpdateEndpointCustomAttributes map[string]interface{} + +type RequestEndpointsUpdateEndpointMdmAttributes interface{} + +type RequestEndpointsCreateEndPointTask struct { + ConnectedLinks *RequestEndpointsCreateEndPointTaskConnectedLinks `json:"connectedLinks,omitempty"` // + CustomAttributes *RequestEndpointsCreateEndPointTaskCustomAttributes `json:"customAttributes,omitempty"` // + Description string `json:"description,omitempty"` // + DeviceType string `json:"deviceType,omitempty"` // + GroupID string `json:"groupId,omitempty"` // + HardwareRevision string `json:"hardwareRevision,omitempty"` // + ID string `json:"id,omitempty"` // + IDentityStore string `json:"identityStore,omitempty"` // + IDentityStoreID string `json:"identityStoreId,omitempty"` // + IPAddress string `json:"ipAddress,omitempty"` // + Mac string `json:"mac,omitempty"` // + MdmAttributes *RequestEndpointsCreateEndPointTaskMdmAttributes `json:"mdmAttributes,omitempty"` // + Name string `json:"name,omitempty"` // + PortalUser string `json:"portalUser,omitempty"` // + ProductID string `json:"productId,omitempty"` // + ProfileID string `json:"profileId,omitempty"` // + Protocol string `json:"protocol,omitempty"` // + SerialNumber string `json:"serialNumber,omitempty"` // + SoftwareRevision string `json:"softwareRevision,omitempty"` // + StaticGroupAssignment *bool `json:"staticGroupAssignment,omitempty"` // + StaticProfileAssignment *bool `json:"staticProfileAssignment,omitempty"` // + Vendor string `json:"vendor,omitempty"` // +} + +type RequestEndpointsCreateEndPointTaskConnectedLinks interface{} + +type RequestEndpointsCreateEndPointTaskCustomAttributes map[string]interface{} + +type RequestEndpointsCreateEndPointTaskMdmAttributes interface{} + +//List1 Get all endpoints +/* Get all endpoints + +@param list_1QueryParams Filtering parameter +*/ +func (s *EndpointsService) List1(list_1QueryParams *List1QueryParams) (*ResponseEndpointsList1, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/endpoint" + + queryString, _ := query.Values(list_1QueryParams) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetQueryString(queryString.Encode()).SetResult(&ResponseEndpointsList1{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation List1") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseEndpointsList1) + return result, response, err + +} + +//GetDeviceTypeSummary Get aggregate of device types +/* Get aggregate of device types + + */ +func (s *EndpointsService) GetDeviceTypeSummary() (*ResponseEndpointsGetDeviceTypeSummary, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/endpoint/deviceType/summary" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseEndpointsGetDeviceTypeSummary{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetDeviceTypeSummary") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseEndpointsGetDeviceTypeSummary) + return result, response, err + +} + +//Get1 Get endpoint by id or MAC +/* Get endpoint by id or MAC + +@param value value path parameter. The id or MAC of the endpoint +*/ +func (s *EndpointsService) Get1(value string) (*ResponseEndpointsGet1, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/endpoint/{value}" + path = strings.Replace(path, "{value}", fmt.Sprintf("%v", value), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseEndpointsGet1{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation Get1") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseEndpointsGet1) + return result, response, err + +} + +//CreateEndPoint Create Endpoint +/* Create Endpoint + + */ +func (s *EndpointsService) CreateEndPoint(requestEndpointsCreateEndPoint *RequestEndpointsCreateEndPoint) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/endpoint" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestEndpointsCreateEndPoint). + SetError(&Error). + Post(path) + + if err != nil { + return nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return response, fmt.Errorf("error with operation CreateEndPoint") + } + + return response, err + +} + +//CreateBulkEndPoints Create Endpoint in bulk +/* Create Endpoint in bulk + + */ +func (s *EndpointsService) CreateBulkEndPoints(requestEndpointsCreateBulkEndPoints *RequestEndpointsCreateBulkEndPoints) (*ResponseEndpointsCreateBulkEndPoints, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/endpoint/bulk" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestEndpointsCreateBulkEndPoints). + SetResult(&ResponseEndpointsCreateBulkEndPoints{}). + SetError(&Error). + Post(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseEndpointsCreateBulkEndPoints{}, response, nil + } + return nil, nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return nil, response, fmt.Errorf("error with operation CreateBulkEndPoints") + } + + result := response.Result().(*ResponseEndpointsCreateBulkEndPoints) + return result, response, err + +} + +//CreateEndPointTask Create Endpoint task +/* Create Endpoint task + + */ +func (s *EndpointsService) CreateEndPointTask(requestEndpointsCreateEndPointTask *RequestEndpointsCreateEndPointTask) (*ResponseEndpointsCreateEndPointTask, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/endpointTask" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestEndpointsCreateEndPointTask). + SetResult(&ResponseEndpointsCreateEndPointTask{}). + SetError(&Error). + Post(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseEndpointsCreateEndPointTask{}, response, nil + } + return nil, nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return nil, response, fmt.Errorf("error with operation CreateEndPointTask") + } + + result := response.Result().(*ResponseEndpointsCreateEndPointTask) + return result, response, err + +} + +//UpdateBulkEndPoints Update Endpoint in bulk +/* Update Endpoint in bulk + + */ +func (s *EndpointsService) UpdateBulkEndPoints(requestEndpointsUpdateBulkEndPoints *RequestEndpointsUpdateBulkEndPoints) (*ResponseEndpointsUpdateBulkEndPoints, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/endpoint/bulk" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestEndpointsUpdateBulkEndPoints). + SetResult(&ResponseEndpointsUpdateBulkEndPoints{}). + SetError(&Error). + Put(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseEndpointsUpdateBulkEndPoints{}, response, nil + } + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation UpdateBulkEndPoints") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseEndpointsUpdateBulkEndPoints) + return result, response, err + +} + +//UpdateEndpoint Update Endpoint by id or mac +/* Update Endpoint by id or mac + +@param value value path parameter. The id or MAC of the endpoint +*/ +func (s *EndpointsService) UpdateEndpoint(value string, requestEndpointsUpdateEndpoint *RequestEndpointsUpdateEndpoint) (*ResponseEndpointsUpdateEndpoint, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/endpoint/{value}" + path = strings.Replace(path, "{value}", fmt.Sprintf("%v", value), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestEndpointsUpdateEndpoint). + SetResult(&ResponseEndpointsUpdateEndpoint{}). + SetError(&Error). + Put(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseEndpointsUpdateEndpoint{}, response, nil + } + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation UpdateEndpoint") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseEndpointsUpdateEndpoint) + return result, response, err + +} + +//DeleteBulkEndPoints Delete Endpoint in bulk +/* Delete Endpoint in bulk + + */ +func (s *EndpointsService) DeleteBulkEndPoints() (*ResponseEndpointsDeleteBulkEndPoints, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/endpoint/bulk" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseEndpointsDeleteBulkEndPoints{}). + SetError(&Error). + Delete(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation DeleteBulkEndPoints") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseEndpointsDeleteBulkEndPoints) + return result, response, err + +} + +//DeleteEndpoint Delete endpoint by id or mac +/* Delete endpoint by id or mac + +@param value value path parameter. The id or MAC of the endpoint +*/ +func (s *EndpointsService) DeleteEndpoint(value string) (*resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/endpoint/{value}" + path = strings.Replace(path, "{value}", fmt.Sprintf("%v", value), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetError(&Error). + Delete(path) + + if err != nil { + return nil, err + + } + + if response.IsError() { + return response, fmt.Errorf("error with operation DeleteEndpoint") + } + + getCSFRToken(response.Header()) + + return response, err + +} diff --git a/sdk/full_upgrade.go b/sdk/full_upgrade.go new file mode 100644 index 0000000..2ab19d7 --- /dev/null +++ b/sdk/full_upgrade.go @@ -0,0 +1,447 @@ +package isegosdk + +import ( + "fmt" + + "github.com/go-resty/resty/v2" + "github.com/google/go-querystring/query" +) + +type FullUpgradeService service + +type GetPrecheckStatusQueryParams struct { + PreCheckReportID string `url:"preCheckReportID,omitempty"` //preCheckReportID + PreCheckID string `url:"preCheckID,omitempty"` //preCheckID +} + +type ProceedStatusQueryParams struct { + PreCheckReportID string `url:"preCheckReportID,omitempty"` //preCheckReportID +} + +type StageStatusQueryParams struct { + PreCheckReportID string `url:"preCheckReportID,omitempty"` //preCheckReportID +} + +type ResponseFullUpgradeGetPrecheckStatus struct { + IsValid *bool `json:"isValid,omitempty"` // + Nodecount *int `json:"nodecount,omitempty"` // + PreCheckReportID string `json:"preCheckReportID,omitempty"` // + PreChecks *[]ResponseFullUpgradeGetPrecheckStatusPreChecks `json:"preChecks,omitempty"` // + Status string `json:"status,omitempty"` // +} + +type ResponseFullUpgradeGetPrecheckStatusPreChecks struct { + CheckType string `json:"checkType,omitempty"` // + Displayname string `json:"displayname,omitempty"` // + ExecutionTime *int `json:"executionTime,omitempty"` // + Message string `json:"message,omitempty"` // + Name string `json:"name,omitempty"` // + Nodes *[]ResponseFullUpgradeGetPrecheckStatusPreChecksNodes `json:"nodes,omitempty"` // + OnFailure string `json:"onFailure,omitempty"` // + Percentage *int `json:"percentage,omitempty"` // + RemediationMsg string `json:"remediationMsg,omitempty"` // + Status string `json:"status,omitempty"` // + SuccessMsg string `json:"successMsg,omitempty"` // + SuccessNodes *int `json:"successNodes,omitempty"` // + UpdateTime *int `json:"updateTime,omitempty"` // +} + +type ResponseFullUpgradeGetPrecheckStatusPreChecksNodes struct { + Msg string `json:"msg,omitempty"` // + Name string `json:"name,omitempty"` // + Status string `json:"status,omitempty"` // +} + +type ResponseFullUpgradeRunPreChecksInPPAN struct { + Response *ResponseFullUpgradeRunPreChecksInPPANResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseFullUpgradeRunPreChecksInPPANResponse struct { + Message string `json:"message,omitempty"` // + PreCheckReportID string `json:"preCheckReportID,omitempty"` // ID which can be used to track the status of upgrade task. +} + +type ResponseFullUpgradeProceedStatus struct { + Nodes *[]ResponseFullUpgradeProceedStatusNodes `json:"nodes,omitempty"` // + Percentage *int `json:"percentage,omitempty"` // + RemainingUpgradeTime *int `json:"remainingUpgradeTime,omitempty"` // + Status string `json:"status,omitempty"` // +} + +type ResponseFullUpgradeProceedStatusNodes struct { + DbStatus string `json:"dbStatus,omitempty"` // + Message string `json:"message,omitempty"` // + Node string `json:"node,omitempty"` // + Percentage *int `json:"percentage,omitempty"` // + ProgressMsg string `json:"progressMsg,omitempty"` // + Status string `json:"status,omitempty"` // + UpgradeTime *int `json:"upgradeTime,omitempty"` // +} + +type ResponseFullUpgradeInitiateUpgradeOnPPAN struct { + Response *ResponseFullUpgradeInitiateUpgradeOnPPANResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseFullUpgradeInitiateUpgradeOnPPANResponse struct { + Message string `json:"message,omitempty"` // + PreCheckReportID string `json:"preCheckReportID,omitempty"` // ID which can be used to track the status of upgrade task. +} + +type ResponseFullUpgradeCancelStagingOnPPAN struct { + Response *ResponseFullUpgradeCancelStagingOnPPANResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseFullUpgradeCancelStagingOnPPANResponse struct { + Message string `json:"message,omitempty"` // + PreCheckReportID string `json:"preCheckReportID,omitempty"` // ID which can be used to track the status of upgrade task. +} + +type ResponseFullUpgradestageStatus struct { + Response *[]ResponseFullUpgradestageStatusResponse `json:"response,omitempty"` // +} + +type ResponseFullUpgradestageStatusResponse struct { + DbStatus string `json:"dbStatus,omitempty"` // + Message string `json:"message,omitempty"` // + Node string `json:"node,omitempty"` // + Percentage *int `json:"percentage,omitempty"` // + ProgressMsg string `json:"progressMsg,omitempty"` // + Status string `json:"status,omitempty"` // +} + +type ResponseFullUpgradeInitiateStagingOnPPAN struct { + Response *ResponseFullUpgradeInitiateStagingOnPPANResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseFullUpgradeInitiateStagingOnPPANResponse struct { + Message string `json:"message,omitempty"` // + PreCheckReportID string `json:"preCheckReportID,omitempty"` // ID which can be used to track the status of upgrade task. +} + +type ResponseFullUpgradeUpgradesummary struct { + Nodes *[]ResponseFullUpgradeUpgradesummaryNodes `json:"nodes,omitempty"` // + Percentage *int `json:"percentage,omitempty"` // + RemainingUpgradeTime *int `json:"remainingUpgradeTime,omitempty"` // + Status string `json:"status,omitempty"` // +} + +type ResponseFullUpgradeUpgradesummaryNodes struct { + DbStatus string `json:"dbStatus,omitempty"` // + Message string `json:"message,omitempty"` // + Node string `json:"node,omitempty"` // + Percentage *int `json:"percentage,omitempty"` // + ProgressMsg string `json:"progressMsg,omitempty"` // + Status string `json:"status,omitempty"` // + UpgradeTime *int `json:"upgradeTime,omitempty"` // +} + +type RequestFullUpgradeRunPreChecksInPPAN struct { + BundleName string `json:"bundleName,omitempty"` // + Hostnames []string `json:"hostnames,omitempty"` // + PatchBundleName string `json:"patchBundleName,omitempty"` // + PreCheckReportID string `json:"preCheckReportID,omitempty"` // + PreChecks []string `json:"preChecks,omitempty"` // + ReTrigger *bool `json:"reTrigger,omitempty"` // + RepoName string `json:"repoName,omitempty"` // + UpgradeType string `json:"upgradeType,omitempty"` // +} + +type RequestFullUpgradeInitiateUpgradeOnPPAN struct { + Hostnames []string `json:"hostnames,omitempty"` // + PreCheckReportID string `json:"preCheckReportID,omitempty"` // + UpgradeType string `json:"upgradeType,omitempty"` // +} + +type RequestFullUpgradeCancelStagingOnPPAN struct { + Hostnames []string `json:"hostnames,omitempty"` // + PreCheckReportID string `json:"preCheckReportID,omitempty"` // + UpgradeType string `json:"upgradeType,omitempty"` // +} + +type RequestFullUpgradeInitiateStagingOnPPAN struct { + Hostnames []string `json:"hostnames,omitempty"` // + PreCheckReportID string `json:"preCheckReportID,omitempty"` // + ReTrigger *bool `json:"reTrigger,omitempty"` // + UpgradeType string `json:"upgradeType,omitempty"` // +} + +//GetPrecheckStatus gets status of pre-checks +/* get the latest precheck report + +@param getPrecheckStatusQueryParams Filtering parameter +*/ +func (s *FullUpgradeService) GetPrecheckStatus(getPrecheckStatusQueryParams *GetPrecheckStatusQueryParams) (*ResponseFullUpgradeGetPrecheckStatus, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/upgrade/prepare/get-status" + + queryString, _ := query.Values(getPrecheckStatusQueryParams) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetQueryString(queryString.Encode()).SetResult(&ResponseFullUpgradeGetPrecheckStatus{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetPrecheckStatus") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseFullUpgradeGetPrecheckStatus) + return result, response, err + +} + +//ProceedStatus get the status of upgrade proceed process +/* get the status of upgrade process for the requested nodes + +@param proceedStatusQueryParams Filtering parameter +*/ +func (s *FullUpgradeService) ProceedStatus(proceedStatusQueryParams *ProceedStatusQueryParams) (*ResponseFullUpgradeProceedStatus, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/upgrade/proceed/get-status" + + queryString, _ := query.Values(proceedStatusQueryParams) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetQueryString(queryString.Encode()).SetResult(&ResponseFullUpgradeProceedStatus{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation ProceedStatus") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseFullUpgradeProceedStatus) + return result, response, err + +} + +//StageStatus get the status a particular upgrade stage process +/* get the status of upgrade stage process for the requested nodes + +@param stageStatusQueryParams Filtering parameter +*/ +func (s *FullUpgradeService) StageStatus(stageStatusQueryParams *StageStatusQueryParams) (*ResponseFullUpgradestageStatus, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/upgrade/stage/get-status" + + queryString, _ := query.Values(stageStatusQueryParams) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetQueryString(queryString.Encode()).SetResult(&ResponseFullUpgradestageStatus{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation StageStatus") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseFullUpgradestageStatus) + return result, response, err + +} + +//Upgradesummary get the summary of upgrade process +/* get the summary of upgrade process + + */ +func (s *FullUpgradeService) Upgradesummary() (*ResponseFullUpgradeUpgradesummary, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/upgrade/summary/get-status" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseFullUpgradeUpgradesummary{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation Upgradesummary") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseFullUpgradeUpgradesummary) + return result, response, err + +} + +//RunPreChecksInPPAN API's to initiate pre-checks execution on PPAN +/* API's purpose is to initiate pre-checks execution on PPAN + + */ +func (s *FullUpgradeService) RunPreChecksInPPAN(requestFullUpgradeRunPreChecksInPPAN *RequestFullUpgradeRunPreChecksInPPAN) (*ResponseFullUpgradeRunPreChecksInPPAN, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/upgrade/prepare/pre-checks" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestFullUpgradeRunPreChecksInPPAN). + SetResult(&ResponseFullUpgradeRunPreChecksInPPAN{}). + SetError(&Error). + Post(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseFullUpgradeRunPreChecksInPPAN{}, response, nil + } + return nil, nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return nil, response, fmt.Errorf("error with operation RunPreChecksInPPAN") + } + + result := response.Result().(*ResponseFullUpgradeRunPreChecksInPPAN) + return result, response, err + +} + +//InitiateUpgradeOnPPAN API's purpose would be to orchestrate upgrade execution on PPAN +/* API's purpose would be to orchestrate upgrade execution on PPAN + + */ +func (s *FullUpgradeService) InitiateUpgradeOnPPAN(requestFullUpgradeInitiateUpgradeOnPPAN *RequestFullUpgradeInitiateUpgradeOnPPAN) (*ResponseFullUpgradeInitiateUpgradeOnPPAN, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/upgrade/proceed/initiate-upgrade" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestFullUpgradeInitiateUpgradeOnPPAN). + SetResult(&ResponseFullUpgradeInitiateUpgradeOnPPAN{}). + SetError(&Error). + Post(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseFullUpgradeInitiateUpgradeOnPPAN{}, response, nil + } + return nil, nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return nil, response, fmt.Errorf("error with operation InitiateUpgradeOnPPAN") + } + + result := response.Result().(*ResponseFullUpgradeInitiateUpgradeOnPPAN) + return result, response, err + +} + +//CancelStagingOnPPAN API to cancel staging process from PPAN +/* API to cancel staging process of specified nodes from PPAN + + */ +func (s *FullUpgradeService) CancelStagingOnPPAN(requestFullUpgradeCancelStagingOnPPAN *RequestFullUpgradeCancelStagingOnPPAN) (*ResponseFullUpgradeCancelStagingOnPPAN, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/upgrade/stage/cancel-stage" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestFullUpgradeCancelStagingOnPPAN). + SetResult(&ResponseFullUpgradeCancelStagingOnPPAN{}). + SetError(&Error). + Post(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseFullUpgradeCancelStagingOnPPAN{}, response, nil + } + return nil, nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return nil, response, fmt.Errorf("error with operation CancelStagingOnPPAN") + } + + result := response.Result().(*ResponseFullUpgradeCancelStagingOnPPAN) + return result, response, err + +} + +//InitiateStagingOnPPAN API to initiate staging orcheastration from PPAN +/* API to initiate staging orcheastration from PPAN + + */ +func (s *FullUpgradeService) InitiateStagingOnPPAN(requestFullUpgradeInitiateStagingOnPPAN *RequestFullUpgradeInitiateStagingOnPPAN) (*ResponseFullUpgradeInitiateStagingOnPPAN, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/upgrade/stage/start-stage" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestFullUpgradeInitiateStagingOnPPAN). + SetResult(&ResponseFullUpgradeInitiateStagingOnPPAN{}). + SetError(&Error). + Post(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseFullUpgradeInitiateStagingOnPPAN{}, response, nil + } + return nil, nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return nil, response, fmt.Errorf("error with operation InitiateStagingOnPPAN") + } + + result := response.Result().(*ResponseFullUpgradeInitiateStagingOnPPAN) + return result, response, err + +} diff --git a/sdk/is_mfa_enabled.go b/sdk/is_mfa_enabled.go new file mode 100644 index 0000000..50e9f0a --- /dev/null +++ b/sdk/is_mfa_enabled.go @@ -0,0 +1,45 @@ +package isegosdk + +import ( + "fmt" + + "github.com/go-resty/resty/v2" +) + +type IsMFAEnabledService service + +type ResponseIsMFAEnabledIsMfaEnabled struct { + Status *bool `json:"status,omitempty"` // +} + +//IsMfaEnabled MFA feature enabled status +/* Is MFA feature enabled? + + */ +func (s *IsMFAEnabledService) IsMfaEnabled() (*ResponseIsMFAEnabledIsMfaEnabled, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/duo-mfa/status" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseIsMFAEnabledIsMfaEnabled{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation IsMfaEnabled") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseIsMFAEnabledIsMfaEnabled) + return result, response, err + +} diff --git a/sdk/licensing.go b/sdk/licensing.go index e30d1d5..03904fe 100644 --- a/sdk/licensing.go +++ b/sdk/licensing.go @@ -8,21 +8,17 @@ import ( type LicensingService service -type ResponseLicensingGetConnectionType struct { - ConnectionType string `json:"connectionType,omitempty"` // - State string `json:"state,omitempty"` // +type ResponseLicensingGetSmartState struct { + Response *ResponseLicensingGetSmartStateResponse `json:"response,omitempty"` // State of the smart license format + Version string `json:"version,omitempty"` // } -type ResponseLicensingGetEvalLicenseInfo struct { - DaysRemaining *int `json:"daysRemaining,omitempty"` // Number of eval license days left +type ResponseLicensingGetSmartStateResponse struct { + ConnectionType string `json:"connectionType,omitempty"` // Type of connection for the registration + State string `json:"state,omitempty"` // Current Smart Licensing State } -type ResponseLicensingGetFeatureToTierMapping []ResponseItemLicensingGetFeatureToTierMapping // Array of ResponseLicensingGetFeatureToTierMapping - -type ResponseItemLicensingGetFeatureToTierMapping struct { - FeatureName []string `json:"featureName,omitempty"` //

List of feature names

- Tier string `json:"tier,omitempty"` // -} +// # Review unknown case type ResponseLicensingGetRegistrationInfo struct { Response *ResponseLicensingGetRegistrationInfoResponse `json:"response,omitempty"` // Registration information format @@ -30,22 +26,10 @@ type ResponseLicensingGetRegistrationInfo struct { } type ResponseLicensingGetRegistrationInfoResponse struct { - ConnectionType string `json:"connectionType,omitempty"` // - RegistrationState string `json:"registrationState,omitempty"` // - SsmOnPremServer string `json:"ssmOnPremServer,omitempty"` // If connection type is selected as SSM_ONPREM_SERVER, then IP address or the hostname (or FQDN) of the SSM On-Prem server Host. Tier []string `json:"tier,omitempty"` // -} - -// # Review unknown case - -type ResponseLicensingGetSmartState struct { - Response *ResponseLicensingGetSmartStateResponse `json:"response,omitempty"` // State of the smart license format - Version string `json:"version,omitempty"` // -} - -type ResponseLicensingGetSmartStateResponse struct { - ConnectionType string `json:"connectionType,omitempty"` // - State string `json:"state,omitempty"` // + ConnectionType string `json:"connectionType,omitempty"` // Type of connection for the registration + RegistrationState string `json:"registrationState,omitempty"` // Registered or Unregistered + SsmOnPremServer string `json:"ssmOnPremServer,omitempty"` // If connection type is selected as SSM_ONPREM_SERVER, then the IP address or the hostname (or FQDN) of the SSM On-Prem server host. } // # Review unknown case @@ -53,53 +37,69 @@ type ResponseLicensingGetSmartStateResponse struct { type ResponseLicensingGetTierStateInfo []ResponseItemLicensingGetTierStateInfo // Array of ResponseLicensingGetTierStateInfo type ResponseItemLicensingGetTierStateInfo struct { - Compliance string `json:"compliance,omitempty"` // + Name string `json:"name,omitempty"` // License tier list + Status string `json:"status,omitempty"` // Current Smart Licensing State + Compliance string `json:"compliance,omitempty"` // Tier compliance state ConsumptionCounter *int `json:"consumptionCounter,omitempty"` // Compliance counter for tier - DaysOutOfCompliance string `json:"daysOutOfCompliance,omitempty"` // Number of days tier is out of compliance + DaysOutOfCompliance string `json:"daysOutOfCompliance,omitempty"` // Number of days, the tier is out of compliance LastAuthorization string `json:"lastAuthorization,omitempty"` // Last date of authorization - Name string `json:"name,omitempty"` // - Status string `json:"status,omitempty"` // } type ResponseLicensingUpdateTierStateInfo struct { - Response *[]ResponseLicensingUpdateTierStateInfoResponse `json:"response,omitempty"` // Version string `json:"version,omitempty"` // + Response *[]ResponseLicensingUpdateTierStateInfoResponse `json:"response,omitempty"` // } type ResponseLicensingUpdateTierStateInfoResponse struct { - Message string `json:"message,omitempty"` // Response message on successful change of license tier state. - Name string `json:"name,omitempty"` // - Status string `json:"status,omitempty"` // + Name string `json:"name,omitempty"` // License tier list + Status string `json:"status,omitempty"` // Current Smart Licensing State + Message string `json:"message,omitempty"` // Response message received on successful change of license tier state. +} + +type ResponseLicensingGetEvalLicenseInfo struct { + DaysRemaining *int `json:"daysRemaining,omitempty"` // Number of eval license days left +} + +type ResponseLicensingGetConnectionType struct { + ConnectionType string `json:"connectionType,omitempty"` // Type of connection for the registration + State string `json:"state,omitempty"` // Current Smart Licensing State +} + +type ResponseLicensingGetFeatureToTierMapping []ResponseItemLicensingGetFeatureToTierMapping // Array of ResponseLicensingGetFeatureToTierMapping + +type ResponseItemLicensingGetFeatureToTierMapping struct { + Tier string `json:"tier,omitempty"` // License tier list + FeatureName []string `json:"featureName,omitempty"` //

List of feature names

} type RequestLicensingCreateRegistrationInfo struct { - ConnectionType string `json:"connectionType,omitempty"` // - RegistrationType string `json:"registrationType,omitempty"` // - SsmOnPremServer string `json:"ssmOnPremServer,omitempty"` // If connection type is selected as SSM_ONPREM_SERVER, then IP address or the hostname (or FQDN) of the SSM On-Prem server Host. - Tier []string `json:"tier,omitempty"` // Token string `json:"token,omitempty"` // token + Tier []string `json:"tier,omitempty"` // + ConnectionType string `json:"connectionType,omitempty"` // Type of connection for the registration + RegistrationType string `json:"registrationType,omitempty"` // Register, deregister, renew or update + SsmOnPremServer string `json:"ssmOnPremServer,omitempty"` // If the connection type is selected as SSM_ONPREM_SERVER, then this field consists of IP address or the hostname (or FQDN) of the SSM On-Prem server host. } type RequestLicensingUpdateTierStateInfo []RequestItemLicensingUpdateTierStateInfo // Array of RequestLicensingUpdateTierStateInfo type RequestItemLicensingUpdateTierStateInfo struct { - Name string `json:"name,omitempty"` // - Status string `json:"status,omitempty"` // + Name string `json:"name,omitempty"` // License tier list + Status string `json:"status,omitempty"` // Current Smart Licensing State } -//GetConnectionType License - Connection Type -/* Get connection type +//GetSmartState Get smart license information +/* Get smart license information */ -func (s *LicensingService) GetConnectionType() (*ResponseLicensingGetConnectionType, *resty.Response, error) { +func (s *LicensingService) GetSmartState() (*ResponseLicensingGetSmartState, *resty.Response, error) { setHost(s.client, "_ui") - path := "/api/v1/license/system/connection-type" + path := "/api/v1/license/system/smart-state" setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseLicensingGetConnectionType{}). + SetResult(&ResponseLicensingGetSmartState{}). SetError(&Error). Get(path) @@ -109,29 +109,29 @@ func (s *LicensingService) GetConnectionType() (*ResponseLicensingGetConnectionT } if response.IsError() { - return nil, response, fmt.Errorf("error with operation GetConnectionType") + return nil, response, fmt.Errorf("error with operation GetSmartState") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseLicensingGetConnectionType) + result := response.Result().(*ResponseLicensingGetSmartState) return result, response, err } -//GetEvalLicenseInfo License - registration information -/* Get registration information +//GetRegistrationInfo Get the registration information +/* Get the registration information */ -func (s *LicensingService) GetEvalLicenseInfo() (*ResponseLicensingGetEvalLicenseInfo, *resty.Response, error) { +func (s *LicensingService) GetRegistrationInfo() (*ResponseLicensingGetRegistrationInfo, *resty.Response, error) { setHost(s.client, "_ui") - path := "/api/v1/license/system/eval-license" + path := "/api/v1/license/system/register" setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseLicensingGetEvalLicenseInfo{}). + SetResult(&ResponseLicensingGetRegistrationInfo{}). SetError(&Error). Get(path) @@ -141,29 +141,29 @@ func (s *LicensingService) GetEvalLicenseInfo() (*ResponseLicensingGetEvalLicens } if response.IsError() { - return nil, response, fmt.Errorf("error with operation GetEvalLicenseInfo") + return nil, response, fmt.Errorf("error with operation GetRegistrationInfo") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseLicensingGetEvalLicenseInfo) + result := response.Result().(*ResponseLicensingGetRegistrationInfo) return result, response, err } -//GetFeatureToTierMapping License - feature to tier mapping -/* Get feature to tier mapping +//GetTierStateInfo Get tier state information +/* Get tier state information */ -func (s *LicensingService) GetFeatureToTierMapping() (*ResponseLicensingGetFeatureToTierMapping, *resty.Response, error) { +func (s *LicensingService) GetTierStateInfo() (*ResponseLicensingGetTierStateInfo, *resty.Response, error) { setHost(s.client, "_ui") - path := "/api/v1/license/system/feature-to-tier-mapping" + path := "/api/v1/license/system/tier-state" setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseLicensingGetFeatureToTierMapping{}). + SetResult(&ResponseLicensingGetTierStateInfo{}). SetError(&Error). Get(path) @@ -173,29 +173,29 @@ func (s *LicensingService) GetFeatureToTierMapping() (*ResponseLicensingGetFeatu } if response.IsError() { - return nil, response, fmt.Errorf("error with operation GetFeatureToTierMapping") + return nil, response, fmt.Errorf("error with operation GetTierStateInfo") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseLicensingGetFeatureToTierMapping) + result := response.Result().(*ResponseLicensingGetTierStateInfo) return result, response, err } -//GetRegistrationInfo License - registration information -/* Get registration information +//GetEvalLicenseInfo Get registration information related to the evaluation license +/* Get registration information related to the evaluation license */ -func (s *LicensingService) GetRegistrationInfo() (*ResponseLicensingGetRegistrationInfo, *resty.Response, error) { +func (s *LicensingService) GetEvalLicenseInfo() (*ResponseLicensingGetEvalLicenseInfo, *resty.Response, error) { setHost(s.client, "_ui") - path := "/api/v1/license/system/register" + path := "/api/v1/license/system/eval-license" setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseLicensingGetRegistrationInfo{}). + SetResult(&ResponseLicensingGetEvalLicenseInfo{}). SetError(&Error). Get(path) @@ -205,29 +205,29 @@ func (s *LicensingService) GetRegistrationInfo() (*ResponseLicensingGetRegistrat } if response.IsError() { - return nil, response, fmt.Errorf("error with operation GetRegistrationInfo") + return nil, response, fmt.Errorf("error with operation GetEvalLicenseInfo") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseLicensingGetRegistrationInfo) + result := response.Result().(*ResponseLicensingGetEvalLicenseInfo) return result, response, err } -//GetSmartState License - smart license information -/* Get smart license information +//GetConnectionType Get the connection type +/* Get the connection type */ -func (s *LicensingService) GetSmartState() (*ResponseLicensingGetSmartState, *resty.Response, error) { +func (s *LicensingService) GetConnectionType() (*ResponseLicensingGetConnectionType, *resty.Response, error) { setHost(s.client, "_ui") - path := "/api/v1/license/system/smart-state" + path := "/api/v1/license/system/connection-type" setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseLicensingGetSmartState{}). + SetResult(&ResponseLicensingGetConnectionType{}). SetError(&Error). Get(path) @@ -237,29 +237,29 @@ func (s *LicensingService) GetSmartState() (*ResponseLicensingGetSmartState, *re } if response.IsError() { - return nil, response, fmt.Errorf("error with operation GetSmartState") + return nil, response, fmt.Errorf("error with operation GetConnectionType") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseLicensingGetSmartState) + result := response.Result().(*ResponseLicensingGetConnectionType) return result, response, err } -//GetTierStateInfo Get tier state information -/* Get tier state information +//GetFeatureToTierMapping Get feature to tier mapping information +/* Get feature to tier mapping information */ -func (s *LicensingService) GetTierStateInfo() (*ResponseLicensingGetTierStateInfo, *resty.Response, error) { +func (s *LicensingService) GetFeatureToTierMapping() (*ResponseLicensingGetFeatureToTierMapping, *resty.Response, error) { setHost(s.client, "_ui") - path := "/api/v1/license/system/tier-state" + path := "/api/v1/license/system/feature-to-tier-mapping" setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseLicensingGetTierStateInfo{}). + SetResult(&ResponseLicensingGetFeatureToTierMapping{}). SetError(&Error). Get(path) @@ -269,29 +269,28 @@ func (s *LicensingService) GetTierStateInfo() (*ResponseLicensingGetTierStateInf } if response.IsError() { - return nil, response, fmt.Errorf("error with operation GetTierStateInfo") + return nil, response, fmt.Errorf("error with operation GetFeatureToTierMapping") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseLicensingGetTierStateInfo) + result := response.Result().(*ResponseLicensingGetFeatureToTierMapping) return result, response, err } -//CreateRegistrationInfo License - registration information -/* License Configure registration information. +//ConfigureSmartState Configure smart state information +/* Configure smart state information. */ -func (s *LicensingService) CreateRegistrationInfo(requestLicensingCreateRegistrationInfo *RequestLicensingCreateRegistrationInfo) (*resty.Response, error) { +func (s *LicensingService) ConfigureSmartState() (*resty.Response, error) { setHost(s.client, "_ui") - path := "/api/v1/license/system/register" + path := "/api/v1/license/system/smart-state" setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetBody(requestLicensingCreateRegistrationInfo). SetError(&Error). Post(path) @@ -302,25 +301,26 @@ func (s *LicensingService) CreateRegistrationInfo(requestLicensingCreateRegistra getCSFRToken(response.Header()) if response.IsError() { - return response, fmt.Errorf("error with operation CreateRegistrationInfo") + return response, fmt.Errorf("error with operation ConfigureSmartState") } return response, err } -//ConfigureSmartState License - smart state information -/* License Configure smart state information. +//CreateRegistrationInfo Configure registration information +/* Configure registration information. */ -func (s *LicensingService) ConfigureSmartState() (*resty.Response, error) { +func (s *LicensingService) CreateRegistrationInfo(requestLicensingCreateRegistrationInfo *RequestLicensingCreateRegistrationInfo) (*resty.Response, error) { setHost(s.client, "_ui") - path := "/api/v1/license/system/smart-state" + path := "/api/v1/license/system/register" setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). + SetBody(requestLicensingCreateRegistrationInfo). SetError(&Error). Post(path) @@ -331,7 +331,7 @@ func (s *LicensingService) ConfigureSmartState() (*resty.Response, error) { getCSFRToken(response.Header()) if response.IsError() { - return response, fmt.Errorf("error with operation ConfigureSmartState") + return response, fmt.Errorf("error with operation CreateRegistrationInfo") } return response, err diff --git a/sdk/native_ipsec.go b/sdk/native_ipsec.go new file mode 100644 index 0000000..2025820 --- /dev/null +++ b/sdk/native_ipsec.go @@ -0,0 +1,1069 @@ +package isegosdk + +import ( + "fmt" + "strings" + + "github.com/go-resty/resty/v2" + "github.com/google/go-querystring/query" +) + +type NativeIPsecService service + +type GetIPsecEnabledNodesQueryParams struct { + Page int `url:"page,omitempty"` //Page number + Size int `url:"size,omitempty"` //Number of objects returned per page + Filter string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.

OPERATOR DESCRIPTION APPLICABLE ON FIELDS
EQ Equals authType
NEQ Not Equals authType
EQ Equals hostName
NEQ Not Equals hostName
EQ Equals nadIp
NEQ Not Equals nadIp
EQ Equals status
NEQ Not Equals status
+ FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter + Sort string `url:"sort,omitempty"` //sort type - asc or desc + SortBy string `url:"sortBy,omitempty"` //Sort column - The IPsec enabled nodes are sorted based on the columns. This is applicable for the field - hostName. +} + +type ResponseNativeIPsecGetIPsecEnabledNodes struct { + NextPage *ResponseNativeIPsecGetIPsecEnabledNodesNextPage `json:"nextPage,omitempty"` // + PreviousPage *ResponseNativeIPsecGetIPsecEnabledNodesPreviousPage `json:"previousPage,omitempty"` // + Response *[]ResponseNativeIPsecGetIPsecEnabledNodesResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseNativeIPsecGetIPsecEnabledNodesNextPage struct { + Href string `json:"href,omitempty"` // + Rel string `json:"rel,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseNativeIPsecGetIPsecEnabledNodesPreviousPage struct { + Href string `json:"href,omitempty"` // + Rel string `json:"rel,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseNativeIPsecGetIPsecEnabledNodesResponse struct { + AuthType string `json:"authType,omitempty"` // Authentication type for establishing connection + CertID string `json:"certId,omitempty"` // ID of the certificate for establishing connection + ConfigureVti *bool `json:"configureVti,omitempty"` // Authentication type for establishing connection + CreateTime string `json:"createTime,omitempty"` // + EspAhProtocol string `json:"espAhProtocol,omitempty"` // Encryption protocol used for establishing connection + HostName string `json:"hostName,omitempty"` // Hostname of the node + ID string `json:"id,omitempty"` // + Iface string `json:"iface,omitempty"` // Ethernet port of the node + IkeReAuthTime *int `json:"ikeReAuthTime,omitempty"` // IKE re-authentication time + IkeVersion string `json:"ikeVersion,omitempty"` // IKE version + LocalInternalIP string `json:"localInternalIp,omitempty"` // Local Tunnel IP address + ModeOption string `json:"modeOption,omitempty"` // The Mode type used for establishing the connection + NadIP string `json:"nadIp,omitempty"` // NAD IP address for establishing connection + PhaseOneDHGroup string `json:"phaseOneDHGroup,omitempty"` // Phase-one DH group used for establishing connection + PhaseOneEncryptionAlgo string `json:"phaseOneEncryptionAlgo,omitempty"` // Phase-one encryption algorithm used for establishing connection + PhaseOneHashAlgo string `json:"phaseOneHashAlgo,omitempty"` // Phase-one hashing algorithm used for establishing connection + PhaseOneLifeTime *int `json:"phaseOneLifeTime,omitempty"` // Phase-one connection lifetime + PhaseTwoDHGroup string `json:"phaseTwoDHGroup,omitempty"` // Phase-two DH group used for establishing connection + PhaseTwoEncryptionAlgo string `json:"phaseTwoEncryptionAlgo,omitempty"` // Phase-two encryption algorithm used for establishing connection + PhaseTwoHashAlgo string `json:"phaseTwoHashAlgo,omitempty"` // Phase-two hashing algorithm used for establishing connection + PhaseTwoLifeTime *int `json:"phaseTwoLifeTime,omitempty"` // Phase-two connection lifetime + Psk string `json:"psk,omitempty"` // Pre-shared key used for establishing connection + RemotePeerInternalIP string `json:"remotePeerInternalIp,omitempty"` // Remote Tunnel IP address + Status string `json:"status,omitempty"` // + UpdateTime string `json:"updateTime,omitempty"` // +} + +type ResponseNativeIPsecUpdateIPsecConnectionConfig struct { + Response *ResponseNativeIPsecUpdateIPsecConnectionConfigResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseNativeIPsecUpdateIPsecConnectionConfigResponse struct { + AuthType string `json:"authType,omitempty"` // Authentication type for establishing connection + CertID string `json:"certId,omitempty"` // ID of the certificate for establishing connection + ConfigureVti *bool `json:"configureVti,omitempty"` // Authentication type for establishing connection + CreateTime string `json:"createTime,omitempty"` // + EspAhProtocol string `json:"espAhProtocol,omitempty"` // Encryption protocol used for establishing connection + HostName string `json:"hostName,omitempty"` // Hostname of the node + ID string `json:"id,omitempty"` // + Iface string `json:"iface,omitempty"` // Ethernet port of the node + IkeReAuthTime *int `json:"ikeReAuthTime,omitempty"` // IKE re-authentication time + IkeVersion string `json:"ikeVersion,omitempty"` // IKE version + Link *ResponseNativeIPsecUpdateIPsecConnectionConfigResponseLink `json:"link,omitempty"` // + LocalInternalIP string `json:"localInternalIp,omitempty"` // Local Tunnel IP address + ModeOption string `json:"modeOption,omitempty"` // The Mode type used for establishing the connection + NadIP string `json:"nadIp,omitempty"` // NAD IP address for establishing connection + PhaseOneDHGroup string `json:"phaseOneDHGroup,omitempty"` // Phase-one DH group used for establishing connection + PhaseOneEncryptionAlgo string `json:"phaseOneEncryptionAlgo,omitempty"` // Phase-one encryption algorithm used for establishing connection + PhaseOneHashAlgo string `json:"phaseOneHashAlgo,omitempty"` // Phase-one hashing algorithm used for establishing connection + PhaseOneLifeTime *int `json:"phaseOneLifeTime,omitempty"` // Phase-one connection lifetime + PhaseTwoDHGroup string `json:"phaseTwoDHGroup,omitempty"` // Phase-two DH group used for establishing connection + PhaseTwoEncryptionAlgo string `json:"phaseTwoEncryptionAlgo,omitempty"` // Phase-two encryption algorithm used for establishing connection + PhaseTwoHashAlgo string `json:"phaseTwoHashAlgo,omitempty"` // Phase-two hashing algorithm used for establishing connection + PhaseTwoLifeTime *int `json:"phaseTwoLifeTime,omitempty"` // Phase-two connection lifetime + Psk string `json:"psk,omitempty"` // Pre-shared key used for establishing connection + RemotePeerInternalIP string `json:"remotePeerInternalIp,omitempty"` // Remote Tunnel IP address + Status string `json:"status,omitempty"` // + UpdateTime string `json:"updateTime,omitempty"` // +} + +type ResponseNativeIPsecUpdateIPsecConnectionConfigResponseLink struct { + Href string `json:"href,omitempty"` // + Rel string `json:"rel,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseNativeIPsecCreateIPsecConnection struct { + Response *ResponseNativeIPsecCreateIPsecConnectionResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseNativeIPsecCreateIPsecConnectionResponse struct { + AuthType string `json:"authType,omitempty"` // Authentication type for establishing connection + CertID string `json:"certId,omitempty"` // ID of the certificate for establishing connection + ConfigureVti *bool `json:"configureVti,omitempty"` // Authentication type for establishing connection + CreateTime string `json:"createTime,omitempty"` // + EspAhProtocol string `json:"espAhProtocol,omitempty"` // Encryption protocol used for establishing connection + HostName string `json:"hostName,omitempty"` // Hostname of the node + ID string `json:"id,omitempty"` // + Iface string `json:"iface,omitempty"` // Ethernet port of the node + IkeReAuthTime *int `json:"ikeReAuthTime,omitempty"` // IKE re-authentication time + IkeVersion string `json:"ikeVersion,omitempty"` // IKE version + Link *ResponseNativeIPsecCreateIPsecConnectionResponseLink `json:"link,omitempty"` // + LocalInternalIP string `json:"localInternalIp,omitempty"` // Local Tunnel IP address + ModeOption string `json:"modeOption,omitempty"` // The Mode type used for establishing the connection + NadIP string `json:"nadIp,omitempty"` // NAD IP address for establishing connection + PhaseOneDHGroup string `json:"phaseOneDHGroup,omitempty"` // Phase-one DH group used for establishing connection + PhaseOneEncryptionAlgo string `json:"phaseOneEncryptionAlgo,omitempty"` // Phase-one encryption algorithm used for establishing connection + PhaseOneHashAlgo string `json:"phaseOneHashAlgo,omitempty"` // Phase-one hashing algorithm used for establishing connection + PhaseOneLifeTime *int `json:"phaseOneLifeTime,omitempty"` // Phase-one connection lifetime + PhaseTwoDHGroup string `json:"phaseTwoDHGroup,omitempty"` // Phase-two DH group used for establishing connection + PhaseTwoEncryptionAlgo string `json:"phaseTwoEncryptionAlgo,omitempty"` // Phase-two encryption algorithm used for establishing connection + PhaseTwoHashAlgo string `json:"phaseTwoHashAlgo,omitempty"` // Phase-two hashing algorithm used for establishing connection + PhaseTwoLifeTime *int `json:"phaseTwoLifeTime,omitempty"` // Phase-two connection lifetime + Psk string `json:"psk,omitempty"` // Pre-shared key used for establishing connection + RemotePeerInternalIP string `json:"remotePeerInternalIp,omitempty"` // Remote Tunnel IP address + Status string `json:"status,omitempty"` // + UpdateTime string `json:"updateTime,omitempty"` // +} + +type ResponseNativeIPsecCreateIPsecConnectionResponseLink struct { + Href string `json:"href,omitempty"` // + Rel string `json:"rel,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseNativeIPsecBulkIPSecOperation struct { + ID string `json:"id,omitempty"` // +} + +type ResponseNativeIPsecGetIPSecCertificates struct { + Response *[]ResponseNativeIPsecGetIPSecCertificatesResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseNativeIPsecGetIPSecCertificatesResponse struct { + FriendlyName string `json:"friendlyName,omitempty"` // Friendly name of system certificate + ID string `json:"id,omitempty"` // ID of system certificate +} + +type ResponseNativeIPsecDisableIPsecConnection struct { + Message string `json:"message,omitempty"` // +} + +type ResponseNativeIPsecEnableIPsecConnection struct { + Message string `json:"message,omitempty"` // +} + +type ResponseNativeIPsecGetIPsecNode struct { + Response *ResponseNativeIPsecGetIPsecNodeResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseNativeIPsecGetIPsecNodeResponse struct { + AuthType string `json:"authType,omitempty"` // Authentication type for establishing connection + CertID string `json:"certId,omitempty"` // ID of the certificate for establishing connection + ConfigureVti *bool `json:"configureVti,omitempty"` // Authentication type for establishing connection + CreateTime string `json:"createTime,omitempty"` // + EspAhProtocol string `json:"espAhProtocol,omitempty"` // Encryption protocol used for establishing connection + HostName string `json:"hostName,omitempty"` // Hostname of the node + ID string `json:"id,omitempty"` // + Iface string `json:"iface,omitempty"` // Ethernet port of the node + IkeReAuthTime *int `json:"ikeReAuthTime,omitempty"` // IKE re-authentication time + IkeVersion string `json:"ikeVersion,omitempty"` // IKE version + Link *ResponseNativeIPsecGetIPsecNodeResponseLink `json:"link,omitempty"` // + LocalInternalIP string `json:"localInternalIp,omitempty"` // Local Tunnel IP address + ModeOption string `json:"modeOption,omitempty"` // The Mode type used for establishing the connection + NadIP string `json:"nadIp,omitempty"` // NAD IP address for establishing connection + PhaseOneDHGroup string `json:"phaseOneDHGroup,omitempty"` // Phase-one DH group used for establishing connection + PhaseOneEncryptionAlgo string `json:"phaseOneEncryptionAlgo,omitempty"` // Phase-one encryption algorithm used for establishing connection + PhaseOneHashAlgo string `json:"phaseOneHashAlgo,omitempty"` // Phase-one hashing algorithm used for establishing connection + PhaseOneLifeTime *int `json:"phaseOneLifeTime,omitempty"` // Phase-one connection lifetime + PhaseTwoDHGroup string `json:"phaseTwoDHGroup,omitempty"` // Phase-two DH group used for establishing connection + PhaseTwoEncryptionAlgo string `json:"phaseTwoEncryptionAlgo,omitempty"` // Phase-two encryption algorithm used for establishing connection + PhaseTwoHashAlgo string `json:"phaseTwoHashAlgo,omitempty"` // Phase-two hashing algorithm used for establishing connection + PhaseTwoLifeTime *int `json:"phaseTwoLifeTime,omitempty"` // Phase-two connection lifetime + Psk string `json:"psk,omitempty"` // Pre-shared key used for establishing connection + RemotePeerInternalIP string `json:"remotePeerInternalIp,omitempty"` // Remote Tunnel IP address + Status string `json:"status,omitempty"` // + UpdateTime string `json:"updateTime,omitempty"` // +} + +type ResponseNativeIPsecGetIPsecNodeResponseLink struct { + Href string `json:"href,omitempty"` // + Rel string `json:"rel,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseNativeIPsecRemoveIPsecConnection struct { + Message string `json:"message,omitempty"` // +} + +type RequestNativeIPsecUpdateIPsecConnectionConfig struct { + AuthType string `json:"authType,omitempty"` // Authentication type for establishing connection + CertID string `json:"certId,omitempty"` // ID of the certificate for establishing connection + ConfigureVti *bool `json:"configureVti,omitempty"` // Authentication type for establishing connection + EspAhProtocol string `json:"espAhProtocol,omitempty"` // Encryption protocol used for establishing connection + HostName string `json:"hostName,omitempty"` // Hostname of the node + Iface string `json:"iface,omitempty"` // Ethernet port of the node + IkeReAuthTime *int `json:"ikeReAuthTime,omitempty"` // IKE re-authentication time + IkeVersion string `json:"ikeVersion,omitempty"` // IKE version + LocalInternalIP string `json:"localInternalIp,omitempty"` // Local Tunnel IP address + ModeOption string `json:"modeOption,omitempty"` // The Mode type used for establishing the connection + NadIP string `json:"nadIp,omitempty"` // NAD IP address for establishing connection + PhaseOneDHGroup string `json:"phaseOneDHGroup,omitempty"` // Phase-one DH group used for establishing connection + PhaseOneEncryptionAlgo string `json:"phaseOneEncryptionAlgo,omitempty"` // Phase-one encryption algorithm used for establishing connection + PhaseOneHashAlgo string `json:"phaseOneHashAlgo,omitempty"` // Phase-one hashing algorithm used for establishing connection + PhaseOneLifeTime *int `json:"phaseOneLifeTime,omitempty"` // Phase-one connection lifetime + PhaseTwoDHGroup string `json:"phaseTwoDHGroup,omitempty"` // Phase-two DH group used for establishing connection + PhaseTwoEncryptionAlgo string `json:"phaseTwoEncryptionAlgo,omitempty"` // Phase-two encryption algorithm used for establishing connection + PhaseTwoHashAlgo string `json:"phaseTwoHashAlgo,omitempty"` // Phase-two hashing algorithm used for establishing connection + PhaseTwoLifeTime *int `json:"phaseTwoLifeTime,omitempty"` // Phase-two connection lifetime + Psk string `json:"psk,omitempty"` // Pre-shared key used for establishing connection + RemotePeerInternalIP string `json:"remotePeerInternalIp,omitempty"` // Remote Tunnel IP address +} + +type RequestNativeIPsecCreateIPsecConnection struct { + AuthType string `json:"authType,omitempty"` // Authentication type for establishing connection + CertID string `json:"certId,omitempty"` // ID of the certificate for establishing connection + ConfigureVti *bool `json:"configureVti,omitempty"` // Authentication type for establishing connection + EspAhProtocol string `json:"espAhProtocol,omitempty"` // Encryption protocol used for establishing connection + HostName string `json:"hostName,omitempty"` // Hostname of the node + Iface string `json:"iface,omitempty"` // Ethernet port of the node + IkeReAuthTime *int `json:"ikeReAuthTime,omitempty"` // IKE re-authentication time + IkeVersion string `json:"ikeVersion,omitempty"` // IKE version + LocalInternalIP string `json:"localInternalIp,omitempty"` // Local Tunnel IP address + ModeOption string `json:"modeOption,omitempty"` // The Mode type used for establishing the connection + NadIP string `json:"nadIp,omitempty"` // NAD IP address for establishing connection + PhaseOneDHGroup string `json:"phaseOneDHGroup,omitempty"` // Phase-one DH group used for establishing connection + PhaseOneEncryptionAlgo string `json:"phaseOneEncryptionAlgo,omitempty"` // Phase-one encryption algorithm used for establishing connection + PhaseOneHashAlgo string `json:"phaseOneHashAlgo,omitempty"` // Phase-one hashing algorithm used for establishing connection + PhaseOneLifeTime *int `json:"phaseOneLifeTime,omitempty"` // Phase-one connection lifetime + PhaseTwoDHGroup string `json:"phaseTwoDHGroup,omitempty"` // Phase-two DH group used for establishing connection + PhaseTwoEncryptionAlgo string `json:"phaseTwoEncryptionAlgo,omitempty"` // Phase-two encryption algorithm used for establishing connection + PhaseTwoHashAlgo string `json:"phaseTwoHashAlgo,omitempty"` // Phase-two hashing algorithm used for establishing connection + PhaseTwoLifeTime *int `json:"phaseTwoLifeTime,omitempty"` // Phase-two connection lifetime + Psk string `json:"psk,omitempty"` // Pre-shared key used for establishing connection + RemotePeerInternalIP string `json:"remotePeerInternalIp,omitempty"` // Remote Tunnel IP address +} + +type RequestNativeIPsecBulkIPSecOperation struct { + ItemList *[]RequestNativeIPsecBulkIPSecOperationItemList `json:"ItemList,omitempty"` // + Operation string `json:"operation,omitempty"` // +} + +type RequestNativeIPsecBulkIPSecOperationItemList struct { + AuthType string `json:"authType,omitempty"` // Authentication type for establishing connection + CertID string `json:"certId,omitempty"` // ID of the certificate for establishing connection + ConfigureVti *bool `json:"configureVti,omitempty"` // Authentication type for establishing connection + EspAhProtocol string `json:"espAhProtocol,omitempty"` // Encryption protocol used for establishing connection + HostName string `json:"hostName,omitempty"` // Hostname of the node + Iface string `json:"iface,omitempty"` // Ethernet port of the node + IkeReAuthTime *int `json:"ikeReAuthTime,omitempty"` // IKE re-authentication time + IkeVersion string `json:"ikeVersion,omitempty"` // IKE version + LocalInternalIP string `json:"localInternalIp,omitempty"` // Local Tunnel IP address + ModeOption string `json:"modeOption,omitempty"` // The Mode type used for establishing the connection + NadIP string `json:"nadIp,omitempty"` // NAD IP address for establishing connection + PhaseOneDHGroup string `json:"phaseOneDHGroup,omitempty"` // Phase-one DH group used for establishing connection + PhaseOneEncryptionAlgo string `json:"phaseOneEncryptionAlgo,omitempty"` // Phase-one encryption algorithm used for establishing connection + PhaseOneHashAlgo string `json:"phaseOneHashAlgo,omitempty"` // Phase-one hashing algorithm used for establishing connection + PhaseOneLifeTime *int `json:"phaseOneLifeTime,omitempty"` // Phase-one connection lifetime + PhaseTwoDHGroup string `json:"phaseTwoDHGroup,omitempty"` // Phase-two DH group used for establishing connection + PhaseTwoEncryptionAlgo string `json:"phaseTwoEncryptionAlgo,omitempty"` // Phase-two encryption algorithm used for establishing connection + PhaseTwoHashAlgo string `json:"phaseTwoHashAlgo,omitempty"` // Phase-two hashing algorithm used for establishing connection + PhaseTwoLifeTime *int `json:"phaseTwoLifeTime,omitempty"` // Phase-two connection lifetime + Psk string `json:"psk,omitempty"` // Pre-shared key used for establishing connection + RemotePeerInternalIP string `json:"remotePeerInternalIp,omitempty"` // Remote Tunnel IP address +} + +//GetIPsecEnabledNodes Get all IPsec enabled nodes +/* Returns all the IPsec enabled nodes with configuration details. + + This API supports filtering, sorting and pagination. + +The attributes that are suppported for filtering are: + + +hostName + +nadIp + +status + +authType + + +The attribute that is suppported for sorting is: + + +hostName + + + +@param getIpsecEnabledNodesQueryParams Filtering parameter +*/ +func (s *NativeIPsecService) GetIPsecEnabledNodes(getIpsecEnabledNodesQueryParams *GetIPsecEnabledNodesQueryParams) (*ResponseNativeIPsecGetIPsecEnabledNodes, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/ipsec" + + queryString, _ := query.Values(getIpsecEnabledNodesQueryParams) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetQueryString(queryString.Encode()).SetResult(&ResponseNativeIPsecGetIPsecEnabledNodes{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetIpsecEnabledNodes") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseNativeIPsecGetIPsecEnabledNodes) + return result, response, err + +} + +//GetIPSecCertificates Get all IPsec related certificates +/* Returns all the certificates for IPsec role. + + + */ +func (s *NativeIPsecService) GetIPSecCertificates() (*ResponseNativeIPsecGetIPSecCertificates, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/ipsec/certificates" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseNativeIPsecGetIPSecCertificates{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetIpSecCertificates") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseNativeIPsecGetIPSecCertificates) + return result, response, err + +} + +//GetIPsecNode Get the IPsec connection details for a given node with the hostname and the NAD IP +/* Returns the IPsec configuration details of a given node with the hostname and the NAD IP. + +@param hostName hostName path parameter. Hostname of the deployed node. +@param nadIP nadIp path parameter. IP address of the NAD. +*/ +func (s *NativeIPsecService) GetIPsecNode(hostName string, nadIP string) (*ResponseNativeIPsecGetIPsecNode, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/ipsec/{hostName}/{nadIp}" + path = strings.Replace(path, "{hostName}", fmt.Sprintf("%v", hostName), -1) + path = strings.Replace(path, "{nadIp}", fmt.Sprintf("%v", nadIP), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseNativeIPsecGetIPsecNode{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetIpsecNode") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseNativeIPsecGetIPsecNode) + return result, response, err + +} + +//CreateIPsecConnection Create an IPsec connection on a node +/* +Creates an IPsec connection. + The following parameters are present in the POST request body: + + + + +PARAMETER + +DESCRIPTION + +EXAMPLE + + + + + +hostName +*required + +Hostname of the node for which IPsec should be enabled + +"hostName": "ise-host1" + + + +iface +*required + +Ethernet port used for establishing connection + +"iface": "0" + + + +psk +*required + +Pre-shared key used for establishing connection. + +"psk": "psk12345" + + + +authType +*required + +Pre-shared key used for establishing connection. + +"authType": "psk" + + + +configureVti + +Used For VTI Configurations + +"configureVti": "false" + + + +remotePeerInternalIp + +VTI Internal IP of the NAD + +"remotePeerInternalIp": "1.2.3.1" + + + +localInternalIp + +IP address assigned to the VTI interface so this would be the internal ip + +"localInternalIp": "1.1.3.1" + + + +certId +*required + +ID of the certificate for establishing connection. + +"certId": "21323243545433" + + + +phaseOneEncryptionAlgo +*required + +Phase-one encryption algorithm used for establishing connection. + +"phaseOneEncryptionAlgo": "aes" + + + +phaseTwoEncryptionAlgo +*required + +Phase-two encryption algorithm used for establishing connection. + +"phaseTwoEncryptionAlgo": "aes" + + + +espAhProtocol +*required + +Encryption protocol used for establishing connection. + +"espAhProtocol": "ah" + + + +phaseOneHashAlgo +*required + +Phase-one hashing algorithm used for establishing connection. + +"phaseOneHashAlgo": "sha" + + + +phaseTwoHashAlgo +*required + +Phase-two hashing algorithm used for establishing connection. + +"phaseTwoHashAlgo": "sha" + + + +phaseOneDHGroup +*required + +Phase-one DH group used for establishing connection. + +"phaseOneDHGroup": "GROUP1" + + + +phaseTwoDHGroup + +Phase-two DH group used for establishing connection. + +"phaseTwoDHGroup": "GROUP1" + + + +phaseOneLifeTime + +DH Phase-one connection lifetime. + +"phaseOneLifeTime": 14400 + + + +phaseTwoLifeTime + +DH Phase-two connection lifetime. + +"phaseTwoLifeTime": 14400 + + + +ikeVersion +*required + +IKE version. + +"ikeVersion": "1" + + + +ikeReAuthTime + +IKE re-authentication time. + +"ikeReAuthTime": 86400 + + + +nadIp +*required + +NAD IP for establishing the connection. + +"nadIp": "1.1.1.1" + + + +modeOption +*required + +The Mode type used for establishing the connection. + +"modeOption": "tunnel" + + + + +NOTE: + +psk +field is mandatory if authType=psk +certId +field is mandatory if authType=x509 + +If FIPS mode is on.: + + +Cannot choose DES or 3DES for Phase-one and Phase-two Encryption algorithms. + +PSK length must be 14 characters or more. + +DH Groups 1, 2, and 5 cannot be chosen for Phase-one and Phase-two fields. + + + + +*/ +func (s *NativeIPsecService) CreateIPsecConnection(requestNativeIPsecCreateIpsecConnection *RequestNativeIPsecCreateIPsecConnection) (*ResponseNativeIPsecCreateIPsecConnection, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/ipsec" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestNativeIPsecCreateIpsecConnection). + SetResult(&ResponseNativeIPsecCreateIPsecConnection{}). + SetError(&Error). + Post(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseNativeIPsecCreateIPsecConnection{}, response, nil + } + return nil, nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return nil, response, fmt.Errorf("error with operation CreateIpsecConnection") + } + + result := response.Result().(*ResponseNativeIPsecCreateIPsecConnection) + return result, response, err + +} + +//BulkIPSecOperation Create, update, disable, enable and remove IPsec connections in bulk +/* Create, update, disable, enable and remove IPsec connections in bulk + + */ +func (s *NativeIPsecService) BulkIPSecOperation(requestNativeIPsecBulkIPSecOperation *RequestNativeIPsecBulkIPSecOperation) (*ResponseNativeIPsecBulkIPSecOperation, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/ipsec/bulk" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestNativeIPsecBulkIPSecOperation). + SetResult(&ResponseNativeIPsecBulkIPSecOperation{}). + SetError(&Error). + Post(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseNativeIPsecBulkIPSecOperation{}, response, nil + } + return nil, nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return nil, response, fmt.Errorf("error with operation BulkIpSecOperation") + } + + result := response.Result().(*ResponseNativeIPsecBulkIPSecOperation) + return result, response, err + +} + +//UpdateIPsecConnectionConfig Update the configuration of an existing IPsec connection on a node +/* +Updates the configuration of existing IPsec connection. + The following parameters are present in the PUT request body: + + + + +PARAMETER + +DESCRIPTION + +EXAMPLE + + + + + +id +*required + +ID of the existing IPsec configuration. + +"id": "7c9484cf-0ebc-47ad-a9ef-bc12729ed73b" + + + +iface +*required + +Ethernet port used for establishing connection + +"iface": "0" + + + +psk +*required + +Pre-shared key used for establishing connection. + +"psk": "psk12345" + + + +authType +*required + +Pre-shared key used for establishing connection. + +"authType": "psk" + + + +configureVti + +Used For VTI Configurations + +"configureVti": "false" + + + +remotePeerInternalIp + +VTI Internal IP of the NAD + +"remotePeerInternalIp": "1.2.3.1" + + + +localInternalIp + +IP address assigned to the VTI interface so this would be the internal ip + +"localInternalIp": "1.1.3.1" + + + +certId +*required + +ID of the certificate for establishing connection. + +"certId": "21323243545433" + + + +phaseOneEncryptionAlgo +*required + +Phase-one encryption algorithm used for establishing connection. + +"phaseOneEncryptionAlgo": "aes" + + + +phaseTwoEncryptionAlgo +*required + +Phase-two encryption algorithm used for establishing connection. + +"phaseTwoEncryptionAlgo": "aes" + + + +espAhProtocol +*required + +Encryption protocol used for establishing connection. + +"espAhProtocol": "ah" + + + +phaseOneHashAlgo +*required + +Phase-one hashing algorithm used for establishing connection. + +"phaseOneHashAlgo": "sha" + + + +phaseTwoHashAlgo +*required + +Phase-two hashing algorithm used for establishing connection. + +"phaseTwoHashAlgo": "sha" + + + +phaseOneDHGroup +*required + +Phase-one DH group used for establishing connection. + +"phaseOneDHGroup": "GROUP1" + + + +phaseTwoDHGroup + +Phase-two DH group used for establishing connection. + +"phaseTwoDHGroup": "GROUP1" + + + +phaseOneLifeTime + +DH Phase-one connection lifetime. + +"phaseOneLifeTime": 14400 + + + +phaseTwoLifeTime + +DH Phase-two connection lifetime. + +"phaseTwoLifeTime": 14400 + + + +ikeVersion +*required + +IKE version. + +"ikeVersion": "1" + + + +ikeReAuthTime + +IKE re-authentication time. + +"ikeReAuthTime": 86400 + + + +nadIp +*required + +NAD IP for establishing connection. + +"nadIp": "1.1.1.1" + + + +modeOption +*required + +The Mode type used for establishing the connection. + +"modeOption": "tunnel" + + + + +NOTE: + +psk +field is mandatory if authType=psk +certId +field is mandatory if authType=x509 + +If FIPS mode is on.: + + +Cannot choose DES or 3DES for Phase-one and Phase-two Encryption algorithms. + +PSK length must be 14 characters or more. + +DH Groups 1, 2, and 5 cannot be chosen for Phase-one and Phase-two fields. + + + + +*/ +func (s *NativeIPsecService) UpdateIPsecConnectionConfig(requestNativeIPsecUpdateIpsecConnectionConfig *RequestNativeIPsecUpdateIPsecConnectionConfig) (*ResponseNativeIPsecUpdateIPsecConnectionConfig, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/ipsec" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestNativeIPsecUpdateIpsecConnectionConfig). + SetResult(&ResponseNativeIPsecUpdateIPsecConnectionConfig{}). + SetError(&Error). + Put(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseNativeIPsecUpdateIPsecConnectionConfig{}, response, nil + } + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation UpdateIpsecConnectionConfig") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseNativeIPsecUpdateIPsecConnectionConfig) + return result, response, err + +} + +//DisableIPsecConnection Disable the IPsec connection on a node for a given hostname and NAD IP +/* Disables an enabled IPsec node connection. + +@param hostName hostName path parameter. Hostname of the deployed node. +@param nadIP nadIp path parameter. IP address of the NAD. +*/ +func (s *NativeIPsecService) DisableIPsecConnection(hostName string, nadIP string) (*ResponseNativeIPsecDisableIPsecConnection, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/ipsec/disable/{hostName}/{nadIp}" + path = strings.Replace(path, "{hostName}", fmt.Sprintf("%v", hostName), -1) + path = strings.Replace(path, "{nadIp}", fmt.Sprintf("%v", nadIP), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseNativeIPsecDisableIPsecConnection{}). + SetError(&Error). + Put(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseNativeIPsecDisableIPsecConnection{}, response, nil + } + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation DisableIpsecConnection") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseNativeIPsecDisableIPsecConnection) + return result, response, err + +} + +//EnableIPsecConnection Enable the IPsec connection on a node for a given hostname and NAD IP +/* Enables an disabled IPsec node connection. + +@param hostName hostName path parameter. Hostname of the deployed node. +@param nadIP nadIp path parameter. IP address of the NAD. +*/ +func (s *NativeIPsecService) EnableIPsecConnection(hostName string, nadIP string) (*ResponseNativeIPsecEnableIPsecConnection, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/ipsec/enable/{hostName}/{nadIp}" + path = strings.Replace(path, "{hostName}", fmt.Sprintf("%v", hostName), -1) + path = strings.Replace(path, "{nadIp}", fmt.Sprintf("%v", nadIP), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseNativeIPsecEnableIPsecConnection{}). + SetError(&Error). + Put(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseNativeIPsecEnableIPsecConnection{}, response, nil + } + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation EnableIpsecConnection") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseNativeIPsecEnableIPsecConnection) + return result, response, err + +} + +//RemoveIPsecConnection Remove the IPsec connection on a node for a given hostname and NAD IP +/* Removes an enabled IPsec node connection. + +@param hostName hostName path parameter. Hostname of the deployed node. +@param nadIP nadIp path parameter. IP address of the NAD. +*/ +func (s *NativeIPsecService) RemoveIPsecConnection(hostName string, nadIP string) (*ResponseNativeIPsecRemoveIPsecConnection, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/ipsec/{hostName}/{nadIp}" + path = strings.Replace(path, "{hostName}", fmt.Sprintf("%v", hostName), -1) + path = strings.Replace(path, "{nadIp}", fmt.Sprintf("%v", nadIP), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseNativeIPsecRemoveIPsecConnection{}). + SetError(&Error). + Delete(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation RemoveIpsecConnection") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseNativeIPsecRemoveIPsecConnection) + return result, response, err + +} diff --git a/sdk/nbar_app.go b/sdk/nbar_app.go index a065764..93bd459 100644 --- a/sdk/nbar_app.go +++ b/sdk/nbar_app.go @@ -10,31 +10,43 @@ import ( type NbarAppService service -type GetNbarAppsQueryParams struct { - Page int `url:"page,omitempty"` //Page number - Size int `url:"size,omitempty"` //Number of objects returned per page - Sort string `url:"sort,omitempty"` //sort type - asc or desc - SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted - Filter []string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
- FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter +type GetNbarAppListQueryParams struct { + Page int `url:"page,omitempty"` //Page number + Size int `url:"size,omitempty"` //Number of objects returned per page + Sort string `url:"sort,omitempty"` //sort type - asc or desc + SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted + Filter string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
+ FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter } -type ResponseNbarAppGetNbarApps struct { - Response *[]ResponseNbarAppGetNbarAppsResponse `json:"response,omitempty"` // +// GetNbarAppsQueryParams is deprecated, please use GetNbarAppListQueryParams +type GetNbarAppsQueryParams = GetNbarAppListQueryParams + +type ResponseNbarAppGetNbarAppList struct { + Response *[]ResponseNbarAppGetNbarAppListResponse `json:"response,omitempty"` // } -type ResponseNbarAppGetNbarAppsResponse struct { - Description string `json:"description,omitempty"` // - ID string `json:"id,omitempty"` // - Name string `json:"name,omitempty"` // - NetworkIDentities *[]ResponseNbarAppGetNbarAppsResponseNetworkIDentities `json:"networkIdentities,omitempty"` // Array of NIs +// ResponseNbarAppGetNbarApps is deprecated, please use ResponseNbarAppGetNbarAppList +type ResponseNbarAppGetNbarApps = ResponseNbarAppGetNbarAppList + +type ResponseNbarAppGetNbarAppListResponse struct { + Description string `json:"description,omitempty"` // + ID string `json:"id,omitempty"` // + Name string `json:"name,omitempty"` // + NetworkIDentities *[]ResponseNbarAppGetNbarAppListResponseNetworkIDentities `json:"networkIdentities,omitempty"` // Array of NIs } -type ResponseNbarAppGetNbarAppsResponseNetworkIDentities struct { +// ResponseNbarAppGetNbarAppsResponse is deprecated, please use ResponseNbarAppGetNbarAppListResponse +type ResponseNbarAppGetNbarAppsResponse = ResponseNbarAppGetNbarAppListResponse + +type ResponseNbarAppGetNbarAppListResponseNetworkIDentities struct { Ports string `json:"ports,omitempty"` // Protocol string `json:"protocol,omitempty"` // } +// ResponseNbarAppGetNbarAppsResponseNetworkIDentities is deprecated, please use ResponseNbarAppGetNbarAppListResponseNetworkIDentities +type ResponseNbarAppGetNbarAppsResponseNetworkIDentities = ResponseNbarAppGetNbarAppListResponseNetworkIDentities + type ResponseNbarAppCreateNbarApp struct { ID string `json:"id,omitempty"` // ID of the newly created object } @@ -55,16 +67,38 @@ type ResponseNbarAppGetNbarAppByIDResponseNetworkIDentities struct { Protocol string `json:"protocol,omitempty"` // } -type ResponseNbarAppUpdateNbarAppByID struct { - Code *int `json:"code,omitempty"` // - Message string `json:"message,omitempty"` // +type ResponseNbarAppUpdateNbarApp struct { + Response *[]ResponseNbarAppUpdateNbarAppResponse `json:"response,omitempty"` // +} + +// ResponseNbarAppUpdateNbarAppByID is deprecated, please use ResponseNbarAppUpdateNbarApp +type ResponseNbarAppUpdateNbarAppByID = ResponseNbarAppUpdateNbarApp + +type ResponseNbarAppUpdateNbarAppResponse struct { + Description string `json:"description,omitempty"` // + ID string `json:"id,omitempty"` // + Name string `json:"name,omitempty"` // + NetworkIDentities *[]ResponseNbarAppUpdateNbarAppResponseNetworkIDentities `json:"networkIdentities,omitempty"` // Array of NIs +} + +// ResponseNbarAppUpdateNbarAppByIDResponse is deprecated, please use ResponseNbarAppUpdateNbarAppResponse +type ResponseNbarAppUpdateNbarAppByIDResponse = ResponseNbarAppUpdateNbarAppResponse + +type ResponseNbarAppUpdateNbarAppResponseNetworkIDentities struct { + Ports string `json:"ports,omitempty"` // + Protocol string `json:"protocol,omitempty"` // } -type ResponseNbarAppDeleteNbarAppByID struct { - Code *int `json:"code,omitempty"` // - Message string `json:"message,omitempty"` // +// ResponseNbarAppUpdateNbarAppByIDResponseNetworkIDentities is deprecated, please use ResponseNbarAppUpdateNbarAppResponseNetworkIDentities +type ResponseNbarAppUpdateNbarAppByIDResponseNetworkIDentities = ResponseNbarAppUpdateNbarAppResponseNetworkIDentities + +type ResponseNbarAppDeleteNbarApp struct { + ID string `json:"id,omitempty"` // resource id } +// ResponseNbarAppDeleteNbarAppByID is deprecated, please use ResponseNbarAppDeleteNbarApp +type ResponseNbarAppDeleteNbarAppByID = ResponseNbarAppDeleteNbarApp + type RequestNbarAppCreateNbarApp struct { Description string `json:"description,omitempty"` // ID string `json:"id,omitempty"` // @@ -77,34 +111,40 @@ type RequestNbarAppCreateNbarAppNetworkIDentities struct { Protocol string `json:"protocol,omitempty"` // } -type RequestNbarAppUpdateNbarAppByID struct { - Description string `json:"description,omitempty"` // - ID string `json:"id,omitempty"` // - Name string `json:"name,omitempty"` // - NetworkIDentities *[]RequestNbarAppUpdateNbarAppByIDNetworkIDentities `json:"networkIdentities,omitempty"` // Array of NIs +type RequestNbarAppUpdateNbarApp struct { + Description string `json:"description,omitempty"` // + ID string `json:"id,omitempty"` // + Name string `json:"name,omitempty"` // + NetworkIDentities *[]RequestNbarAppUpdateNbarAppNetworkIDentities `json:"networkIdentities,omitempty"` // Array of NIs } -type RequestNbarAppUpdateNbarAppByIDNetworkIDentities struct { +// RequestNbarAppUpdateNbarAppByID is deprecated, please use RequestNbarAppUpdateNbarApp +type RequestNbarAppUpdateNbarAppByID = RequestNbarAppUpdateNbarApp + +type RequestNbarAppUpdateNbarAppNetworkIDentities struct { Ports string `json:"ports,omitempty"` // Protocol string `json:"protocol,omitempty"` // } -//GetNbarApps Get all NBAR Applications +// RequestNbarAppUpdateNbarAppByIDNetworkIDentities is deprecated, please use RequestNbarAppUpdateNbarAppNetworkIDentities +type RequestNbarAppUpdateNbarAppByIDNetworkIDentities = RequestNbarAppUpdateNbarAppNetworkIDentities + +//GetNbarAppList Get all NBAR Applications /* Get all NBAR Applications -@param getNBARAppsQueryParams Filtering parameter +@param getNBARAppListQueryParams Filtering parameter */ -func (s *NbarAppService) GetNbarApps(getNBARAppsQueryParams *GetNbarAppsQueryParams) (*ResponseNbarAppGetNbarApps, *resty.Response, error) { +func (s *NbarAppService) GetNbarAppList(getNBARAppListQueryParams *GetNbarAppListQueryParams) (*ResponseNbarAppGetNbarAppList, *resty.Response, error) { setHost(s.client, "_ui") path := "/api/v1/trustsec/sgacl/nbarapp" - queryString, _ := query.Values(getNBARAppsQueryParams) + queryString, _ := query.Values(getNBARAppListQueryParams) setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetQueryString(queryString.Encode()).SetResult(&ResponseNbarAppGetNbarApps{}). + SetQueryString(queryString.Encode()).SetResult(&ResponseNbarAppGetNbarAppList{}). SetError(&Error). Get(path) @@ -114,16 +154,21 @@ func (s *NbarAppService) GetNbarApps(getNBARAppsQueryParams *GetNbarAppsQueryPar } if response.IsError() { - return nil, response, fmt.Errorf("error with operation GetNbarApps") + return nil, response, fmt.Errorf("error with operation GetNbarAppList") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseNbarAppGetNbarApps) + result := response.Result().(*ResponseNbarAppGetNbarAppList) return result, response, err } +// Alias of GetNbarAppList Get all NBAR Applications +func (s *NbarAppService) GetNbarApps(getNBARAppListQueryParams *GetNbarAppListQueryParams) (*ResponseNbarAppGetNbarAppList, *resty.Response, error) { + return s.GetNbarAppList(getNBARAppListQueryParams) +} + //GetNbarAppByID Get NBAR Application by id /* Get NBAR Application by id @@ -193,12 +238,12 @@ func (s *NbarAppService) CreateNbarApp(requestNbarAppCreateNBARApp *RequestNbarA } -//UpdateNbarAppByID Update NBAR Application +//UpdateNbarApp Update NBAR Application /* Update NBAR Application @param id id path parameter. */ -func (s *NbarAppService) UpdateNbarAppByID(id string, requestNbarAppUpdateNBARAppById *RequestNbarAppUpdateNbarAppByID) (*ResponseNbarAppUpdateNbarAppByID, *resty.Response, error) { +func (s *NbarAppService) UpdateNbarApp(id string, requestNbarAppUpdateNBARApp *RequestNbarAppUpdateNbarApp) (*ResponseNbarAppUpdateNbarApp, *resty.Response, error) { setHost(s.client, "_ui") path := "/api/v1/trustsec/sgacl/nbarapp/{id}" path = strings.Replace(path, "{id}", fmt.Sprintf("%v", id), -1) @@ -207,36 +252,41 @@ func (s *NbarAppService) UpdateNbarAppByID(id string, requestNbarAppUpdateNBARAp response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetBody(requestNbarAppUpdateNBARAppById). - SetResult(&ResponseNbarAppUpdateNbarAppByID{}). + SetBody(requestNbarAppUpdateNBARApp). + SetResult(&ResponseNbarAppUpdateNbarApp{}). SetError(&Error). Put(path) if err != nil { if err.Error() == emptyStringToJSONError { - return &ResponseNbarAppUpdateNbarAppByID{}, response, nil + return &ResponseNbarAppUpdateNbarApp{}, response, nil } return nil, nil, err } if response.IsError() { - return nil, response, fmt.Errorf("error with operation UpdateNbarAppById") + return nil, response, fmt.Errorf("error with operation UpdateNbarApp") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseNbarAppUpdateNbarAppByID) + result := response.Result().(*ResponseNbarAppUpdateNbarApp) return result, response, err } -//DeleteNbarAppByID Delete NBAR Application +// Alias of UpdateNbarApp Update NBAR Application +func (s *NbarAppService) UpdateNbarAppByID(id string, requestNbarAppUpdateNBARApp *RequestNbarAppUpdateNbarApp) (*ResponseNbarAppUpdateNbarApp, *resty.Response, error) { + return s.UpdateNbarApp(id, requestNbarAppUpdateNBARApp) +} + +//DeleteNbarApp Delete NBAR Application /* Delete NBAR Application @param id id path parameter. */ -func (s *NbarAppService) DeleteNbarAppByID(id string) (*ResponseNbarAppDeleteNbarAppByID, *resty.Response, error) { +func (s *NbarAppService) DeleteNbarApp(id string) (*ResponseNbarAppDeleteNbarApp, *resty.Response, error) { setHost(s.client, "_ui") path := "/api/v1/trustsec/sgacl/nbarapp/{id}" path = strings.Replace(path, "{id}", fmt.Sprintf("%v", id), -1) @@ -245,7 +295,7 @@ func (s *NbarAppService) DeleteNbarAppByID(id string) (*ResponseNbarAppDeleteNba response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseNbarAppDeleteNbarAppByID{}). + SetResult(&ResponseNbarAppDeleteNbarApp{}). SetError(&Error). Delete(path) @@ -255,12 +305,17 @@ func (s *NbarAppService) DeleteNbarAppByID(id string) (*ResponseNbarAppDeleteNba } if response.IsError() { - return nil, response, fmt.Errorf("error with operation DeleteNbarAppById") + return nil, response, fmt.Errorf("error with operation DeleteNbarApp") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseNbarAppDeleteNbarAppByID) + result := response.Result().(*ResponseNbarAppDeleteNbarApp) return result, response, err } + +// Alias of DeleteNbarApp Delete NBAR Application +func (s *NbarAppService) DeleteNbarAppByID(id string) (*ResponseNbarAppDeleteNbarApp, *resty.Response, error) { + return s.DeleteNbarApp(id) +} diff --git a/sdk/node_deployment.go b/sdk/node_deployment.go index 41e828f..030988c 100644 --- a/sdk/node_deployment.go +++ b/sdk/node_deployment.go @@ -11,33 +11,42 @@ import ( type NodeDeploymentService service type GetDeploymentNodesQueryParams struct { - Filter string `url:"filter,omitempty"` //
Simple filtering is available through the filter query string parameter. The structure of a filter is a triplet of field operator and value, separated by dots. More than one filter can be sent. The logical operator common to all filter criteria is AND by default, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
- FilterType string `url:"filterType,omitempty"` //The logical operator common to all filter criteria is AND by default, and can be changed by using this parameter. + Filter []string `url:"filter,omitempty"` //
Simple filtering is available through the filter query string parameter. The structure of a filter is a triplet of field operator and value, separated by dots. More than one filter can be sent. The logical operator common to all filter criteria is AND by default, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
+ FilterType string `url:"filterType,omitempty"` //The logical operator common to all filter criteria is AND by default, and can be changed by using this parameter. } -// GetNodesQueryParams is deprecated, please use GetDeploymentNodesQueryParams -type GetNodesQueryParams = GetDeploymentNodesQueryParams +type ResponseNodeDeploymentMakePrimary struct { + Success *ResponseNodeDeploymentMakePrimarySuccess `json:"success,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseNodeDeploymentMakePrimarySuccess struct { + Message string `json:"message,omitempty"` // +} + +type ResponseNodeDeploymentMakeStandalone struct { + Success *ResponseNodeDeploymentMakeStandaloneSuccess `json:"success,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseNodeDeploymentMakeStandaloneSuccess struct { + Message string `json:"message,omitempty"` // +} type ResponseNodeDeploymentGetDeploymentNodes struct { Response *[]ResponseNodeDeploymentGetDeploymentNodesResponse `json:"response,omitempty"` // Version string `json:"version,omitempty"` // } -// ResponseNodeDeploymentGetNodes is deprecated, please use ResponseNodeDeploymentGetDeploymentNodes -type ResponseNodeDeploymentGetNodes = ResponseNodeDeploymentGetDeploymentNodes - type ResponseNodeDeploymentGetDeploymentNodesResponse struct { - Fqdn string `json:"fqdn,omitempty"` // Hostname string `json:"hostname,omitempty"` // + Fqdn string `json:"fqdn,omitempty"` // IPAddress string `json:"ipAddress,omitempty"` // - NodeStatus string `json:"nodeStatus,omitempty"` // - Roles []string `json:"roles,omitempty"` // Roles can be empty or have many values for a node. - Services []string `json:"services,omitempty"` // Services can be empty or have many values for a node. + Roles []string `json:"roles,omitempty"` // + Services []string `json:"services,omitempty"` // + Nodestatus string `json:"nodeStatus,omitempty"` // } -// ResponseNodeDeploymentGetNodesResponse is deprecated, please use ResponseNodeDeploymentGetDeploymentNodesResponse -type ResponseNodeDeploymentGetNodesResponse = ResponseNodeDeploymentGetDeploymentNodesResponse - type ResponseNodeDeploymentRegisterNode struct { Success *ResponseNodeDeploymentRegisterNodeSuccess `json:"success,omitempty"` // Version string `json:"version,omitempty"` // @@ -53,12 +62,12 @@ type ResponseNodeDeploymentGetNodeDetails struct { } type ResponseNodeDeploymentGetNodeDetailsResponse struct { - Fqdn string `json:"fqdn,omitempty"` // Hostname string `json:"hostname,omitempty"` // + Fqdn string `json:"fqdn,omitempty"` // IPAddress string `json:"ipAddress,omitempty"` // - NodeStatus string `json:"nodeStatus,omitempty"` // - Roles []string `json:"roles,omitempty"` // Roles can be empty or have many values for a node. - Services []string `json:"services,omitempty"` // Services can be empty or have many values for a node. + Roles []string `json:"roles,omitempty"` // + Services []string `json:"services,omitempty"` // + Nodestatus string `json:"nodeStatus,omitempty"` // } type ResponseNodeDeploymentUpdateDeploymentNode struct { @@ -91,12 +100,13 @@ type ResponseNodeDeploymentDeleteDeploymentNodeSuccess struct { // ResponseNodeDeploymentDeleteNodeSuccess is deprecated, please use ResponseNodeDeploymentDeleteDeploymentNodeSuccess type ResponseNodeDeploymentDeleteNodeSuccess = ResponseNodeDeploymentDeleteDeploymentNodeSuccess -type ResponseNodeDeploymentMakePrimary struct { - Success *ResponseNodeDeploymentMakePrimarySuccess `json:"success,omitempty"` // - Version string `json:"version,omitempty"` // +type ResponseNodeDeploymentSyncNode struct { + Response *ResponseNodeDeploymentSyncNodeResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // } -type ResponseNodeDeploymentMakePrimarySuccess struct { +type ResponseNodeDeploymentSyncNodeResponse struct { + ID string `json:"id,omitempty"` // ID which can be used to track the status of the deployment task using the Task Service API. Message string `json:"message,omitempty"` // } @@ -109,37 +119,18 @@ type ResponseNodeDeploymentPromoteNodeSuccess struct { Message string `json:"message,omitempty"` // } -type ResponseNodeDeploymentMakeStandalone struct { - Success *ResponseNodeDeploymentMakeStandaloneSuccess `json:"success,omitempty"` // - Version string `json:"version,omitempty"` // -} - -type ResponseNodeDeploymentMakeStandaloneSuccess struct { - Message string `json:"message,omitempty"` // -} - -type ResponseNodeDeploymentSyncNode struct { - Response *ResponseNodeDeploymentSyncNodeResponse `json:"response,omitempty"` // - Version string `json:"version,omitempty"` // -} - -type ResponseNodeDeploymentSyncNodeResponse struct { - ID string `json:"id,omitempty"` // ID which can be used to track the status of the deployment task using the Task Service API. - Message string `json:"message,omitempty"` // -} - type RequestNodeDeploymentRegisterNode struct { - AllowCertImport *bool `json:"allowCertImport,omitempty"` // Consent to import the self-signed certificate of the registering node. Fqdn string `json:"fqdn,omitempty"` // - Password string `json:"password,omitempty"` // - Roles []string `json:"roles,omitempty"` // Roles can be empty or have many values for a node. - Services []string `json:"services,omitempty"` // Services can be empty or have many values for a node. UserName string `json:"userName,omitempty"` // + Password string `json:"password,omitempty"` // + AllowCertImport *bool `json:"allowCertImport,omitempty"` // Consent to import the self-signed certificate of the registering node. + Roles []string `json:"roles,omitempty"` // + Services []string `json:"services,omitempty"` // } type RequestNodeDeploymentUpdateDeploymentNode struct { - Roles []string `json:"roles,omitempty"` // Roles can be empty or have many values for a node. - Services []string `json:"services,omitempty"` // Services can be empty or have many values for a node. + Roles []string `json:"roles,omitempty"` // + Services []string `json:"services,omitempty"` // } // RequestNodeDeploymentUpdateNode is deprecated, please use RequestNodeDeploymentUpdateDeploymentNode @@ -147,8 +138,11 @@ type RequestNodeDeploymentUpdateNode = RequestNodeDeploymentUpdateDeploymentNode //GetDeploymentNodes Retrieve the list of all the nodes that are deployed in the cluster. /* The API lists all the nodes that are deployed in the cluster. - Returns basic information about each of the deployed nodes in the cluster like hostname, status, roles, and services. - Supports filtering on FQDN, hostname, IP address, roles, services and node status. + +Returns basic information about each of the deployed nodes in the cluster like hostname, status, roles, and services. + +Supports filtering on FQDN, hostname, IP address, roles, services and node status. + @param getDeploymentNodesQueryParams Filtering parameter */ @@ -182,14 +176,10 @@ func (s *NodeDeploymentService) GetDeploymentNodes(getDeploymentNodesQueryParams } -// Alias of GetDeploymentNodes Retrieve the list of all the nodes that are deployed in the cluster. -func (s *NodeDeploymentService) GetNodes(getDeploymentNodesQueryParams *GetDeploymentNodesQueryParams) (*ResponseNodeDeploymentGetDeploymentNodes, *resty.Response, error) { - return s.GetDeploymentNodes(getDeploymentNodesQueryParams) -} - //GetNodeDetails Retrieve details of a deployed node. /* This API retrieves detailed information of the deployed node. + @param hostname hostname path parameter. Hostname of the deployed node. */ func (s *NodeDeploymentService) GetNodeDetails(hostname string) (*ResponseNodeDeploymentGetNodeDetails, *resty.Response, error) { @@ -221,27 +211,26 @@ func (s *NodeDeploymentService) GetNodeDetails(hostname string) (*ResponseNodeDe } -//RegisterNode Register a standalone node to the cluster -/* This API registers a Cisco ISE node to form a multi-node deployment. -Approximate execution time 300 seconds. +//MakePrimary Promote a standalone node to a primary PAN. +/* This API promotes the standalone node on which the API is invoked to the primary Policy Administration node (PAN). -*/ -func (s *NodeDeploymentService) RegisterNode(requestNodeDeploymentRegisterNode *RequestNodeDeploymentRegisterNode) (*ResponseNodeDeploymentRegisterNode, *resty.Response, error) { + + */ +func (s *NodeDeploymentService) MakePrimary() (*ResponseNodeDeploymentMakePrimary, *resty.Response, error) { setHost(s.client, "_ui") - path := "/api/v1/deployment/node" + path := "/api/v1/deployment/primary" setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetBody(requestNodeDeploymentRegisterNode). - SetResult(&ResponseNodeDeploymentRegisterNode{}). + SetResult(&ResponseNodeDeploymentMakePrimary{}). SetError(&Error). Post(path) if err != nil { if err.Error() == emptyStringToJSONError { - return &ResponseNodeDeploymentRegisterNode{}, response, nil + return &ResponseNodeDeploymentMakePrimary{}, response, nil } return nil, nil, err @@ -249,33 +238,34 @@ func (s *NodeDeploymentService) RegisterNode(requestNodeDeploymentRegisterNode * getCSFRToken(response.Header()) if response.IsError() { - return nil, response, fmt.Errorf("error with operation RegisterNode") + return nil, response, fmt.Errorf("error with operation MakePrimary") } - result := response.Result().(*ResponseNodeDeploymentRegisterNode) + result := response.Result().(*ResponseNodeDeploymentMakePrimary) return result, response, err } -//MakePrimary Promote a standalone node to a primary PAN. -/* This API promotes the standalone node on which the API is invoked to the primary Policy Administration node (PAN). +//MakeStandalone Change a primary PAN to a standalone node. +/* This API changes the primary PAN in a single node cluster on which the API is invoked, to a standalone node. + */ -func (s *NodeDeploymentService) MakePrimary() (*ResponseNodeDeploymentMakePrimary, *resty.Response, error) { +func (s *NodeDeploymentService) MakeStandalone() (*ResponseNodeDeploymentMakeStandalone, *resty.Response, error) { setHost(s.client, "_ui") - path := "/api/v1/deployment/primary" + path := "/api/v1/deployment/standalone" setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseNodeDeploymentMakePrimary{}). + SetResult(&ResponseNodeDeploymentMakeStandalone{}). SetError(&Error). Post(path) if err != nil { if err.Error() == emptyStringToJSONError { - return &ResponseNodeDeploymentMakePrimary{}, response, nil + return &ResponseNodeDeploymentMakeStandalone{}, response, nil } return nil, nil, err @@ -283,34 +273,35 @@ func (s *NodeDeploymentService) MakePrimary() (*ResponseNodeDeploymentMakePrimar getCSFRToken(response.Header()) if response.IsError() { - return nil, response, fmt.Errorf("error with operation MakePrimary") + return nil, response, fmt.Errorf("error with operation MakeStandalone") } - result := response.Result().(*ResponseNodeDeploymentMakePrimary) + result := response.Result().(*ResponseNodeDeploymentMakeStandalone) return result, response, err } -//PromoteNode Promote the secondary PAN in a multi-node cluster to the role of primary PAN. -/* Execute this API in the secondary PAN in the cluster to promote the node to primary PAN. Ensure that the API Gateway setting is enabled in the secondary PAN. -Approximate execution time 300 seconds. +//RegisterNode Register a standalone node to the cluster +/* This API registers a Cisco ISE node to form a multi-node deployment. -*/ -func (s *NodeDeploymentService) PromoteNode() (*ResponseNodeDeploymentPromoteNode, *resty.Response, error) { + + */ +func (s *NodeDeploymentService) RegisterNode(requestNodeDeploymentRegisterNode *RequestNodeDeploymentRegisterNode) (*ResponseNodeDeploymentRegisterNode, *resty.Response, error) { setHost(s.client, "_ui") - path := "/api/v1/deployment/promote" + path := "/api/v1/deployment/node" setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseNodeDeploymentPromoteNode{}). + SetBody(requestNodeDeploymentRegisterNode). + SetResult(&ResponseNodeDeploymentRegisterNode{}). SetError(&Error). Post(path) if err != nil { if err.Error() == emptyStringToJSONError { - return &ResponseNodeDeploymentPromoteNode{}, response, nil + return &ResponseNodeDeploymentRegisterNode{}, response, nil } return nil, nil, err @@ -318,33 +309,35 @@ func (s *NodeDeploymentService) PromoteNode() (*ResponseNodeDeploymentPromoteNod getCSFRToken(response.Header()) if response.IsError() { - return nil, response, fmt.Errorf("error with operation PromoteNode") + return nil, response, fmt.Errorf("error with operation RegisterNode") } - result := response.Result().(*ResponseNodeDeploymentPromoteNode) + result := response.Result().(*ResponseNodeDeploymentRegisterNode) return result, response, err } -//MakeStandalone Change a primary PAN to a standalone node. -/* This API changes the primary PAN in a single node cluster on which the API is invoked, to a standalone node. +//SyncNode Trigger manual synchronization of the node. +/* Performing a manual synchronization involves a reload of the target node, but not the primary PAN. - */ -func (s *NodeDeploymentService) MakeStandalone() (*ResponseNodeDeploymentMakeStandalone, *resty.Response, error) { +@param hostname hostname path parameter. Hostname of the node. +*/ +func (s *NodeDeploymentService) SyncNode(hostname string) (*ResponseNodeDeploymentSyncNode, *resty.Response, error) { setHost(s.client, "_ui") - path := "/api/v1/deployment/standalone" + path := "/api/v1/deployment/sync-node/{hostname}" + path = strings.Replace(path, "{hostname}", fmt.Sprintf("%v", hostname), -1) setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseNodeDeploymentMakeStandalone{}). + SetResult(&ResponseNodeDeploymentSyncNode{}). SetError(&Error). Post(path) if err != nil { if err.Error() == emptyStringToJSONError { - return &ResponseNodeDeploymentMakeStandalone{}, response, nil + return &ResponseNodeDeploymentSyncNode{}, response, nil } return nil, nil, err @@ -352,36 +345,34 @@ func (s *NodeDeploymentService) MakeStandalone() (*ResponseNodeDeploymentMakeSta getCSFRToken(response.Header()) if response.IsError() { - return nil, response, fmt.Errorf("error with operation MakeStandalone") + return nil, response, fmt.Errorf("error with operation SyncNode") } - result := response.Result().(*ResponseNodeDeploymentMakeStandalone) + result := response.Result().(*ResponseNodeDeploymentSyncNode) return result, response, err } -//SyncNode Trigger manual synchronization of the node. -/* Performing a manual synchronization involves a reload of the target node, but not the primary PAN. - Approximate execution time 300 seconds. +//PromoteNode Promote the secondary PAN in a multi-node cluster to the role of primary PAN. +/* Execute this API in the secondary PAN in the cluster to promote the node to primary PAN. Ensure that the API Gateway setting is enabled in the secondary PAN. -@param hostname hostname path parameter. Hostname of the node. -*/ -func (s *NodeDeploymentService) SyncNode(hostname string) (*ResponseNodeDeploymentSyncNode, *resty.Response, error) { + + */ +func (s *NodeDeploymentService) PromoteNode() (*ResponseNodeDeploymentPromoteNode, *resty.Response, error) { setHost(s.client, "_ui") - path := "/api/v1/deployment/sync-node/{hostname}" - path = strings.Replace(path, "{hostname}", fmt.Sprintf("%v", hostname), -1) + path := "/api/v1/deployment/promote" setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseNodeDeploymentSyncNode{}). + SetResult(&ResponseNodeDeploymentPromoteNode{}). SetError(&Error). Post(path) if err != nil { if err.Error() == emptyStringToJSONError { - return &ResponseNodeDeploymentSyncNode{}, response, nil + return &ResponseNodeDeploymentPromoteNode{}, response, nil } return nil, nil, err @@ -389,17 +380,17 @@ func (s *NodeDeploymentService) SyncNode(hostname string) (*ResponseNodeDeployme getCSFRToken(response.Header()) if response.IsError() { - return nil, response, fmt.Errorf("error with operation SyncNode") + return nil, response, fmt.Errorf("error with operation PromoteNode") } - result := response.Result().(*ResponseNodeDeploymentSyncNode) + result := response.Result().(*ResponseNodeDeploymentPromoteNode) return result, response, err } //UpdateDeploymentNode Replace the existing configuration of the Cisco ISE node with the configuration provided. /* This API updates the configuration of the Cisco ISE node with the configuration provided. - Approximate execution time 300 seconds. + @param hostname hostname path parameter. Hostname of the deployed node. */ @@ -443,8 +434,9 @@ func (s *NodeDeploymentService) UpdateNode(hostname string, requestNodeDeploymen //DeleteDeploymentNode Remove a deployed node from a cluster. /* The deregistered node becomes a standalone Cisco ISE node. - It retains the last configuration that it received from the primary PAN and assumes the default roles and services of a standalone node. - Approximate execution time 300 seconds. + +It retains the last configuration that it received from the primary PAN and assumes the default roles and services of a standalone node. + @param hostname hostname path parameter. The hostname of the node in the deployment to be deregistered. */ diff --git a/sdk/node_group.go b/sdk/node_group.go index 62a7ec0..cea92bc 100644 --- a/sdk/node_group.go +++ b/sdk/node_group.go @@ -20,16 +20,16 @@ type ResponseNodeGroupGetNodeGroups struct { } type ResponseNodeGroupGetNodeGroupsResponse struct { + Name string `json:"name,omitempty"` // Description string `json:"description,omitempty"` // MarCache *ResponseNodeGroupGetNodeGroupsResponseMarCache `json:"marCache,omitempty"` // - Name string `json:"name,omitempty"` // } type ResponseNodeGroupGetNodeGroupsResponseMarCache struct { - QueryAttempts *int `json:"query-attempts,omitempty"` // The number of times Cisco ISE attempts to perform the cache entry query. (0 - 5). - QueryTimeout *int `json:"query-timeout,omitempty"` // The time, in seconds, after which the cache entry query times out. (1 - 10). - ReplicationAttempts *int `json:"replication-attempts,omitempty"` // The number of times Cisco ISE attempts to perform MAR cache entry replication. (0 - 5). ReplicationTimeout *int `json:"replication-timeout,omitempty"` // The time, in seconds, after which the cache entry replication times out. (1 - 10). + ReplicationAttempts *int `json:"replication-attempts,omitempty"` // The number of times Cisco ISE attempts to perform MAR cache entry replication. (0 - 5). + QueryTimeout *int `json:"query-timeout,omitempty"` // The time, in seconds, after which the cache entry query times out. (1 - 10). + QueryAttempts *int `json:"query-attempts,omitempty"` // The number of times Cisco ISE attempts to perform the cache entry query. (0 - 5). } type ResponseNodeGroupCreateNodeGroup struct { @@ -47,16 +47,16 @@ type ResponseNodeGroupGetNodeGroup struct { } type ResponseNodeGroupGetNodeGroupResponse struct { + Name string `json:"name,omitempty"` // Description string `json:"description,omitempty"` // MarCache *ResponseNodeGroupGetNodeGroupResponseMarCache `json:"marCache,omitempty"` // - Name string `json:"name,omitempty"` // } type ResponseNodeGroupGetNodeGroupResponseMarCache struct { - QueryAttempts *int `json:"query-attempts,omitempty"` // The number of times Cisco ISE attempts to perform the cache entry query. (0 - 5). - QueryTimeout *int `json:"query-timeout,omitempty"` // The time, in seconds, after which the cache entry query times out. (1 - 10). - ReplicationAttempts *int `json:"replication-attempts,omitempty"` // The number of times Cisco ISE attempts to perform MAR cache entry replication. (0 - 5). ReplicationTimeout *int `json:"replication-timeout,omitempty"` // The time, in seconds, after which the cache entry replication times out. (1 - 10). + ReplicationAttempts *int `json:"replication-attempts,omitempty"` // The number of times Cisco ISE attempts to perform MAR cache entry replication. (0 - 5). + QueryTimeout *int `json:"query-timeout,omitempty"` // The time, in seconds, after which the cache entry query times out. (1 - 10). + QueryAttempts *int `json:"query-attempts,omitempty"` // The number of times Cisco ISE attempts to perform the cache entry query. (0 - 5). } type ResponseNodeGroupUpdateNodeGroup struct { @@ -78,11 +78,20 @@ type ResponseNodeGroupDeleteNodeGroupSuccess struct { } type ResponseNodeGroupAddNode struct { - Success *ResponseNodeGroupAddNodeSuccess `json:"success,omitempty"` // + Success *ResponseNodeGroupAddNodesuccess `json:"success,omitempty"` // Version string `json:"version,omitempty"` // } -type ResponseNodeGroupAddNodeSuccess struct { +type ResponseNodeGroupAddNodesuccess struct { + Message string `json:"message,omitempty"` // +} + +type ResponseNodeGroupRemoveNode struct { + Success *ResponseNodeGroupRemoveNodesuccess `json:"success,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseNodeGroupRemoveNodesuccess struct { Message string `json:"message,omitempty"` // } @@ -95,39 +104,30 @@ type ResponseNodeGroupGetNodesResponse struct { Hostname string `json:"hostname,omitempty"` // } -type ResponseNodeGroupRemoveNode struct { - Success *ResponseNodeGroupRemoveNodeSuccess `json:"success,omitempty"` // - Version string `json:"version,omitempty"` // -} - -type ResponseNodeGroupRemoveNodeSuccess struct { - Message string `json:"message,omitempty"` // -} - type RequestNodeGroupCreateNodeGroup struct { + Name string `json:"name,omitempty"` // Description string `json:"description,omitempty"` // MarCache *RequestNodeGroupCreateNodeGroupMarCache `json:"marCache,omitempty"` // - Name string `json:"name,omitempty"` // } type RequestNodeGroupCreateNodeGroupMarCache struct { - QueryAttempts *int `json:"query-attempts,omitempty"` // The number of times Cisco ISE attempts to perform the cache entry query. (0 - 5). - QueryTimeout *int `json:"query-timeout,omitempty"` // The time, in seconds, after which the cache entry query times out. (1 - 10). - ReplicationAttempts *int `json:"replication-attempts,omitempty"` // The number of times Cisco ISE attempts to perform MAR cache entry replication. (0 - 5). ReplicationTimeout *int `json:"replication-timeout,omitempty"` // The time, in seconds, after which the cache entry replication times out. (1 - 10). + ReplicationAttempts *int `json:"replication-attempts,omitempty"` // The number of times Cisco ISE attempts to perform MAR cache entry replication. (0 - 5). + QueryTimeout *int `json:"query-timeout,omitempty"` // The time, in seconds, after which the cache entry query times out. (1 - 10). + QueryAttempts *int `json:"query-attempts,omitempty"` // The number of times Cisco ISE attempts to perform the cache entry query. (0 - 5). } type RequestNodeGroupUpdateNodeGroup struct { + Name string `json:"name,omitempty"` // Description string `json:"description,omitempty"` // MarCache *RequestNodeGroupUpdateNodeGroupMarCache `json:"marCache,omitempty"` // - Name string `json:"name,omitempty"` // } type RequestNodeGroupUpdateNodeGroupMarCache struct { - QueryAttempts *int `json:"query-attempts,omitempty"` // The number of times Cisco ISE attempts to perform the cache entry query. (0 - 5). - QueryTimeout *int `json:"query-timeout,omitempty"` // The time, in seconds, after which the cache entry query times out. (1 - 10). - ReplicationAttempts *int `json:"replication-attempts,omitempty"` // The number of times Cisco ISE attempts to perform MAR cache entry replication. (0 - 5). ReplicationTimeout *int `json:"replication-timeout,omitempty"` // The time, in seconds, after which the cache entry replication times out. (1 - 10). + ReplicationAttempts *int `json:"replication-attempts,omitempty"` // The number of times Cisco ISE attempts to perform MAR cache entry replication. (0 - 5). + QueryTimeout *int `json:"query-timeout,omitempty"` // The time, in seconds, after which the cache entry query times out. (1 - 10). + QueryAttempts *int `json:"query-attempts,omitempty"` // The number of times Cisco ISE attempts to perform the cache entry query. (0 - 5). } type RequestNodeGroupAddNode struct { @@ -274,7 +274,7 @@ description Description of the node group ( valid-range: - 0-256 characters) + 1-256 characters) {"name": "site2", "description": "sample"} diff --git a/sdk/node_services.go b/sdk/node_services.go index 140cb8d..0f757f4 100644 --- a/sdk/node_services.go +++ b/sdk/node_services.go @@ -42,84 +42,64 @@ type ResponseNodeServicesGetProfilerProbeConfig struct { } type ResponseNodeServicesGetProfilerProbeConfigResponse struct { - ActiveDirectory *ResponseNodeServicesGetProfilerProbeConfigResponseActiveDirectory `json:"activeDirectory,omitempty"` // The Active Directory probe queries the Active Directory for Windows information. + Netflow *ResponseNodeServicesGetProfilerProbeConfigResponseNetflow `json:"netflow,omitempty"` // The NetFlow probe collects the NetFlow packets that are sent to it from routers. Dhcp *ResponseNodeServicesGetProfilerProbeConfigResponseDhcp `json:"dhcp,omitempty"` // The DHCP probe listens for DHCP packets from IP helpers. DhcpSpan *ResponseNodeServicesGetProfilerProbeConfigResponseDhcpSpan `json:"dhcpSpan,omitempty"` // The DHCP SPAN probe collects DHCP packets. - DNS *ResponseNodeServicesGetProfilerProbeConfigResponseDNS `json:"dns,omitempty"` // The DNS probe performs a DNS lookup for the FQDN. HTTP *ResponseNodeServicesGetProfilerProbeConfigResponseHTTP `json:"http,omitempty"` // The HTTP probe receives and parses HTTP packets. - Netflow *ResponseNodeServicesGetProfilerProbeConfigResponseNetflow `json:"netflow,omitempty"` // The NetFlow probe collects the NetFlow packets that are sent to it from routers. - Nmap *[]ResponseNodeServicesGetProfilerProbeConfigResponseNmap `json:"nmap,omitempty"` // The NMAP probe scans endpoints for open ports and OS. - Pxgrid *[]ResponseNodeServicesGetProfilerProbeConfigResponsePxgrid `json:"pxgrid,omitempty"` // The pxGrid probe fetches attributes of MAC address or IP address as a subscriber from the pxGrid queue. Radius *[]ResponseNodeServicesGetProfilerProbeConfigResponseRadius `json:"radius,omitempty"` // The RADIUS probe collects RADIUS session attributes as well as CDP, LLDP, DHCP, HTTP, and MDM attributes from IOS Sensors. + Nmap *[]ResponseNodeServicesGetProfilerProbeConfigResponseNmap `json:"nmap,omitempty"` // The NMAP probe scans endpoints for open ports and OS. + DNS *ResponseNodeServicesGetProfilerProbeConfigResponseDNS `json:"dns,omitempty"` // The DNS probe performs a DNS lookup for the FQDN. SNMPQuery *ResponseNodeServicesGetProfilerProbeConfigResponseSNMPQuery `json:"snmpQuery,omitempty"` // The SNMP query probe collects details from network devices such as interface, CDP, LLDP, and ARP. SNMPTrap *ResponseNodeServicesGetProfilerProbeConfigResponseSNMPTrap `json:"snmpTrap,omitempty"` // The SNMP trap probe receives linkup, linkdown, and MAC notification traps from network devices. + ActiveDirectory *ResponseNodeServicesGetProfilerProbeConfigResponseActiveDirectory `json:"activeDirectory,omitempty"` // The Active Directory probe queries the Active Directory for Windows information. + Pxgrid *[]ResponseNodeServicesGetProfilerProbeConfigResponsePxgrid `json:"pxgrid,omitempty"` // The pxGrid probe fetches attributes of MAC address or IP address as a subscriber from the pxGrid queue. } -type ResponseNodeServicesGetProfilerProbeConfigResponseActiveDirectory struct { - DaysBeforeRescan *int `json:"daysBeforeRescan,omitempty"` // +type ResponseNodeServicesGetProfilerProbeConfigResponseNetflow struct { + Interface string `json:"interface,omitempty"` // + Port *int `json:"port,omitempty"` // } type ResponseNodeServicesGetProfilerProbeConfigResponseDhcp struct { - Interfaces *[]ResponseNodeServicesGetProfilerProbeConfigResponseDhcpInterfaces `json:"interfaces,omitempty"` // - Port *int `json:"port,omitempty"` // -} - -type ResponseNodeServicesGetProfilerProbeConfigResponseDhcpInterfaces struct { Interface string `json:"interface,omitempty"` // + Port *int `json:"port,omitempty"` // } type ResponseNodeServicesGetProfilerProbeConfigResponseDhcpSpan struct { - Interfaces *[]ResponseNodeServicesGetProfilerProbeConfigResponseDhcpSpanInterfaces `json:"interfaces,omitempty"` // -} - -type ResponseNodeServicesGetProfilerProbeConfigResponseDhcpSpanInterfaces struct { Interface string `json:"interface,omitempty"` // } -type ResponseNodeServicesGetProfilerProbeConfigResponseDNS struct { - Timeout *int `json:"timeout,omitempty"` // -} - type ResponseNodeServicesGetProfilerProbeConfigResponseHTTP struct { - Interfaces *[]ResponseNodeServicesGetProfilerProbeConfigResponseHTTPInterfaces `json:"interfaces,omitempty"` // -} - -type ResponseNodeServicesGetProfilerProbeConfigResponseHTTPInterfaces struct { Interface string `json:"interface,omitempty"` // } -type ResponseNodeServicesGetProfilerProbeConfigResponseNetflow struct { - Interfaces *[]ResponseNodeServicesGetProfilerProbeConfigResponseNetflowInterfaces `json:"interfaces,omitempty"` // - Port *int `json:"port,omitempty"` // -} - -type ResponseNodeServicesGetProfilerProbeConfigResponseNetflowInterfaces struct { - Interface string `json:"interface,omitempty"` // -} +type ResponseNodeServicesGetProfilerProbeConfigResponseRadius interface{} type ResponseNodeServicesGetProfilerProbeConfigResponseNmap interface{} -type ResponseNodeServicesGetProfilerProbeConfigResponsePxgrid interface{} - -type ResponseNodeServicesGetProfilerProbeConfigResponseRadius interface{} +type ResponseNodeServicesGetProfilerProbeConfigResponseDNS struct { + Timeout *int `json:"timeout,omitempty"` // +} type ResponseNodeServicesGetProfilerProbeConfigResponseSNMPQuery struct { - EventTimeout *int `json:"eventTimeout,omitempty"` // Retries *int `json:"retries,omitempty"` // Timeout *int `json:"timeout,omitempty"` // + EventTimeout *int `json:"eventTimeout,omitempty"` // } type ResponseNodeServicesGetProfilerProbeConfigResponseSNMPTrap struct { - Interfaces *[]ResponseNodeServicesGetProfilerProbeConfigResponseSNMPTrapInterfaces `json:"interfaces,omitempty"` // - LinkTrapQuery *bool `json:"linkTrapQuery,omitempty"` // - MacTrapQuery *bool `json:"macTrapQuery,omitempty"` // - Port *int `json:"port,omitempty"` // + LinkTrapQuery *bool `json:"linkTrapQuery,omitempty"` // + MacTrapQuery *bool `json:"macTrapQuery,omitempty"` // + Interface string `json:"interface,omitempty"` // + Port *int `json:"port,omitempty"` // } -type ResponseNodeServicesGetProfilerProbeConfigResponseSNMPTrapInterfaces struct { - Interface string `json:"interface,omitempty"` // +type ResponseNodeServicesGetProfilerProbeConfigResponseActiveDirectory struct { + DaysBeforeRescan *int `json:"daysBeforeRescan,omitempty"` // } +type ResponseNodeServicesGetProfilerProbeConfigResponsePxgrid interface{} + type ResponseNodeServicesSetProfilerProbeConfig struct { Success *ResponseNodeServicesSetProfilerProbeConfigSuccess `json:"success,omitempty"` // Version string `json:"version,omitempty"` // @@ -134,87 +114,68 @@ type RequestNodeServicesSetSxpInterface struct { } type RequestNodeServicesSetProfilerProbeConfig struct { - ActiveDirectory *RequestNodeServicesSetProfilerProbeConfigActiveDirectory `json:"activeDirectory,omitempty"` // The Active Directory probe queries the Active Directory for Windows information. + Netflow *RequestNodeServicesSetProfilerProbeConfigNetflow `json:"netflow,omitempty"` // The NetFlow probe collects the NetFlow packets that are sent to it from routers. Dhcp *RequestNodeServicesSetProfilerProbeConfigDhcp `json:"dhcp,omitempty"` // The DHCP probe listens for DHCP packets from IP helpers. DhcpSpan *RequestNodeServicesSetProfilerProbeConfigDhcpSpan `json:"dhcpSpan,omitempty"` // The DHCP SPAN probe collects DHCP packets. - DNS *RequestNodeServicesSetProfilerProbeConfigDNS `json:"dns,omitempty"` // The DNS probe performs a DNS lookup for the FQDN. HTTP *RequestNodeServicesSetProfilerProbeConfigHTTP `json:"http,omitempty"` // The HTTP probe receives and parses HTTP packets. - Netflow *RequestNodeServicesSetProfilerProbeConfigNetflow `json:"netflow,omitempty"` // The NetFlow probe collects the NetFlow packets that are sent to it from routers. - Nmap *[]RequestNodeServicesSetProfilerProbeConfigNmap `json:"nmap,omitempty"` // The NMAP probe scans endpoints for open ports and OS. - Pxgrid *[]RequestNodeServicesSetProfilerProbeConfigPxgrid `json:"pxgrid,omitempty"` // The pxGrid probe fetches attributes of MAC address or IP address as a subscriber from the pxGrid queue. Radius *[]RequestNodeServicesSetProfilerProbeConfigRadius `json:"radius,omitempty"` // The RADIUS probe collects RADIUS session attributes as well as CDP, LLDP, DHCP, HTTP, and MDM attributes from IOS Sensors. + Nmap *[]RequestNodeServicesSetProfilerProbeConfigNmap `json:"nmap,omitempty"` // The NMAP probe scans endpoints for open ports and OS. + DNS *RequestNodeServicesSetProfilerProbeConfigDNS `json:"dns,omitempty"` // The DNS probe performs a DNS lookup for the FQDN. SNMPQuery *RequestNodeServicesSetProfilerProbeConfigSNMPQuery `json:"snmpQuery,omitempty"` // The SNMP query probe collects details from network devices such as interface, CDP, LLDP, and ARP. SNMPTrap *RequestNodeServicesSetProfilerProbeConfigSNMPTrap `json:"snmpTrap,omitempty"` // The SNMP trap probe receives linkup, linkdown, and MAC notification traps from network devices. + ActiveDirectory *RequestNodeServicesSetProfilerProbeConfigActiveDirectory `json:"activeDirectory,omitempty"` // The Active Directory probe queries the Active Directory for Windows information. + Pxgrid *[]RequestNodeServicesSetProfilerProbeConfigPxgrid `json:"pxgrid,omitempty"` // The pxGrid probe fetches attributes of MAC address or IP address as a subscriber from the pxGrid queue. } -type RequestNodeServicesSetProfilerProbeConfigActiveDirectory struct { - DaysBeforeRescan *int `json:"daysBeforeRescan,omitempty"` // +type RequestNodeServicesSetProfilerProbeConfigNetflow struct { + Interface string `json:"interface,omitempty"` // + Port *int `json:"port,omitempty"` // } type RequestNodeServicesSetProfilerProbeConfigDhcp struct { - Interfaces *[]RequestNodeServicesSetProfilerProbeConfigDhcpInterfaces `json:"interfaces,omitempty"` // - Port *int `json:"port,omitempty"` // -} - -type RequestNodeServicesSetProfilerProbeConfigDhcpInterfaces struct { Interface string `json:"interface,omitempty"` // + Port *int `json:"port,omitempty"` // } type RequestNodeServicesSetProfilerProbeConfigDhcpSpan struct { - Interfaces *[]RequestNodeServicesSetProfilerProbeConfigDhcpSpanInterfaces `json:"interfaces,omitempty"` // -} - -type RequestNodeServicesSetProfilerProbeConfigDhcpSpanInterfaces struct { Interface string `json:"interface,omitempty"` // } -type RequestNodeServicesSetProfilerProbeConfigDNS struct { - Timeout *int `json:"timeout,omitempty"` // -} - type RequestNodeServicesSetProfilerProbeConfigHTTP struct { - Interfaces *[]RequestNodeServicesSetProfilerProbeConfigHTTPInterfaces `json:"interfaces,omitempty"` // -} - -type RequestNodeServicesSetProfilerProbeConfigHTTPInterfaces struct { Interface string `json:"interface,omitempty"` // } -type RequestNodeServicesSetProfilerProbeConfigNetflow struct { - Interfaces *[]RequestNodeServicesSetProfilerProbeConfigNetflowInterfaces `json:"interfaces,omitempty"` // - Port *int `json:"port,omitempty"` // -} - -type RequestNodeServicesSetProfilerProbeConfigNetflowInterfaces struct { - Interface string `json:"interface,omitempty"` // -} +type RequestNodeServicesSetProfilerProbeConfigRadius interface{} type RequestNodeServicesSetProfilerProbeConfigNmap interface{} -type RequestNodeServicesSetProfilerProbeConfigPxgrid interface{} - -type RequestNodeServicesSetProfilerProbeConfigRadius interface{} +type RequestNodeServicesSetProfilerProbeConfigDNS struct { + Timeout *int `json:"timeout,omitempty"` // +} type RequestNodeServicesSetProfilerProbeConfigSNMPQuery struct { - EventTimeout *int `json:"eventTimeout,omitempty"` // Retries *int `json:"retries,omitempty"` // Timeout *int `json:"timeout,omitempty"` // + EventTimeout *int `json:"eventTimeout,omitempty"` // } type RequestNodeServicesSetProfilerProbeConfigSNMPTrap struct { - Interfaces *[]RequestNodeServicesSetProfilerProbeConfigSNMPTrapInterfaces `json:"interfaces,omitempty"` // - LinkTrapQuery *bool `json:"linkTrapQuery,omitempty"` // - MacTrapQuery *bool `json:"macTrapQuery,omitempty"` // - Port *int `json:"port,omitempty"` // + LinkTrapQuery *bool `json:"linkTrapQuery,omitempty"` // + MacTrapQuery *bool `json:"macTrapQuery,omitempty"` // + Interface string `json:"interface,omitempty"` // + Port *int `json:"port,omitempty"` // } -type RequestNodeServicesSetProfilerProbeConfigSNMPTrapInterfaces struct { - Interface string `json:"interface,omitempty"` // +type RequestNodeServicesSetProfilerProbeConfigActiveDirectory struct { + DaysBeforeRescan *int `json:"daysBeforeRescan,omitempty"` // } +type RequestNodeServicesSetProfilerProbeConfigPxgrid interface{} + //GetInterfaces Get the list of interfaces on a node in a cluster. /* This API retrieves the list of interfaces on a node in a cluster. + @param hostname hostname path parameter. Hostname of the node. */ func (s *NodeServicesService) GetInterfaces(hostname string) (*ResponseNodeServicesGetInterfaces, *resty.Response, error) { @@ -249,6 +210,7 @@ func (s *NodeServicesService) GetInterfaces(hostname string) (*ResponseNodeServi //GetSxpInterface Get the interface configured for SXP. /* This API retrieves the SXP interface. + @param hostname hostname path parameter. Hostname of the node. */ func (s *NodeServicesService) GetSxpInterface(hostname string) (*ResponseNodeServicesGetSxpInterface, *resty.Response, error) { @@ -283,6 +245,7 @@ func (s *NodeServicesService) GetSxpInterface(hostname string) (*ResponseNodeSer //GetProfilerProbeConfig Retrieve the profiler probe configuration of a PSN. /* This API retrieves the profiler probe configuration of a PSN. + @param hostname hostname path parameter. Hostname of the node. */ func (s *NodeServicesService) GetProfilerProbeConfig(hostname string) (*ResponseNodeServicesGetProfilerProbeConfig, *resty.Response, error) { @@ -317,6 +280,7 @@ func (s *NodeServicesService) GetProfilerProbeConfig(hostname string) (*Response //SetSxpInterface Configure the interface for use with SXP. /* This API configures the SXP interface. + @param hostname hostname path parameter. Hostname of the node. */ func (s *NodeServicesService) SetSxpInterface(hostname string, requestNodeServicesSetSxpInterface *RequestNodeServicesSetSxpInterface) (*ResponseNodeServicesSetSxpInterface, *resty.Response, error) { diff --git a/sdk/pan_ha.go b/sdk/pan_ha.go index d14aa5b..e6ba84f 100644 --- a/sdk/pan_ha.go +++ b/sdk/pan_ha.go @@ -14,11 +14,11 @@ type ResponsePanHaGetPanHaStatus struct { } type ResponsePanHaGetPanHaStatusResponse struct { - FailedAttempts *int `json:"failedAttempts,omitempty"` // Failover occurs if the primary PAN is down for the specified number of failure polls. Count (2 - 60).
The default value is 5. IsEnabled *bool `json:"isEnabled,omitempty"` // - PollingInterval *int `json:"pollingInterval,omitempty"` // Administration nodes are checked after each interval. Seconds (30 - 300)
The default value is 120. PrimaryHealthCheckNode *ResponsePanHaGetPanHaStatusResponsePrimaryHealthCheckNode `json:"primaryHealthCheckNode,omitempty"` // SecondaryHealthCheckNode *ResponsePanHaGetPanHaStatusResponseSecondaryHealthCheckNode `json:"secondaryHealthCheckNode,omitempty"` // + PollingInterval *int `json:"pollingInterval,omitempty"` // Administration nodes are checked after each interval. Seconds (30 - 300)
The default value is 120. + FailedAttempts *int `json:"failedAttempts,omitempty"` // Failover occurs if the primary PAN is down for the specified number of failure polls. Count (2 - 60).
The default value is 5. } type ResponsePanHaGetPanHaStatusResponsePrimaryHealthCheckNode struct { @@ -39,11 +39,11 @@ type ResponsePanHaUpdatePanHaSuccess struct { } type RequestPanHaUpdatePanHa struct { - FailedAttempts *int `json:"failedAttempts,omitempty"` // Failover occurs if the primary PAN is down for the specified number of failure polls. Count (2 - 60).
The default value is 5. IsEnabled *bool `json:"isEnabled,omitempty"` // - PollingInterval *int `json:"pollingInterval,omitempty"` // Administration nodes are checked after each interval. Seconds (30 - 300)
The default value is 120. PrimaryHealthCheckNode *RequestPanHaUpdatePanHaPrimaryHealthCheckNode `json:"primaryHealthCheckNode,omitempty"` // SecondaryHealthCheckNode *RequestPanHaUpdatePanHaSecondaryHealthCheckNode `json:"secondaryHealthCheckNode,omitempty"` // + PollingInterval *int `json:"pollingInterval,omitempty"` // Administration nodes are checked after each interval. Seconds (30 - 300)
The default value is 120. + FailedAttempts *int `json:"failedAttempts,omitempty"` // Failover occurs if the primary PAN is down for the specified number of failure polls. Count (2 - 60).
The default value is 5. } type RequestPanHaUpdatePanHaPrimaryHealthCheckNode struct { diff --git a/sdk/patching.go b/sdk/patching.go index 629df11..2be2078 100644 --- a/sdk/patching.go +++ b/sdk/patching.go @@ -68,18 +68,21 @@ type ResponsePatchingRollbackPatchResponse struct { } type RequestPatchingInstallHotpatch struct { - HotpatchName string `json:"hotpatchName,omitempty"` // - RepositoryName string `json:"repositoryName,omitempty"` // + HotpatchName string `json:"hotpatchName,omitempty"` // + IsDirectoryListed *bool `json:"isDirectoryListed,omitempty"` // + RepositoryName string `json:"repositoryName,omitempty"` // } type RequestPatchingRollbackHotpatch struct { - HotpatchName string `json:"hotpatchName,omitempty"` // - RepositoryName string `json:"repositoryName,omitempty"` // + HotpatchName string `json:"hotpatchName,omitempty"` // + IsDirectoryListed *bool `json:"isDirectoryListed,omitempty"` // + RepositoryName string `json:"repositoryName,omitempty"` // } type RequestPatchingInstallPatch struct { - PatchName string `json:"patchName,omitempty"` // - RepositoryName string `json:"repositoryName,omitempty"` // + IsDirectoryListed *bool `json:"isDirectoryListed,omitempty"` // + PatchName string `json:"patchName,omitempty"` // + RepositoryName string `json:"repositoryName,omitempty"` // } type RequestPatchingRollbackPatch struct { @@ -151,7 +154,7 @@ func (s *PatchingService) ListInstalledPatches() (*ResponsePatchingListInstalled } //InstallHotpatch Trigger hotpatch installation on Cisco ISE node. -/* Triggers hot patch installation on the Cisco ISE node. A task ID is returned which can be used to monitor the progress of the hot patch installation process. As hot patch installation triggers the Cisco ISE to restart, the task API becomes unavailable for a certain period of time. +/* Triggers hot patch installation on the Cisco ISE node. A task ID is returned which can be used to monitor the progress of the hot patch installation process. As hot patch installation triggers the Cisco ISE to restart, the task API becomes unavailable for a certain period of time. For installation of hotpatch on secondary nodes, request needs to be sent to individual node instead of the Primary Administration Node. */ func (s *PatchingService) InstallHotpatch(requestPatchingInstallHotpatch *RequestPatchingInstallHotpatch) (*ResponsePatchingInstallHotpatch, *resty.Response, error) { @@ -186,7 +189,7 @@ func (s *PatchingService) InstallHotpatch(requestPatchingInstallHotpatch *Reques } //RollbackHotpatch Rollback hotpatch from the Cisco ISE node. -/* Triggers hot patch rollback on the Cisco ISE node. A task ID is returned which can be used to monitor the progress of the hot patch rollback process. As hot patch rollback triggers the Cisco ISE to restart, the task API becomes unavailable for a certain period of time. +/* Triggers hot patch rollback on the Cisco ISE node. A task ID is returned which can be used to monitor the progress of the hot patch rollback process. As hot patch rollback triggers the Cisco ISE to restart, the task API becomes unavailable for a certain period of time. For rollback of hotpatch on secondary nodes , request needs to be sent on individual node instead of the Primary Administration Node. */ func (s *PatchingService) RollbackHotpatch(requestPatchingRollbackHotpatch *RequestPatchingRollbackHotpatch) (*ResponsePatchingRollbackHotpatch, *resty.Response, error) { @@ -221,7 +224,7 @@ func (s *PatchingService) RollbackHotpatch(requestPatchingRollbackHotpatch *Requ } //InstallPatch Trigger patch installation on the Cisco ISE node. -/* Triggers patch installation on the Cisco ISE node. A task ID is returned which can be used to monitor the progress of the patch installation process. As the patch installation triggers the Cisco ISE to restart, the task API becomes unavailable for a certain period of time. +/* Triggers patch installation on the Cisco ISE node. A task ID is returned which can be used to monitor the progress of the patch installation process. As the patch installation triggers the Cisco ISE to restart, the task API becomes unavailable for a certain period of time. For installation of patch on secondary nodes, request needs to be sent to individual node instead of the Primary Administration Node. */ func (s *PatchingService) InstallPatch(requestPatchingInstallPatch *RequestPatchingInstallPatch) (*ResponsePatchingInstallPatch, *resty.Response, error) { @@ -256,7 +259,7 @@ func (s *PatchingService) InstallPatch(requestPatchingInstallPatch *RequestPatch } //RollbackPatch Removes patch from the Cisco ISE node. -/* Triggers patch rollback on the Cisco ISE node. A task ID is returned which can be used to monitor the progress of the patch rollback process. As the patch rollback triggers the Cisco ISE to restart, the task API becomes unavailable for a certain period of time. +/* Triggers patch rollback on the Cisco ISE node. A task ID is returned which can be used to monitor the progress of the patch rollback process. As the patch rollback triggers the Cisco ISE to restart, the task API becomes unavailable for a certain period of time. For rollback of patch on secondary nodes , request needs to sent on individual node instead of the Primary Administration Node. */ func (s *PatchingService) RollbackPatch(requestPatchingRollbackPatch *RequestPatchingRollbackPatch) (*ResponsePatchingRollbackPatch, *resty.Response, error) { diff --git a/sdk/proxy.go b/sdk/proxy.go index 8bc59de..d7830e0 100644 --- a/sdk/proxy.go +++ b/sdk/proxy.go @@ -45,7 +45,7 @@ type RequestProxyUpdateProxyConnection struct { UserName string `json:"userName,omitempty"` // User name for the proxy connection } -//GetProxyConnection Returns ISE proxy connection settings +//GetProxyConnection Return ISE proxy connection settings /* The following functionalities are impacted by the proxy settings: diff --git a/sdk/px_grid_direct.go b/sdk/px_grid_direct.go new file mode 100644 index 0000000..ee3d09d --- /dev/null +++ b/sdk/px_grid_direct.go @@ -0,0 +1,665 @@ +package isegosdk + +import ( + "fmt" + "strings" + + "github.com/go-resty/resty/v2" +) + +type PxGridDirectService service + +type ResponsePxGridDirectGetConnectorConfig struct { + Response *[]ResponsePxGridDirectGetConnectorConfigResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponsePxGridDirectGetConnectorConfigResponse struct { + Connector *ResponsePxGridDirectGetConnectorConfigResponseConnector `json:"connector,omitempty"` // connectorName +} + +type ResponsePxGridDirectGetConnectorConfigResponseConnector struct { + AdditionalProperties *ResponsePxGridDirectGetConnectorConfigResponseConnectorAdditionalProperties `json:"additionalProperties,omitempty"` // + Attributes *ResponsePxGridDirectGetConnectorConfigResponseConnectorAttributes `json:"attributes,omitempty"` // connectorName + ConnectorName string `json:"connectorName,omitempty"` // connectorName + ConnectorType string `json:"connectorType,omitempty"` // connector Type list + DeltasyncSchedule *ResponsePxGridDirectGetConnectorConfigResponseConnectorDeltasyncSchedule `json:"deltasyncSchedule,omitempty"` // + Description string `json:"description,omitempty"` // description + Enabled *bool `json:"enabled,omitempty"` // + FullsyncSchedule *ResponsePxGridDirectGetConnectorConfigResponseConnectorFullsyncSchedule `json:"fullsyncSchedule,omitempty"` // + Protocol string `json:"protocol,omitempty"` // protocol + SkipCertificateValidations *bool `json:"skipCertificateValidations,omitempty"` // + URL *ResponsePxGridDirectGetConnectorConfigResponseConnectorURL `json:"url,omitempty"` // +} + +type ResponsePxGridDirectGetConnectorConfigResponseConnectorAdditionalProperties interface{} + +type ResponsePxGridDirectGetConnectorConfigResponseConnectorAttributes struct { + AttributeMapping *[]ResponsePxGridDirectGetConnectorConfigResponseConnectorAttributesAttributeMapping `json:"attributeMapping,omitempty"` //

List of feature names

+ CorrelationIDentifier string `json:"correlationIdentifier,omitempty"` // uniqueness to identify + TopLevelObject string `json:"topLevelObject,omitempty"` // root level of json + UniqueIDentifier string `json:"uniqueIdentifier,omitempty"` // uniqueness to identify + VersionIDentifier string `json:"versionIdentifier,omitempty"` // version uniqueness to identify +} + +type ResponsePxGridDirectGetConnectorConfigResponseConnectorAttributesAttributeMapping struct { + DictionaryAttribute string `json:"dictionaryAttribute,omitempty"` // + IncludeInDictionary *bool `json:"includeInDictionary,omitempty"` // + JSONAttribute string `json:"jsonAttribute,omitempty"` // +} + +type ResponsePxGridDirectGetConnectorConfigResponseConnectorDeltasyncSchedule struct { + Interval *int `json:"interval,omitempty"` // run at interval (hours) + IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units + StartDate string `json:"startDate,omitempty"` // start date and Time +} + +type ResponsePxGridDirectGetConnectorConfigResponseConnectorFullsyncSchedule struct { + Interval *int `json:"interval,omitempty"` // run at interval (hours) + IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units + StartDate string `json:"startDate,omitempty"` // start date and Time +} + +type ResponsePxGridDirectGetConnectorConfigResponseConnectorURL struct { + AuthenticationType string `json:"authenticationType,omitempty"` // authentication Type list + BulkURL string `json:"bulkUrl,omitempty"` // bulkUrl + IncrementalURL string `json:"incrementalUrl,omitempty"` // incrementalUrl + Password string `json:"password,omitempty"` // password + UserName string `json:"userName,omitempty"` // userName +} + +// # Review unknown case + +type ResponsePxGridDirectGetConnectorConfigByConnectorName struct { + Response *ResponsePxGridDirectGetConnectorConfigByConnectorNameResponse `json:"response,omitempty"` // ConnectorConfig information format + Version string `json:"version,omitempty"` // +} + +type ResponsePxGridDirectGetConnectorConfigByConnectorNameResponse struct { + Connector *ResponsePxGridDirectGetConnectorConfigByConnectorNameResponseConnector `json:"connector,omitempty"` // connectorName +} + +type ResponsePxGridDirectGetConnectorConfigByConnectorNameResponseConnector struct { + AdditionalProperties *ResponsePxGridDirectGetConnectorConfigByConnectorNameResponseConnectorAdditionalProperties `json:"additionalProperties,omitempty"` // + Attributes *ResponsePxGridDirectGetConnectorConfigByConnectorNameResponseConnectorAttributes `json:"attributes,omitempty"` // connectorName + ConnectorName string `json:"connectorName,omitempty"` // connectorName + ConnectorType string `json:"connectorType,omitempty"` // connector Type list + DeltasyncSchedule *ResponsePxGridDirectGetConnectorConfigByConnectorNameResponseConnectorDeltasyncSchedule `json:"deltasyncSchedule,omitempty"` // + Description string `json:"description,omitempty"` // description + Enabled *bool `json:"enabled,omitempty"` // + FullsyncSchedule *ResponsePxGridDirectGetConnectorConfigByConnectorNameResponseConnectorFullsyncSchedule `json:"fullsyncSchedule,omitempty"` // + Protocol string `json:"protocol,omitempty"` // protocol + SkipCertificateValidations *bool `json:"skipCertificateValidations,omitempty"` // + URL *ResponsePxGridDirectGetConnectorConfigByConnectorNameResponseConnectorURL `json:"url,omitempty"` // +} + +type ResponsePxGridDirectGetConnectorConfigByConnectorNameResponseConnectorAdditionalProperties interface{} + +type ResponsePxGridDirectGetConnectorConfigByConnectorNameResponseConnectorAttributes struct { + AttributeMapping *[]ResponsePxGridDirectGetConnectorConfigByConnectorNameResponseConnectorAttributesAttributeMapping `json:"attributeMapping,omitempty"` //

List of feature names

+ CorrelationIDentifier string `json:"correlationIdentifier,omitempty"` // uniqueness to identify + TopLevelObject string `json:"topLevelObject,omitempty"` // root level of json + UniqueIDentifier string `json:"uniqueIdentifier,omitempty"` // uniqueness to identify + VersionIDentifier string `json:"versionIdentifier,omitempty"` // version uniqueness to identify +} + +type ResponsePxGridDirectGetConnectorConfigByConnectorNameResponseConnectorAttributesAttributeMapping struct { + DictionaryAttribute string `json:"dictionaryAttribute,omitempty"` // + IncludeInDictionary *bool `json:"includeInDictionary,omitempty"` // + JSONAttribute string `json:"jsonAttribute,omitempty"` // +} + +type ResponsePxGridDirectGetConnectorConfigByConnectorNameResponseConnectorDeltasyncSchedule struct { + Interval *int `json:"interval,omitempty"` // run at interval (hours) + IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units + StartDate string `json:"startDate,omitempty"` // start date and Time +} + +type ResponsePxGridDirectGetConnectorConfigByConnectorNameResponseConnectorFullsyncSchedule struct { + Interval *int `json:"interval,omitempty"` // run at interval (hours) + IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units + StartDate string `json:"startDate,omitempty"` // start date and Time +} + +type ResponsePxGridDirectGetConnectorConfigByConnectorNameResponseConnectorURL struct { + AuthenticationType string `json:"authenticationType,omitempty"` // authentication Type list + BulkURL string `json:"bulkUrl,omitempty"` // bulkUrl + IncrementalURL string `json:"incrementalUrl,omitempty"` // incrementalUrl + Password string `json:"password,omitempty"` // password + UserName string `json:"userName,omitempty"` // userName +} + +// # Review unknown case +// # Review unknown case + +type ResponsePxGridDirectGetpxgridDirectDictionaryReferences struct { + Response *ResponsePxGridDirectGetpxgridDirectDictionaryReferencesResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponsePxGridDirectGetpxgridDirectDictionaryReferencesResponse interface{} + +type ResponsePxGridDirectGetConnectorConfigSyncNowStatus struct { + Response *ResponsePxGridDirectGetConnectorConfigSyncNowStatusResponse `json:"response,omitempty"` // ConnectorConfig information format + Version string `json:"version,omitempty"` // +} + +type ResponsePxGridDirectGetConnectorConfigSyncNowStatusResponse struct { + Connector *ResponsePxGridDirectGetConnectorConfigSyncNowStatusResponseConnector `json:"connector,omitempty"` // connectorName +} + +type ResponsePxGridDirectGetConnectorConfigSyncNowStatusResponseConnector struct { + ConnectorName string `json:"connectorName,omitempty"` // connectorName + SyncStatus string `json:"syncStatus,omitempty"` // description +} + +// # Review unknown case + +type ResponsePxGridDirectTestConnector struct { + ConnectorName string `json:"connectorName,omitempty"` // connectorName + Data string `json:"data,omitempty"` // Response data + Error string `json:"error,omitempty"` // error + SkipCertificateValidations *bool `json:"skipCertificateValidations,omitempty"` // skipCertificateValidations + Status string `json:"status,omitempty"` // status of the request + UniqueID string `json:"uniqueID,omitempty"` // uniqueness to identify +} + +type RequestPxGridDirectCreateConnectorConfig struct { + Connector *RequestPxGridDirectCreateConnectorConfigConnector `json:"connector,omitempty"` // connectorName +} + +type RequestPxGridDirectCreateConnectorConfigConnector struct { + AdditionalProperties *RequestPxGridDirectCreateConnectorConfigConnectorAdditionalProperties `json:"additionalProperties,omitempty"` // + Attributes *RequestPxGridDirectCreateConnectorConfigConnectorAttributes `json:"attributes,omitempty"` // connectorName + ConnectorName string `json:"connectorName,omitempty"` // connectorName + ConnectorType string `json:"connectorType,omitempty"` // connector Type list + DeltasyncSchedule *RequestPxGridDirectCreateConnectorConfigConnectorDeltasyncSchedule `json:"deltasyncSchedule,omitempty"` // + Description string `json:"description,omitempty"` // description + Enabled *bool `json:"enabled,omitempty"` // + FullsyncSchedule *RequestPxGridDirectCreateConnectorConfigConnectorFullsyncSchedule `json:"fullsyncSchedule,omitempty"` // + Protocol string `json:"protocol,omitempty"` // protocol + SkipCertificateValidations *bool `json:"skipCertificateValidations,omitempty"` // + URL *RequestPxGridDirectCreateConnectorConfigConnectorURL `json:"url,omitempty"` // +} + +type RequestPxGridDirectCreateConnectorConfigConnectorAdditionalProperties interface{} + +type RequestPxGridDirectCreateConnectorConfigConnectorAttributes struct { + AttributeMapping *[]RequestPxGridDirectCreateConnectorConfigConnectorAttributesAttributeMapping `json:"attributeMapping,omitempty"` //

List of feature names

+ CorrelationIDentifier string `json:"correlationIdentifier,omitempty"` // uniqueness to identify + TopLevelObject string `json:"topLevelObject,omitempty"` // root level of json + UniqueIDentifier string `json:"uniqueIdentifier,omitempty"` // uniqueness to identify + VersionIDentifier string `json:"versionIdentifier,omitempty"` // version uniqueness to identify +} + +type RequestPxGridDirectCreateConnectorConfigConnectorAttributesAttributeMapping struct { + DictionaryAttribute string `json:"dictionaryAttribute,omitempty"` // + IncludeInDictionary *bool `json:"includeInDictionary,omitempty"` // + JSONAttribute string `json:"jsonAttribute,omitempty"` // +} + +type RequestPxGridDirectCreateConnectorConfigConnectorDeltasyncSchedule struct { + Interval *int `json:"interval,omitempty"` // run at interval (hours) + IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units + StartDate string `json:"startDate,omitempty"` // start date and Time +} + +type RequestPxGridDirectCreateConnectorConfigConnectorFullsyncSchedule struct { + Interval *int `json:"interval,omitempty"` // run at interval (hours) + IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units + StartDate string `json:"startDate,omitempty"` // start date and Time +} + +type RequestPxGridDirectCreateConnectorConfigConnectorURL struct { + AuthenticationType string `json:"authenticationType,omitempty"` // authentication Type list + BulkURL string `json:"bulkUrl,omitempty"` // bulkUrl + IncrementalURL string `json:"incrementalUrl,omitempty"` // incrementalUrl + Password string `json:"password,omitempty"` // password + UserName string `json:"userName,omitempty"` // userName +} + +type RequestPxGridDirectUpdateConnectorConfigByConnectorName struct { + Connector *RequestPxGridDirectUpdateConnectorConfigByConnectorNameConnector `json:"connector,omitempty"` // connectorName +} + +type RequestPxGridDirectUpdateConnectorConfigByConnectorNameConnector struct { + AdditionalProperties *RequestPxGridDirectUpdateConnectorConfigByConnectorNameConnectorAdditionalProperties `json:"additionalProperties,omitempty"` // + Attributes *RequestPxGridDirectUpdateConnectorConfigByConnectorNameConnectorAttributes `json:"attributes,omitempty"` // connectorName + ConnectorName string `json:"connectorName,omitempty"` // connectorName + ConnectorType string `json:"connectorType,omitempty"` // connector Type list + DeltasyncSchedule *RequestPxGridDirectUpdateConnectorConfigByConnectorNameConnectorDeltasyncSchedule `json:"deltasyncSchedule,omitempty"` // + Description string `json:"description,omitempty"` // description + Enabled *bool `json:"enabled,omitempty"` // + FullsyncSchedule *RequestPxGridDirectUpdateConnectorConfigByConnectorNameConnectorFullsyncSchedule `json:"fullsyncSchedule,omitempty"` // + Protocol string `json:"protocol,omitempty"` // protocol + SkipCertificateValidations *bool `json:"skipCertificateValidations,omitempty"` // + URL *RequestPxGridDirectUpdateConnectorConfigByConnectorNameConnectorURL `json:"url,omitempty"` // +} + +type RequestPxGridDirectUpdateConnectorConfigByConnectorNameConnectorAdditionalProperties interface{} + +type RequestPxGridDirectUpdateConnectorConfigByConnectorNameConnectorAttributes struct { + AttributeMapping *[]RequestPxGridDirectUpdateConnectorConfigByConnectorNameConnectorAttributesAttributeMapping `json:"attributeMapping,omitempty"` //

List of feature names

+ CorrelationIDentifier string `json:"correlationIdentifier,omitempty"` // uniqueness to identify + TopLevelObject string `json:"topLevelObject,omitempty"` // root level of json + UniqueIDentifier string `json:"uniqueIdentifier,omitempty"` // uniqueness to identify + VersionIDentifier string `json:"versionIdentifier,omitempty"` // version uniqueness to identify +} + +type RequestPxGridDirectUpdateConnectorConfigByConnectorNameConnectorAttributesAttributeMapping struct { + DictionaryAttribute string `json:"dictionaryAttribute,omitempty"` // + IncludeInDictionary *bool `json:"includeInDictionary,omitempty"` // + JSONAttribute string `json:"jsonAttribute,omitempty"` // +} + +type RequestPxGridDirectUpdateConnectorConfigByConnectorNameConnectorDeltasyncSchedule struct { + Interval *int `json:"interval,omitempty"` // run at interval (hours) + IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units + StartDate string `json:"startDate,omitempty"` // start date and Time +} + +type RequestPxGridDirectUpdateConnectorConfigByConnectorNameConnectorFullsyncSchedule struct { + Interval *int `json:"interval,omitempty"` // run at interval (hours) + IntervalUnit string `json:"intervalUnit,omitempty"` // interval Units + StartDate string `json:"startDate,omitempty"` // start date and Time +} + +type RequestPxGridDirectUpdateConnectorConfigByConnectorNameConnectorURL struct { + AuthenticationType string `json:"authenticationType,omitempty"` // authentication Type list + BulkURL string `json:"bulkUrl,omitempty"` // bulkUrl + IncrementalURL string `json:"incrementalUrl,omitempty"` // incrementalUrl + Password string `json:"password,omitempty"` // password + UserName string `json:"userName,omitempty"` // userName +} + +type RequestPxGridDirectSyncNowConnector struct { + Connector *RequestPxGridDirectSyncNowConnectorConnector `json:"connector,omitempty"` // connectorName +} + +type RequestPxGridDirectSyncNowConnectorConnector struct { + SyncType string `json:"SyncType,omitempty"` // connector Type list + ConnectorName string `json:"connectorName,omitempty"` // connectorName + Description string `json:"description,omitempty"` // description +} + +type RequestPxGridDirectTestConnector struct { + AuthType string `json:"authType,omitempty"` // authentication Type list + AuthValues *RequestPxGridDirectTestConnectorAuthValues `json:"authValues,omitempty"` // Request to test Connector + ConnectorName string `json:"connectorName,omitempty"` // connectorName + ResponseParsing string `json:"responseParsing,omitempty"` // uniqueness to identify + SkipCertificateValidations *bool `json:"skipCertificateValidations,omitempty"` // skipCertificateValidations + UniqueID string `json:"uniqueID,omitempty"` // uniqueness to identify + URL string `json:"url,omitempty"` // bulkUrl +} + +type RequestPxGridDirectTestConnectorAuthValues struct { + Password string `json:"password,omitempty"` // password + UserName string `json:"userName,omitempty"` // userName +} + +//GetConnectorConfig get All connectorConfig information +/* pxGrid Direct Get ALL connectorConfig information + + */ +func (s *PxGridDirectService) GetConnectorConfig() (*ResponsePxGridDirectGetConnectorConfig, *resty.Response, error) { + setHost(s.client, "_px_grid_direct") + path := "/api/v1/pxgrid-direct/connector-config" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponsePxGridDirectGetConnectorConfig{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetConnectorConfig") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponsePxGridDirectGetConnectorConfig) + return result, response, err + +} + +//GetConnectorConfigByConnectorName get connectorConfig information +/* pxGrid Direct Get connectorConfig information based on ConnectorName + +@param connectorName connectorName path parameter. update or delete or retrieve the connector config. +*/ +func (s *PxGridDirectService) GetConnectorConfigByConnectorName(connectorName string) (*ResponsePxGridDirectGetConnectorConfigByConnectorName, *resty.Response, error) { + setHost(s.client, "_px_grid_direct") + path := "/api/v1/pxgrid-direct/connector-config/{connectorName}" + path = strings.Replace(path, "{connectorName}", fmt.Sprintf("%v", connectorName), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponsePxGridDirectGetConnectorConfigByConnectorName{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetConnectorConfigByConnectorName") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponsePxGridDirectGetConnectorConfigByConnectorName) + return result, response, err + +} + +//GetpxgridDirectDictionaryReferences Get a map of references to pxgrid-direct dictionaries +/* pxGrid Direct Get a map of references to pxgrid-direct dictionaries + + */ +func (s *PxGridDirectService) GetpxgridDirectDictionaryReferences() (*ResponsePxGridDirectGetpxgridDirectDictionaryReferences, *resty.Response, error) { + setHost(s.client, "_px_grid_direct") + path := "/api/v1/pxgrid-direct/dictionary-references" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponsePxGridDirectGetpxgridDirectDictionaryReferences{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetpxgridDirectDictionaryReferences") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponsePxGridDirectGetpxgridDirectDictionaryReferences) + return result, response, err + +} + +//GetConnectorConfigSyncNowStatus sync Now Status for Connector information +/* This API is used to get the status for SyncNow Status + +It returns the sync status as + + +syncstatus + + +QUEUED ,means its in QUEUED state + +SUBMITTED ,means its in Submited to fetch the data + +INPROGRESS ,means its inprogress of fetching and saving in ISE + +ERRORED ,means some internal error while fetching and saving in ISE further debugging logs will help + +COMPLETED ,means its COMPLETED of fetching and saving in ISE + +SCH_INPROGRESS ,means its inprogress for schedule time fetch and saving in ISE + +SCH_SUBMITTED ,means its submitted for schedule time fetch and will start to saving in ISE + +CANCELED ,means its cancelled if any of ISE Service start when its in middle of QUEUED/SUBMITTED/INPROGRESS + + +connectorName + + + +@param connectorName connectorName path parameter. retrieve the connector syncnow status. +*/ +func (s *PxGridDirectService) GetConnectorConfigSyncNowStatus(connectorName string) (*ResponsePxGridDirectGetConnectorConfigSyncNowStatus, *resty.Response, error) { + setHost(s.client, "_px_grid_direct") + path := "/api/v1/pxgrid-direct/syncNowStatus/{connectorName}" + path = strings.Replace(path, "{connectorName}", fmt.Sprintf("%v", connectorName), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponsePxGridDirectGetConnectorConfigSyncNowStatus{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetConnectorConfigSyncNowStatus") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponsePxGridDirectGetConnectorConfigSyncNowStatus) + return result, response, err + +} + +//CreateConnectorConfig Configure connectorconfig information +/* pxGrid Direct Configure connectorconfig information. + + */ +func (s *PxGridDirectService) CreateConnectorConfig(requestPxGridDirectCreateConnectorConfig *RequestPxGridDirectCreateConnectorConfig) (*resty.Response, error) { + setHost(s.client, "_px_grid_direct") + path := "/api/v1/pxgrid-direct/connector-config" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestPxGridDirectCreateConnectorConfig). + SetError(&Error). + Post(path) + + if err != nil { + return nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return response, fmt.Errorf("error with operation CreateConnectorConfig") + } + + return response, err + +} + +//SyncNowConnector syncnow for the Connector +/* +This syncNow is used on demand on a URLFetch Type connector only + Following parameters are present in the POST request body + + + + +PARAMETER + +DESCRIPTION + +EXAMPLE + + + + + +SyncType +*required + +its for FULL or INCREMENTAL + +"SyncType": "FULL or INCREMENTAL" + + + +connectorName +*required + +Name of the Connector for only URLFetcher type + +name of Connector + + + +description + +Decription of the Connector + +"length": "256 character" + + + + +NOTE: +For +Use syncNowStatus api to get the status of the connector + + + +*/ +func (s *PxGridDirectService) SyncNowConnector(requestPxGridDirectSyncNowConnector *RequestPxGridDirectSyncNowConnector) (*resty.Response, error) { + setHost(s.client, "_px_grid_direct") + path := "/api/v1/pxgrid-direct/syncnow" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestPxGridDirectSyncNowConnector). + SetError(&Error). + Post(path) + + if err != nil { + return nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return response, fmt.Errorf("error with operation SyncNowConnector") + } + + return response, err + +} + +//TestConnector test the Connector +/* pxGrid Direct test the Connector. + + */ +func (s *PxGridDirectService) TestConnector(requestPxGridDirectTestConnector *RequestPxGridDirectTestConnector) (*ResponsePxGridDirectTestConnector, *resty.Response, error) { + setHost(s.client, "_px_grid_direct") + path := "/api/v1/pxgrid-direct/test-connector" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestPxGridDirectTestConnector). + SetResult(&ResponsePxGridDirectTestConnector{}). + SetError(&Error). + Post(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponsePxGridDirectTestConnector{}, response, nil + } + return nil, nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return nil, response, fmt.Errorf("error with operation TestConnector") + } + + result := response.Result().(*ResponsePxGridDirectTestConnector) + return result, response, err + +} + +//UpdateConnectorConfigByConnectorName update connectoConfig information +/* pxGrid Direct update Configure connectorConfig information based on ConnectorName. + +@param connectorName connectorName path parameter. update or delete or retrieve the connector config. +*/ +func (s *PxGridDirectService) UpdateConnectorConfigByConnectorName(connectorName string, requestPxGridDirectUpdateConnectorConfigByConnectorName *RequestPxGridDirectUpdateConnectorConfigByConnectorName) (*resty.Response, error) { + setHost(s.client, "_px_grid_direct") + path := "/api/v1/pxgrid-direct/connector-config/{connectorName}" + path = strings.Replace(path, "{connectorName}", fmt.Sprintf("%v", connectorName), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestPxGridDirectUpdateConnectorConfigByConnectorName). + SetError(&Error). + Put(path) + + if err != nil { + return nil, err + + } + + if response.IsError() { + return response, fmt.Errorf("error with operation UpdateConnectorConfigByConnectorName") + } + + getCSFRToken(response.Header()) + + return response, err + +} + +//DeleteConnectorConfigByConnectorName Delete connectorConfig information +/* pxGrid Direct Delete Configure connectorConfig information based on ConnectorName. + +@param connectorName connectorName path parameter. update or delete or retrieve the connector config. +*/ +func (s *PxGridDirectService) DeleteConnectorConfigByConnectorName(connectorName string) (*resty.Response, error) { + setHost(s.client, "_px_grid_direct") + path := "/api/v1/pxgrid-direct/connector-config/{connectorName}" + path = strings.Replace(path, "{connectorName}", fmt.Sprintf("%v", connectorName), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetError(&Error). + Delete(path) + + if err != nil { + return nil, err + + } + + if response.IsError() { + return response, fmt.Errorf("error with operation DeleteConnectorConfigByConnectorName") + } + + getCSFRToken(response.Header()) + + return response, err + +} diff --git a/sdk/self_registered_portal.go b/sdk/self_registered_portal.go index e60378d..061252b 100644 --- a/sdk/self_registered_portal.go +++ b/sdk/self_registered_portal.go @@ -124,7 +124,7 @@ type ResponseSelfRegisteredPortalGetSelfRegisteredPortalByIDSelfRegPortalSetting ApproveDenyLinksTimeUnits string `json:"approveDenyLinksTimeUnits,omitempty"` // This attribute, along with approveDenyLinksValidFor, specifies how long the link can be used. Only valid if requireGuestApproval = true. Allowed Values: - DAYS, - HOURS, - MINUTES RequireApproverToAuthenticate *bool `json:"requireApproverToAuthenticate,omitempty"` // When self-registered guests require approval, an approval request is e-mailed to one or more sponsor users. If the Cisco ISE Administrator chooses to include an approval link in the e-mail, a sponsor user who clicks the link will be required to enter their username and password if this attribute is true. Only valid if requireGuestApproval = true AuthenticateSponsorsUsingPortalList *bool `json:"authenticateSponsorsUsingPortalList,omitempty"` // - SponsorPortalList *[]interface{} `json:"sponsorPortalList,omitempty"` // + SponsorPortalList []string `json:"sponsorPortalList,omitempty"` // } type ResponseSelfRegisteredPortalGetSelfRegisteredPortalByIDSelfRegPortalSettingsSelfRegPageSettingsFieldUserName struct { @@ -507,7 +507,7 @@ type RequestSelfRegisteredPortalUpdateSelfRegisteredPortalByIDSelfRegPortalSetti ApproveDenyLinksTimeUnits string `json:"approveDenyLinksTimeUnits,omitempty"` // This attribute, along with approveDenyLinksValidFor, specifies how long the link can be used. Only valid if requireGuestApproval = true. Allowed Values: - DAYS, - HOURS, - MINUTES RequireApproverToAuthenticate *bool `json:"requireApproverToAuthenticate,omitempty"` // When self-registered guests require approval, an approval request is e-mailed to one or more sponsor users. If the Cisco ISE Administrator chooses to include an approval link in the e-mail, a sponsor user who clicks the link will be required to enter their username and password if this attribute is true. Only valid if requireGuestApproval = true AuthenticateSponsorsUsingPortalList *bool `json:"authenticateSponsorsUsingPortalList,omitempty"` // - SponsorPortalList *[]interface{} `json:"sponsorPortalList,omitempty"` // + SponsorPortalList []string `json:"sponsorPortalList,omitempty"` // } type RequestSelfRegisteredPortalUpdateSelfRegisteredPortalByIDSelfRegPortalSettingsSelfRegPageSettingsFieldUserName struct { @@ -814,7 +814,7 @@ type RequestSelfRegisteredPortalCreateSelfRegisteredPortalSelfRegPortalSettingsS ApproveDenyLinksTimeUnits string `json:"approveDenyLinksTimeUnits,omitempty"` // This attribute, along with approveDenyLinksValidFor, specifies how long the link can be used. Only valid if requireGuestApproval = true. Allowed Values: - DAYS, - HOURS, - MINUTES RequireApproverToAuthenticate *bool `json:"requireApproverToAuthenticate,omitempty"` // When self-registered guests require approval, an approval request is e-mailed to one or more sponsor users. If the Cisco ISE Administrator chooses to include an approval link in the e-mail, a sponsor user who clicks the link will be required to enter their username and password if this attribute is true. Only valid if requireGuestApproval = true AuthenticateSponsorsUsingPortalList *bool `json:"authenticateSponsorsUsingPortalList,omitempty"` // - SponsorPortalList *[]interface{} `json:"sponsorPortalList,omitempty"` // + SponsorPortalList []string `json:"sponsorPortalList,omitempty"` // } type RequestSelfRegisteredPortalCreateSelfRegisteredPortalSelfRegPortalSettingsSelfRegPageSettingsFieldUserName struct { diff --git a/sdk/sg_vn_mapping.go b/sdk/sg_vn_mapping.go index 521b552..455b538 100644 --- a/sdk/sg_vn_mapping.go +++ b/sdk/sg_vn_mapping.go @@ -10,20 +10,20 @@ import ( type SgVnMappingService service -type GetSgVnMappingsQueryParams struct { - Page int `url:"page,omitempty"` //Page number - Size int `url:"size,omitempty"` //Number of objects returned per page - Sort string `url:"sort,omitempty"` //sort type - asc or desc - SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted - Filter []string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
- FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter +type GetSgVnMappingListQueryParams struct { + Page int `url:"page,omitempty"` //Page number + Size int `url:"size,omitempty"` //Number of objects returned per page + Sort string `url:"sort,omitempty"` //sort type - asc or desc + SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted + Filter string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
+ FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter } -type ResponseSgVnMappingGetSgVnMappings struct { - Response *[]ResponseSgVnMappingGetSgVnMappingsResponse `json:"response,omitempty"` // Array of SG-VN Mapping +type ResponseSgVnMappingGetSgVnMappingList struct { + Response *[]ResponseSgVnMappingGetSgVnMappingListResponse `json:"response,omitempty"` // Array of SG-VN Mapping } -type ResponseSgVnMappingGetSgVnMappingsResponse struct { +type ResponseSgVnMappingGetSgVnMappingListResponse struct { ID string `json:"id,omitempty"` // Identifier of the SG-VN mapping LastUpdate string `json:"lastUpdate,omitempty"` // Timestamp for the last update of the SG-VN mapping SgName string `json:"sgName,omitempty"` // Name of the associated Security Group to be used for identity if id is not provided @@ -61,13 +61,16 @@ type ResponseSgVnMappingGetSgVnMappingByIDResponse struct { VnName string `json:"vnName,omitempty"` // Name of the associated Virtual Network to be used for identity if id is not provided } -type ResponseSgVnMappingUpdateSgVnMappingByID struct { - Code *int `json:"code,omitempty"` // - Message string `json:"message,omitempty"` // +type ResponseSgVnMappingUpdateSgVnMapping struct { + ID string `json:"id,omitempty"` // Identifier of the SG-VN mapping + LastUpdate string `json:"lastUpdate,omitempty"` // Timestamp for the last update of the SG-VN mapping + SgName string `json:"sgName,omitempty"` // Name of the associated Security Group to be used for identity if id is not provided + SgtID string `json:"sgtId,omitempty"` // Identifier of the associated Security Group which is required unless its name is provided + VnID string `json:"vnId,omitempty"` // Identifier for the associated Virtual Network which is required unless its name is provided + VnName string `json:"vnName,omitempty"` // Name of the associated Virtual Network to be used for identity if id is not provided } -type ResponseSgVnMappingDeleteSgVnMappingByID struct { - Code *int `json:"code,omitempty"` // +type ResponseSgVnMappingDeleteSgVnMapping struct { Message string `json:"message,omitempty"` // } @@ -104,7 +107,7 @@ type RequestItemSgVnMappingBulkUpdateSgVnMappings struct { VnName string `json:"vnName,omitempty"` // Name of the associated Virtual Network to be used for identity if id is not provided } -type RequestSgVnMappingUpdateSgVnMappingByID struct { +type RequestSgVnMappingUpdateSgVnMapping struct { ID string `json:"id,omitempty"` // Identifier of the SG-VN mapping LastUpdate string `json:"lastUpdate,omitempty"` // Timestamp for the last update of the SG-VN mapping SgName string `json:"sgName,omitempty"` // Name of the associated Security Group to be used for identity if id is not provided @@ -113,22 +116,22 @@ type RequestSgVnMappingUpdateSgVnMappingByID struct { VnName string `json:"vnName,omitempty"` // Name of the associated Virtual Network to be used for identity if id is not provided } -//GetSgVnMappings Get all SG-VN Mappings +//GetSgVnMappingList Get all SG-VN Mappings /* Get all Security Group and Virtual Network mappings -@param getSgVnMappingsQueryParams Filtering parameter +@param getSgVnMappingListQueryParams Filtering parameter */ -func (s *SgVnMappingService) GetSgVnMappings(getSgVnMappingsQueryParams *GetSgVnMappingsQueryParams) (*ResponseSgVnMappingGetSgVnMappings, *resty.Response, error) { +func (s *SgVnMappingService) GetSgVnMappingList(getSgVnMappingListQueryParams *GetSgVnMappingListQueryParams) (*ResponseSgVnMappingGetSgVnMappingList, *resty.Response, error) { setHost(s.client, "_ui") path := "/api/v1/trustsec/sgvnmapping" - queryString, _ := query.Values(getSgVnMappingsQueryParams) + queryString, _ := query.Values(getSgVnMappingListQueryParams) setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetQueryString(queryString.Encode()).SetResult(&ResponseSgVnMappingGetSgVnMappings{}). + SetQueryString(queryString.Encode()).SetResult(&ResponseSgVnMappingGetSgVnMappingList{}). SetError(&Error). Get(path) @@ -138,12 +141,12 @@ func (s *SgVnMappingService) GetSgVnMappings(getSgVnMappingsQueryParams *GetSgVn } if response.IsError() { - return nil, response, fmt.Errorf("error with operation GetSgVnMappings") + return nil, response, fmt.Errorf("error with operation GetSgVnMappingList") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseSgVnMappingGetSgVnMappings) + result := response.Result().(*ResponseSgVnMappingGetSgVnMappingList) return result, response, err } @@ -322,12 +325,12 @@ func (s *SgVnMappingService) BulkUpdateSgVnMappings(requestSgVnMappingBulkUpdate } -//UpdateSgVnMappingByID Update SG-VN mapping +//UpdateSgVnMapping Update SG-VN mapping /* Update Security Group and Virtual Network mapping @param id id path parameter. */ -func (s *SgVnMappingService) UpdateSgVnMappingByID(id string, requestSgVnMappingUpdateSgVnMappingById *RequestSgVnMappingUpdateSgVnMappingByID) (*ResponseSgVnMappingUpdateSgVnMappingByID, *resty.Response, error) { +func (s *SgVnMappingService) UpdateSgVnMapping(id string, requestSgVnMappingUpdateSgVnMapping *RequestSgVnMappingUpdateSgVnMapping) (*ResponseSgVnMappingUpdateSgVnMapping, *resty.Response, error) { setHost(s.client, "_ui") path := "/api/v1/trustsec/sgvnmapping/{id}" path = strings.Replace(path, "{id}", fmt.Sprintf("%v", id), -1) @@ -336,36 +339,36 @@ func (s *SgVnMappingService) UpdateSgVnMappingByID(id string, requestSgVnMapping response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetBody(requestSgVnMappingUpdateSgVnMappingById). - SetResult(&ResponseSgVnMappingUpdateSgVnMappingByID{}). + SetBody(requestSgVnMappingUpdateSgVnMapping). + SetResult(&ResponseSgVnMappingUpdateSgVnMapping{}). SetError(&Error). Put(path) if err != nil { if err.Error() == emptyStringToJSONError { - return &ResponseSgVnMappingUpdateSgVnMappingByID{}, response, nil + return &ResponseSgVnMappingUpdateSgVnMapping{}, response, nil } return nil, nil, err } if response.IsError() { - return nil, response, fmt.Errorf("error with operation UpdateSgVnMappingById") + return nil, response, fmt.Errorf("error with operation UpdateSgVnMapping") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseSgVnMappingUpdateSgVnMappingByID) + result := response.Result().(*ResponseSgVnMappingUpdateSgVnMapping) return result, response, err } -//DeleteSgVnMappingByID Delete SG-VN mapping +//DeleteSgVnMapping Delete SG-VN mapping /* Delete Security Group and Virtual Network mapping @param id id path parameter. */ -func (s *SgVnMappingService) DeleteSgVnMappingByID(id string) (*ResponseSgVnMappingDeleteSgVnMappingByID, *resty.Response, error) { +func (s *SgVnMappingService) DeleteSgVnMapping(id string) (*ResponseSgVnMappingDeleteSgVnMapping, *resty.Response, error) { setHost(s.client, "_ui") path := "/api/v1/trustsec/sgvnmapping/{id}" path = strings.Replace(path, "{id}", fmt.Sprintf("%v", id), -1) @@ -374,7 +377,7 @@ func (s *SgVnMappingService) DeleteSgVnMappingByID(id string) (*ResponseSgVnMapp response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseSgVnMappingDeleteSgVnMappingByID{}). + SetResult(&ResponseSgVnMappingDeleteSgVnMapping{}). SetError(&Error). Delete(path) @@ -384,12 +387,12 @@ func (s *SgVnMappingService) DeleteSgVnMappingByID(id string) (*ResponseSgVnMapp } if response.IsError() { - return nil, response, fmt.Errorf("error with operation DeleteSgVnMappingById") + return nil, response, fmt.Errorf("error with operation DeleteSgVnMapping") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseSgVnMappingDeleteSgVnMappingByID) + result := response.Result().(*ResponseSgVnMappingDeleteSgVnMapping) return result, response, err } diff --git a/sdk/sgt_range_reservation.go b/sdk/sgt_range_reservation.go new file mode 100644 index 0000000..e5addec --- /dev/null +++ b/sdk/sgt_range_reservation.go @@ -0,0 +1,257 @@ +package isegosdk + +import ( + "fmt" + "strings" + + "github.com/go-resty/resty/v2" + "github.com/google/go-querystring/query" +) + +type SgtRangeReservationService service + +type GetSgtReservedRangesQueryParams struct { + Page int `url:"page,omitempty"` //Page number + Size int `url:"size,omitempty"` //Number of objects returned per page +} + +type ResponseSgtRangeReservationGetSgtReservedRanges struct { + Response *[]ResponseSgtRangeReservationGetSgtReservedRangesResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseSgtRangeReservationGetSgtReservedRangesResponse struct { + ClientID string `json:"clientId,omitempty"` // Unique ID of the given client + ClientName string `json:"clientName,omitempty"` // Name of the given client + EndIndex *int `json:"endIndex,omitempty"` // End index of the reserved range + StartIndex *int `json:"startIndex,omitempty"` // Start index of the reserved range +} + +type ResponseSgtRangeReservationReserveSgtRange struct { + Response *ResponseSgtRangeReservationReserveSgtRangeResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseSgtRangeReservationReserveSgtRangeResponse struct { + ClientID string `json:"clientId,omitempty"` // Unique ID of the given client + ClientName string `json:"clientName,omitempty"` // Name of the given client + EndIndex *int `json:"endIndex,omitempty"` // End index of the reserved range + StartIndex *int `json:"startIndex,omitempty"` // Start index of the reserved range +} + +type ResponseSgtRangeReservationGetSgtReservedRange struct { + Response *ResponseSgtRangeReservationGetSgtReservedRangeResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseSgtRangeReservationGetSgtReservedRangeResponse struct { + ClientID string `json:"clientId,omitempty"` // Unique ID of the given client + ClientName string `json:"clientName,omitempty"` // Name of the given client + EndIndex *int `json:"endIndex,omitempty"` // End index of the reserved range + StartIndex *int `json:"startIndex,omitempty"` // Start index of the reserved range +} + +type ResponseSgtRangeReservationUpdateReservedRange struct { + Success *ResponseSgtRangeReservationUpdateReservedRangeSuccess `json:"success,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseSgtRangeReservationUpdateReservedRangeSuccess struct { + Message string `json:"message,omitempty"` // +} + +type ResponseSgtRangeReservationDeleteSgtReserveRange struct { + Success *ResponseSgtRangeReservationDeleteSgtReserveRangeSuccess `json:"success,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseSgtRangeReservationDeleteSgtReserveRangeSuccess struct { + Message string `json:"message,omitempty"` // +} + +type RequestSgtRangeReservationReserveSgtRange struct { + ClientName string `json:"clientName,omitempty"` // Name of the given client + NumberOfTags *int `json:"numberOfTags,omitempty"` // Nummber of tags required to be reserved in ISE. +} + +type RequestSgtRangeReservationUpdateReservedRange struct { + ClientID string `json:"clientId,omitempty"` // Unique ID of the given client + EndIndex *int `json:"endIndex,omitempty"` // End index of the reserved range + StartIndex *int `json:"startIndex,omitempty"` // Start index of the reserved range +} + +//GetSgtReservedRanges Get all the reserved Security Group tag ranges in ISE. +/* Get all the reserved Security Group tag ranges in ISE. + +@param getSgtReservedRangesQueryParams Filtering parameter +*/ +func (s *SgtRangeReservationService) GetSgtReservedRanges(getSgtReservedRangesQueryParams *GetSgtReservedRangesQueryParams) (*ResponseSgtRangeReservationGetSgtReservedRanges, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/sgt/reservation" + + queryString, _ := query.Values(getSgtReservedRangesQueryParams) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetQueryString(queryString.Encode()).SetResult(&ResponseSgtRangeReservationGetSgtReservedRanges{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetSgtReservedRanges") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseSgtRangeReservationGetSgtReservedRanges) + return result, response, err + +} + +//GetSgtReservedRange Get the reserved range for the specific Client. +/* Get the reserved range of SGT for the specific client which is passed in the URL. + +@param clientID clientID path parameter. Unique name for a Client +*/ +func (s *SgtRangeReservationService) GetSgtReservedRange(clientID string) (*ResponseSgtRangeReservationGetSgtReservedRange, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/sgt/reservation/{clientID}" + path = strings.Replace(path, "{clientID}", fmt.Sprintf("%v", clientID), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseSgtRangeReservationGetSgtReservedRange{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetSgtReservedRange") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseSgtRangeReservationGetSgtReservedRange) + return result, response, err + +} + +//ReserveSgtRange Reserve range of SGT in ISE for the given Client. +/* Reserve given number of SGTs in a continuous range for the given Client. + + */ +func (s *SgtRangeReservationService) ReserveSgtRange(requestSgtRangeReservationReserveSgtRange *RequestSgtRangeReservationReserveSgtRange) (*ResponseSgtRangeReservationReserveSgtRange, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/sgt/reservation/reserveRange" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestSgtRangeReservationReserveSgtRange). + SetResult(&ResponseSgtRangeReservationReserveSgtRange{}). + SetError(&Error). + Post(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseSgtRangeReservationReserveSgtRange{}, response, nil + } + return nil, nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return nil, response, fmt.Errorf("error with operation ReserveSgtRange") + } + + result := response.Result().(*ResponseSgtRangeReservationReserveSgtRange) + return result, response, err + +} + +//UpdateReservedRange Update the reserved ranges of a specific Client +/* Update the reserved ranges of a specific Client by giving the custom start and end index + +@param clientID clientID path parameter. Unique name for a Client +*/ +func (s *SgtRangeReservationService) UpdateReservedRange(clientID string, requestSgtRangeReservationUpdateReservedRange *RequestSgtRangeReservationUpdateReservedRange) (*ResponseSgtRangeReservationUpdateReservedRange, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/sgt/reservation/{clientID}" + path = strings.Replace(path, "{clientID}", fmt.Sprintf("%v", clientID), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestSgtRangeReservationUpdateReservedRange). + SetResult(&ResponseSgtRangeReservationUpdateReservedRange{}). + SetError(&Error). + Put(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseSgtRangeReservationUpdateReservedRange{}, response, nil + } + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation UpdateReservedRange") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseSgtRangeReservationUpdateReservedRange) + return result, response, err + +} + +//DeleteSgtReserveRange Delete the reserved range for the given Client +/* Delete the reserved range of SGT for the given Client + +@param clientID clientID path parameter. Unique name for a Client +*/ +func (s *SgtRangeReservationService) DeleteSgtReserveRange(clientID string) (*ResponseSgtRangeReservationDeleteSgtReserveRange, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/sgt/reservation/{clientID}" + path = strings.Replace(path, "{clientID}", fmt.Sprintf("%v", clientID), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseSgtRangeReservationDeleteSgtReserveRange{}). + SetError(&Error). + Delete(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation DeleteSgtReserveRange") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseSgtRangeReservationDeleteSgtReserveRange) + return result, response, err + +} diff --git a/sdk/subscriber.go b/sdk/subscriber.go index 21c4563..9b337c3 100644 --- a/sdk/subscriber.go +++ b/sdk/subscriber.go @@ -20,41 +20,41 @@ type GetAllSubscribersQueryParams struct { } type ResponseSubscriberGetAllSubscribers struct { + Response *[]ResponseSubscriberGetAllSubscribersResponse `json:"response,omitempty"` // NextPage *ResponseSubscriberGetAllSubscribersNextPage `json:"nextPage,omitempty"` // PreviousPage *ResponseSubscriberGetAllSubscribersPreviousPage `json:"previousPage,omitempty"` // - Response *[]ResponseSubscriberGetAllSubscribersResponse `json:"response,omitempty"` // Version string `json:"version,omitempty"` // } -type ResponseSubscriberGetAllSubscribersNextPage struct { - Href string `json:"href,omitempty"` // - Rel string `json:"rel,omitempty"` // - Type string `json:"type,omitempty"` // -} - -type ResponseSubscriberGetAllSubscribersPreviousPage struct { - Href string `json:"href,omitempty"` // - Rel string `json:"rel,omitempty"` // - Type string `json:"type,omitempty"` // -} - type ResponseSubscriberGetAllSubscribersResponse struct { - CreateTime string `json:"createTime,omitempty"` // Enabled *bool `json:"enabled,omitempty"` // Subscriber is enabled or not FriendlyName string `json:"friendlyName,omitempty"` // Friendly name for the subscriber - ID string `json:"id,omitempty"` // - IDentityGroups string `json:"identityGroups,omitempty"` // Identity Group(s). With more than one idGroups it needs to be comma seperated + IDentityGroups string `json:"identityGroups,omitempty"` // Identity Groups. If you add more than one identity group, they need to be comma separated. Imeis string `json:"imeis,omitempty"` // IMEI to be attached to the subscriber - Imsi string `json:"imsi,omitempty"` // IMSI for Subscriber - Ki string `json:"ki,omitempty"` // KI - Link *ResponseSubscriberGetAllSubscribersResponseLink `json:"link,omitempty"` // Opc string `json:"opc,omitempty"` // OPC + Ki string `json:"ki,omitempty"` // KI + Imsi string `json:"imsi,omitempty"` // IMSI for subscriber + CreateTime string `json:"createTime,omitempty"` // UpdateTime string `json:"updateTime,omitempty"` // + ID string `json:"id,omitempty"` // + Link *ResponseSubscriberGetAllSubscribersResponseLink `json:"link,omitempty"` // } type ResponseSubscriberGetAllSubscribersResponseLink struct { + Rel string `json:"rel,omitempty"` // Href string `json:"href,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseSubscriberGetAllSubscribersNextPage struct { Rel string `json:"rel,omitempty"` // + Href string `json:"href,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseSubscriberGetAllSubscribersPreviousPage struct { + Rel string `json:"rel,omitempty"` // + Href string `json:"href,omitempty"` // Type string `json:"type,omitempty"` // } @@ -64,51 +64,22 @@ type ResponseSubscriberCreateSubscriber struct { } type ResponseSubscriberCreateSubscriberResponse struct { - CreateTime string `json:"createTime,omitempty"` // Enabled *bool `json:"enabled,omitempty"` // Subscriber is enabled or not FriendlyName string `json:"friendlyName,omitempty"` // Friendly name for the subscriber - ID string `json:"id,omitempty"` // - IDentityGroups string `json:"identityGroups,omitempty"` // Identity Group(s). With more than one idGroups it needs to be comma seperated + IDentityGroups string `json:"identityGroups,omitempty"` // Identity Groups. If you add more than one identity group, they need to be comma separated. Imeis string `json:"imeis,omitempty"` // IMEI to be attached to the subscriber - Imsi string `json:"imsi,omitempty"` // IMSI for Subscriber - Ki string `json:"ki,omitempty"` // KI - Link *ResponseSubscriberCreateSubscriberResponseLink `json:"link,omitempty"` // Opc string `json:"opc,omitempty"` // OPC + Ki string `json:"ki,omitempty"` // KI + Imsi string `json:"imsi,omitempty"` // IMSI for subscriber + CreateTime string `json:"createTime,omitempty"` // UpdateTime string `json:"updateTime,omitempty"` // + ID string `json:"id,omitempty"` // + Link *ResponseSubscriberCreateSubscriberResponseLink `json:"link,omitempty"` // } type ResponseSubscriberCreateSubscriberResponseLink struct { - Href string `json:"href,omitempty"` // Rel string `json:"rel,omitempty"` // - Type string `json:"type,omitempty"` // -} - -type ResponseSubscriberBulkSubscriberOperation struct { - ID string `json:"id,omitempty"` // -} - -type ResponseSubscriberGetSubscriberByIMSI struct { - Response *ResponseSubscriberGetSubscriberByIMSIResponse `json:"response,omitempty"` // - Version string `json:"version,omitempty"` // -} - -type ResponseSubscriberGetSubscriberByIMSIResponse struct { - CreateTime string `json:"createTime,omitempty"` // - Enabled *bool `json:"enabled,omitempty"` // Subscriber is enabled or not - FriendlyName string `json:"friendlyName,omitempty"` // Friendly name for the subscriber - ID string `json:"id,omitempty"` // - IDentityGroups string `json:"identityGroups,omitempty"` // Identity Group(s). With more than one idGroups it needs to be comma seperated - Imeis string `json:"imeis,omitempty"` // IMEI to be attached to the subscriber - Imsi string `json:"imsi,omitempty"` // IMSI for Subscriber - Ki string `json:"ki,omitempty"` // KI - Link *ResponseSubscriberGetSubscriberByIMSIResponseLink `json:"link,omitempty"` // - Opc string `json:"opc,omitempty"` // OPC - UpdateTime string `json:"updateTime,omitempty"` // -} - -type ResponseSubscriberGetSubscriberByIMSIResponseLink struct { Href string `json:"href,omitempty"` // - Rel string `json:"rel,omitempty"` // Type string `json:"type,omitempty"` // } @@ -118,22 +89,22 @@ type ResponseSubscriberGetSubscriberByID struct { } type ResponseSubscriberGetSubscriberByIDResponse struct { - CreateTime string `json:"createTime,omitempty"` // Enabled *bool `json:"enabled,omitempty"` // Subscriber is enabled or not FriendlyName string `json:"friendlyName,omitempty"` // Friendly name for the subscriber - ID string `json:"id,omitempty"` // - IDentityGroups string `json:"identityGroups,omitempty"` // Identity Group(s). With more than one idGroups it needs to be comma seperated + IDentityGroups string `json:"identityGroups,omitempty"` // Identity Groups. If you add more than one identity group, they need to be comma separated. Imeis string `json:"imeis,omitempty"` // IMEI to be attached to the subscriber - Imsi string `json:"imsi,omitempty"` // IMSI for Subscriber - Ki string `json:"ki,omitempty"` // KI - Link *ResponseSubscriberGetSubscriberByIDResponseLink `json:"link,omitempty"` // Opc string `json:"opc,omitempty"` // OPC + Ki string `json:"ki,omitempty"` // KI + Imsi string `json:"imsi,omitempty"` // IMSI for subscriber + CreateTime string `json:"createTime,omitempty"` // UpdateTime string `json:"updateTime,omitempty"` // + ID string `json:"id,omitempty"` // + Link *ResponseSubscriberGetSubscriberByIDResponseLink `json:"link,omitempty"` // } type ResponseSubscriberGetSubscriberByIDResponseLink struct { - Href string `json:"href,omitempty"` // Rel string `json:"rel,omitempty"` // + Href string `json:"href,omitempty"` // Type string `json:"type,omitempty"` // } @@ -143,22 +114,22 @@ type ResponseSubscriberUpdateSubscriber struct { } type ResponseSubscriberUpdateSubscriberResponse struct { - CreateTime string `json:"createTime,omitempty"` // Enabled *bool `json:"enabled,omitempty"` // Subscriber is enabled or not FriendlyName string `json:"friendlyName,omitempty"` // Friendly name for the subscriber - ID string `json:"id,omitempty"` // - IDentityGroups string `json:"identityGroups,omitempty"` // Identity Group(s). With more than one idGroups it needs to be comma seperated + IDentityGroups string `json:"identityGroups,omitempty"` // Identity Groups. If you add more than one identity group, they need to be comma separated. Imeis string `json:"imeis,omitempty"` // IMEI to be attached to the subscriber - Imsi string `json:"imsi,omitempty"` // IMSI for Subscriber - Ki string `json:"ki,omitempty"` // KI - Link *ResponseSubscriberUpdateSubscriberResponseLink `json:"link,omitempty"` // Opc string `json:"opc,omitempty"` // OPC + Ki string `json:"ki,omitempty"` // KI + Imsi string `json:"imsi,omitempty"` // IMSI for subscriber + CreateTime string `json:"createTime,omitempty"` // UpdateTime string `json:"updateTime,omitempty"` // + ID string `json:"id,omitempty"` // + Link *ResponseSubscriberUpdateSubscriberResponseLink `json:"link,omitempty"` // } type ResponseSubscriberUpdateSubscriberResponseLink struct { - Href string `json:"href,omitempty"` // Rel string `json:"rel,omitempty"` // + Href string `json:"href,omitempty"` // Type string `json:"type,omitempty"` // } @@ -166,43 +137,72 @@ type ResponseSubscriberDeleteSubscriber struct { Message string `json:"message,omitempty"` // } +type ResponseSubscriberGetSubscriberByIMSI struct { + Response *ResponseSubscriberGetSubscriberByIMSIResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseSubscriberGetSubscriberByIMSIResponse struct { + Enabled *bool `json:"enabled,omitempty"` // Subscriber is enabled or not + FriendlyName string `json:"friendlyName,omitempty"` // Friendly name for the subscriber + IDentityGroups string `json:"identityGroups,omitempty"` // Identity Groups. If you add more than one identity group, they need to be comma separated. + Imeis string `json:"imeis,omitempty"` // IMEI to be attached to the subscriber + Opc string `json:"opc,omitempty"` // OPC + Ki string `json:"ki,omitempty"` // KI + Imsi string `json:"imsi,omitempty"` // IMSI for subscriber + CreateTime string `json:"createTime,omitempty"` // + UpdateTime string `json:"updateTime,omitempty"` // + ID string `json:"id,omitempty"` // + Link *ResponseSubscriberGetSubscriberByIMSIResponseLink `json:"link,omitempty"` // +} + +type ResponseSubscriberGetSubscriberByIMSIResponseLink struct { + Rel string `json:"rel,omitempty"` // + Href string `json:"href,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseSubscriberBulkSubscriberOperation struct { + ID string `json:"id,omitempty"` // +} + type RequestSubscriberCreateSubscriber struct { Enabled *bool `json:"enabled,omitempty"` // Subscriber is enabled or not FriendlyName string `json:"friendlyName,omitempty"` // Friendly name for the subscriber - IDentityGroups string `json:"identityGroups,omitempty"` // Identity Group(s). With more than one idGroups it needs to be comma seperated + IDentityGroups string `json:"identityGroups,omitempty"` // Identity Groups. If you add more than one identity group, they need to be comma separated. Imeis string `json:"imeis,omitempty"` // IMEI to be attached to the subscriber - Imsi string `json:"imsi,omitempty"` // IMSI for Subscriber + Opc string `json:"opc,omitempty"` // OPC Ki string `json:"ki,omitempty"` // KI + Imsi string `json:"imsi,omitempty"` // IMSI for subscriber +} + +type RequestSubscriberUpdateSubscriber struct { + Enabled *bool `json:"enabled,omitempty"` // Subscriber is enabled or not + FriendlyName string `json:"friendlyName,omitempty"` // Friendly name for the subscriber + IDentityGroups string `json:"identityGroups,omitempty"` // Identity Groups. If you add more than one identity group, they need to be comma separated. + Imeis string `json:"imeis,omitempty"` // IMEI to be attached to the subscriber Opc string `json:"opc,omitempty"` // OPC + Ki string `json:"ki,omitempty"` // KI } type RequestSubscriberBulkSubscriberOperation struct { - ItemList *[]RequestSubscriberBulkSubscriberOperationItemList `json:"ItemList,omitempty"` // Operation string `json:"operation,omitempty"` // + ItemList *[]RequestSubscriberBulkSubscriberOperationItemList `json:"ItemList,omitempty"` // } type RequestSubscriberBulkSubscriberOperationItemList struct { - Enabled *bool `json:"enabled,omitempty"` // Subscriber is enabled or not - FriendlyName string `json:"friendlyName,omitempty"` // Friendly name for the subscriber ID string `json:"id,omitempty"` // - IDentityGroups string `json:"identityGroups,omitempty"` // Identity Group(s). With more than one idGroups it needs to be comma seperated - Imeis string `json:"imeis,omitempty"` // Comma separated IMEIs to be attached to the subscriber Imsi string `json:"imsi,omitempty"` // IMSI for Subscriber - Ki string `json:"ki,omitempty"` // KI - Opc string `json:"opc,omitempty"` // OPC -} - -type RequestSubscriberUpdateSubscriber struct { Enabled *bool `json:"enabled,omitempty"` // Subscriber is enabled or not FriendlyName string `json:"friendlyName,omitempty"` // Friendly name for the subscriber - IDentityGroups string `json:"identityGroups,omitempty"` // Identity Group(s). With more than one idGroups it needs to be comma seperated - Imeis string `json:"imeis,omitempty"` // IMEI to be attached to the subscriber - Ki string `json:"ki,omitempty"` // KI + IDentityGroups string `json:"identityGroups,omitempty"` // Identity Groups. If you add more than one identity group, they need to be comma separated + Imeis string `json:"imeis,omitempty"` // Comma separated IMEIs to be attached to the subscriber Opc string `json:"opc,omitempty"` // OPC + Ki string `json:"ki,omitempty"` // KI } -//GetAllSubscribers Purpose of this API is to get all Subscribers. -/* Purpose of this API is to get all Subscribers. +//GetAllSubscribers Get all subscribers +/* Get all subscribers @param getAllSubscribersQueryParams Filtering parameter */ @@ -236,21 +236,21 @@ func (s *SubscriberService) GetAllSubscribers(getAllSubscribersQueryParams *GetA } -//GetSubscriberByIMSI Purpose of this API is to get Subscriber by IMSI. -/* Purpose of this API is to get Subscriber by IMSI. +//GetSubscriberByID Get the subscriber for a given ID +/* Get the subscriber for a given ID -@param imsi imsi path parameter. IMSI parameter +@param subscriberID subscriberId path parameter. Unique ID for a subscriber object */ -func (s *SubscriberService) GetSubscriberByIMSI(imsi string) (*ResponseSubscriberGetSubscriberByIMSI, *resty.Response, error) { +func (s *SubscriberService) GetSubscriberByID(subscriberID string) (*ResponseSubscriberGetSubscriberByID, *resty.Response, error) { setHost(s.client, "_ui") - path := "/api/v1/fiveg/subscriber/imsi/{imsi}" - path = strings.Replace(path, "{imsi}", fmt.Sprintf("%v", imsi), -1) + path := "/api/v1/fiveg/subscriber/{subscriberId}" + path = strings.Replace(path, "{subscriberId}", fmt.Sprintf("%v", subscriberID), -1) setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseSubscriberGetSubscriberByIMSI{}). + SetResult(&ResponseSubscriberGetSubscriberByID{}). SetError(&Error). Get(path) @@ -260,31 +260,31 @@ func (s *SubscriberService) GetSubscriberByIMSI(imsi string) (*ResponseSubscribe } if response.IsError() { - return nil, response, fmt.Errorf("error with operation GetSubscriberByIMSI") + return nil, response, fmt.Errorf("error with operation GetSubscriberById") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseSubscriberGetSubscriberByIMSI) + result := response.Result().(*ResponseSubscriberGetSubscriberByID) return result, response, err } -//GetSubscriberByID Purpose of this API is to get Subscriber by ID. -/* Purpose of this API is to get Subscriber by ID. +//GetSubscriberByIMSI Get a subscriber by IMSI +/* Get a subscriber by IMSI -@param subscriberID subscriberId path parameter. Unique id for a subscriber object +@param imsi imsi path parameter. IMSI parameter */ -func (s *SubscriberService) GetSubscriberByID(subscriberID string) (*ResponseSubscriberGetSubscriberByID, *resty.Response, error) { +func (s *SubscriberService) GetSubscriberByIMSI(imsi string) (*ResponseSubscriberGetSubscriberByIMSI, *resty.Response, error) { setHost(s.client, "_ui") - path := "/api/v1/fiveg/subscriber/{subscriberId}" - path = strings.Replace(path, "{subscriberId}", fmt.Sprintf("%v", subscriberID), -1) + path := "/api/v1/fiveg/subscriber/imsi/{imsi}" + path = strings.Replace(path, "{imsi}", fmt.Sprintf("%v", imsi), -1) setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseSubscriberGetSubscriberByID{}). + SetResult(&ResponseSubscriberGetSubscriberByIMSI{}). SetError(&Error). Get(path) @@ -294,18 +294,18 @@ func (s *SubscriberService) GetSubscriberByID(subscriberID string) (*ResponseSub } if response.IsError() { - return nil, response, fmt.Errorf("error with operation GetSubscriberById") + return nil, response, fmt.Errorf("error with operation GetSubscriberByIMSI") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseSubscriberGetSubscriberByID) + result := response.Result().(*ResponseSubscriberGetSubscriberByIMSI) return result, response, err } -//CreateSubscriber Purpose of this API is to create Subscriber holding the IMSI. -/* Purpose of this API is to create Subscriber holding the IMSI. +//CreateSubscriber Create subscriber holding the IMEI +/* Create subscriber holding the IMEI */ func (s *SubscriberService) CreateSubscriber(requestSubscriberCreateSubscriber *RequestSubscriberCreateSubscriber) (*ResponseSubscriberCreateSubscriber, *resty.Response, error) { @@ -339,8 +339,8 @@ func (s *SubscriberService) CreateSubscriber(requestSubscriberCreateSubscriber * } -//BulkSubscriberOperation Create/update/delete Subscribers in bulk. -/* Create/update/delete Subscribers in bulk. +//BulkSubscriberOperation Create, update and delete subscribers in bulk +/* Create, update and delete subscribers in bulk */ func (s *SubscriberService) BulkSubscriberOperation(requestSubscriberBulkSubscriberOperation *RequestSubscriberBulkSubscriberOperation) (*ResponseSubscriberBulkSubscriberOperation, *resty.Response, error) { @@ -374,10 +374,10 @@ func (s *SubscriberService) BulkSubscriberOperation(requestSubscriberBulkSubscri } -//UpdateSubscriber Purpose of this API is to update Subscriber given the Subscriber's Id and the request payload -/* Purpose of this API is to update Subscriber given the Subscriber's Id and the request payload +//UpdateSubscriber Update a subscriber for a given ID and the request payload +/* Update a subscriber for a given ID and the request payload -@param subscriberID subscriberId path parameter. Unique id for a subscriber object +@param subscriberID subscriberId path parameter. Unique ID for a subscriber object */ func (s *SubscriberService) UpdateSubscriber(subscriberID string, requestSubscriberUpdateSubscriber *RequestSubscriberUpdateSubscriber) (*ResponseSubscriberUpdateSubscriber, *resty.Response, error) { setHost(s.client, "_ui") @@ -412,10 +412,10 @@ func (s *SubscriberService) UpdateSubscriber(subscriberID string, requestSubscri } -//DeleteSubscriber Purpose of this API is to delete the Subscriber given the Subscriber's Id -/* Purpose of this API is to delete the Subscriber given the Subscriber's Id +//DeleteSubscriber Delete the subscriber for a given ID +/* Delete the subscriber for a given ID -@param subscriberID subscriberId path parameter. Unique id for a subscriber object +@param subscriberID subscriberId path parameter. Unique ID for a subscriber object */ func (s *SubscriberService) DeleteSubscriber(subscriberID string) (*ResponseSubscriberDeleteSubscriber, *resty.Response, error) { setHost(s.client, "_ui") diff --git a/sdk/tasks.go b/sdk/tasks.go index dfc2de7..ab97057 100644 --- a/sdk/tasks.go +++ b/sdk/tasks.go @@ -117,7 +117,7 @@ func (s *TasksService) GetTaskStatus(taskID string) (*ResponseTasksGetTaskStatus } -// Alias of GetTaskStatus Monitor task status +//Alias of GetTaskStatus Monitor task status func (s *TasksService) GetTaskStatusByID(taskID string) (*ResponseTasksGetTaskStatus, *resty.Response, error) { return s.GetTaskStatus(taskID) } diff --git a/sdk/telemetry.go b/sdk/telemetry.go index c25e2be..7126f95 100644 --- a/sdk/telemetry.go +++ b/sdk/telemetry.go @@ -33,8 +33,8 @@ type RequestTelemetryUpdateTransportGateway struct { URL string `json:"url,omitempty"` // URL of transport gateway } -//GetTransportGateway Returns ISE transport gateway settings -/* Transport Gateway acts a proxy for the communication between the ISE servers in your network and the Telemetry servers in case of air-gapped network. +//GetTransportGateway Return ISE transport gateway settings +/* Transport Gateway acts a proxy for the communication between the ISE servers in your network and the telemetry servers in case of air-gapped network. */ func (s *TelemetryService) GetTransportGateway() (*ResponseTelemetryGetTransportGateway, *resty.Response, error) { @@ -66,7 +66,7 @@ func (s *TelemetryService) GetTransportGateway() (*ResponseTelemetryGetTransport } //UpdateTransportGateway Configure ISE transport gateway settings -/* Transport Gateway acts a proxy for the communication between the ISE servers in your network and the Telemetry servers in case of air-gapped network. +/* Transport Gateway acts a proxy for the communication between the ISE servers in your network and the telemetry servers in case of air-gapped network. */ func (s *TelemetryService) UpdateTransportGateway(requestTelemetryUpdateTransportGateway *RequestTelemetryUpdateTransportGateway) (*ResponseTelemetryUpdateTransportGateway, *resty.Response, error) { diff --git a/sdk/user_equipment.go b/sdk/user_equipment.go new file mode 100644 index 0000000..6b10c1c --- /dev/null +++ b/sdk/user_equipment.go @@ -0,0 +1,508 @@ +package isegosdk + +import ( + "fmt" + "strings" + + "github.com/go-resty/resty/v2" + "github.com/google/go-querystring/query" +) + +type UserEquipmentService service + +type GetUserEquipmentsQueryParams struct { + Page int `url:"page,omitempty"` //Page number + Size int `url:"size,omitempty"` //Number of objects returned per page + Filter string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
+ FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter + Sort string `url:"sort,omitempty"` //sort type - asc or desc + SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted +} + +type ResponseUserEquipmentGetUserEquipments struct { + Response *[]ResponseUserEquipmentGetUserEquipmentsResponse `json:"response,omitempty"` // + NextPage *ResponseUserEquipmentGetUserEquipmentsNextPage `json:"nextPage,omitempty"` // + PreviousPage *ResponseUserEquipmentGetUserEquipmentsPreviousPage `json:"previousPage,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseUserEquipmentGetUserEquipmentsResponse struct { + Description string `json:"description,omitempty"` // Description for User Equipment + DeviceGroup string `json:"deviceGroup,omitempty"` // Device or Endpoint Group + Imei string `json:"imei,omitempty"` // IMEI for User Equipment + CreateTime string `json:"createTime,omitempty"` // + UpdateTime string `json:"updateTime,omitempty"` // + ID string `json:"id,omitempty"` // + Link *ResponseUserEquipmentGetUserEquipmentsResponseLink `json:"link,omitempty"` // +} + +type ResponseUserEquipmentGetUserEquipmentsResponseLink struct { + Rel string `json:"rel,omitempty"` // + Href string `json:"href,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseUserEquipmentGetUserEquipmentsNextPage struct { + Rel string `json:"rel,omitempty"` // + Href string `json:"href,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseUserEquipmentGetUserEquipmentsPreviousPage struct { + Rel string `json:"rel,omitempty"` // + Href string `json:"href,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseUserEquipmentCreateUserEquipment struct { + Response *ResponseUserEquipmentCreateUserEquipmentResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseUserEquipmentCreateUserEquipmentResponse struct { + Description string `json:"description,omitempty"` // Description for User Equipment + DeviceGroup string `json:"deviceGroup,omitempty"` // Device or Endpoint Group + Imei string `json:"imei,omitempty"` // IMEI for User Equipment + CreateTime string `json:"createTime,omitempty"` // + UpdateTime string `json:"updateTime,omitempty"` // + ID string `json:"id,omitempty"` // + Link *ResponseUserEquipmentCreateUserEquipmentResponseLink `json:"link,omitempty"` // +} + +type ResponseUserEquipmentCreateUserEquipmentResponseLink struct { + Rel string `json:"rel,omitempty"` // + Href string `json:"href,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseUserEquipmentGetUserEquipmentByID struct { + Response *ResponseUserEquipmentGetUserEquipmentByIDResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseUserEquipmentGetUserEquipmentByIDResponse struct { + Description string `json:"description,omitempty"` // Description for User Equipment + DeviceGroup string `json:"deviceGroup,omitempty"` // Device or Endpoint Group + Imei string `json:"imei,omitempty"` // IMEI for User Equipment + CreateTime string `json:"createTime,omitempty"` // + UpdateTime string `json:"updateTime,omitempty"` // + ID string `json:"id,omitempty"` // + Link *ResponseUserEquipmentGetUserEquipmentByIDResponseLink `json:"link,omitempty"` // +} + +type ResponseUserEquipmentGetUserEquipmentByIDResponseLink struct { + Rel string `json:"rel,omitempty"` // + Href string `json:"href,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseUserEquipmentUpdateUserEquipment struct { + Response *ResponseUserEquipmentUpdateUserEquipmentResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseUserEquipmentUpdateUserEquipmentResponse struct { + Description string `json:"description,omitempty"` // Description for User Equipment + DeviceGroup string `json:"deviceGroup,omitempty"` // Device or Endpoint Group + Imei string `json:"imei,omitempty"` // IMEI for User Equipment + CreateTime string `json:"createTime,omitempty"` // + UpdateTime string `json:"updateTime,omitempty"` // + ID string `json:"id,omitempty"` // + Link *ResponseUserEquipmentUpdateUserEquipmentResponseLink `json:"link,omitempty"` // +} + +type ResponseUserEquipmentUpdateUserEquipmentResponseLink struct { + Rel string `json:"rel,omitempty"` // + Href string `json:"href,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseUserEquipmentDeleteUserEquipment struct { + Message string `json:"message,omitempty"` // +} + +type ResponseUserEquipmentGetUserEquipmentsBySubscriberID struct { + Response *[]ResponseUserEquipmentGetUserEquipmentsBySubscriberIDResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseUserEquipmentGetUserEquipmentsBySubscriberIDResponse struct { + Description string `json:"description,omitempty"` // Description for User Equipment + DeviceGroup string `json:"deviceGroup,omitempty"` // Device or Endpoint Group + Imei string `json:"imei,omitempty"` // IMEI for User Equipment + CreateTime string `json:"createTime,omitempty"` // + UpdateTime string `json:"updateTime,omitempty"` // + ID string `json:"id,omitempty"` // + Link *ResponseUserEquipmentGetUserEquipmentsBySubscriberIDResponseLink `json:"link,omitempty"` // +} + +type ResponseUserEquipmentGetUserEquipmentsBySubscriberIDResponseLink struct { + Rel string `json:"rel,omitempty"` // + Href string `json:"href,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseUserEquipmentGetUserEquipmentByIMEI struct { + Response *ResponseUserEquipmentGetUserEquipmentByIMEIResponse `json:"response,omitempty"` // + Version string `json:"version,omitempty"` // +} + +type ResponseUserEquipmentGetUserEquipmentByIMEIResponse struct { + Description string `json:"description,omitempty"` // Description for User Equipment + DeviceGroup string `json:"deviceGroup,omitempty"` // Device or Endpoint Group + Imei string `json:"imei,omitempty"` // IMEI for User Equipment + CreateTime string `json:"createTime,omitempty"` // + UpdateTime string `json:"updateTime,omitempty"` // + ID string `json:"id,omitempty"` // + Link *ResponseUserEquipmentGetUserEquipmentByIMEIResponseLink `json:"link,omitempty"` // +} + +type ResponseUserEquipmentGetUserEquipmentByIMEIResponseLink struct { + Rel string `json:"rel,omitempty"` // + Href string `json:"href,omitempty"` // + Type string `json:"type,omitempty"` // +} + +type ResponseUserEquipmentCreateUserEquipmentsFromCSV struct { + ID string `json:"id,omitempty"` // +} + +type ResponseUserEquipmentBulkUserEquipmentOperation struct { + ID string `json:"id,omitempty"` // +} + +type RequestUserEquipmentCreateUserEquipment struct { + Description string `json:"description,omitempty"` // Description for User Equipment + DeviceGroup string `json:"deviceGroup,omitempty"` // Device or Endpoint Group + Imei string `json:"imei,omitempty"` // IMEI for User Equipment +} + +type RequestUserEquipmentUpdateUserEquipment struct { + Description string `json:"description,omitempty"` // Description for User Equipment + DeviceGroup string `json:"deviceGroup,omitempty"` // Device or Endpoint Group +} + +type RequestUserEquipmentBulkUserEquipmentOperation struct { + Operation string `json:"operation,omitempty"` // + ItemList *[]RequestUserEquipmentBulkUserEquipmentOperationItemList `json:"ItemList,omitempty"` // +} + +type RequestUserEquipmentBulkUserEquipmentOperationItemList struct { + Imei string `json:"imei,omitempty"` // + Description string `json:"description,omitempty"` // + ID string `json:"id,omitempty"` // + DeviceGroup string `json:"deviceGroup,omitempty"` // Device or Endpoint Group +} + +//GetUserEquipments Get user equipments +/* Get user equipments + +@param getUserEquipmentsQueryParams Filtering parameter +*/ +func (s *UserEquipmentService) GetUserEquipments(getUserEquipmentsQueryParams *GetUserEquipmentsQueryParams) (*ResponseUserEquipmentGetUserEquipments, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/fiveg/user-equipment" + + queryString, _ := query.Values(getUserEquipmentsQueryParams) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetQueryString(queryString.Encode()).SetResult(&ResponseUserEquipmentGetUserEquipments{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetUserEquipments") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseUserEquipmentGetUserEquipments) + return result, response, err + +} + +//GetUserEquipmentByID Get the user equipment for a given ID +/* Get the user equipment for a given ID + +@param userEquipmentID userEquipmentId path parameter. Unique ID for a user equipment object +*/ +func (s *UserEquipmentService) GetUserEquipmentByID(userEquipmentID string) (*ResponseUserEquipmentGetUserEquipmentByID, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/fiveg/user-equipment/{userEquipmentId}" + path = strings.Replace(path, "{userEquipmentId}", fmt.Sprintf("%v", userEquipmentID), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseUserEquipmentGetUserEquipmentByID{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetUserEquipmentById") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseUserEquipmentGetUserEquipmentByID) + return result, response, err + +} + +//GetUserEquipmentsBySubscriberID Get user equipments associated with a subscriber GUID +/* Get user equipments associated with a subscriber GUID + +@param subscriberID subscriberId path parameter. Unique ID for a subscriber object +*/ +func (s *UserEquipmentService) GetUserEquipmentsBySubscriberID(subscriberID string) (*ResponseUserEquipmentGetUserEquipmentsBySubscriberID, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/fiveg/user-equipment/subscriber/{subscriberId}" + path = strings.Replace(path, "{subscriberId}", fmt.Sprintf("%v", subscriberID), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseUserEquipmentGetUserEquipmentsBySubscriberID{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetUserEquipmentsBySubscriberId") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseUserEquipmentGetUserEquipmentsBySubscriberID) + return result, response, err + +} + +//GetUserEquipmentByIMEI Get a user equipment based on the IMEI +/* Get a user equipment based on the IMEI + +@param imei imei path parameter. IMEI for the user equipment object +*/ +func (s *UserEquipmentService) GetUserEquipmentByIMEI(imei string) (*ResponseUserEquipmentGetUserEquipmentByIMEI, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/fiveg/user-equipment/imei/{imei}" + path = strings.Replace(path, "{imei}", fmt.Sprintf("%v", imei), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseUserEquipmentGetUserEquipmentByIMEI{}). + SetError(&Error). + Get(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation GetUserEquipmentByIMEI") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseUserEquipmentGetUserEquipmentByIMEI) + return result, response, err + +} + +//CreateUserEquipment Create a user equipment +/* Create a user equipment + + */ +func (s *UserEquipmentService) CreateUserEquipment(requestUserEquipmentCreateUserEquipment *RequestUserEquipmentCreateUserEquipment) (*ResponseUserEquipmentCreateUserEquipment, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/fiveg/user-equipment" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestUserEquipmentCreateUserEquipment). + SetResult(&ResponseUserEquipmentCreateUserEquipment{}). + SetError(&Error). + Post(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseUserEquipmentCreateUserEquipment{}, response, nil + } + return nil, nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return nil, response, fmt.Errorf("error with operation CreateUserEquipment") + } + + result := response.Result().(*ResponseUserEquipmentCreateUserEquipment) + return result, response, err + +} + +//CreateUserEquipmentsFromCSV Create user equipments from a CSV file +/* Create user equipments from a CSV file + + */ +func (s *UserEquipmentService) CreateUserEquipmentsFromCSV() (*ResponseUserEquipmentCreateUserEquipmentsFromCSV, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/fiveg/user-equipment/csv" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseUserEquipmentCreateUserEquipmentsFromCSV{}). + SetError(&Error). + Post(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseUserEquipmentCreateUserEquipmentsFromCSV{}, response, nil + } + return nil, nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return nil, response, fmt.Errorf("error with operation CreateUserEquipmentsFromCSV") + } + + result := response.Result().(*ResponseUserEquipmentCreateUserEquipmentsFromCSV) + return result, response, err + +} + +//BulkUserEquipmentOperation Create, update and delete multiple user equipments +/* Create, update and delete multiple user equipments + + */ +func (s *UserEquipmentService) BulkUserEquipmentOperation(requestUserEquipmentBulkUserEquipmentOperation *RequestUserEquipmentBulkUserEquipmentOperation) (*ResponseUserEquipmentBulkUserEquipmentOperation, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/fiveg/user-equipment/bulk" + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestUserEquipmentBulkUserEquipmentOperation). + SetResult(&ResponseUserEquipmentBulkUserEquipmentOperation{}). + SetError(&Error). + Post(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseUserEquipmentBulkUserEquipmentOperation{}, response, nil + } + return nil, nil, err + + } + + getCSFRToken(response.Header()) + if response.IsError() { + return nil, response, fmt.Errorf("error with operation BulkUserEquipmentOperation") + } + + result := response.Result().(*ResponseUserEquipmentBulkUserEquipmentOperation) + return result, response, err + +} + +//UpdateUserEquipment Update the user equipment for a given ID and request payload +/* Update the user equipment for a given ID and request payload + +@param userEquipmentID userEquipmentId path parameter. Unique ID for a user equipment object +*/ +func (s *UserEquipmentService) UpdateUserEquipment(userEquipmentID string, requestUserEquipmentUpdateUserEquipment *RequestUserEquipmentUpdateUserEquipment) (*ResponseUserEquipmentUpdateUserEquipment, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/fiveg/user-equipment/{userEquipmentId}" + path = strings.Replace(path, "{userEquipmentId}", fmt.Sprintf("%v", userEquipmentID), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetBody(requestUserEquipmentUpdateUserEquipment). + SetResult(&ResponseUserEquipmentUpdateUserEquipment{}). + SetError(&Error). + Put(path) + + if err != nil { + if err.Error() == emptyStringToJSONError { + return &ResponseUserEquipmentUpdateUserEquipment{}, response, nil + } + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation UpdateUserEquipment") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseUserEquipmentUpdateUserEquipment) + return result, response, err + +} + +//DeleteUserEquipment Delete the user equipment for a given ID +/* Delete the user equipment for a given ID + +@param userEquipmentID userEquipmentId path parameter. Unique ID for a user equipment object +*/ +func (s *UserEquipmentService) DeleteUserEquipment(userEquipmentID string) (*ResponseUserEquipmentDeleteUserEquipment, *resty.Response, error) { + setHost(s.client, "_ui") + path := "/api/v1/fiveg/user-equipment/{userEquipmentId}" + path = strings.Replace(path, "{userEquipmentId}", fmt.Sprintf("%v", userEquipmentID), -1) + + setCSRFToken(s.client) + response, err := s.client.R(). + SetHeader("Content-Type", "application/json"). + SetHeader("Accept", "application/json"). + SetResult(&ResponseUserEquipmentDeleteUserEquipment{}). + SetError(&Error). + Delete(path) + + if err != nil { + return nil, nil, err + + } + + if response.IsError() { + return nil, response, fmt.Errorf("error with operation DeleteUserEquipment") + } + + getCSFRToken(response.Header()) + + result := response.Result().(*ResponseUserEquipmentDeleteUserEquipment) + return result, response, err + +} diff --git a/sdk/virtual_network.go b/sdk/virtual_network.go index fc5a97e..7c88ccc 100644 --- a/sdk/virtual_network.go +++ b/sdk/virtual_network.go @@ -10,26 +10,35 @@ import ( type VirtualNetworkService service -type GetVirtualNetworksQueryParams struct { - Page int `url:"page,omitempty"` //Page number - Size int `url:"size,omitempty"` //Number of objects returned per page - Sort string `url:"sort,omitempty"` //sort type - asc or desc - SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted - Filter []string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
- FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter +type GetVirtualNetworkListQueryParams struct { + Page int `url:"page,omitempty"` //Page number + Size int `url:"size,omitempty"` //Number of objects returned per page + Sort string `url:"sort,omitempty"` //sort type - asc or desc + SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted + Filter string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
+ FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter } -type ResponseVirtualNetworkGetVirtualNetworks struct { - Response *[]ResponseVirtualNetworkGetVirtualNetworksResponse `json:"response,omitempty"` // Array of Virtual Network +// GetVirtualNetworksQueryParams is deprecated, please use GetVirtualNetworkListQueryParams +type GetVirtualNetworksQueryParams = GetVirtualNetworkListQueryParams + +type ResponseVirtualNetworkGetVirtualNetworkList struct { + Response *[]ResponseVirtualNetworkGetVirtualNetworkListResponse `json:"response,omitempty"` // Array of Virtual Network } -type ResponseVirtualNetworkGetVirtualNetworksResponse struct { +// ResponseVirtualNetworkGetVirtualNetworks is deprecated, please use ResponseVirtualNetworkGetVirtualNetworkList +type ResponseVirtualNetworkGetVirtualNetworks = ResponseVirtualNetworkGetVirtualNetworkList + +type ResponseVirtualNetworkGetVirtualNetworkListResponse struct { AdditionalAttributes string `json:"additionalAttributes,omitempty"` // JSON String of additional attributes for the Virtual Network ID string `json:"id,omitempty"` // Identifier of the Virtual Network LastUpdate string `json:"lastUpdate,omitempty"` // Timestamp for the last update of the Virtual Network Name string `json:"name,omitempty"` // Name of the Virtual Network } +// ResponseVirtualNetworkGetVirtualNetworksResponse is deprecated, please use ResponseVirtualNetworkGetVirtualNetworkListResponse +type ResponseVirtualNetworkGetVirtualNetworksResponse = ResponseVirtualNetworkGetVirtualNetworkListResponse + type ResponseVirtualNetworkCreateVirtualNetwork struct { ID string `json:"id,omitempty"` // ID of the newly created object } @@ -57,16 +66,30 @@ type ResponseVirtualNetworkGetVirtualNetworkByIDResponse struct { Name string `json:"name,omitempty"` // Name of the Virtual Network } -type ResponseVirtualNetworkUpdateVirtualNetworkByID struct { - Code *int `json:"code,omitempty"` // - Message string `json:"message,omitempty"` // +type ResponseVirtualNetworkUpdateVirtualNetwork struct { + Response *[]ResponseVirtualNetworkUpdateVirtualNetworkResponse `json:"response,omitempty"` // Array of Virtual Network } -type ResponseVirtualNetworkDeleteVirtualNetworkByID struct { - Code *int `json:"code,omitempty"` // - Message string `json:"message,omitempty"` // +// ResponseVirtualNetworkUpdateVirtualNetworkByID is deprecated, please use ResponseVirtualNetworkUpdateVirtualNetwork +type ResponseVirtualNetworkUpdateVirtualNetworkByID = ResponseVirtualNetworkUpdateVirtualNetwork + +type ResponseVirtualNetworkUpdateVirtualNetworkResponse struct { + AdditionalAttributes string `json:"additionalAttributes,omitempty"` // JSON String of additional attributes for the Virtual Network + ID string `json:"id,omitempty"` // Identifier of the Virtual Network + LastUpdate string `json:"lastUpdate,omitempty"` // Timestamp for the last update of the Virtual Network + Name string `json:"name,omitempty"` // Name of the Virtual Network } +// ResponseVirtualNetworkUpdateVirtualNetworkByIDResponse is deprecated, please use ResponseVirtualNetworkUpdateVirtualNetworkResponse +type ResponseVirtualNetworkUpdateVirtualNetworkByIDResponse = ResponseVirtualNetworkUpdateVirtualNetworkResponse + +type ResponseVirtualNetworkDeleteVirtualNetwork struct { + ID string `json:"id,omitempty"` // resource id +} + +// ResponseVirtualNetworkDeleteVirtualNetworkByID is deprecated, please use ResponseVirtualNetworkDeleteVirtualNetwork +type ResponseVirtualNetworkDeleteVirtualNetworkByID = ResponseVirtualNetworkDeleteVirtualNetwork + type RequestVirtualNetworkCreateVirtualNetwork struct { AdditionalAttributes string `json:"additionalAttributes,omitempty"` // JSON String of additional attributes for the Virtual Network ID string `json:"id,omitempty"` // Identifier of the Virtual Network @@ -94,29 +117,32 @@ type RequestItemVirtualNetworkBulkUpdateVirtualNetworks struct { Name string `json:"name,omitempty"` // Name of the Virtual Network } -type RequestVirtualNetworkUpdateVirtualNetworkByID struct { +type RequestVirtualNetworkUpdateVirtualNetwork struct { AdditionalAttributes string `json:"additionalAttributes,omitempty"` // JSON String of additional attributes for the Virtual Network ID string `json:"id,omitempty"` // Identifier of the Virtual Network LastUpdate string `json:"lastUpdate,omitempty"` // Timestamp for the last update of the Virtual Network Name string `json:"name,omitempty"` // Name of the Virtual Network } -//GetVirtualNetworks Get all Virtual Networks +// RequestVirtualNetworkUpdateVirtualNetworkByID is deprecated, please use RequestVirtualNetworkUpdateVirtualNetwork +type RequestVirtualNetworkUpdateVirtualNetworkByID = RequestVirtualNetworkUpdateVirtualNetwork + +//GetVirtualNetworkList Get all Virtual Networks /* Get all Virtual Networks -@param getVirtualNetworksQueryParams Filtering parameter +@param getVirtualNetworkListQueryParams Filtering parameter */ -func (s *VirtualNetworkService) GetVirtualNetworks(getVirtualNetworksQueryParams *GetVirtualNetworksQueryParams) (*ResponseVirtualNetworkGetVirtualNetworks, *resty.Response, error) { +func (s *VirtualNetworkService) GetVirtualNetworkList(getVirtualNetworkListQueryParams *GetVirtualNetworkListQueryParams) (*ResponseVirtualNetworkGetVirtualNetworkList, *resty.Response, error) { setHost(s.client, "_ui") path := "/api/v1/trustsec/virtualnetwork" - queryString, _ := query.Values(getVirtualNetworksQueryParams) + queryString, _ := query.Values(getVirtualNetworkListQueryParams) setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetQueryString(queryString.Encode()).SetResult(&ResponseVirtualNetworkGetVirtualNetworks{}). + SetQueryString(queryString.Encode()).SetResult(&ResponseVirtualNetworkGetVirtualNetworkList{}). SetError(&Error). Get(path) @@ -126,16 +152,21 @@ func (s *VirtualNetworkService) GetVirtualNetworks(getVirtualNetworksQueryParams } if response.IsError() { - return nil, response, fmt.Errorf("error with operation GetVirtualNetworks") + return nil, response, fmt.Errorf("error with operation GetVirtualNetworkList") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseVirtualNetworkGetVirtualNetworks) + result := response.Result().(*ResponseVirtualNetworkGetVirtualNetworkList) return result, response, err } +// Alias of GetVirtualNetworkList Get all Virtual Networks +func (s *VirtualNetworkService) GetVirtualNetworks(getVirtualNetworkListQueryParams *GetVirtualNetworkListQueryParams) (*ResponseVirtualNetworkGetVirtualNetworkList, *resty.Response, error) { + return s.GetVirtualNetworkList(getVirtualNetworkListQueryParams) +} + //GetVirtualNetworkByID Get Virtual Network by id /* Get Virtual Network by id @@ -310,12 +341,12 @@ func (s *VirtualNetworkService) BulkUpdateVirtualNetworks(requestVirtualNetworkB } -//UpdateVirtualNetworkByID Update Virtual Network +//UpdateVirtualNetwork Update Virtual Network /* Update Virtual Network @param id id path parameter. */ -func (s *VirtualNetworkService) UpdateVirtualNetworkByID(id string, requestVirtualNetworkUpdateVirtualNetworkById *RequestVirtualNetworkUpdateVirtualNetworkByID) (*ResponseVirtualNetworkUpdateVirtualNetworkByID, *resty.Response, error) { +func (s *VirtualNetworkService) UpdateVirtualNetwork(id string, requestVirtualNetworkUpdateVirtualNetwork *RequestVirtualNetworkUpdateVirtualNetwork) (*ResponseVirtualNetworkUpdateVirtualNetwork, *resty.Response, error) { setHost(s.client, "_ui") path := "/api/v1/trustsec/virtualnetwork/{id}" path = strings.Replace(path, "{id}", fmt.Sprintf("%v", id), -1) @@ -324,36 +355,41 @@ func (s *VirtualNetworkService) UpdateVirtualNetworkByID(id string, requestVirtu response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetBody(requestVirtualNetworkUpdateVirtualNetworkById). - SetResult(&ResponseVirtualNetworkUpdateVirtualNetworkByID{}). + SetBody(requestVirtualNetworkUpdateVirtualNetwork). + SetResult(&ResponseVirtualNetworkUpdateVirtualNetwork{}). SetError(&Error). Put(path) if err != nil { if err.Error() == emptyStringToJSONError { - return &ResponseVirtualNetworkUpdateVirtualNetworkByID{}, response, nil + return &ResponseVirtualNetworkUpdateVirtualNetwork{}, response, nil } return nil, nil, err } if response.IsError() { - return nil, response, fmt.Errorf("error with operation UpdateVirtualNetworkById") + return nil, response, fmt.Errorf("error with operation UpdateVirtualNetwork") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseVirtualNetworkUpdateVirtualNetworkByID) + result := response.Result().(*ResponseVirtualNetworkUpdateVirtualNetwork) return result, response, err } -//DeleteVirtualNetworkByID Delete Virtual Network +// Alias of UpdateVirtualNetwork Update Virtual Network +func (s *VirtualNetworkService) UpdateVirtualNetworkByID(id string, requestVirtualNetworkUpdateVirtualNetwork *RequestVirtualNetworkUpdateVirtualNetwork) (*ResponseVirtualNetworkUpdateVirtualNetwork, *resty.Response, error) { + return s.UpdateVirtualNetwork(id, requestVirtualNetworkUpdateVirtualNetwork) +} + +//DeleteVirtualNetwork Delete Virtual Network /* Delete Virtual Network @param id id path parameter. */ -func (s *VirtualNetworkService) DeleteVirtualNetworkByID(id string) (*ResponseVirtualNetworkDeleteVirtualNetworkByID, *resty.Response, error) { +func (s *VirtualNetworkService) DeleteVirtualNetwork(id string) (*ResponseVirtualNetworkDeleteVirtualNetwork, *resty.Response, error) { setHost(s.client, "_ui") path := "/api/v1/trustsec/virtualnetwork/{id}" path = strings.Replace(path, "{id}", fmt.Sprintf("%v", id), -1) @@ -362,7 +398,7 @@ func (s *VirtualNetworkService) DeleteVirtualNetworkByID(id string) (*ResponseVi response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseVirtualNetworkDeleteVirtualNetworkByID{}). + SetResult(&ResponseVirtualNetworkDeleteVirtualNetwork{}). SetError(&Error). Delete(path) @@ -372,12 +408,17 @@ func (s *VirtualNetworkService) DeleteVirtualNetworkByID(id string) (*ResponseVi } if response.IsError() { - return nil, response, fmt.Errorf("error with operation DeleteVirtualNetworkById") + return nil, response, fmt.Errorf("error with operation DeleteVirtualNetwork") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseVirtualNetworkDeleteVirtualNetworkByID) + result := response.Result().(*ResponseVirtualNetworkDeleteVirtualNetwork) return result, response, err } + +// Alias of DeleteVirtualNetwork Delete Virtual Network +func (s *VirtualNetworkService) DeleteVirtualNetworkByID(id string) (*ResponseVirtualNetworkDeleteVirtualNetwork, *resty.Response, error) { + return s.DeleteVirtualNetwork(id) +} diff --git a/sdk/vn_vlan_mapping.go b/sdk/vn_vlan_mapping.go index 5af8ddd..225288a 100644 --- a/sdk/vn_vlan_mapping.go +++ b/sdk/vn_vlan_mapping.go @@ -10,20 +10,20 @@ import ( type VnVLANMappingService service -type GetVnVLANMappingsQueryParams struct { - Page int `url:"page,omitempty"` //Page number - Size int `url:"size,omitempty"` //Number of objects returned per page - Sort string `url:"sort,omitempty"` //sort type - asc or desc - SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted - Filter []string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
- FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter +type GetVnVLANMappingListQueryParams struct { + Page int `url:"page,omitempty"` //Page number + Size int `url:"size,omitempty"` //Number of objects returned per page + Sort string `url:"sort,omitempty"` //sort type - asc or desc + SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted + Filter string `url:"filter,omitempty"` //
Simple filtering should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the "filterType=or" query string parameter. Each resource Data model description should specify if an attribute is a filtered field.
OPERATOR DESCRIPTION
EQ Equals
NEQ Not Equals
GT Greater Than
LT Less Then
STARTSW Starts With
NSTARTSW Not Starts With
ENDSW Ends With
NENDSW Not Ends With
CONTAINS Contains
NCONTAINS Not Contains
+ FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter } -type ResponseVnVLANMappingGetVnVLANMappings struct { - Response *[]ResponseVnVLANMappingGetVnVLANMappingsResponse `json:"response,omitempty"` // Array of VN-Vlan Mappings +type ResponseVnVLANMappingGetVnVLANMappingList struct { + Response *[]ResponseVnVLANMappingGetVnVLANMappingListResponse `json:"response,omitempty"` // Array of VN-Vlan Mappings } -type ResponseVnVLANMappingGetVnVLANMappingsResponse struct { +type ResponseVnVLANMappingGetVnVLANMappingListResponse struct { ID string `json:"id,omitempty"` // Identifier of the VN-Vlan Mapping IsData *bool `json:"isData,omitempty"` // Flag which indicates whether the Vlan is data or voice type IsDefaultVLAN *bool `json:"isDefaultVlan,omitempty"` // Flag which indicates if the Vlan is default @@ -65,13 +65,11 @@ type ResponseVnVLANMappingGetVnVLANMappingByIDResponse struct { VnName string `json:"vnName,omitempty"` // Name of the associated Virtual Network to be used for identity if id is not provided } -type ResponseVnVLANMappingUpdateVnVLANMappingByID struct { - Code *int `json:"code,omitempty"` // +type ResponseVnVLANMappingUpdateVnVLANMapping struct { Message string `json:"message,omitempty"` // } -type ResponseVnVLANMappingDeleteVnVLANMappingByID struct { - Code *int `json:"code,omitempty"` // +type ResponseVnVLANMappingDeleteVnVLANMapping struct { Message string `json:"message,omitempty"` // } @@ -114,7 +112,7 @@ type RequestItemVnVLANMappingBulkUpdateVnVLANMappings struct { VnName string `json:"vnName,omitempty"` // Name of the associated Virtual Network to be used for identity if id is not provided } -type RequestVnVLANMappingUpdateVnVLANMappingByID struct { +type RequestVnVLANMappingUpdateVnVLANMapping struct { ID string `json:"id,omitempty"` // Identifier of the VN-Vlan Mapping IsData *bool `json:"isData,omitempty"` // Flag which indicates whether the Vlan is data or voice type IsDefaultVLAN *bool `json:"isDefaultVlan,omitempty"` // Flag which indicates if the Vlan is default @@ -125,22 +123,22 @@ type RequestVnVLANMappingUpdateVnVLANMappingByID struct { VnName string `json:"vnName,omitempty"` // Name of the associated Virtual Network to be used for identity if id is not provided } -//GetVnVLANMappings Get all VN-Vlan Mappings +//GetVnVLANMappingList Get all VN-Vlan Mappings /* Get all VN-Vlan Mappings -@param getVnVlanMappingsQueryParams Filtering parameter +@param getVnVlanMappingListQueryParams Filtering parameter */ -func (s *VnVLANMappingService) GetVnVLANMappings(getVnVlanMappingsQueryParams *GetVnVLANMappingsQueryParams) (*ResponseVnVLANMappingGetVnVLANMappings, *resty.Response, error) { +func (s *VnVLANMappingService) GetVnVLANMappingList(getVnVlanMappingListQueryParams *GetVnVLANMappingListQueryParams) (*ResponseVnVLANMappingGetVnVLANMappingList, *resty.Response, error) { setHost(s.client, "_ui") path := "/api/v1/trustsec/vnvlanmapping" - queryString, _ := query.Values(getVnVlanMappingsQueryParams) + queryString, _ := query.Values(getVnVlanMappingListQueryParams) setCSRFToken(s.client) response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetQueryString(queryString.Encode()).SetResult(&ResponseVnVLANMappingGetVnVLANMappings{}). + SetQueryString(queryString.Encode()).SetResult(&ResponseVnVLANMappingGetVnVLANMappingList{}). SetError(&Error). Get(path) @@ -150,12 +148,12 @@ func (s *VnVLANMappingService) GetVnVLANMappings(getVnVlanMappingsQueryParams *G } if response.IsError() { - return nil, response, fmt.Errorf("error with operation GetVnVlanMappings") + return nil, response, fmt.Errorf("error with operation GetVnVlanMappingList") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseVnVLANMappingGetVnVLANMappings) + result := response.Result().(*ResponseVnVLANMappingGetVnVLANMappingList) return result, response, err } @@ -334,12 +332,12 @@ func (s *VnVLANMappingService) BulkUpdateVnVLANMappings(requestVnVLANMappingBulk } -//UpdateVnVLANMappingByID Update VN-Vlan Mapping +//UpdateVnVLANMapping Update VN-Vlan Mapping /* Update VN-Vlan Mapping @param id id path parameter. */ -func (s *VnVLANMappingService) UpdateVnVLANMappingByID(id string, requestVnVLANMappingUpdateVnVlanMappingById *RequestVnVLANMappingUpdateVnVLANMappingByID) (*ResponseVnVLANMappingUpdateVnVLANMappingByID, *resty.Response, error) { +func (s *VnVLANMappingService) UpdateVnVLANMapping(id string, requestVnVLANMappingUpdateVnVlanMapping *RequestVnVLANMappingUpdateVnVLANMapping) (*ResponseVnVLANMappingUpdateVnVLANMapping, *resty.Response, error) { setHost(s.client, "_ui") path := "/api/v1/trustsec/vnvlanmapping/{id}" path = strings.Replace(path, "{id}", fmt.Sprintf("%v", id), -1) @@ -348,36 +346,36 @@ func (s *VnVLANMappingService) UpdateVnVLANMappingByID(id string, requestVnVLANM response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetBody(requestVnVLANMappingUpdateVnVlanMappingById). - SetResult(&ResponseVnVLANMappingUpdateVnVLANMappingByID{}). + SetBody(requestVnVLANMappingUpdateVnVlanMapping). + SetResult(&ResponseVnVLANMappingUpdateVnVLANMapping{}). SetError(&Error). Put(path) if err != nil { if err.Error() == emptyStringToJSONError { - return &ResponseVnVLANMappingUpdateVnVLANMappingByID{}, response, nil + return &ResponseVnVLANMappingUpdateVnVLANMapping{}, response, nil } return nil, nil, err } if response.IsError() { - return nil, response, fmt.Errorf("error with operation UpdateVnVlanMappingById") + return nil, response, fmt.Errorf("error with operation UpdateVnVlanMapping") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseVnVLANMappingUpdateVnVLANMappingByID) + result := response.Result().(*ResponseVnVLANMappingUpdateVnVLANMapping) return result, response, err } -//DeleteVnVLANMappingByID Delete VN-Vlan Mapping +//DeleteVnVLANMapping Delete VN-Vlan Mapping /* Delete VN-Vlan Mapping @param id id path parameter. */ -func (s *VnVLANMappingService) DeleteVnVLANMappingByID(id string) (*ResponseVnVLANMappingDeleteVnVLANMappingByID, *resty.Response, error) { +func (s *VnVLANMappingService) DeleteVnVLANMapping(id string) (*ResponseVnVLANMappingDeleteVnVLANMapping, *resty.Response, error) { setHost(s.client, "_ui") path := "/api/v1/trustsec/vnvlanmapping/{id}" path = strings.Replace(path, "{id}", fmt.Sprintf("%v", id), -1) @@ -386,7 +384,7 @@ func (s *VnVLANMappingService) DeleteVnVLANMappingByID(id string) (*ResponseVnVL response, err := s.client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Accept", "application/json"). - SetResult(&ResponseVnVLANMappingDeleteVnVLANMappingByID{}). + SetResult(&ResponseVnVLANMappingDeleteVnVLANMapping{}). SetError(&Error). Delete(path) @@ -396,12 +394,12 @@ func (s *VnVLANMappingService) DeleteVnVLANMappingByID(id string) (*ResponseVnVL } if response.IsError() { - return nil, response, fmt.Errorf("error with operation DeleteVnVlanMappingById") + return nil, response, fmt.Errorf("error with operation DeleteVnVlanMapping") } getCSFRToken(response.Header()) - result := response.Result().(*ResponseVnVLANMappingDeleteVnVLANMappingByID) + result := response.Result().(*ResponseVnVLANMappingDeleteVnVLANMapping) return result, response, err }