This repository has been archived by the owner on Jan 14, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support adding image datastores - agent update_config API
Add an agent thrift API (AgentControl.update_config) to allow updating agent's configuration after provision has completed, and new configuration can take effect without restarting agent. Currently this API only updates image datastores. Change-Id: I91d3e37239b40ee6cefe12ea9d46c328329baee8
- Loading branch information
Showing
9 changed files
with
125 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python | ||
# Copyright (c) 2015 VMware, Inc. All Rights Reserved. | ||
import sys | ||
|
||
from eccli.format import print_request | ||
from eccli.format import print_response | ||
from eccli.optparser import default_parser | ||
from eccli.thrift import get_client | ||
from gen.agent.ttypes import UpdateConfigRequest | ||
from gen.resource.ttypes import ImageDatastore | ||
|
||
parser = default_parser(usage="eccli-config-update [options]", | ||
add_help=True) | ||
parser.add_option("-d", "--image_datastores", | ||
action="store", type="string", dest="imageds", | ||
help="list of image datastore names (e.g. ds1,ds2)") | ||
(options, args) = parser.parse_args() | ||
|
||
if not options.imageds: | ||
print >> sys.stderr, "Error: image datastores are required\n" | ||
parser.print_help() | ||
exit(1) | ||
|
||
client = get_client(options.host, "AgentControl") | ||
|
||
request = UpdateConfigRequest() | ||
request.image_datastores = set([ImageDatastore(name=ds, used_for_vms=True) for ds in options.imageds.split(',')]) | ||
|
||
print_request(request) | ||
response = client.update_config(request) | ||
print_response(response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters