)
@click.option("--vca", default=None, help="VCA to be used in this VIM account")
@click.option("--creds", default=None, help="credentials file (only applycable for GCP VIM type)")
+@click.option("--prometheus_config_file", default=None, help="Prometheus configuration to get VIM data")
@click.pass_context
def vim_create(
ctx,
wait,
vca,
creds,
+ prometheus_config_file
):
"""creates a new VIM account"""
logger.debug("")
if sdn_port_mapping:
check_client_version(ctx.obj, "--sdn_port_mapping")
vim = {}
+ if prometheus_config_file:
+ with open(prometheus_config_file) as prometheus_file:
+ prometheus_config_dict = json.load(prometheus_file)
+ vim["prometheus-config"] = prometheus_config_dict
+
vim["vim-username"] = user
vim["vim-password"] = password
vim["vim-url"] = auth_url
"until the operation is completed, or timeout",
)
@click.option("--creds", default=None, help="credentials file (only applycable for GCP VIM type)")
+@click.option("--prometheus_config_file", default=None, help="Prometheus configuration to get VIM data")
@click.pass_context
def vim_update(
ctx,
sdn_port_mapping,
wait,
creds,
+ prometheus_config_file
):
"""updates a VIM account
if creds:
with open(creds, "r") as cf:
vim_config["credentials"] = yaml.safe_load(cf.read())
+ if prometheus_config_file:
+ with open(prometheus_config_file) as prometheus_file:
+ prometheus_config_dict = json.load(prometheus_file)
+ vim["prometheus-config"] = prometheus_config_dict
logger.info(f"VIM: {vim}, VIM config: {vim_config}")
ctx.obj.vim.update(name, vim, vim_config, sdn_controller, sdn_port_mapping, wait=wait)
# except ClientException as e: