Skip to content

Commit cdd68a1

Browse files
cholmes1111eelkram
authored andcommitted
Hso 4887 (#2)
* updated default API version to 6.0. Updated data type to decimal. * major version bump. updated Copyright year * added CHANGELOG.md
1 parent cae5a6e commit cdd68a1

File tree

6 files changed

+20
-9
lines changed

6 files changed

+20
-9
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
This file is used to list changes made in each version of the Brocade VTM plugin
2+
3+
2.0.0
4+
------
5+
Version 18.2 of the Pulse Secure VTM has introduced version 6.0 of the API
6+
- Updated default API version to 6.0.
7+
- Changed data type of the APIVersion variable from double to decimal

Org.BeyondComputing.NewRelic.Brocade.VTM.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
</ItemGroup>
8282
<ItemGroup>
8383
<None Include="App.config" />
84+
<None Include="CHANGELOG.md">
85+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
86+
</None>
8487
<None Include="config\newrelic.template.json">
8588
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
8689
</None>

Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("BeyondComputing")]
1212
[assembly: AssemblyProduct("Org.BeyondComputing.NewRelic.Brocade.VTM")]
13-
[assembly: AssemblyCopyright("Copyright © Mark Studer 2015")]
13+
[assembly: AssemblyCopyright("Copyright © Mark Studer 2018")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.5.0")]
36-
[assembly: AssemblyFileVersion("1.5.0")]
35+
[assembly: AssemblyVersion("2.0.0")]
36+
[assembly: AssemblyFileVersion("2.0.0")]

VTM.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public VTM(string host, int port, string username, string password)
1818
// HTTP Client settings
1919
var credentials = new NetworkCredential(username, password);
2020
var handler = new HttpClientHandler { Credentials = credentials };
21+
2122
var url = string.Format("https://{0}:{1}", host, port);
2223

2324
// Create HTTP Client for all future requests to API

VTMAgent.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ public override string Version
2727

2828
private string name;
2929
private VTM VTM;
30-
private double APIVersion;
30+
private decimal APIVersion;
3131

3232
// Create Dictionary of EpochProcessors to track rate over time for unknown number of items
3333
private Dictionary<string,IProcessor> processors = new Dictionary<string,IProcessor>();
3434

3535
private Logger log = Logger.GetLogger(typeof(VTMAgent).Name);
3636

37-
public VTMAgent(string name, string host, int port, string username, string password, double APIVersion)
37+
public VTMAgent(string name, string host, int port, string username, string password, decimal APIVersion)
3838
{
3939
this.name = name;
4040
this.VTM = new VTM(host, port, username, password);
@@ -87,7 +87,7 @@ private void PollGlobal()
8787
ReportMetric("global/sys_cpu_busy_percent", "percent", globalStats.sys_cpu_busy_percent);
8888

8989
// Get Global Status API v3.7+
90-
if (APIVersion >= 3.7)
90+
if (APIVersion >= 3.7m)
9191
{
9292
dynamic globalStatus = VTM.fetchVTMObject<dynamic>($"/api/tm/{APIVersion}/status/local_tm/state");
9393

@@ -110,7 +110,7 @@ private void PollPool()
110110
dynamic failedNodes = null;
111111

112112
// Get Global Status API v3.7+
113-
if (APIVersion >= 3.7)
113+
if (APIVersion >= 3.7m)
114114
{
115115
failedNodes = VTM.fetchVTMObject<dynamic>($"/api/tm/{APIVersion}/status/local_tm/state").state.failed_nodes;
116116
}

VTMAgentFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ class VTMAgentFactory : AgentFactory
1212
public override Agent CreateAgentWithConfiguration(IDictionary<string, object> properties)
1313
{
1414
// Set the default version of the API to use if not found in the config file
15-
const double _APIVersion = 3.8;
15+
const decimal _APIVersion = 6.0m;
1616

1717
string name = (string)properties["name"];
1818
string host = (string)properties["host"];
1919
int port = int.Parse((string)properties["port"]);
2020
string username = (string)properties["username"];
2121
string password = (string)properties["password"];
22-
double APIVersion = properties.ContainsKey("api_version") ? (double)properties["api_version"] : _APIVersion;
22+
decimal APIVersion = properties.ContainsKey("api_version") ? (decimal)properties["api_version"] : _APIVersion;
2323

2424
if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(host) || string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
2525
{

0 commit comments

Comments
 (0)