-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03ec72b
commit 57f1b3a
Showing
5 changed files
with
118 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package connect | ||
|
||
import ( | ||
"net/http" | ||
) | ||
|
||
// 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