cm_client.NameservicesResourceApi

All URIs are relative to /api/v57

Method HTTP request Description
get_metrics GET /clusters/{clusterName}/services/{serviceName}/nameservices/{nameservice}/metrics Fetch metric readings for a particular nameservice.
list_nameservices GET /clusters/{clusterName}/services/{serviceName}/nameservices List the nameservices of an HDFS service.
read_nameservice GET /clusters/{clusterName}/services/{serviceName}/nameservices/{nameservice} Retrieve information about a nameservice.

get_metrics

ApiMetricList get_metrics(cluster_name, nameservice, service_name, _from=_from, metrics=metrics, to=to, view=view)

Fetch metric readings for a particular nameservice.

Fetch metric readings for a particular nameservice.

By default, this call will look up all metrics available. If only specific metrics are desired, use the metrics parameter.

By default, the returned results correspond to a 5 minute window based on the provided end time (which defaults to the current server time). The from and to parameters can be used to control the window being queried. A maximum window of 3 hours is enforced.

When requesting a "full" view, aside from the extended properties of the returned metric data, the collection will also contain information about all metrics available, even if no readings are available in the requested window.

Example

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.NameservicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
nameservice = 'nameservice_example' # str | The nameservice.
service_name = 'service_name_example' # str | The service name.
_from = '_from_example' # str | Start of the period to query. (optional)
metrics = ['metrics_example'] # list[str] | Filter for which metrics to query. (optional)
to = 'now' # str | End of the period to query. (optional) (default to now)
view = 'summary' # str | The view of the data to materialize, either \"summary\" or \"full\". (optional) (default to summary)

try:
    # Fetch metric readings for a particular nameservice.
    api_response = api_instance.get_metrics(cluster_name, nameservice, service_name, _from=_from, metrics=metrics, to=to, view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling NameservicesResourceApi->get_metrics: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
nameservice str The nameservice.
service_name str The service name.
_from str Start of the period to query. [optional]
metrics list[str] Filter for which metrics to query. [optional]
to str End of the period to query. [optional] [default to now]
view str The view of the data to materialize, either "summary" or "full". [optional] [default to summary]

Return type

ApiMetricList

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_nameservices

ApiNameserviceList list_nameservices(cluster_name, service_name, view=view)

List the nameservices of an HDFS service.

List the nameservices of an HDFS service.

Example

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.NameservicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
service_name = 'service_name_example' # str | The service name.
view = 'summary' # str | The view of the data to materialize, either \"summary\" or \"full\". (optional) (default to summary)

try:
    # List the nameservices of an HDFS service.
    api_response = api_instance.list_nameservices(cluster_name, service_name, view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling NameservicesResourceApi->list_nameservices: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
service_name str The service name.
view str The view of the data to materialize, either "summary" or "full". [optional] [default to summary]

Return type

ApiNameserviceList

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

read_nameservice

ApiNameservice read_nameservice(cluster_name, nameservice, service_name, view=view)

Retrieve information about a nameservice.

Retrieve information about a nameservice.

Example

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.NameservicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
nameservice = 'nameservice_example' # str | The nameservice to retrieve.
service_name = 'service_name_example' # str | The service name.
view = 'summary' # str | The view to materialize. Defaults to 'full'. (optional) (default to summary)

try:
    # Retrieve information about a nameservice.
    api_response = api_instance.read_nameservice(cluster_name, nameservice, service_name, view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling NameservicesResourceApi->read_nameservice: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
nameservice str The nameservice to retrieve.
service_name str The service name.
view str The view to materialize. Defaults to 'full'. [optional] [default to summary]

Return type

ApiNameservice

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]