uncloud/ucloud/api/create_image_store.py
2019-12-08 13:00:42 +01:00

16 lines
382 B
Python
Executable file

import json
import os
from uuid import uuid4
from ucloud.config import etcd_client, config
data = {
"is_public": True,
"type": "ceph",
"name": "images",
"description": "first ever public image-store",
"attributes": {"list": [], "key": [], "pool": "images"},
}
etcd_client.put(os.path.join(config['api']['IMAGE_STORE_PREFIX'], uuid4().hex), json.dumps(data))