Esempio n. 1
0
 def make_backup(self, storage, name, backup_date, incremental=False):
     if incremental is True:
         incremental_blob = self.make_blob(
             "localhost/{}/meta/incremental".format(name),
             backup_date.timestamp())
     else:
         incremental_blob = None
     manifest_blob = self.make_blob(
         "localhost/{}/meta/manifest.json".format(name),
         backup_date.timestamp())
     tokenmap_blob = self.make_blob(
         "localhost/{}/meta/tokenmap.json".format(name),
         backup_date.timestamp())
     schema_blob = self.make_blob(
         "localhost/{}/meta/schema.cql".format(name),
         backup_date.timestamp())
     manifest_blob = self.make_blob(
         "localhost/{}/meta/manifest.json".format(name),
         backup_date.timestamp())
     return NodeBackup(storage=storage,
                       fqdn="localhost",
                       name=str(name),
                       incremental_blob=incremental_blob,
                       manifest_blob=manifest_blob,
                       tokenmap_blob=tokenmap_blob,
                       schema_blob=schema_blob,
                       started_timestamp=backup_date.timestamp(),
                       finished_timestamp=backup_date.timestamp())
Esempio n. 2
0
 def make_node_backup(self,
                      storage,
                      name,
                      backup_date,
                      differential=False,
                      fqdn="localhost"):
     if differential is True:
         differential_blob = self.make_blob(
             "localhost/{}/meta/differential".format(name),
             backup_date.timestamp())
     else:
         differential_blob = None
     tokenmap_blob = self.make_blob(
         "localhost/{}/meta/tokenmap.json".format(name),
         backup_date.timestamp())
     schema_blob = self.make_blob(
         "localhost/{}/meta/schema.cql".format(name),
         backup_date.timestamp())
     manifest_blob = self.make_blob(
         "localhost/{}/meta/manifest.json".format(name),
         backup_date.timestamp())
     return NodeBackup(storage=storage,
                       fqdn=fqdn,
                       name=str(name),
                       differential_blob=differential_blob,
                       manifest_blob=manifest_blob,
                       tokenmap_blob=tokenmap_blob,
                       schema_blob=schema_blob,
                       started_timestamp=backup_date.timestamp(),
                       finished_timestamp=backup_date.timestamp())