def default_view(self): """returns a reference to the primary / default Jenkins view The default view is the one displayed when navigating to the main URL. Typically this will be the "All" view. :returns: object that manages the default Jenkins view :rtype: :class:`~.view.View` """ data = self._api.get_api_data() return View.instantiate(data['primaryView'], self._api)
def views(self): """Gets all views contained within this view, non-recursively To get a recursive list of all child views and their children use :py:meth:`all_views`. :returns: list of all views contained within this view :rtype: :class:`list` of :class:`pyjen.view.View` """ retval = list() data = self._api.get_api_data() for cur_view in data['views']: retval.append(View.instantiate(cur_view, self._api)) return retval
def views(self): """Gets a list of all views directly managed by the Jenkins dashboard To retrieve all views managed by this Jenkins instance, including recursing into views that support sub-views, see the :py:meth:`.all_views` property :returns: list of one or more views defined on this Jenkins instance. :rtype: :class:`list` of :class:`~.view.View` objects """ retval = list() data = self._api.get_api_data() for cur_view in data['views']: retval.append(View.instantiate(cur_view, self._api)) return retval
def find_view(self, view_name): """Searches views for a specific one .. seealso: :py:meth:`.get_view` :param str view_name: the name of the view to search for :returns: If a view with the specified name can be found, an object to manage the view will be returned, otherwise None :rtype: :class:`~.view.View` """ data = self._api.get_api_data() for cur_view in data['views']: temp_view = View.instantiate(cur_view, self._api) if temp_view.name == view_name: return temp_view return None