node_roles
Creates, updates, deletes, gets or lists a node_roles resource.
Overview​
| Name | node_roles |
| Type | Resource |
| Id | ovh.cluster_hadoop.node_roles |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | integer | ID of the Role |
type | string | Role 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) |
Role (ie set of Hadoop services) of the Node
| Name | Datatype | Description |
|---|---|---|
id | integer | ID of the Role |
type | string | Role 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | hostname, service_name, type | Get this object properties | |
list | select | hostname, service_name | x_pagination_mode | Roles (ie set of Hadoop services) of the Node |
create | insert | hostname, service_name, type | Add the Role to the Node | |
delete | delete | hostname, service_name, type | Remove this Role from the Node | |
restart | exec | hostname, serviceName, type | Restart the role on the node (THIS ACTION WILL RESTART OTHER DEPENDANT ROLES) | |
start | exec | hostname, serviceName, type | Start the role on the node | |
stop | exec | hostname, serviceName, type | Stop 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.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The 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"}}) |
hostname | string | Hostname of the node |
serviceName | string | The internal name of your cluster |
service_name | string | The internal name of your cluster (wire: serviceName) |
type | string | Role name |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
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
;
Roles (ie set of Hadoop services) of the Node
SELECT
id,
type
FROM ovh.cluster_hadoop.node_roles
WHERE hostname = '{{ hostname }}' -- required
AND service_name = '{{ service_name }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: node_roles
props:
- name: hostname
value: "{{ hostname }}"
description: Required parameter for the node_roles resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the node_roles resource.
- name: type
value: "{{ type }}"
description: |
Role name
valid_values: ['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']
DELETE examples​
- delete
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
- start
- stop
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
;
Start the role on the node
EXEC ovh.cluster_hadoop.node_roles.start
@hostname='{{ hostname }}' --required,
@serviceName='{{ serviceName }}' --required,
@type='{{ type }}' --required
;
Stop the role on the node (THIS ACTION WILL STOP OTHER DEPENDANT ROLES)
EXEC ovh.cluster_hadoop.node_roles.stop
@hostname='{{ hostname }}' --required,
@serviceName='{{ serviceName }}' --required,
@type='{{ type }}' --required
;