Package cm_api :: Package endpoints :: Module types
[hide private]
[frames] | no frames]

Module types

source code

Classes [hide private]
  Attr
Encapsulates information about an attribute in the JSON encoding of the object.
  ROAttr
Subclass that just defines the attribute as read-only.
  BaseApiObject
The BaseApiObject helps with (de)serialization from/to JSON.
  ApiList
A list of some api object
  ApiHostRef
  ApiServiceRef
  ApiClusterRef
  ApiRoleRef
  ApiRoleConfigGroupRef
  ApiCommand
  ApiMetricData
Metric reading data.
  ApiMetric
Metric information.
  ApiActivity
  ApiCmPeer
  ApiHdfsReplicationArguments
  ApiHdfsReplicationResult
  ApiHiveTable
  ApiHiveReplicationArguments
  ApiHiveReplicationResult
  ApiReplicationCommand
  ApiReplicationSchedule
  ApiConfig
  ApiImpalaQuery
  ApiImpalaQueryResponse
  ApiImpalaQueryDetailsResponse
  ApiImpalaCancelResponse
Functions [hide private]
 
config_to_api_list(dic)
Converts a python dictionary into a list containing the proper ApiConfig encoding for configuration data.
source code
 
config_to_json(dic)
Converts a python dictionary into a JSON payload.
source code
 
json_to_config(dic, full=False)
Converts a JSON-decoded config dictionary to a python dictionary.
source code
Variables [hide private]
  __package__ = 'cm_api.endpoints'
Function Details [hide private]

config_to_api_list(dic)

source code 

Converts a python dictionary into a list containing the proper ApiConfig encoding for configuration data.

@param dic Key-value pairs to convert. @return JSON dictionary of an ApiConfig list (*not* an ApiList).

config_to_json(dic)

source code 

Converts a python dictionary into a JSON payload.

The payload matches the expected "apiConfig list" type used to update configuration parameters using the API.

@param dic Key-value pairs to convert. @return String with the JSON-encoded data.

json_to_config(dic, full=False)

source code 

Converts a JSON-decoded config dictionary to a python dictionary.

When materializing the full view, the values in the dictionary will be instances of ApiConfig, instead of strings.

@param dic JSON-decoded config dictionary. @param full Whether to materialize the full view of the config data. @return Python dictionary with config data.