From 3a30e6fb7cf854a594b8e2960fc92961d288b00b Mon Sep 17 00:00:00 2001 From: kekkokers Date: Tue, 12 Dec 2023 19:16:40 +0200 Subject: [PATCH] Remove cluster_license_response file --- collector/cluster_license.go | 17 ++++++++++++++ collector/cluster_license_response.go | 32 --------------------------- 2 files changed, 17 insertions(+), 32 deletions(-) delete mode 100644 collector/cluster_license_response.go diff --git a/collector/cluster_license.go b/collector/cluster_license.go index 6a6c653d..4dfb0df9 100644 --- a/collector/cluster_license.go +++ b/collector/cluster_license.go @@ -20,6 +20,7 @@ import ( "net/http" "net/url" "path" + "time" "github.com/go-kit/log" "github.com/go-kit/log/level" @@ -33,6 +34,22 @@ type clusterLicenseMetric struct { Labels func(clusterLicenseStats clusterLicenseResponse) []string } +type clusterLicenseResponse struct { + License struct { + Status string `json:"status"` + UID string `json:"uid"` + Type string `json:"type"` + IssueDate time.Time `json:"issue_date"` + IssueDateInMillis int64 `json:"issue_date_in_millis"` + ExpiryDate time.Time `json:"expiry_date"` + ExpiryDateInMillis int64 `json:"expiry_date_in_millis"` + MaxNodes int `json:"max_nodes"` + IssuedTo string `json:"issued_to"` + Issuer string `json:"issuer"` + StartDateInMillis int64 `json:"start_date_in_millis"` + } `json:"license"` +} + var ( defaultClusterLicenseLabels = []string{"cluster_license_type"} defaultClusterLicenseValues = func(clusterLicense clusterLicenseResponse) []string { diff --git a/collector/cluster_license_response.go b/collector/cluster_license_response.go deleted file mode 100644 index 8bef6792..00000000 --- a/collector/cluster_license_response.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2023 The Prometheus Authors -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package collector - -import "time" - -type clusterLicenseResponse struct { - License struct { - Status string `json:"status"` - UID string `json:"uid"` - Type string `json:"type"` - IssueDate time.Time `json:"issue_date"` - IssueDateInMillis int64 `json:"issue_date_in_millis"` - ExpiryDate time.Time `json:"expiry_date"` - ExpiryDateInMillis int64 `json:"expiry_date_in_millis"` - MaxNodes int `json:"max_nodes"` - IssuedTo string `json:"issued_to"` - Issuer string `json:"issuer"` - StartDateInMillis int64 `json:"start_date_in_millis"` - } `json:"license"` -}