uncloud-mravi/uncloud/api/create_image_store.py

21 lines
443 B
Python
Raw Normal View History

import json
import os
2019-12-03 11:49:10 +00:00
from uuid import uuid4
from uncloud.common.shared import shared
2020-01-06 07:25:59 +00:00
from uncloud.common.settings import settings
data = {
'is_public': True,
'type': 'ceph',
'name': 'images',
'description': 'first ever public image-store',
'attributes': {'list': [], 'key': [], 'pool': 'images'},
}
shared.etcd_client.put(
os.path.join(settings['etcd']['image_store_prefix'], uuid4().hex),
json.dumps(data),
)