Beispiel #1
0
    def get(self, cube_name):
        """ get cube from TM1 Server

        :param cube_name:
        :return: instance of TM1py.Cube
        """
        request = "/api/v1/Cubes('{}')?$expand=Dimensions($select=Name)".format(cube_name)
        response = self._rest.GET(request)
        cube = Cube.from_json(response.text)
        return cube
Beispiel #2
0
    def get(self, cube_name: str, **kwargs) -> Cube:
        """ get cube from TM1 Server

        :param cube_name:
        :return: instance of TM1py.Cube
        """
        url = format_url("/api/v1/Cubes('{}')?$expand=Dimensions($select=Name)", cube_name)
        response = self._rest.GET(url=url, **kwargs)
        cube = Cube.from_json(response.text)
        return cube
Beispiel #3
0
    def get(self, cube_name: str, **kwargs) -> Cube:
        """ get cube from TM1 Server

        :param cube_name:
        :return: instance of TM1py.Cube
        """
        url = format_url("/api/v1/Cubes('{}')?$expand=Dimensions($select=Name)", cube_name)
        response = self._rest.GET(url=url, **kwargs)
        cube = Cube.from_json(response.text)
        # cater for potential EnableSandboxDimension=T setup
        if case_and_space_insensitive_equals(cube.dimensions[0], "Sandboxes"):
            cube.dimensions = cube.dimensions[1:]
        return cube