# CmPeersResource Resource

### GET /cm/peers

Retrieves all configured Cloudera Manager peers.

Available since API v3. Only available with Cloudera Manager Enterprise Edition.

When accessed via API version before v11, only REPLICATION type peers will be returned.

Response Body
media type | data type | description
--- | --- | ---
application/json | ApiCmPeerList (JSON) | List of Cloudera Manager peers.

### POST /cm/peers

Create a new Cloudera Manager peer.

The remote server will be contacted so that a user can be created for use by the new peer. The username and password properties of the provided peer object should contain credentials of a valid admin user on the remote server. A timeout of 10 seconds is enforced when contacting the remote server.

It is recommended to run the remote server with TLS enabled, since creating and using peers involve transferring credentials over the network.

Available since API v3. Only available with Cloudera Manager Enterprise Edition.

Type field in ApiCmPeer is available since API v11. if not specified when making createPeer() call, 'REPLICATION' type peer will be created.

Request Body
media type | data type | description
--- | --- | ---
application/json | ApiCmPeer (JSON) | Peer to create (see above).

Response Body
media type | data type | description
--- | --- | ---
application/json | ApiCmPeer (JSON) | Information about the created peer.

### DELETE /cm/peers/{peerName}

Delete Cloudera Manager peer.

An attempt will be made to contact the peer server, so that the configured user can be deleted.. Errors while contacting the remote server are non-fatal.

Available since API v3. Only available with Cloudera Manager Enterprise Edition.

Request Parameters
name | type | description | default
--- | --- | --- | ---
peerName | path | Name of peer to delete. | n/a

Response Body
media type | data type | description
--- | --- | ---
application/json | ApiCmPeer (JSON) | Information about the deleted peer.

### DELETE /cm/peers/{peerName}

Delete Cloudera Manager peer.

An attempt will be made to contact the peer server, so that the configured user can be deleted.. Errors while contacting the remote server are non-fatal.

Available since API v11. Only available with Cloudera Manager Enterprise Edition.

Request Parameters
name | type | description | default
--- | --- | --- | ---
peerName | path | Name of peer to delete. | n/a
type | query | Type of peer to delete. If null, REPLICATION peer type will be deleted. | n/a

Response Body
media type | data type | description
--- | --- | ---
application/json | ApiCmPeer (JSON) | Information about the deleted peer.

### GET /cm/peers/{peerName}

Fetch information about an existing Cloudera Manager peer.

Available since API v3. Only available with Cloudera Manager Enterprise Edition.

Request Parameters
name | type | description | default
--- | --- | --- | ---
peerName | path | Name of peer to retrieve. | n/a

Response Body
media type | data type | description
--- | --- | ---
application/json | ApiCmPeer (JSON) | Peer information.

### GET /cm/peers/{peerName}

Fetch information about an existing Cloudera Manager peer.

Available since API v11. Only available with Cloudera Manager Enterprise Edition.

Request Parameters
name | type | description | default
--- | --- | --- | ---
peerName | path | Name of peer to retrieve. | n/a
type | query | Type of peer to retrieve. If null, REPLICATION peer type will be returned. | n/a

Response Body
media type | data type | description
--- | --- | ---
application/json | ApiCmPeer (JSON) | Peer information.

### PUT /cm/peers/{peerName}

Update information for a Cloudera Manager peer.

In administrator credentials are provided in the peer information, they will be used to establish new credentials with the remote server. This can be used in case the old credentials are not working anymore. An attempt will be made to delete the old credentials if new ones are successfully created.

If changing the peer's URL, an attempt will be made to contact the old Cloudera Manager to delete the existing credentials.

Available since API v3. Only available with Cloudera Manager Enterprise Edition.

Request Parameters
name | type | description | default
--- | --- | --- | ---
peerName | path | Name of peer to update. | n/a

Request Body
media type | data type | description
--- | --- | ---
application/json | ApiCmPeer (JSON) | Updated peer information.

Response Body
media type | data type | description
--- | --- | ---
application/json | ApiCmPeer (JSON) | The updated peer information.

### POST /cm/peers/{peerName}/commands/test

Test the connectivity of a peer.

Available since API v3. Only available with Cloudera Manager Enterprise Edition.

Request Parameters
name | type | description | default
--- | --- | --- | ---
peerName | path | Name of peer to test. | n/a

Response Body
media type | data type | description
--- | --- | ---
application/json | ApiCommand (JSON) | Information about the submitted command.

### POST /cm/peers/{peerName}/commands/test

Test the connectivity of a peer.

Available since API v11. Only available with Cloudera Manager Enterprise Edition.

Request Parameters
name | type | description | default
--- | --- | --- | ---
peerName | path | Name of peer to test. | n/a
type | query | Type of peer to test. If null, REPLICATION peer type will be tested. | n/a

Response Body
media type | data type | description
--- | --- | ---
application/json | ApiCommand (JSON) | Information about the submitted command.