glance.cmd.replicator module¶
- class glance.cmd.replicator.ImageService(conn, auth_token)[source]¶
Bases:
object
- add_image(image_meta, image_data)[source]¶
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)[source]¶
Update image metadata.
image_meta: image metadata as a dictionary
Returns: a tuple of (http response headers, http response body)
- get_image(image_uuid)[source]¶
Fetch image data from glance.
image_uuid: the id of an image
- Returns:
a http.client Response object where the body is the image.
- glance.cmd.replicator.get_image_service()[source]¶
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)[source]¶
Lookup a command.
command_name: the command name
Returns: a method which implements that command
- glance.cmd.replicator.print_help(options, args)[source]¶
Print help specific to a command.
options: the parsed command line options args: the command line
- glance.cmd.replicator.replication_compare(options, args)[source]¶
%(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)[source]¶
%(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)[source]¶
%(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.