From bf29809c2884f1f54ba85ef15e634e2d3ff6a964 Mon Sep 17 00:00:00 2001 From: bvargasre Date: Tue, 6 Aug 2024 15:09:50 -0600 Subject: [PATCH] chore: Set User-Agent header in API client --- CHANGELOG.md | 10 ++++++++-- sdk/api_client.go | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67549b6..1bb38fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.3.4] - 2024-08-06 +### Added +- Set User-Agent header in API client + ## [1.3.3] - 2024-05-15 ### Fixed - Added missing parameters in Children structs at `network_access_authorization_rules` - + ## [1.3.2] - 2024-05-15 ### Fixed - Update NetworkDeviceGroup API parameter name from `ndgtpye` to `othername`in 3.3 patch 1. @@ -242,4 +246,6 @@ Following parameters were added to `RequestNetworkAccessAuthenticationRulesCreat [1.3.0]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.2.0...v1.3.0 [1.3.1]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.3.0...v1.3.1 [1.3.2]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.3.1...v1.3.2 -[Unreleased]: https://github.com/cisco-en-programmability/ciscoise-go-sdk/compare/v1.3.2...main +[1.3.3]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.3.2...v1.3.3 +[1.3.4]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.3.3...v1.3.4 +[Unreleased]: https://github.com/cisco-en-programmability/ciscoise-go-sdk/compare/v1.3.4...main diff --git a/sdk/api_client.go b/sdk/api_client.go index 9f09fcd..8d0b2e7 100644 --- a/sdk/api_client.go +++ b/sdk/api_client.go @@ -24,6 +24,8 @@ const ISE_DEBUG = "ISE_DEBUG" const ISE_SSL_VERIFY = "ISE_SSL_VERIFY" const ISE_USE_API_GATEWAY = "ISE_USE_API_GATEWAY" const ISE_USE_CSRF_TOKEN = "ISE_USE_CSRF_TOKEN" +const VERSION = "3.3_patch_1" +const USER_AGENT = "go-cisco-ise/" + VERSION const emptyStringToJSONError = "unexpected end of JSON input" @@ -239,6 +241,7 @@ var Error map[string]interface{} func NewClient() (*Client, error) { var err error client := resty.New() + client.SetHeader("User-Agent", USER_AGENT) c := &Client{} c.common.client = client username := "" @@ -461,5 +464,6 @@ func NewClientWithOptions(baseURL string, username string, password string, debu // RestyClient returns the resty.Client used by the sdk func (s *Client) RestyClient() *resty.Client { + s.common.client.SetHeader("User-Agent", USER_AGENT) return s.common.client }