def logger_name_from_path(path): """Validate a logger URI path and get the logger name. :type path: str :param path: URI path for a logger API request. :rtype: str :returns: Logger name parsed from ``path``. :raises: :class:`ValueError` if the ``path`` is ill-formed or if the project from the ``path`` does not agree with the ``project`` passed in. """ return _name_from_project_path(path, None, _LOGGER_TEMPLATE)
def _sink_name_from_path(path, project): """Validate a sink URI path and get the sink name. :type path: string :param path: URI path for a sink API request. :type project: string :param project: The project associated with the request. It is included for validation purposes. :rtype: string :returns: Metric name parsed from ``path``. :raises: :class:`ValueError` if the ``path`` is ill-formed or if the project from the ``path`` does not agree with the ``project`` passed in. """ return _name_from_project_path(path, project, _SINK_TEMPLATE)
def _group_id_from_name(path, project=None): """Validate a group URI path and get the group ID. :type path: string :param path: URI path for a group API request. :type project: string or None :param project: The project associated with the request. It is included for validation purposes. :rtype: string :returns: Group ID parsed from ``path``. :raises: :class:`ValueError` if the ``path`` is ill-formed or if the project from the ``path`` does not agree with the ``project`` passed in. """ return _name_from_project_path(path, project, _GROUP_TEMPLATE)
def _callFUT(self, path, project, template): from gcloud._helpers import _name_from_project_path return _name_from_project_path(path, project, template)