code: def get_layer_ids(self, rev=True):
          
          layers = [x['Id'] for x in self.d.history(self.get_id())]
          if not rev:
              layers.reverse()
          return layers
docs: Get IDs of image layers
  
          :param rev: get layers reversed
          :return: list of strings