Skip to main content

node_roles

Creates, updates, deletes, gets or lists a node_roles resource.

Overview​

Namenode_roles
TypeResource
Idovh.cluster_hadoop.node_roles

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerID of the Role
typestringRole name (cloudera_manager, data_node, elasticsearch_server, hbase_master, hbase_region_server, hive_server2, hue, impala_daemon, impala_server, map_reduce_history_server, name_node, oozie_server, open_tsdb, secondary_name_node, solr_server, spark_master, spark_worker, sqoop_server, yarn_node_manager, yarn_resource_manager, zoo_keeper)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselecthostname, service_name, typeGet this object properties
listselecthostname, service_namex_pagination_modeRoles (ie set of Hadoop services) of the Node
createinserthostname, service_name, typeAdd the Role to the Node
deletedeletehostname, service_name, typeRemove this Role from the Node
restartexechostname, serviceName, typeRestart the role on the node (THIS ACTION WILL RESTART OTHER DEPENDANT ROLES)
startexechostname, serviceName, typeStart the role on the node
stopexechostname, serviceName, typeStop the role on the node (THIS ACTION WILL STOP OTHER DEPENDANT ROLES)

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
hostnamestringHostname of the node
serviceNamestringThe internal name of your cluster
service_namestringThe internal name of your cluster (wire: serviceName)
typestringRole name
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Get this object properties

SELECT
id,
type
FROM ovh.cluster_hadoop.node_roles
WHERE hostname = '{{ hostname }}' -- required
AND service_name = '{{ service_name }}' -- required
AND type = '{{ type }}' -- required
;

INSERT examples​

Add the Role to the Node

INSERT INTO ovh.cluster_hadoop.node_roles (
type,
hostname,
service_name
)
SELECT
'{{ type }}' /* required */,
'{{ hostname }}',
'{{ service_name }}'
RETURNING
name,
task_id,
status
;

DELETE examples​

Remove this Role from the Node

DELETE FROM ovh.cluster_hadoop.node_roles
WHERE hostname = '{{ hostname }}' --required
AND service_name = '{{ service_name }}' --required
AND type = '{{ type }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Restart the role on the node (THIS ACTION WILL RESTART OTHER DEPENDANT ROLES)

EXEC ovh.cluster_hadoop.node_roles.restart
@hostname='{{ hostname }}' --required,
@serviceName='{{ serviceName }}' --required,
@type='{{ type }}' --required
;