uncloud/ucloud/api/create_image_store.py

17 lines
382 B
Python
Raw Normal View History

import json
import os
2019-12-03 11:49:10 +00:00
from uuid import uuid4
2019-12-08 12:00:42 +00:00
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"},
}
2019-12-08 12:00:42 +00:00
etcd_client.put(os.path.join(config['api']['IMAGE_STORE_PREFIX'], uuid4().hex), json.dumps(data))