Skip to content

Commit

Permalink
Merge pull request #24 from dell/Resiliency-changes-for-gopowerscale
Browse files Browse the repository at this point in the history
Resiliency changes for gopowerscale
  • Loading branch information
bpjain2004 authored May 4, 2022
2 parents bcc52d0 + ba7e757 commit d204171
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/v3/api_v3_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ func GetIsiStats(
return resp, err
}

func IsIOInProgress(ctx context.Context,
client api.Client) (resp *ExportClientList, err error) {
err = client.Get(
ctx, string(platfromStatsPath), "summary/client", nil,
nil,
&resp)
return resp, err
}

// GetIsiClusterConfig queries the config information of OneFS cluster
func GetIsiClusterConfig(
ctx context.Context,
Expand Down
9 changes: 9 additions & 0 deletions api/v3/api_v3_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,12 @@ type IsiDevice struct {
IsUp bool `json:"is_up"`
Lnn int64 `json:"lnn"`
}

type isiClientList struct {
Protocol string `json:"protocol"`
RemoteAddr string `json:"remote_addr"`
RemoteName string `json:"remote_name"`
}
type ExportClientList struct {
ClientsList []*isiClientList `json:"client"`
}
13 changes: 13 additions & 0 deletions cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

// Stats is Isilon statistics data structure .
type Stats *apiv3.IsiStatsResp
type Clients *apiv3.ExportClientList

//GetStatistics returns statistics from Isilon. Keys indicate type of statistics expected
func (c *Client) GetStatistics(
Expand All @@ -37,6 +38,18 @@ func (c *Client) GetStatistics(
return stats, nil
}

// IsIOinProgress checks whether a volume on a node has IO in progress
func (c *Client) IsIOInProgress(
ctx context.Context) (Clients, error) {

// query the volume without using the metadata parameter, use whether an error (typically, JSONError instance with "404 Not Found" status code) is returned to indicate whether the volume already exists.
clientList, err := apiv3.IsIOInProgress(ctx, c.API)
if err != nil {
return nil, err
}
return clientList, nil
}

// ClusterConfig represents the configuration of cluster in k8s (namespace API).
type ClusterConfig *apiv3.IsiClusterConfig

Expand Down

0 comments on commit d204171

Please sign in to comment.