Esempio n. 1
0
    def get_mdx_view(self, cube_name: str, view_name: str, private: bool = False, **kwargs) -> MDXView:
        """ Get an MDXView from TM1 Server

        :param cube_name: String, name of the cube
        :param view_name: String, name of the MDX view
        :param private: boolean

        :return: instance of TM1py.MDXView
        """
        view_type = 'PrivateViews' if private else 'Views'
        url = format_url("/api/v1/Cubes('{}')/{}('{}')?$expand=*", cube_name, view_type, view_name)
        response = self._rest.GET(url, **kwargs)
        mdx_view = MDXView.from_json(view_as_json=response.text)
        return mdx_view
Esempio n. 2
0
    def get_mdx_view(self, cube_name, view_name, private=True):
        """ Get an MDXView from TM1 Server

        :param cube_name: String, name of the cube
        :param view_name: String, name of the MDX view
        :param private: boolean

        :return: instance of TM1py.MDXView
        """
        view_type = 'PrivateViews' if private else 'Views'
        request = "/api/v1/Cubes('{}')/{}('{}')?$expand=*".format(cube_name, view_type, view_name)
        response = self._rest.GET(request)
        mdx_view = MDXView.from_json(view_as_json=response.text)
        return mdx_view