Source code for pyrally.client
from pyrally.models import Story, Defect, Artifact
from pyrally.rally_access import get_accessor
[docs]class RallyAPIClient(object):
def __init__(self, username, password, base_url):
self.rally_access = get_accessor(username, password, base_url)
[docs] def get_all_entities(self):
"""
Get all stories, defects and tasks.
:returns:
A list of ``BaseRallyModel`` inherited objects.
"""
return Artifact.get_all()
[docs] def get_all_in_kanban_states(self, kanban_states):
"""
Get all stories and defects in the given ``kanban_state``.
:param kanban_state:
A list of kanban states to search on.
:returns:
A dictionary containing keys for ``stories`` and ``defects``, and
values of lists of associated ``Story`` and ``Defect`` objects.
"""
stories = Story.get_all_in_kanban_states(kanban_states)
defects = Defect.get_all_in_kanban_states(kanban_states)
return {'stories': stories, 'defects': defects}
[docs] def get_story_by_formatted_id(self, story_id):
"""
Return the story with the id ``story_id``.
:param story_id:
The USXXX story id of the story.
:returns:
A ``Story`` object.
"""
return Story.get_by_formatted_id(story_id)