Ejemplo n.º 1
0
    def __info(self):
        """Get metadata for specific cubes. Implements GET /cubes to retrieve basic metadata."""

        res = cubes.cube_info(connection=self._connection, cube_id=self._cube_id)

        _info = res.json()["cubesInfos"][0]
        self._name = _info["cubeName"]
        self._owner_id = _info["ownerId"]
        self._path = _info["path"]
        self._last_modified = _info["modificationTime"]
        self._server_mode = _info["serverMode"]
        self._size = _info["size"]
        self._status = _info["status"]
Ejemplo n.º 2
0
    def _get_info(self) -> None:
        """Get metadata for specific cubes.

        Implements GET /cubes to retrieve basic metadata.
        """
        if self._id is not None:
            res = cubes.cube_info(connection=self._connection, id=self._id)

            _info = res.json()["cubesInfos"][0]
            self.name = _info["cubeName"]  # duplicated
            self._owner_id = _info["ownerId"]
            self._path = _info["path"]
            self._server_mode = _info["serverMode"]
            self._size = _info["size"]
            self._status = _info["status"]

            # for lazy fetch properties
            self.__info_retrieved = True
Ejemplo n.º 3
0
    def __info(self):
        """Get metadata for specific cubes. Implements GET /cubes to retrieve basic metadata."""

        res = cubes.cube_info(connection=self._connection,
                              cube_id=self._cube_id)

        if not res.ok:
            self.__response_handler(
                response=res,
                msg="Error getting cube metadata information. Check Cube ID.")
            return None
        else:
            _info = res.json()["cubesInfos"][0]
            self._name = _info["cubeName"]
            self._owner_id = _info["ownerId"]
            self._path = _info["path"]
            self._last_modified = _info["modificationTime"]
            self._server_mode = _info["serverMode"]
            self._size = _info["size"]
            self._status = _info["status"]
Ejemplo n.º 4
0
 def generate_cube_info(self):
     res = cubes.cube_info(connection=self.connection,
                           cube_id=self.cube_id)
     return res.json()