uncloud/api/create_image_store.py

17 lines
393 B
Python
Executable file

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