@@ -12,6 +12,13 @@ class ResourceManager(BaseYarnAPI):
12
12
cluster - status on the cluster, metrics on the cluster,
13
13
scheduler information, information about nodes in the cluster,
14
14
and information about applications on the cluster.
15
+
16
+ If `address` argument is `None` client will try to extract `address` and
17
+ `port` from Hadoop configuration files.
18
+
19
+ :param str address: ResourceManager HTTP address
20
+ :param int port: ResourceManager HTTP port
21
+ :param int timeout: API connection timeout in seconds
15
22
"""
16
23
def __init__ (self , address = None , port = 8088 , timeout = 30 ):
17
24
self .address , self .port , self .timeout = address , port , timeout
@@ -24,6 +31,9 @@ def cluster_information(self):
24
31
"""
25
32
The cluster information resource provides overall information about
26
33
the cluster.
34
+
35
+ :returns: API response object with JSON data
36
+ :rtype: :py:class:`yarn_api_client.base.Response`
27
37
"""
28
38
path = '/ws/v1/cluster/info'
29
39
return self .request (path )
@@ -33,6 +43,9 @@ def cluster_metrics(self):
33
43
The cluster metrics resource provides some overall metrics about the
34
44
cluster. More detailed metrics should be retrieved from the jmx
35
45
interface.
46
+
47
+ :returns: API response object with JSON data
48
+ :rtype: :py:class:`yarn_api_client.base.Response`
36
49
"""
37
50
path = '/ws/v1/cluster/metrics'
38
51
return self .request (path )
@@ -44,6 +57,9 @@ def cluster_scheduler(self):
44
57
Capacity Scheduler. You will get different information depending on
45
58
which scheduler is configured so be sure to look at the type
46
59
information.
60
+
61
+ :returns: API response object with JSON data
62
+ :rtype: :py:class:`yarn_api_client.base.Response`
47
63
"""
48
64
path = '/ws/v1/cluster/scheduler'
49
65
return self .request (path )
@@ -55,6 +71,25 @@ def cluster_applications(self, state=None, final_status=None,
55
71
"""
56
72
With the Applications API, you can obtain a collection of resources,
57
73
each of which represents an application.
74
+
75
+ :param str state: state of the application
76
+ :param str final_status: the final status of the
77
+ application - reported by the application itself
78
+ :param str user: user name
79
+ :param str queue: queue name
80
+ :param str limit: total number of app objects to be returned
81
+ :param str started_time_begin: applications with start time beginning
82
+ with this time, specified in ms since epoch
83
+ :param str started_time_end: applications with start time ending with
84
+ this time, specified in ms since epoch
85
+ :param str finished_time_begin: applications with finish time
86
+ beginning with this time, specified in ms since epoch
87
+ :param str finished_time_end: applications with finish time ending
88
+ with this time, specified in ms since epoch
89
+ :returns: API response object with JSON data
90
+ :rtype: :py:class:`yarn_api_client.base.Response`
91
+ :raises yarn_api_client.errors.IllegalArgumentError: if `state` or
92
+ `final_status` incorrect
58
93
"""
59
94
path = '/ws/v1/cluster/apps'
60
95
@@ -92,6 +127,19 @@ def cluster_application_statistics(self, state_list=None,
92
127
ResourceManager context.
93
128
94
129
This method work in Hadoop > 2.0.0
130
+
131
+ :param list state_list: states of the applications, specified as a
132
+ comma-separated list. If states is not provided, the API will
133
+ enumerate all application states and return the counts of them.
134
+ :param list application_type_list: types of the applications,
135
+ specified as a comma-separated list. If applicationTypes is not
136
+ provided, the API will count the applications of any application
137
+ type. In this case, the response shows * to indicate any
138
+ application type. Note that we only support at most one
139
+ applicationType temporarily. Otherwise, users will expect
140
+ an BadRequestException.
141
+ :returns: API response object with JSON data
142
+ :rtype: :py:class:`yarn_api_client.base.Response`
95
143
"""
96
144
path = '/ws/v1/cluster/appstatistics'
97
145
@@ -113,6 +161,10 @@ def cluster_application(self, application_id):
113
161
"""
114
162
An application resource contains information about a particular
115
163
application that was submitted to a cluster.
164
+
165
+ :param str application_id: The application id
166
+ :returns: API response object with JSON data
167
+ :rtype: :py:class:`yarn_api_client.base.Response`
116
168
"""
117
169
path = '/ws/v1/cluster/apps/{appid}' .format (appid = application_id )
118
170
@@ -122,6 +174,10 @@ def cluster_application_attempts(self, application_id):
122
174
"""
123
175
With the application attempts API, you can obtain a collection of
124
176
resources that represent an application attempt.
177
+
178
+ :param str application_id: The application id
179
+ :returns: API response object with JSON data
180
+ :rtype: :py:class:`yarn_api_client.base.Response`
125
181
"""
126
182
path = '/ws/v1/cluster/apps/{appid}/appattempts' .format (
127
183
appid = application_id )
@@ -132,6 +188,11 @@ def cluster_nodes(self, state=None, healthy=None):
132
188
"""
133
189
With the Nodes API, you can obtain a collection of resources, each of
134
190
which represents a node.
191
+
192
+ :returns: API response object with JSON data
193
+ :rtype: :py:class:`yarn_api_client.base.Response`
194
+ :raises yarn_api_client.errors.IllegalArgumentError: if `healthy`
195
+ incorrect
135
196
"""
136
197
path = '/ws/v1/cluster/nodes'
137
198
# TODO: validate state argument
@@ -152,6 +213,10 @@ def cluster_nodes(self, state=None, healthy=None):
152
213
def cluster_node (self , node_id ):
153
214
"""
154
215
A node resource contains information about a node in the cluster.
216
+
217
+ :param str node_id: The node id
218
+ :returns: API response object with JSON data
219
+ :rtype: :py:class:`yarn_api_client.base.Response`
155
220
"""
156
221
path = '/ws/v1/cluster/nodes/{nodeid}' .format (nodeid = node_id )
157
222
0 commit comments