Skip to content

Commit

Permalink
Merge pull request #122 from dell/nvme_tcp
Browse files Browse the repository at this point in the history
  • Loading branch information
boyamurthy authored Jan 23, 2024
2 parents 5ddb356 + 6f0f86c commit ec40aaf
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 8 deletions.
1 change: 1 addition & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ type Client interface {
DetachVolumeFromHost(ctx context.Context, hostID string, detachParams *HostVolumeDetach) (EmptyResponse, error)
DetachVolumeFromHostGroup(ctx context.Context, hostGroupID string, detachParams *HostVolumeDetach) (EmptyResponse, error)
GetStorageISCSITargetAddresses(ctx context.Context) ([]IPPoolAddress, error)
GetStorageNVMETCPTargetAddresses(ctx context.Context) ([]IPPoolAddress, error)
GetCapacity(ctx context.Context) (int64, error)
GetFCPorts(ctx context.Context) (resp []FcPort, err error)
GetFCPort(ctx context.Context, id string) (resp FcPort, err error)
Expand Down
26 changes: 26 additions & 0 deletions ip_pool_address.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,29 @@ func (c *ClientIMPL) GetStorageISCSITargetAddresses(
}
return resp, nil
}

// GetStorageNVMETCPTargetAddresses returns a list of PowerStore NVME/TCP targets ip addresses
func (c *ClientIMPL) GetStorageNVMETCPTargetAddresses(
ctx context.Context,
) (resp []IPPoolAddress, err error) {
var ipPoolAddress IPPoolAddress
qp := c.APIClient().QueryParamsWithFields(&ipPoolAddress)
qp.RawArg("purposes", fmt.Sprintf("cs.{%s}", IPPurposeTypeEnumStorageNVMETCPPort))
qp.Order("id")
_, err = c.APIClient().Query(
ctx,
RequestConfig{
Method: "GET",
Endpoint: apiPoolAddressURL,
QueryParams: qp,
},
&resp)
err = WrapErr(err)
if err != nil {
return resp, err
}
if len(resp) == 0 {
return resp, errors.New("can't get NVMeTCP target address")
}
return resp, nil
}
2 changes: 2 additions & 0 deletions ip_pool_address_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const (
IPPurposeTypeEnumStorageIscsiInitiator IPPurposeTypeEnum = "Storage_Iscsi_Initiator"
// IPPurposeTypeEnumStorageIscsiTarget captures enum value "Storage_Iscsi_Target"
IPPurposeTypeEnumStorageIscsiTarget IPPurposeTypeEnum = "Storage_Iscsi_Target"
// IPPurposeTypeEnumStorageNVMETCPPort captures enum value "Storage_NVMe_TCP_Port"
IPPurposeTypeEnumStorageNVMETCPPort IPPurposeTypeEnum = "Storage_NVMe_TCP_Port"
// IPPurposeTypeEnumStorageClusterFloating captures enum value "Storage_Cluster_Floating"
IPPurposeTypeEnumStorageClusterFloating IPPurposeTypeEnum = "Storage_Cluster_Floating"
// IPPurposeTypeEnumICDNode captures enum value "ICD_Node"
Expand Down
32 changes: 31 additions & 1 deletion mocks/Client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/FieldProvider.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/Logger.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/QueryParamsEncoder.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/RequestConfigRenderer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/TimeoutSemaphoreInterface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/Traceable.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion replication_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const (
RsStatePausedForNdu RSStateEnum = "Paused_For_NDU"
RsStateResuming RSStateEnum = "Resuming"
RsStateFailingOver RSStateEnum = "Failing_Over"
RsStateFailingOverForDr RSStateEnum = "Failing_Over_For_DR"
RsStateFailingOverForDR RSStateEnum = "Failing_Over_For_DR"
RsStateFailedOver RSStateEnum = "Failed_Over"
RsStateReprotecting RSStateEnum = "Reprotecting"
RsStatePartialCutoverForMigration RSStateEnum = "Partial_Cutover_For_Migration"
Expand Down

0 comments on commit ec40aaf

Please sign in to comment.