예제 #1
0
    def agent_api_encrypted_url(self):
        """Encrypted data reception point.

        Args:
            None

        Returns:
            link (str): Link of encrypted data receive point

        """

        _ip = url.url_ip_address(self.agent_api_ip_address())
        link = ('http://{}:{}{}'.format(_ip, self.agent_api_ip_bind_port(),
                                        self.agent_api_encrypted()))

        return link
예제 #2
0
    def agent_api_key_url(self):
        """Exchange point for public keys.

        Args:
            None

        Returns:
            link (str): Link of the key exchange point

        """
        # Initialize key variables
        _ip = url.url_ip_address(self.agent_api_ip_address())
        link = ('http://{}:{}{}'.format(_ip, self.agent_api_ip_bind_port(),
                                        self.agent_api_key()))

        return link
예제 #3
0
    def agent_api_validation_url(self):
        """Validation point for encryption.

        Args:
            None

        Returns:
            link (str): Link of the validation point

        """

        _ip = url.url_ip_address(self.agent_api_ip_address())
        link = ('http://{}:{}{}'.format(_ip, self.agent_api_ip_bind_port(),
                                        self.agent_api_validation()))

        return link
예제 #4
0
    def agent_api_server_url(self, agent_id):
        """Get pattoo server's remote URL.

        Args:
            agent_id: Agent ID

        Returns:
            result: URL.

        """
        # Return
        _ip = url.url_ip_address(self.agent_api_ip_address())
        result = ('http://{}:{}{}/{}'.format(_ip,
                                             self.agent_api_ip_bind_port(),
                                             self.agent_api_uri(), agent_id))
        return result
예제 #5
0
    def web_api_server_url(self, graphql=True):
        """Get pattoo server's remote URL.

        Args:
            agent_id: Agent ID

        Returns:
            result: URL.

        """
        # Create the suffix
        if bool(graphql) is True:
            suffix = '/graphql'
        else:
            suffix = '/rest/data'

        # Return
        _ip = url.url_ip_address(self.web_api_ip_address())
        result = ('http://{}:{}{}{}'.format(_ip, self.web_api_ip_bind_port(),
                                            PATTOO_API_WEB_PREFIX, suffix))
        return result