ucloud-api/create_image_store.py
2019-09-12 20:55:25 +05:00

24 lines
434 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),
)