-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from 90poe/issue-11/cluster-info
feat: Cluster Info in version cmd
- Loading branch information
Showing
8 changed files
with
217 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package connect | ||
|
||
import ( | ||
"net/http" | ||
) | ||
|
||
// ClusterInfo - this is new and not from the original author | ||
type ClusterInfo struct { | ||
Version string `json:"version"` | ||
Commit string `json:"commit"` | ||
KafkaClusterID string `json:"kafka_cluster_id"` | ||
} | ||
|
||
// GetClusterInfo retrieves information about a cluster | ||
// | ||
// See: https://docs.confluent.io/current/connect/references/restapi.html#kconnect-cluster | ||
func (c *Client) GetClusterInfo() (*ClusterInfo, *http.Response, error) { | ||
path := "/" | ||
clusterInfo := new(ClusterInfo) | ||
response, err := c.get(path, &clusterInfo) | ||
return clusterInfo, response, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package manager | ||
|
||
import ( | ||
"github.com/pkg/errors" | ||
|
||
"github.com/90poe/connectctl/pkg/client/connect" | ||
) | ||
|
||
// GetClusterInfo returns kafka cluster info | ||
func (c *ConnectorManager) GetClusterInfo() (*connect.ClusterInfo, error) { | ||
clusterInfo, _, err := c.client.GetClusterInfo() | ||
|
||
if err != nil { | ||
return nil, errors.Wrap(err, "error getting cluster info") | ||
} | ||
|
||
return clusterInfo, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.