File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,20 @@ type NginxInfo struct {
193
193
ParentProcessID uint64 `json:"ppid"`
194
194
}
195
195
196
+ // LicenseReporting contains information about license status for NGINX Plus.
197
+ type LicenseReporting struct {
198
+ Healthy bool
199
+ Fails uint64
200
+ Grace uint64
201
+ }
202
+
203
+ // NginxLicense contains licensing information about NGINX Plus.
204
+ type NginxLicense struct {
205
+ ActiveTill uint64 `json:"active_till"`
206
+ Eval bool
207
+ Reporting LicenseReporting
208
+ }
209
+
196
210
// Caches is a map of cache stats by cache zone.
197
211
type Caches = map [string ]HTTPCache
198
212
@@ -1553,6 +1567,16 @@ func (client *NginxClient) GetNginxInfo(ctx context.Context) (*NginxInfo, error)
1553
1567
return & info , nil
1554
1568
}
1555
1569
1570
+ // GetNginxLicense returns Nginx License data with a context.
1571
+ func (client * NginxClient ) GetNginxLicense (ctx context.Context ) (* NginxLicense , error ) {
1572
+ var info NginxLicense
1573
+ err := client .get (ctx , "license" , & info )
1574
+ if err != nil {
1575
+ return nil , fmt .Errorf ("failed to get info: %w" , err )
1576
+ }
1577
+ return & info , nil
1578
+ }
1579
+
1556
1580
// GetCaches returns Cache stats with a context.
1557
1581
func (client * NginxClient ) GetCaches (ctx context.Context ) (* Caches , error ) {
1558
1582
var caches Caches
You can’t perform that action at this time.
0 commit comments