You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2016/11/28 21:22:59 UTC
[01/11] incubator-trafficcontrol git commit: update server.go and
server fixture for new API
Repository: incubator-trafficcontrol
Updated Branches:
refs/heads/psql-rebase ec0d16262 -> 0cfb4ecc4
update server.go and server fixture for new API
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/cf14ba38
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/cf14ba38
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/cf14ba38
Branch: refs/heads/psql-rebase
Commit: cf14ba385daf61972e6da718283e80d1f71d1703
Parents: 29eb317
Author: David Neuman <da...@gmail.com>
Authored: Mon Nov 21 09:49:42 2016 -0700
Committer: David Neuman <da...@gmail.com>
Committed: Mon Nov 21 09:49:42 2016 -0700
----------------------------------------------------------------------
traffic_ops/client/fixtures/server.go | 22 +++++++++++-----------
traffic_ops/client/server.go | 6 +++---
2 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cf14ba38/traffic_ops/client/fixtures/server.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/server.go b/traffic_ops/client/fixtures/server.go
index 07c541a..4184ad1 100644
--- a/traffic_ops/client/fixtures/server.go
+++ b/traffic_ops/client/fixtures/server.go
@@ -22,13 +22,13 @@ func Servers() *client.ServerResponse {
return &client.ServerResponse{
Response: []client.Server{
{
- ID: "001",
+ ID: 001,
HostName: "edge-alb-01",
DomainName: "albuquerque.nm.albuq.kabletown.com",
CDNName: "CDN-1",
Type: "EDGE",
Profile: "EDGE1_CDN_520",
- TCPPort: "80",
+ TCPPort: 80,
Rack: "F-4/35",
PhysLocation: "Albuquerque",
Cachegroup: "albuquerque",
@@ -49,19 +49,19 @@ func Servers() *client.ServerResponse {
IloIPGateway: "10.10.10.10",
IloIPNetmask: "255.255.255.192",
InterfaceName: "bond0",
- InterfaceMtu: "9000",
+ InterfaceMtu: 9000,
RouterPortName: "TenGigE0/3/0/10\t|\tBundle-Ether1000\t|\tPHY|10G|AGG-MEMBER|dtype:IPCDN-EDGE|rhost:edge-alb-01|rport:eth1|lagg:1000",
RouterHostName: "ar01.albuquerque.nm.albuq.kabletown.com",
LastUpdated: "2015-03-27 17:00:30",
},
{
- ID: "002",
+ ID: 002,
HostName: "edge-alb-02",
DomainName: "albuquerque.nm.albuq.kabletown.com",
CDNName: "CDN-1",
Type: "EDGE",
Profile: "EDGE1_XCR_520",
- TCPPort: "80",
+ TCPPort: 80,
Rack: "F-4/38",
PhysLocation: "Albuquerque",
Cachegroup: "us-nm-albuquerque",
@@ -82,19 +82,19 @@ func Servers() *client.ServerResponse {
IloIPGateway: "10.10.10.10",
IloIPNetmask: "255.255.255.192",
InterfaceName: "bond0",
- InterfaceMtu: "9000",
+ InterfaceMtu: 9000,
RouterPortName: "TenGigE0/3/0/10\t|\tBundle-Ether1000\t|\tPHY|10G|AGG-MEMBER|dtype:IPCDN-EDGE|rhost:edge-alb-02|rport:eth1|lagg:1000",
RouterHostName: "ar02.albuquerque.nm.albuq.kabletown.com",
LastUpdated: "2015-03-27 17:00:34",
},
{
- ID: "003",
+ ID: 003,
HostName: "atlanta-mid-01",
DomainName: "ga.atlanta.kabletown.net",
CDNName: "CDN-1",
Type: "MID",
Profile: "MID1",
- TCPPort: "80",
+ TCPPort: 80,
Rack: "F-4/38",
PhysLocation: "Denver",
Cachegroup: "mid-northeast-group",
@@ -115,7 +115,7 @@ func Servers() *client.ServerResponse {
IloIPGateway: "1",
IloIPNetmask: "",
InterfaceName: "bond0",
- InterfaceMtu: "9000",
+ InterfaceMtu: 9000,
RouterPortName: "",
RouterHostName: "",
LastUpdated: "2015-03-27 17:00:34",
@@ -129,7 +129,7 @@ func LogstashServers() *client.ServerResponse {
return &client.ServerResponse{
Response: []client.Server{
{
- ID: "004",
+ ID: 004,
HostName: "logstash-01",
DomainName: "albuquerque.nm.albuq.kabletown.com",
CDNName: "CDN-2",
@@ -138,7 +138,7 @@ func LogstashServers() *client.ServerResponse {
IPAddress: "10.10.10.10",
},
{
- ID: "005",
+ ID: 005,
HostName: "logstash-02",
DomainName: "albuquerque.nm.albuq.kabletown.com",
CDNName: "CDN-2",
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cf14ba38/traffic_ops/client/server.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/server.go b/traffic_ops/client/server.go
index 93ea9e5..8295bab 100644
--- a/traffic_ops/client/server.go
+++ b/traffic_ops/client/server.go
@@ -32,13 +32,13 @@ type ServerResponse struct {
type Server struct {
DomainName string `json:"domainName"`
HostName string `json:"hostName"`
- ID string `json:"id"`
+ ID int `json:"id"`
IloIPAddress string `json:"iloIpAddress"`
IloIPGateway string `json:"iloIpGateway"`
IloIPNetmask string `json:"iloIpNetmask"`
IloPassword string `json:"iloPassword"`
IloUsername string `json:"iloUsername"`
- InterfaceMtu string `json:"interfaceMtu"`
+ InterfaceMtu int `json:"interfaceMtu"`
InterfaceName string `json:"interfaceName"`
IP6Address string `json:"ip6Address"`
IP6Gateway string `json:"ip6Gateway"`
@@ -59,7 +59,7 @@ type Server struct {
RouterHostName string `json:"routerHostName"`
RouterPortName string `json:"routerPortName"`
Status string `json:"status"`
- TCPPort string `json:"tcpPort"`
+ TCPPort int `json:"tcpPort"`
Type string `json:"type"`
XMPPID string `json:"xmppId"`
XMPPPasswd string `json:"xmppPasswd"`
[10/11] incubator-trafficcontrol git commit: Merge branch
'to-client-psql' of https://github.com/dneuman64/incubator-trafficcontrol
into psql-rebase
Posted by mi...@apache.org.
Merge branch 'to-client-psql' of https://github.com/dneuman64/incubator-trafficcontrol into psql-rebase
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/dc81269d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/dc81269d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/dc81269d
Branch: refs/heads/psql-rebase
Commit: dc81269d1e808f0bbab25e2d885a1e9a6abd5257
Parents: ec0d162 2d2aac9
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Mon Nov 28 14:20:50 2016 -0700
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Mon Nov 28 14:20:50 2016 -0700
----------------------------------------------------------------------
traffic_ops/app/lib/API/HwInfo.pm | 2 +-
traffic_ops/client/cachegroup.go | 5 ++-
traffic_ops/client/cdn.go | 3 +-
.../client/delivery_service_resources.go | 33 ++++++++++----------
traffic_ops/client/fixtures/cachegroup.go | 4 +--
traffic_ops/client/fixtures/delivery_service.go | 30 +++++++++---------
traffic_ops/client/fixtures/hardware.go | 15 ++++++---
traffic_ops/client/fixtures/server.go | 22 ++++++-------
traffic_ops/client/fixtures/user.go | 2 +-
traffic_ops/client/hardware.go | 10 ++++--
traffic_ops/client/parameter.go | 1 -
traffic_ops/client/profile.go | 1 -
traffic_ops/client/server.go | 7 ++---
traffic_ops/client/stats_summary.go | 1 -
traffic_ops/client/tests/cachegroup_test.go | 12 +++----
.../client/tests/delivery_service_test.go | 8 ++---
traffic_ops/client/tests/hardware_test.go | 27 ++++++++--------
traffic_ops/client/tests/user_test.go | 2 +-
traffic_ops/client/traffic_monitor_config.go | 1 -
traffic_ops/client/traffic_ops.go | 3 +-
traffic_ops/client/traffic_router_config.go | 1 -
traffic_ops/client/type.go | 1 -
traffic_ops/client/user.go | 7 ++---
23 files changed, 99 insertions(+), 99 deletions(-)
----------------------------------------------------------------------
[09/11] incubator-trafficcontrol git commit: update cachegroup to
support real floats returned from API
Posted by mi...@apache.org.
update cachegroup to support real floats returned from API
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/2d2aac92
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/2d2aac92
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/2d2aac92
Branch: refs/heads/psql-rebase
Commit: 2d2aac92ee8924b9e98352c56079f01953119ad5
Parents: 0358622
Author: David Neuman <da...@gmail.com>
Authored: Mon Nov 28 14:14:15 2016 -0700
Committer: David Neuman <da...@gmail.com>
Committed: Mon Nov 28 14:14:15 2016 -0700
----------------------------------------------------------------------
traffic_ops/client/cachegroup.go | 4 ++--
traffic_ops/client/fixtures/cachegroup.go | 4 ++--
traffic_ops/client/tests/cachegroup_test.go | 12 ++++++------
3 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2d2aac92/traffic_ops/client/cachegroup.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/cachegroup.go b/traffic_ops/client/cachegroup.go
index 1c65c56..bb21b72 100644
--- a/traffic_ops/client/cachegroup.go
+++ b/traffic_ops/client/cachegroup.go
@@ -26,8 +26,8 @@ type CacheGroupResponse struct {
type CacheGroup struct {
Name string `json:"name"`
ShortName string `json:"shortName"`
- Latitude float64 `json:"latitude,string"`
- Longitude float64 `json:"longitude,string"`
+ Latitude float64 `json:"latitude"`
+ Longitude float64 `json:"longitude"`
ParentName string `json:"parentCachegroupName,omitempty"`
Type string `json:"typeName,omitempty"`
LastUpdated string `json:"lastUpdated,omitempty"`
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2d2aac92/traffic_ops/client/fixtures/cachegroup.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/cachegroup.go b/traffic_ops/client/fixtures/cachegroup.go
index e6bcfd6..ea0fd69 100644
--- a/traffic_ops/client/fixtures/cachegroup.go
+++ b/traffic_ops/client/fixtures/cachegroup.go
@@ -25,8 +25,8 @@ func Cachegroups() *client.CacheGroupResponse {
Name: "edge-philadelphia",
ShortName: "phila",
Type: "EDGE_LOC",
- Longitude: 5,
- Latitude: 55,
+ Longitude: -5.66,
+ Latitude: 55.67,
ParentName: "mid-northeast",
LastUpdated: "2014-03-28 15:23:50",
},
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2d2aac92/traffic_ops/client/tests/cachegroup_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/cachegroup_test.go b/traffic_ops/client/tests/cachegroup_test.go
index aa343a4..13c0372 100644
--- a/traffic_ops/client/tests/cachegroup_test.go
+++ b/traffic_ops/client/tests/cachegroup_test.go
@@ -57,16 +57,16 @@ func TestCacheGroup(t *testing.T) {
testHelper.Success(t, "Should get back \"edge-philadelphia\" for \"Name\"")
}
- if cacheGroup.Longitude != 5 {
- testHelper.Error(t, "Should get back \"5\" for \"Longitude\", got: %v", cacheGroup.Longitude)
+ if cacheGroup.Longitude != -5.66 {
+ testHelper.Error(t, "Should get back \"-5.66\" for \"Longitude\", got: %v", cacheGroup.Longitude)
} else {
- testHelper.Success(t, "Should get back \"5\" for \"Longitude\"")
+ testHelper.Success(t, "Should get back \"-5.66\" for \"Longitude\"")
}
- if cacheGroup.Latitude != 55 {
- testHelper.Error(t, "Should get back \"55\" for \"Latitude\", got: %v", cacheGroup.Latitude)
+ if cacheGroup.Latitude != 55.67 {
+ testHelper.Error(t, "Should get back \"55.67\" for \"Latitude\", got: %v", cacheGroup.Latitude)
} else {
- testHelper.Success(t, "Should get back \"55\" for \"Latitude\"")
+ testHelper.Success(t, "Should get back \"55.67\" for \"Latitude\"")
}
if cacheGroup.ParentName != "mid-northeast" {
[02/11] incubator-trafficcontrol git commit: update Deliverservice
and associated tests/fixtures for psql
Posted by mi...@apache.org.
update Deliverservice and associated tests/fixtures for psql
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/c444a403
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/c444a403
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/c444a403
Branch: refs/heads/psql-rebase
Commit: c444a40328c009f6eda520b71963d6dbe3150306
Parents: cf14ba3
Author: David Neuman <da...@gmail.com>
Authored: Mon Nov 21 15:36:49 2016 -0700
Committer: David Neuman <da...@gmail.com>
Committed: Mon Nov 21 15:36:49 2016 -0700
----------------------------------------------------------------------
.../client/delivery_service_resources.go | 32 ++++++++++----------
traffic_ops/client/fixtures/delivery_service.go | 30 +++++++++---------
.../client/tests/delivery_service_test.go | 8 ++---
3 files changed, 35 insertions(+), 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c444a403/traffic_ops/client/delivery_service_resources.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/delivery_service_resources.go b/traffic_ops/client/delivery_service_resources.go
index a65734c..f8a677c 100644
--- a/traffic_ops/client/delivery_service_resources.go
+++ b/traffic_ops/client/delivery_service_resources.go
@@ -35,39 +35,39 @@ type DeleteDeliveryServiceResponse struct {
// DeliveryService ...
type DeliveryService struct {
- ID string `json:"id"`
+ ID int `json:"id"`
XMLID string `json:"xmlId"`
Active bool `json:"active"`
- DSCP string `json:"dscp"`
+ DSCP int `json:"dscp"`
Signed bool `json:"signed"`
- QStringIgnore string `json:"qstringIgnore"`
- GeoLimit string `json:"geoLimit"`
- GeoProvider string `json:"geoProvider"`
+ QStringIgnore int `json:"qstringIgnore"`
+ GeoLimit int `json:"geoLimit"`
+ GeoProvider int `json:"geoProvider"`
HTTPBypassFQDN string `json:"httpBypassFqdn"`
DNSBypassIP string `json:"dnsBypassIp"`
DNSBypassIP6 string `json:"dnsBypassIp6"`
DNSBypassCname string `json:"dnsBypassCname"`
- DNSBypassTTL string `json:"dnsBypassTtl"`
+ DNSBypassTTL int `json:"dnsBypassTtl"`
OrgServerFQDN string `json:"orgServerFqdn"`
Type string `json:"type"`
ProfileName string `json:"profileName"`
ProfileDesc string `json:"profileDescription"`
CDNName string `json:"cdnName"`
- CCRDNSTTL string `json:"ccrDnsTtl"`
- GlobalMaxMBPS string `json:"globalMaxMbps"`
- GlobalMaxTPS string `json:"globalMaxTps"`
+ CCRDNSTTL int `json:"ccrDnsTtl"`
+ GlobalMaxMBPS int `json:"globalMaxMbps"`
+ GlobalMaxTPS int `json:"globalMaxTps"`
LongDesc string `json:"longDesc"`
LongDesc1 string `json:"longDesc1"`
LongDesc2 string `json:"longDesc2"`
- MaxDNSAnswers string `json:"maxDnsAnswers"`
+ MaxDNSAnswers int `json:"maxDnsAnswers"`
InfoURL string `json:"infoUrl"`
- MissLat string `json:"missLat"`
- MissLong string `json:"missLong"`
+ MissLat float64 `json:"missLat"`
+ MissLong float64 `json:"missLong"`
CheckPath string `json:"checkPath"`
LastUpdated string `json:"lastUpdated"`
- Protocol string `json:"protocol"`
+ Protocol int `json:"protocol"`
IPV6RoutingEnabled bool `json:"ipv6RoutingEnabled"`
- RangeRequestHandling string `json:"rangeRequestHandling"`
+ RangeRequestHandling int `json:"rangeRequestHandling"`
HeaderRewrite string `json:"headerRewrite"`
EdgeHeaderRewrite string `json:"edgeHeaderRewrite"`
MidHeaderRewrite string `json:"midHeaderRewrite"`
@@ -75,9 +75,9 @@ type DeliveryService struct {
RegexRemap string `json:"regexRemap"`
CacheURL string `json:"cacheurl"`
RemapText string `json:"remapText"`
- MultiSiteOrigin string `json:"multiSiteOrigin"`
+ MultiSiteOrigin int `json:"multiSiteOrigin"`
DisplayName string `json:"displayName"`
- InitialDispersion string `json:"initialDispersion"`
+ InitialDispersion int `json:"initialDispersion"`
MatchList []DeliveryServiceMatch `json:"matchList,omitempty"`
}
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c444a403/traffic_ops/client/fixtures/delivery_service.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/delivery_service.go b/traffic_ops/client/fixtures/delivery_service.go
index 6c7bf74..a0263eb 100644
--- a/traffic_ops/client/fixtures/delivery_service.go
+++ b/traffic_ops/client/fixtures/delivery_service.go
@@ -22,30 +22,30 @@ func DeliveryServices() *client.GetDeliveryServiceResponse {
return &client.GetDeliveryServiceResponse{
Response: []client.DeliveryService{
client.DeliveryService{
- ID: "001",
+ ID: 001,
XMLID: "ds-test",
Active: true,
- DSCP: "40",
+ DSCP: 40,
Signed: false,
- QStringIgnore: "1",
- GeoLimit: "0",
- GeoProvider: "0",
- DNSBypassTTL: "30",
+ QStringIgnore: 1,
+ GeoLimit: 0,
+ GeoProvider: 0,
+ DNSBypassTTL: 30,
Type: "HTTP",
ProfileName: "ds-123",
CDNName: "test-cdn",
- CCRDNSTTL: "3600",
- GlobalMaxTPS: "0",
- MaxDNSAnswers: "0",
- MissLat: "44.654321",
- MissLong: "-99.123456",
- Protocol: "0",
+ CCRDNSTTL: 3600,
+ GlobalMaxTPS: 0,
+ MaxDNSAnswers: 0,
+ MissLat: 44.654321,
+ MissLong: -99.123456,
+ Protocol: 0,
IPV6RoutingEnabled: true,
- RangeRequestHandling: "0",
+ RangeRequestHandling: 0,
TRResponseHeaders: "Access-Control-Allow-Origin: *",
- MultiSiteOrigin: "0",
+ MultiSiteOrigin: 0,
DisplayName: "Testing",
- InitialDispersion: "1",
+ InitialDispersion: 1,
},
},
}
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c444a403/traffic_ops/client/tests/delivery_service_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/delivery_service_test.go b/traffic_ops/client/tests/delivery_service_test.go
index d8691b5..bf182e4 100644
--- a/traffic_ops/client/tests/delivery_service_test.go
+++ b/traffic_ops/client/tests/delivery_service_test.go
@@ -57,7 +57,7 @@ func TestDeliveryServices(t *testing.T) {
testHelper.Success(t, "Should get back \"ds-test\" for \"XMLID\"")
}
- if s.MissLong != "-99.123456" {
+ if s.MissLong != -99.123456 {
testHelper.Error(t, "Should get back \"-99.123456\" for \"MissLong\", got: %s", s.MissLong)
} else {
testHelper.Success(t, "Should get back \"-99.123456\" for \"MissLong\"")
@@ -111,7 +111,7 @@ func TestDeliveryService(t *testing.T) {
testHelper.Success(t, "Should get back \"ds-test\" for \"XMLID\"")
}
- if ds.MissLong != "-99.123456" {
+ if ds.MissLong != -99.123456 {
testHelper.Error(t, "Should get back \"-99.123456\" for \"MissLong\", got: %s", ds.MissLong)
} else {
testHelper.Success(t, "Should get back \"-99.123456\" for \"MissLong\"")
@@ -159,7 +159,7 @@ func TestCreateDeliveryService(t *testing.T) {
}
actual := ds.Response.ID
- if actual != "001" {
+ if actual != 001 {
testHelper.Error(t, "Should get back \"001\" for \"Response.ID\", got: %s", actual)
} else {
testHelper.Success(t, "Should get back \"0001\" for \"Response.ID\"")
@@ -207,7 +207,7 @@ func TestUpdateDeliveryService(t *testing.T) {
}
actual := ds.Response.ID
- if actual != "001" {
+ if actual != 001 {
testHelper.Error(t, "Should get back \"001\" for \"Response.ID\", got: %s", actual)
} else {
testHelper.Success(t, "Should get back \"0001\" for \"Response.ID\"")
[08/11] incubator-trafficcontrol git commit: change MultiSiteOrigin
to bool
Posted by mi...@apache.org.
change MultiSiteOrigin to bool
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/03586229
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/03586229
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/03586229
Branch: refs/heads/psql-rebase
Commit: 0358622996b0cf482c29866560ef1cdf1e83612a
Parents: dae0f12
Author: David Neuman <da...@gmail.com>
Authored: Mon Nov 28 10:07:52 2016 -0700
Committer: David Neuman <da...@gmail.com>
Committed: Mon Nov 28 10:07:52 2016 -0700
----------------------------------------------------------------------
traffic_ops/client/delivery_service_resources.go | 2 +-
traffic_ops/client/fixtures/delivery_service.go | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/03586229/traffic_ops/client/delivery_service_resources.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/delivery_service_resources.go b/traffic_ops/client/delivery_service_resources.go
index aa7aaad..53e4c8e 100644
--- a/traffic_ops/client/delivery_service_resources.go
+++ b/traffic_ops/client/delivery_service_resources.go
@@ -74,7 +74,7 @@ type DeliveryService struct {
RegexRemap string `json:"regexRemap"`
CacheURL string `json:"cacheurl"`
RemapText string `json:"remapText"`
- MultiSiteOrigin int `json:"multiSiteOrigin"`
+ MultiSiteOrigin bool `json:"multiSiteOrigin"`
DisplayName string `json:"displayName"`
InitialDispersion int `json:"initialDispersion"`
MatchList []DeliveryServiceMatch `json:"matchList,omitempty"`
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/03586229/traffic_ops/client/fixtures/delivery_service.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/delivery_service.go b/traffic_ops/client/fixtures/delivery_service.go
index a0263eb..f9996dd 100644
--- a/traffic_ops/client/fixtures/delivery_service.go
+++ b/traffic_ops/client/fixtures/delivery_service.go
@@ -43,7 +43,7 @@ func DeliveryServices() *client.GetDeliveryServiceResponse {
IPV6RoutingEnabled: true,
RangeRequestHandling: 0,
TRResponseHeaders: "Access-Control-Allow-Origin: *",
- MultiSiteOrigin: 0,
+ MultiSiteOrigin: false,
DisplayName: "Testing",
InitialDispersion: 1,
},
[05/11] incubator-trafficcontrol git commit: added second entry to
hardware
Posted by mi...@apache.org.
added second entry to hardware
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/f6f3f156
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/f6f3f156
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/f6f3f156
Branch: refs/heads/psql-rebase
Commit: f6f3f156f57a821f73668ee5be1ba7d3addf8985
Parents: 09d6bdf
Author: David Neuman <da...@gmail.com>
Authored: Tue Nov 22 11:50:43 2016 -0700
Committer: David Neuman <da...@gmail.com>
Committed: Tue Nov 22 11:50:43 2016 -0700
----------------------------------------------------------------------
traffic_ops/client/fixtures/hardware.go | 13 ++++++++++---
traffic_ops/client/tests/hardware_test.go | 23 ++++++++++++-----------
2 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/f6f3f156/traffic_ops/client/fixtures/hardware.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/hardware.go b/traffic_ops/client/fixtures/hardware.go
index 74c4a36..eb5f454 100644
--- a/traffic_ops/client/fixtures/hardware.go
+++ b/traffic_ops/client/fixtures/hardware.go
@@ -23,10 +23,17 @@ func Hardware() *client.HardwareResponse {
Response: []client.Hardware{
client.Hardware{
ID: 18,
- HostName: "odol-atsmid-cen-09",
+ HostName: "edge-den-01",
LastUpdated: "2015-07-16 09:04:20",
- Value: "1.00",
- Description: "BACKPLANE FIRMWARE",
+ Value: "DIS1",
+ Description: "Phys Disk",
+ },
+ client.Hardware{
+ ID: 19,
+ HostName: "edge-den-02",
+ LastUpdated: "2015-07-16 09:04:20",
+ Value: "DIS2",
+ Description: "Physical Disk",
},
},
}
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/f6f3f156/traffic_ops/client/tests/hardware_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/hardware_test.go b/traffic_ops/client/tests/hardware_test.go
index 58a042c..619b05c 100644
--- a/traffic_ops/client/tests/hardware_test.go
+++ b/traffic_ops/client/tests/hardware_test.go
@@ -17,6 +17,7 @@ package test
import (
"net/http"
+ "strings"
"testing"
"github.com/apache/incubator-trafficcontrol/traffic_ops/client"
@@ -44,27 +45,27 @@ func TestHardware(t *testing.T) {
testHelper.Success(t, "Should be able to make a request to Traffic Ops")
}
- if len(hardware) != 1 {
- testHelper.Error(t, "Should get back \"1\" Hardware, got: %d", len(hardware))
+ if len(hardware) != 2 {
+ testHelper.Error(t, "Should get back \"2\" Hardware, got: %d", len(hardware))
} else {
- testHelper.Success(t, "Should get back \"1\" Hardware")
+ testHelper.Success(t, "Should get back \"2\" Hardware")
}
for _, h := range hardware {
- if h.HostName != "odol-atsmid-cen-09" {
- testHelper.Error(t, "Should get back \"odol-atsmid-cen-09\" for \"Hostname\", got: %s", h.HostName)
+ if !strings.Contains(h.HostName, "edge-den") {
+ testHelper.Error(t, "Should get back \"edge-den\" in \"Hostname\", got: %s", h.HostName)
} else {
- testHelper.Success(t, "Should get back \"odol-atsmid-cen-09\" for \"Hostname\"")
+ testHelper.Success(t, "Should get back \"edge-den\" in \"Hostname\"")
}
- if h.Value != "1.00" {
- testHelper.Error(t, "Should get back \"1.00\" for \"Value\", got: %s", h.Value)
+ if !strings.Contains(h.Value, "DIS") {
+ testHelper.Error(t, "Should get back \"DIS1\" or \"DIS2\" for \"Value\", got: %s", h.Value)
} else {
- testHelper.Success(t, "Should get back \"1.00\" for \"Value\"")
+ testHelper.Success(t, "Should get back \"DIS1\" or \"DIS2\" for \"Value\"")
}
- if h.Description != "BACKPLANE FIRMWARE" {
- testHelper.Error(t, "Should get back \"BACKPLANE FIRMWARE\" for \"Description\", got: %s", h.Description)
+ if !strings.Contains(h.Description, "Phys") {
+ testHelper.Error(t, "Should get back \"Phys Disk\" or \"Physical Disk\" for \"Description\", got: %s", h.Description)
} else {
testHelper.Success(t, "Should get back \"BACKPLANE FIRMWARE\" for \"Description\"")
}
[11/11] incubator-trafficcontrol git commit: This closes #104
Posted by mi...@apache.org.
This closes #104
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/0cfb4ecc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/0cfb4ecc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/0cfb4ecc
Branch: refs/heads/psql-rebase
Commit: 0cfb4ecc41d2d49aa9a199dab0a669b181777b72
Parents: dc81269
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Mon Nov 28 14:22:41 2016 -0700
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Mon Nov 28 14:22:41 2016 -0700
----------------------------------------------------------------------
----------------------------------------------------------------------
[07/11] incubator-trafficcontrol git commit: update user client for
psql
Posted by mi...@apache.org.
update user client for psql
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/dae0f12b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/dae0f12b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/dae0f12b
Branch: refs/heads/psql-rebase
Commit: dae0f12be5fef4bee250ab125230e4f0995215d5
Parents: cbd5e09
Author: David Neuman <da...@gmail.com>
Authored: Tue Nov 22 15:48:37 2016 -0700
Committer: David Neuman <da...@gmail.com>
Committed: Tue Nov 22 15:48:37 2016 -0700
----------------------------------------------------------------------
traffic_ops/client/fixtures/user.go | 2 +-
traffic_ops/client/tests/user_test.go | 2 +-
traffic_ops/client/user.go | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/dae0f12b/traffic_ops/client/fixtures/user.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/user.go b/traffic_ops/client/fixtures/user.go
index 39bf775..b70a3e8 100644
--- a/traffic_ops/client/fixtures/user.go
+++ b/traffic_ops/client/fixtures/user.go
@@ -24,7 +24,7 @@ func Users() *client.UserResponse {
client.User{
Username: "bsmith",
PublicSSHKey: "some-ssh-key",
- Role: "3",
+ Role: 3,
RoleName: "operations",
Email: "bobsmith@email.com",
FullName: "Bob Smith",
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/dae0f12b/traffic_ops/client/tests/user_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/user_test.go b/traffic_ops/client/tests/user_test.go
index d684770..bcddcce 100644
--- a/traffic_ops/client/tests/user_test.go
+++ b/traffic_ops/client/tests/user_test.go
@@ -57,7 +57,7 @@ func TestUsers(t *testing.T) {
testHelper.Success(t, "Should get back \"some-ssh-key\" for \"PublicSSHKey\"")
}
- if u.Role != "3" {
+ if u.Role != 3 {
testHelper.Error(t, "Should get back \"3\" for \"Role\", got %s", u.Role)
} else {
testHelper.Success(t, "Should get back \"3\" for \"Role\"")
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/dae0f12b/traffic_ops/client/user.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/user.go b/traffic_ops/client/user.go
index 3e2a1d7..1b2cf2f 100644
--- a/traffic_ops/client/user.go
+++ b/traffic_ops/client/user.go
@@ -26,10 +26,10 @@ type UserResponse struct {
type User struct {
Username string `json:"username,omitempty"`
PublicSSHKey string `json:"publicSshKey,omitempty"`
- Role string `json:"role,omitempty"`
+ Role int `json:"role,omitempty"`
RoleName string `json:"rolename,omitempty"`
- UID string `json:"uid,omitempty"`
- GID string `json:"gid,omitempty"`
+ UID int `json:"uid,omitempty"`
+ GID int `json:"gid,omitempty"`
Company string `json:"company,omitempty"`
Email string `json:"email,omitempty"`
FullName string `json:"fullName,omitempty"`
[03/11] incubator-trafficcontrol git commit: update HwInfo.pm to
always return an int for limit
Posted by mi...@apache.org.
update HwInfo.pm to always return an int for limit
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/028ac962
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/028ac962
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/028ac962
Branch: refs/heads/psql-rebase
Commit: 028ac9621f33602bc9e8fca624599e03ffb262f1
Parents: c444a40
Author: David Neuman <da...@gmail.com>
Authored: Tue Nov 22 10:08:12 2016 -0700
Committer: David Neuman <da...@gmail.com>
Committed: Tue Nov 22 10:08:12 2016 -0700
----------------------------------------------------------------------
traffic_ops/app/lib/API/HwInfo.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028ac962/traffic_ops/app/lib/API/HwInfo.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/HwInfo.pm b/traffic_ops/app/lib/API/HwInfo.pm
index 43495fc..972f76a 100644
--- a/traffic_ops/app/lib/API/HwInfo.pm
+++ b/traffic_ops/app/lib/API/HwInfo.pm
@@ -39,7 +39,7 @@ sub index {
}
);
}
-
+ $limit += 0; #converts to int.
$self->success( \@data, undef, undef, $limit, undef );
}
[06/11] incubator-trafficcontrol git commit: Remove version for
response structs
Posted by mi...@apache.org.
Remove version for response structs
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/cbd5e092
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/cbd5e092
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/cbd5e092
Branch: refs/heads/psql-rebase
Commit: cbd5e092ed988b63799f5ffa37f38f2ef4699596
Parents: f6f3f15
Author: David Neuman <da...@gmail.com>
Authored: Tue Nov 22 15:30:44 2016 -0700
Committer: David Neuman <da...@gmail.com>
Committed: Tue Nov 22 15:30:44 2016 -0700
----------------------------------------------------------------------
traffic_ops/client/cachegroup.go | 1 -
traffic_ops/client/cdn.go | 3 +--
traffic_ops/client/delivery_service_resources.go | 1 -
traffic_ops/client/parameter.go | 1 -
traffic_ops/client/profile.go | 1 -
traffic_ops/client/server.go | 1 -
traffic_ops/client/stats_summary.go | 1 -
traffic_ops/client/traffic_monitor_config.go | 1 -
traffic_ops/client/traffic_ops.go | 3 +--
traffic_ops/client/traffic_router_config.go | 1 -
traffic_ops/client/type.go | 1 -
traffic_ops/client/user.go | 1 -
12 files changed, 2 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cbd5e092/traffic_ops/client/cachegroup.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/cachegroup.go b/traffic_ops/client/cachegroup.go
index 44aadd9..1c65c56 100644
--- a/traffic_ops/client/cachegroup.go
+++ b/traffic_ops/client/cachegroup.go
@@ -19,7 +19,6 @@ import "encoding/json"
// CacheGroupResponse ...
type CacheGroupResponse struct {
- Version string `json:"version"`
Response []CacheGroup `json:"response"`
}
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cbd5e092/traffic_ops/client/cdn.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/cdn.go b/traffic_ops/client/cdn.go
index 665382e..3657fc5 100644
--- a/traffic_ops/client/cdn.go
+++ b/traffic_ops/client/cdn.go
@@ -22,8 +22,7 @@ import (
// CDNResponse ...
type CDNResponse struct {
- Version string `json:"version"`
- Response []CDN `json:"response"`
+ Response []CDN `json:"response"`
}
// CDN ...
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cbd5e092/traffic_ops/client/delivery_service_resources.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/delivery_service_resources.go b/traffic_ops/client/delivery_service_resources.go
index f8a677c..aa7aaad 100644
--- a/traffic_ops/client/delivery_service_resources.go
+++ b/traffic_ops/client/delivery_service_resources.go
@@ -18,7 +18,6 @@ package client
// GetDeliveryServiceResponse ...
type GetDeliveryServiceResponse struct {
- Version string `json:"version"`
Response []DeliveryService `json:"response"`
}
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cbd5e092/traffic_ops/client/parameter.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/parameter.go b/traffic_ops/client/parameter.go
index 937e450..34a805e 100644
--- a/traffic_ops/client/parameter.go
+++ b/traffic_ops/client/parameter.go
@@ -22,7 +22,6 @@ import (
// ParamResponse ...
type ParamResponse struct {
- Version string `json:"version"`
Response []Parameter `json:"response"`
}
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cbd5e092/traffic_ops/client/profile.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/profile.go b/traffic_ops/client/profile.go
index b417886..a770780 100644
--- a/traffic_ops/client/profile.go
+++ b/traffic_ops/client/profile.go
@@ -19,7 +19,6 @@ import "encoding/json"
// ProfileResponse ...
type ProfileResponse struct {
- Version string `json:"version"`
Response []Profile `json:"response"`
}
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cbd5e092/traffic_ops/client/server.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/server.go b/traffic_ops/client/server.go
index 8295bab..8dd0c1c 100644
--- a/traffic_ops/client/server.go
+++ b/traffic_ops/client/server.go
@@ -24,7 +24,6 @@ import (
// ServerResponse ...
type ServerResponse struct {
- Version string `json:"version"`
Response []Server `json:"response"`
}
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cbd5e092/traffic_ops/client/stats_summary.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/stats_summary.go b/traffic_ops/client/stats_summary.go
index 2045c23..7ea0ea1 100644
--- a/traffic_ops/client/stats_summary.go
+++ b/traffic_ops/client/stats_summary.go
@@ -20,7 +20,6 @@ import (
// StatsSummaryResponse ...
type StatsSummaryResponse struct {
- Version string `json:"version"`
Response []StatsSummary `json:"response"`
}
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cbd5e092/traffic_ops/client/traffic_monitor_config.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/traffic_monitor_config.go b/traffic_ops/client/traffic_monitor_config.go
index 50ec7cd..cf1208b 100644
--- a/traffic_ops/client/traffic_monitor_config.go
+++ b/traffic_ops/client/traffic_monitor_config.go
@@ -24,7 +24,6 @@ import (
// TMConfigResponse ...
type TMConfigResponse struct {
- Version string `json:"version"`
Response TrafficMonitorConfig `json:"response"`
}
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cbd5e092/traffic_ops/client/traffic_ops.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/traffic_ops.go b/traffic_ops/client/traffic_ops.go
index c5abfa9..9c2273d 100644
--- a/traffic_ops/client/traffic_ops.go
+++ b/traffic_ops/client/traffic_ops.go
@@ -52,8 +52,7 @@ func (e *HTTPError) Error() string {
// Result {"response":[{"level":"success","text":"Successfully logged in."}],"version":"1.1"}
type Result struct {
- Alerts []Alert
- Version string `json:"version"`
+ Alerts []Alert
}
// Alert ...
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cbd5e092/traffic_ops/client/traffic_router_config.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/traffic_router_config.go b/traffic_ops/client/traffic_router_config.go
index aecd72d..96064b9 100644
--- a/traffic_ops/client/traffic_router_config.go
+++ b/traffic_ops/client/traffic_router_config.go
@@ -22,7 +22,6 @@ import (
// TRConfigResponse ...
type TRConfigResponse struct {
- Version string `json:"version"`
Response TrafficRouterConfig `json:"response"`
}
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cbd5e092/traffic_ops/client/type.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/type.go b/traffic_ops/client/type.go
index 9bfe19f..088982b 100644
--- a/traffic_ops/client/type.go
+++ b/traffic_ops/client/type.go
@@ -22,7 +22,6 @@ import (
// TypeResponse ...
type TypeResponse struct {
- Version string `json:"version"`
Response []Type `json:"response"`
}
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cbd5e092/traffic_ops/client/user.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/user.go b/traffic_ops/client/user.go
index b2f1bb6..3e2a1d7 100644
--- a/traffic_ops/client/user.go
+++ b/traffic_ops/client/user.go
@@ -19,7 +19,6 @@ import "encoding/json"
// UserResponse ...
type UserResponse struct {
- Version string `json:"version"`
Response []User `json:"response"`
}
[04/11] incubator-trafficcontrol git commit: update hardware client
for psql
Posted by mi...@apache.org.
update hardware client for psql
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/09d6bdfe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/09d6bdfe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/09d6bdfe
Branch: refs/heads/psql-rebase
Commit: 09d6bdfe8c07591bc1dbcdf8a7ef3f8e7bbeb994
Parents: 028ac96
Author: David Neuman <da...@gmail.com>
Authored: Tue Nov 22 11:05:17 2016 -0700
Committer: David Neuman <da...@gmail.com>
Committed: Tue Nov 22 11:05:17 2016 -0700
----------------------------------------------------------------------
traffic_ops/client/fixtures/hardware.go | 2 +-
traffic_ops/client/hardware.go | 10 +++++++---
traffic_ops/client/tests/hardware_test.go | 4 ++--
3 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/09d6bdfe/traffic_ops/client/fixtures/hardware.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/hardware.go b/traffic_ops/client/fixtures/hardware.go
index a7069a2..74c4a36 100644
--- a/traffic_ops/client/fixtures/hardware.go
+++ b/traffic_ops/client/fixtures/hardware.go
@@ -22,7 +22,7 @@ func Hardware() *client.HardwareResponse {
return &client.HardwareResponse{
Response: []client.Hardware{
client.Hardware{
- ID: "18",
+ ID: 18,
HostName: "odol-atsmid-cen-09",
LastUpdated: "2015-07-16 09:04:20",
Value: "1.00",
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/09d6bdfe/traffic_ops/client/hardware.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/hardware.go b/traffic_ops/client/hardware.go
index 939ce12..1fef498 100644
--- a/traffic_ops/client/hardware.go
+++ b/traffic_ops/client/hardware.go
@@ -16,16 +16,17 @@
package client
import "encoding/json"
+import "fmt"
// HardwareResponse ...
type HardwareResponse struct {
- Version string `json:"version"`
+ Limit int `json:"limit"`
Response []Hardware `json:"response"`
}
// Hardware ...
type Hardware struct {
- ID string `json:"serverId"`
+ ID int `json:"serverId"`
HostName string `json:"serverHostName"`
LastUpdated string `json:"lastUpdated"`
Value string `json:"val"`
@@ -33,8 +34,11 @@ type Hardware struct {
}
// Hardware gets an array of Hardware
-func (to *Session) Hardware() ([]Hardware, error) {
+func (to *Session) Hardware(limit int) ([]Hardware, error) {
url := "/api/1.2/hwinfo.json"
+ if limit > 0 {
+ url += fmt.Sprintf("?limit=%v", limit)
+ }
resp, err := to.request("GET", url, nil)
if err != nil {
return nil, err
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/09d6bdfe/traffic_ops/client/tests/hardware_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/hardware_test.go b/traffic_ops/client/tests/hardware_test.go
index 140601a..58a042c 100644
--- a/traffic_ops/client/tests/hardware_test.go
+++ b/traffic_ops/client/tests/hardware_test.go
@@ -37,7 +37,7 @@ func TestHardware(t *testing.T) {
testHelper.Context(t, "Given the need to test a successful Traffic Ops request for Hardware")
- hardware, err := to.Hardware()
+ hardware, err := to.Hardware(0)
if err != nil {
testHelper.Error(t, "Should be able to make a request to Traffic Ops")
} else {
@@ -83,7 +83,7 @@ func TestHardwareUnauthorized(t *testing.T) {
testHelper.Context(t, "Given the need to test a failed Traffic Ops request for Hardware")
- _, err := to.Hardware()
+ _, err := to.Hardware(0)
if err == nil {
testHelper.Error(t, "Should not be able to make a request to Traffic Ops")
} else {