Skip to content

Commit

Permalink
Clean documentation (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimon222 authored and kevin-bates committed Oct 22, 2019
1 parent 92b3ae0 commit 97b5d2d
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 44 deletions.
5 changes: 5 additions & 0 deletions docs/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Base Response class
==========================

.. autoclass:: yarn_api_client.base.Response
:members: data
11 changes: 6 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ Welcome to yarn-api-client's documentation!
Contents:

.. toctree::
:maxdepth: 2
:maxdepth: 2

resource_manager
node_manager
application_master
history_server
base
resource_manager
node_manager
application_master
history_server


Indices and tables
Expand Down
4 changes: 2 additions & 2 deletions yarn_api_client/application_master.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class ApplicationMaster(BaseYarnAPI):
:param int timeout: API connection timeout in seconds
:param AuthBase auth: Auth to use for requests
:param boolean verify: Either a boolean, in which case it controls whether
we verify the server's TLS certificate, or a string, in which case it must
be a path to a CA bundle to use. Defaults to ``True``
we verify the server's TLS certificate, or a string, in which case it must
be a path to a CA bundle to use. Defaults to ``True``
"""
def __init__(self, service_endpoint=None, timeout=30, auth=None, verify=True):
if not service_endpoint:
Expand Down
6 changes: 6 additions & 0 deletions yarn_api_client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@


class Response(object):
"""
Basic container for response dictionary
:param requests.Response response: Response for call via requests lib
"""
def __init__(self, response):
#: Dictionary with response data
self.data = response.json()


Expand Down
4 changes: 2 additions & 2 deletions yarn_api_client/history_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class HistoryServer(BaseYarnAPI):
:param int timeout: API connection timeout in seconds
:param AuthBase auth: Auth to use for requests
:param boolean verify: Either a boolean, in which case it controls whether
we verify the server's TLS certificate, or a string, in which case it must
be a path to a CA bundle to use. Defaults to ``True``
we verify the server's TLS certificate, or a string, in which case it must
be a path to a CA bundle to use. Defaults to ``True``
"""
def __init__(self, service_endpoint=None, timeout=30, auth=None, verify=True):
if not service_endpoint:
Expand Down
4 changes: 2 additions & 2 deletions yarn_api_client/node_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class NodeManager(BaseYarnAPI):
:param int timeout: API connection timeout in seconds
:param AuthBase auth: Auth to use for requests
:param boolean verify: Either a boolean, in which case it controls whether
we verify the server's TLS certificate, or a string, in which case it must
be a path to a CA bundle to use. Defaults to ``True``
we verify the server's TLS certificate, or a string, in which case it must
be a path to a CA bundle to use. Defaults to ``True``
"""
def __init__(self, service_endpoint=None, timeout=30, auth=None, verify=True):
if not service_endpoint:
Expand Down
66 changes: 33 additions & 33 deletions yarn_api_client/resource_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ class ResourceManager(BaseYarnAPI):
be used.
:param List[str] service_endpoints: List of ResourceManager HTTP(S)
addresses
addresses
:param int timeout: API connection timeout in seconds
:param AuthBase auth: Auth to use for requests configurations
:param boolean verify: Either a boolean, in which case it controls whether
we verify the server's TLS certificate, or a string, in which case it must
be a path to a CA bundle to use. Defaults to ``True``
we verify the server's TLS certificate, or a string, in which case it must
be a path to a CA bundle to use. Defaults to ``True``
"""
def __init__(self, service_endpoints=None, timeout=30, auth=None, verify=True):
active_service_endpoint = None
Expand Down Expand Up @@ -305,8 +305,8 @@ def cluster_application_attempt_container_info(self, application_id, attempt_id,

def cluster_application_state(self, application_id):
"""
* This feature is currently in the alpha stage and may change in the
future *
(This feature is currently in the alpha stage and may change in the
future)
With the application state API, you can obtain the current
state of an application.
Expand All @@ -322,8 +322,8 @@ def cluster_application_state(self, application_id):

def cluster_application_kill(self, application_id):
"""
* This feature is currently in the alpha stage and may change in the
future *
(This feature is currently in the alpha stage and may change in the
future)
With the application kill API, you can kill an application
that is not in FINISHED or FAILED state.
Expand Down Expand Up @@ -377,8 +377,8 @@ def cluster_node(self, node_id):

def cluster_submit_application(self, data):
"""
* This feature is currently in the alpha stage and may change in the
future *
(This feature is currently in the alpha stage and may change in the
future)
With the New Application API, you can obtain an application-id which
can then be used as part of the Cluster Submit Applications API to
Expand All @@ -398,8 +398,8 @@ def cluster_submit_application(self, data):

def cluster_new_application(self):
"""
* This feature is currently in the alpha stage and may change in the
future *
(This feature is currently in the alpha stage and may change in the
future)
With the New Application API, you can obtain an application-id which
can then be used as part of the Cluster Submit Applications API to
Expand All @@ -415,8 +415,8 @@ def cluster_new_application(self):

def cluster_get_application_queue(self, application_id):
"""
* This feature is currently in the alpha stage and may change in the
future *
(This feature is currently in the alpha stage and may change in the
future)
With the application queue API, you can query the queue of a
submitted app
Expand All @@ -431,8 +431,8 @@ def cluster_get_application_queue(self, application_id):

def cluster_change_application_queue(self, application_id, queue):
"""
* This feature is currently in the alpha stage and may change in the
future *
(This feature is currently in the alpha stage and may change in the
future)
Move a running app to another queue using a PUT request specifying the
target queue.
Expand All @@ -458,8 +458,8 @@ def cluster_change_application_queue(self, application_id, queue):

def cluster_get_application_priority(self, application_id):
"""
* This feature is currently in the alpha stage and may change in the
future *
(This feature is currently in the alpha stage and may change in the
future)
With the application priority API, you can query the priority of a
submitted app
Expand All @@ -474,8 +474,8 @@ def cluster_get_application_priority(self, application_id):

def cluster_change_application_priority(self, application_id, priority):
"""
* This feature is currently in the alpha stage and may change in the
future *
(This feature is currently in the alpha stage and may change in the
future)
Update priority of a running or accepted app using a PUT request
specifying the target priority.
Expand Down Expand Up @@ -584,7 +584,7 @@ def cluster_reservations(self, queue=None, reservation_id=None,
unspecified or invalid, this will default to 0.
:param str end_time: reservations that start after this end-time will be listed. If
unspecified or invalid, this will default to Long.MaxValue.
:param str include_resource_allocations : true or false. If true, the resource allocations
:param str include_resource_allocations: true or false. If true, the resource allocations
of the reservation will be included in the response. If false, no resource allocations
will be included in the response. This will default to false.
:returns: API response object with JSON data
Expand All @@ -606,8 +606,8 @@ def cluster_reservations(self, queue=None, reservation_id=None,

def cluster_new_delegation_token(self, renewer):
"""
* This feature is currently in the alpha stage and may change in the
future *
(This feature is currently in the alpha stage and may change in the
future)
API to create delegation token.
Expand All @@ -627,8 +627,8 @@ def cluster_new_delegation_token(self, renewer):

def cluster_renew_delegation_token(self, delegation_token):
"""
* This feature is currently in the alpha stage and may change in the
future *
(This feature is currently in the alpha stage and may change in the
future)
API to renew delegation token.
Expand All @@ -650,8 +650,8 @@ def cluster_renew_delegation_token(self, delegation_token):

def cluster_cancel_delegation_token(self, delegation_token):
"""
* This feature is currently in the alpha stage and may change in the
future *
(This feature is currently in the alpha stage and may change in the
future)
API to cancel delegation token.
Expand All @@ -671,8 +671,8 @@ def cluster_cancel_delegation_token(self, delegation_token):

def cluster_new_reservation(self):
"""
* This feature is currently in the alpha stage and may change in the
future *
(This feature is currently in the alpha stage and may change in the
future)
Use the New Reservation API, to obtain a reservation-id which can then be used as part of
the Cluster Reservation API Submit to submit reservations.
Expand Down Expand Up @@ -764,7 +764,7 @@ def cluster_application_timeout(self, application_id, timeout_type):
The Cluster Application Timeout resource contains information about timeout.
:param str application_id: The application id
:param str timeout_type:Timeout type. Valid values are the members of the
:param str timeout_type: Timeout type. Valid values are the members of the
ApplicationTimeoutType enum. LIFETIME is currently the only valid value. .
:returns: API response object with JSON data
:rtype: :py:class:`yarn_api_client.base.Response`
Expand Down Expand Up @@ -794,8 +794,8 @@ def cluster_update_application_timeout(self, application_id, timeout_type, expir

def cluster_scheduler_conf_mutation(self):
"""
* This feature is currently in the alpha stage and may change in the
future *
(This feature is currently in the alpha stage and may change in the
future)
API to retrieve the scheduler’s configuration that is currently loaded into
scheduler’s context.
Expand All @@ -809,8 +809,8 @@ def cluster_scheduler_conf_mutation(self):

def cluster_modify_scheduler_conf_mutation(self, data):
"""
* This feature is currently in the alpha stage and may change in the
future *
(This feature is currently in the alpha stage and may change in the
future)
API to modify the scheduler configuration
Expand Down

0 comments on commit 97b5d2d

Please sign in to comment.