diff --git a/README.md b/README.md index 95d06121..a4f20aea 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This project includes a client library for working with NGINX Plus API. ## Compatibility -This Client works against versions 4 to 7 of the NGINX Plus API. The table below shows the version of NGINX Plus where the API was first introduced. +This Client works against versions 4 to 8 of the NGINX Plus API. The table below shows the version of NGINX Plus where the API was first introduced. | API version | NGINX Plus version | |-------------|--------------------| @@ -19,6 +19,7 @@ This Client works against versions 4 to 7 of the NGINX Plus API. The table below | 5 | R19 | | 6 | R20 | | 7 | R25 | +| 8 | R27 | ## Using the Client diff --git a/client/nginx.go b/client/nginx.go index f575b723..5885e323 100644 --- a/client/nginx.go +++ b/client/nginx.go @@ -16,7 +16,7 @@ import ( const ( // APIVersion is the default version of NGINX Plus API supported by the client. - APIVersion = 7 + APIVersion = 8 pathNotFoundCode = "PathNotFound" streamContext = true @@ -25,7 +25,7 @@ const ( ) var ( - supportedAPIVersions = versions{4, 5, 6, 7} + supportedAPIVersions = versions{4, 5, 6, 7, 8} // Default values for servers in Upstreams. defaultMaxConns = 0 @@ -235,6 +235,7 @@ type ServerZone struct { Discarded uint64 Received uint64 Sent uint64 + SSL SSL } // StreamServerZones is map of stream server zone stats by zone name. @@ -248,6 +249,7 @@ type StreamServerZone struct { Discarded uint64 Received uint64 Sent uint64 + SSL SSL } // StreamZoneSync represents the sync information per each shared memory zone and the sync information per node in a cluster @@ -373,6 +375,7 @@ type Peer struct { Weight int State string Active uint64 + SSL SSL MaxConns int `json:"max_conns"` Requests uint64 Responses Responses @@ -398,6 +401,7 @@ type StreamPeer struct { Weight int State string Active uint64 + SSL SSL MaxConns int `json:"max_conns"` Connections uint64 ConnectTime int `json:"connect_time"` diff --git a/tests/client_test.go b/tests/client_test.go index e47bc148..dff8383a 100644 --- a/tests/client_test.go +++ b/tests/client_test.go @@ -657,10 +657,13 @@ func TestStats(t *testing.T) { if val.Requests < 1 { t.Errorf("ServerZone stats missing: %v", val) } + if val.Responses.Codes.HTTPOk < 1 { + t.Errorf("ServerZone response codes missing: %v", val.Responses.Codes) + } } else { t.Errorf("ServerZone 'test' not found") } - if ups, ok := stats.Upstreams["test"]; ok { + if ups, ok := stats.Upstreams[upstream]; ok { if len(ups.Peers) < 1 { t.Errorf("upstream server not visible in stats") } else {