ucloud-api/create_image_store.py

25 lines
434 B
Python
Raw Normal View History

2019-08-01 15:04:40 +05:00
import json
2019-09-12 20:55:25 +05:00
import os
2019-08-01 15:04:40 +05:00
from uuid import uuid4
2019-09-12 20:55:25 +05:00
from config import etcd_client as client
from config import IMAGE_STORE_PREFIX
2019-08-01 15:04:40 +05:00
data = {
"is_public": True,
"type": "ceph",
"name": "images",
"description": "first ever public image-store",
"attributes": {
"list": [],
"key": [],
"pool": "images",
}
}
client.put(
2019-09-12 20:55:25 +05:00
os.path.join(IMAGE_STORE_PREFIX, uuid4().hex),
2019-08-01 15:04:40 +05:00
json.dumps(data),
)