Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated/obsolete functionality #159

Merged
merged 1 commit into from
May 30, 2024
Merged
Changes from all commits
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
116 changes: 0 additions & 116 deletions api/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ type IngestPartition struct {
NodeIds []int
}

type StoragePartition struct {
Id int
NodeIds []int
}

type Cluster struct {
Nodes []ClusterNode
ClusterInfoAgeSeconds float64
Expand All @@ -57,7 +52,6 @@ type Cluster struct {
TargetMissingSegmentSize float64
TargetProperlyReplicatedSegmentSize float64
IngestPartitions []IngestPartition
StoragePartitions []StoragePartition // Deprecated: returns dummy data as of LogScale 1.88
}

func (c *Client) Clusters() *Clusters { return &Clusters{client: c} }
Expand All @@ -71,92 +65,6 @@ func (c *Clusters) Get() (Cluster, error) {
return query.Cluster, err
}

type StoragePartitionInput struct {
ID graphql.Int `json:"id"`
NodeIDs []graphql.Int `json:"nodeIds"`
}

type IngestPartitionInput struct {
ID graphql.Int `json:"id"`
NodeIDs []graphql.Int `json:"nodeIds"`
}

// Deprecated: returns dummy data as of LogScale 1.88
func (c *Clusters) UpdateStoragePartitionScheme(desired []StoragePartitionInput) error {
var mutation struct {
UpdateStoragePartitionScheme struct {
// We have to make a selection, so just take __typename
Typename graphql.String `graphql:"__typename"`
} `graphql:"updateStoragePartitionScheme(partitions: $partitions)"`
}

variables := map[string]interface{}{
"partitions": desired,
}

return c.client.Mutate(&mutation, variables)
}

// Deprecated: returns dummy data as of LogScale 1.80
func (c *Clusters) UpdateIngestPartitionScheme(desired []IngestPartitionInput) error {
var mutation struct {
UpdateStoragePartitionScheme struct {
// We have to make a selection, so just take __typename
Typename graphql.String `graphql:"__typename"`
} `graphql:"updateIngestPartitionScheme(partitions: $partitions)"`
}

variables := map[string]interface{}{
"partitions": desired,
}

return c.client.Mutate(&mutation, variables)
}

// Deprecated: returns dummy data as of LogScale 1.88
func (c *Clusters) StartDataRedistribution() error {
var mutation struct {
StartDataRedistribution struct {
// We have to make a selection, so just take __typename
Typename graphql.String `graphql:"__typename"`
} `graphql:"startDataRedistribution"`
}

return c.client.Mutate(&mutation, nil)
}

// Deprecated: returns dummy data as of LogScale 1.88
func (c *Clusters) ClusterMoveStorageRouteAwayFromNode(nodeID int) error {
var mutation struct {
ClusterMoveStorageRouteAwayFromNode struct {
// We have to make a selection, so just take __typename
Typename graphql.String `graphql:"__typename"`
} `graphql:"clusterMoveStorageRouteAwayFromNode(nodeID: $id)"`
}

variables := map[string]interface{}{
"id": graphql.Int(nodeID),
}

return c.client.Mutate(&mutation, variables)
}

// Deprecated: returns dummy data as of LogScale 1.80
func (c *Clusters) ClusterMoveIngestRoutesAwayFromNode(nodeID int) error {
var mutation struct {
ClusterMoveIngestRoutesAwayFromNode struct {
// We have to make a selection, so just take __typename
Typename graphql.String `graphql:"__typename"`
} `graphql:"clusterMoveIngestRoutesAwayFromNode(nodeID: $id)"`
}

variables := map[string]interface{}{
"id": graphql.Int(nodeID),
}

return c.client.Mutate(&mutation, variables)
}

type ClusterNodes struct {
client *Client
}
Expand Down Expand Up @@ -213,27 +121,3 @@ func (n *ClusterNodes) Unregister(nodeID int, force bool) error {

return n.client.Mutate(&mutation, variables)
}

// Deprecated: returns dummy data as of LogScale 1.80
func (c *Clusters) SuggestedIngestPartitions() ([]IngestPartitionInput, error) {
var query struct {
Cluster struct {
SuggestedIngestPartitions []IngestPartitionInput `graphql:"suggestedIngestPartitions"`
} `graphql:"cluster"`
}

err := c.client.Query(&query, nil)
return query.Cluster.SuggestedIngestPartitions, err
}

// Deprecated: returns dummy data as of LogScale 1.88
func (c *Clusters) SuggestedStoragePartitions() ([]StoragePartitionInput, error) {
var query struct {
Cluster struct {
SuggestedStoragePartitions []StoragePartitionInput `graphql:"suggestedStoragePartitions"`
} `graphql:"cluster"`
}

err := c.client.Query(&query, nil)
return query.Cluster.SuggestedStoragePartitions, err
}
Loading