How to use cmd glance md-object-create

Asked by Wenjun Wang

i can't give a right argument of schema,i made a file called schema.json with the json of these:
  "name": "Image",
  "description": "Image description",
  "required": [],
  "properties": {
then excute: glance md-object-create --name test --schema schema.json test_namespace
responsed with "Schema is not a valid JSON object."
it's must my fault,but what's right?,thanks to help.

Question information

English Edit question
Glance Edit question
No assignee Edit question
Solved by:
Nikhil Komawar
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Nikhil Komawar (nikhil-komawar) said :


Revision history for this message
Travis Tripp (travis-tripp) said :

It is possible that you hit a bug which has been fixed, but may not be released yet:

Besides that, the Glance API docs for metadefs contain many excellent examples:

For example, click on POST --> Detail and you'll see several examples. The example provided in the link for POST namespace can be easily expanded with other optional data(properties, etc).

There are many concrete complete namespace examples using any json file in

Right now much of the content out of the box is OpenStack specific content. However, it definitely is intended for the broad usage that you mentioned so that you can create your own content specific to you cloud. For example, you may create some custom metadata definitions that you use to help manage associations between host aggregates, flavors, and images (when used with the host aggregates filter).

Have you had a chance to read this, yet? If not, I think it’ll answer a lot of questions.

My typical workflow is to basically create a json namespace file. In the file put in properties using simple json schema syntax (no nested properties). Then upload via CLI or horizon.

If you are on the glance host, you can also use the upgrade commands in glance-manage in conjunction with the json:
 - glance-manage db load_metadefs [path] [merge] [prefer_new]

Please note that glance-manage expects to connect directly into the DB and is typically used at deployment time.

Otherwise, you can use the CLI or direclty use the API. As FYI, here is the API overview:

Here are a number of links to different APIs:


Revision history for this message
Best Nikhil Komawar (nikhil-komawar) said :

nikhil komawar suggests this article as an answer to your question:
FAQ #2777: “How to use cmd glance md-object-create”.

Revision history for this message
Wenjun Wang (wangwenjun) said :

very nice.thank you very much.