All URIs are relative to https://localhost/api/v41
Method | HTTP request | Description |
---|---|---|
create_peer | POST /cm/peers | Create a new Cloudera Manager peer. |
delete_peer | DELETE /cm/peers/{peerName} | Delete Cloudera Manager peer. |
list_peers | GET /cm/peers | Retrieves all configured Cloudera Manager peers. |
read_peer | GET /cm/peers/{peerName} | Fetch information about an existing Cloudera Manager peer. |
test_peer | POST /cm/peers/{peerName}/commands/test | Test the connectivity of a peer. |
update_peer | PUT /cm/peers/{peerName} | Update information for a Cloudera Manager peer. |
ApiCmPeer create_peer(body=body)
Create a new Cloudera Manager peer.
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.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.CmPeersResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiCmPeer() # ApiCmPeer | Peer to create (see above). (optional)
try:
# Create a new Cloudera Manager peer.
api_response = api_instance.create_peer(body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling CmPeersResourceApi->create_peer: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
body | ApiCmPeer | Peer to create (see above). | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCmPeer delete_peer(peer_name, type=type)
Delete Cloudera Manager peer.
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.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.CmPeersResourceApi(cm_client.ApiClient(configuration))
peer_name = 'peer_name_example' # str | Name of peer to delete.
type = 'type_example' # str | Type of peer to delete. If null, REPLICATION peer type will be deleted. (optional)
try:
# Delete Cloudera Manager peer.
api_response = api_instance.delete_peer(peer_name, type=type)
pprint(api_response)
except ApiException as e:
print("Exception when calling CmPeersResourceApi->delete_peer: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
peer_name | str | Name of peer to delete. | |
type | str | Type of peer to delete. If null, REPLICATION peer type will be deleted. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCmPeerList list_peers()
Retrieves all configured Cloudera Manager 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.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.CmPeersResourceApi(cm_client.ApiClient(configuration))
try:
# Retrieves all configured Cloudera Manager peers.
api_response = api_instance.list_peers()
pprint(api_response)
except ApiException as e:
print("Exception when calling CmPeersResourceApi->list_peers: %s\n" % e)
This endpoint does not need any parameter.
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCmPeer read_peer(peer_name, type=type)
Fetch information about an existing Cloudera Manager peer.
Fetch information about an existing Cloudera Manager peer.
Available since API v11. Only available with Cloudera Manager Enterprise Edition.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.CmPeersResourceApi(cm_client.ApiClient(configuration))
peer_name = 'peer_name_example' # str | Name of peer to retrieve.
type = 'type_example' # str | Type of peer to retrieve. If null, REPLICATION peer type will be returned. (optional)
try:
# Fetch information about an existing Cloudera Manager peer.
api_response = api_instance.read_peer(peer_name, type=type)
pprint(api_response)
except ApiException as e:
print("Exception when calling CmPeersResourceApi->read_peer: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
peer_name | str | Name of peer to retrieve. | |
type | str | Type of peer to retrieve. If null, REPLICATION peer type will be returned. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand test_peer(peer_name, type=type)
Test the connectivity of a peer.
Test the connectivity of a peer.
Available since API v11. Only available with Cloudera Manager Enterprise Edition.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.CmPeersResourceApi(cm_client.ApiClient(configuration))
peer_name = 'peer_name_example' # str | Name of peer to test.
type = 'type_example' # str | Type of peer to test. If null, REPLICATION peer type will be tested. (optional)
try:
# Test the connectivity of a peer.
api_response = api_instance.test_peer(peer_name, type=type)
pprint(api_response)
except ApiException as e:
print("Exception when calling CmPeersResourceApi->test_peer: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
peer_name | str | Name of peer to test. | |
type | str | Type of peer to test. If null, REPLICATION peer type will be tested. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCmPeer update_peer(peer_name, body=body)
Update information for a Cloudera Manager peer.
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.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.CmPeersResourceApi(cm_client.ApiClient(configuration))
peer_name = 'peer_name_example' # str | Name of peer to update.
body = cm_client.ApiCmPeer() # ApiCmPeer | Updated peer information. (optional)
try:
# Update information for a Cloudera Manager peer.
api_response = api_instance.update_peer(peer_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling CmPeersResourceApi->update_peer: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
peer_name | str | Name of peer to update. | |
body | ApiCmPeer | Updated peer information. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]