コード例 #1
0
    def get_info(self):
        """
        Get info on this link.

        :rtype: .Link
        """
        response = self.ctx.get_proto(f"/links/{self._instance}/{self._link}")
        message = links_pb2.LinkInfo()
        message.ParseFromString(response.content)
        return Link(message)
コード例 #2
0
    def get_info(self):
        """
        Get info on this link.

        :rtype: .Link
        """
        response = self.ctx.get_proto("/links/{}/{}".format(
            self._instance, self._link))
        message = yamcsManagement_pb2.LinkInfo()
        message.ParseFromString(response.content)
        return Link(message)
コード例 #3
0
    def get_data_link(self, instance, link):
        """
        Gets a single data link.

        :param str instance: A Yamcs instance name.
        :param str link: The name of the data link.
        :rtype: .Link
        """
        response = self.get_proto('/links/{}/{}'.format(instance, link))
        message = yamcsManagement_pb2.LinkInfo()
        message.ParseFromString(response.content)
        return Link(message)
コード例 #4
0
ファイル: client.py プロジェクト: xpromache/yamcs-python
    def list_data_links(self, instance):
        """
        Lists the data links visible to this client.

        Data links are returned in random order.

        :param str instance: A Yamcs instance name.
        :rtype: ~collections.Iterable[.Link]
        """
        # Server does not do pagination on listings of this resource.
        # Return an iterator anyway for similarity with other API methods
        response = self.get_proto(path="/links/" + instance)
        message = yamcsManagement_pb2.ListLinksResponse()
        message.ParseFromString(response.content)
        links = getattr(message, "links")
        return iter([Link(link) for link in links])