Skip to content

Commit

Permalink
Get Specific Replication Pair
Browse files Browse the repository at this point in the history
  • Loading branch information
doriac11 committed Oct 4, 2024
1 parent 0d4ba30 commit 32230df
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions inttests/replication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,17 @@ func TestQueryReplicationPairs(t *testing.T) {
}
}

// Query Specific Replication Pair
func TestQueryReplicationPair(t *testing.T) {
if C2 == nil {
t.Skip("no client connection to replication target system")
}

pair, err := C.GetReplicationPair(rep.pair.ReplicaitonPair.ID)
assert.Nil(t, err)
assert.NotNil(t, pair)
}

// Query Replication Pair Statistics
func TestQueryReplicationPairsStatistics(t *testing.T) {
if C2 == nil {
Expand Down
11 changes: 11 additions & 0 deletions replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,17 @@ func (c *Client) GetAllReplicationPairs() ([]*types.ReplicationPair, error) {
return pairs, err
}

// GetReplicationPair returns a specific replication pair on the system.
func (c *Client) GetReplicationPair(id string) (*types.ReplicationPair, error) {
defer TimeSpent("GetReplicationPairs", time.Now())

path := "/api/instances/ReplicationPair::" + id

var pair *types.ReplicationPair
err := c.getJSONWithRetry(http.MethodGet, path, nil, &pair)
return pair, err
}

// GetReplicationPairs returns a list of replication pairs associated to the rcg.
func (rcg *ReplicationConsistencyGroup) GetReplicationPairs() ([]*types.ReplicationPair, error) {
defer TimeSpent("GetReplicationPairs", time.Now())
Expand Down

0 comments on commit 32230df

Please sign in to comment.