Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions client/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,20 @@ type NginxInfo struct {
ParentProcessID uint64 `json:"ppid"`
}

// LicenseReporting contains information about license status for NGINX Plus.
type LicenseReporting struct {
Healthy bool
Fails uint64
Grace uint64
}

// NginxLicense contains licensing information about NGINX Plus.
type NginxLicense struct {
ActiveTill uint64 `json:"active_till"`
Eval bool
Reporting LicenseReporting
}

// Caches is a map of cache stats by cache zone.
type Caches = map[string]HTTPCache

Expand Down Expand Up @@ -1553,6 +1567,16 @@ func (client *NginxClient) GetNginxInfo(ctx context.Context) (*NginxInfo, error)
return &info, nil
}

// GetNginxLicense returns Nginx License data with a context.
func (client *NginxClient) GetNginxLicense(ctx context.Context) (*NginxLicense, error) {
var info NginxLicense
err := client.get(ctx, "license", &info)
if err != nil {
return nil, fmt.Errorf("failed to get info: %w", err)
}
return &info, nil
}

// GetCaches returns Cache stats with a context.
func (client *NginxClient) GetCaches(ctx context.Context) (*Caches, error) {
var caches Caches
Expand Down
Loading