# glance.cmd.replicator module

class glance.cmd.replicator.ImageService(conn, auth_token)

  Bases: `object`

  add_image(image_meta, image_data)

    Upload an image.

    image_meta: image metadata as a dictionary image_data: image data as a object with a read() method

    Returns: a tuple of (http response headers, http response body)

  add_image_meta(image_meta)

    Update image metadata.

    image_meta: image metadata as a dictionary

    Returns: a tuple of (http response headers, http response body)

  get_image(image_uuid)

    Fetch image data from glance.

    image_uuid: the id of an image

    Returns:

      a http.client Response object where the body is the image.

  get_image_meta(image_uuid)

    Return the metadata for a single image.

    image_uuid: the id of an image

    Returns: image metadata as a dictionary

  get_images()

    Return a detailed list of images.

    Yields a series of images as dicts containing metadata.

glance.cmd.replicator.get_image_service()

  Get a copy of the image service.

  This is done like this to make it easier to mock out ImageService.

glance.cmd.replicator.lookup_command(command_name)

  Lookup a command.

  command_name: the command name

  Returns: a method which implements that command

glance.cmd.replicator.main()

  The main function.

glance.cmd.replicator.print_help(options, args)

  Print help specific to a command.

  options: the parsed command line options args: the command line

glance.cmd.replicator.replication_compare(options, args)

  %(prog)s compare <fromserver:port> <toserver:port>

  Compare the contents of fromserver with those of toserver.

  fromserver:port: the location of the source glance instance. toserver:port: the location of the target glance instance.

glance.cmd.replicator.replication_dump(options, args)

  %(prog)s dump <server:port> <path>

  Dump the contents of a glance instance to local disk.

  server:port: the location of the glance instance. path: a directory on disk to contain the data.

glance.cmd.replicator.replication_livecopy(options, args)

  %(prog)s livecopy <fromserver:port> <toserver:port>

  Load the contents of one glance instance into another.

  fromserver:port: the location of the source glance instance. toserver:port: the location of the target glance instance.

glance.cmd.replicator.replication_load(options, args)

  %(prog)s load <server:port> <path>

  Load the contents of a local directory into glance.

  server:port: the location of the glance instance. path: a directory on disk containing the data.

glance.cmd.replicator.replication_size(options, args)

  %(prog)s size <server:port>

  Determine the size of a glance instance if dumped to disk.

  server:port: the location of the glance instance.

this page last updated: 2026-08-19 03:42:39

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug