def __repr__(self):
        return "<NamedRequirements({}{})>".format(
            self.name,
            ", filename='{}'".format(self.filename.name) if self.filename
            else "")
def create_snapshot_metadata(self, snapshot_id, metadata):
        """Create metadata for the snapshot."""
        put_body = json.dumps({'metadata': metadata})
        url = "snapshots/%s/metadata" % str(snapshot_id)
        resp, body = self.post(url, put_body)
        body = json.loads(body)
        return resp, body['metadata']