@click.option('--config_file',
default=None,
help='ns specific yaml configuration file')
@click.option('--config_file',
default=None,
help='ns specific yaml configuration file')
-def nsi_create(ctx, nst_name, nsi_name, vim_account, ssh_keys, config, config_file):
+def nsi_create(ctx, nst_name, nsi_name, vim_account, ssh_keys, config, config_file, wait):
"""creates a new Network Slice Instance (NSI)"""
try:
check_client_version(ctx.obj, ctx.command.name)
"""creates a new Network Slice Instance (NSI)"""
try:
check_client_version(ctx.obj, ctx.command.name)
with open(config_file, 'r') as cf:
config=cf.read()
ctx.obj.nsi.create(nst_name, nsi_name, config=config, ssh_keys=ssh_keys,
with open(config_file, 'r') as cf:
config=cf.read()
ctx.obj.nsi.create(nst_name, nsi_name, config=config, ssh_keys=ssh_keys,
@click.option('--config_file',
default=None,
help='nsi specific yaml configuration file')
@click.option('--config_file',
default=None,
help='nsi specific yaml configuration file')
-def nsi_create1(ctx, nst_name, nsi_name, vim_account, ssh_keys, config, config_file):
+def nsi_create1(ctx, nst_name, nsi_name, vim_account, ssh_keys, config, config_file, wait):
- nsi_create(ctx, nst_name, nsi_name, vim_account, ssh_keys, config, config_file)
+ nsi_create(ctx, nst_name, nsi_name, vim_account, ssh_keys, config, config_file, wait=wait)
@click.option('--config_file',
default=None,
help='nsi specific yaml configuration file')
@click.option('--config_file',
default=None,
help='nsi specific yaml configuration file')
-def nsi_create2(ctx, nst_name, nsi_name, vim_account, ssh_keys, config, config_file):
+def nsi_create2(ctx, nst_name, nsi_name, vim_account, ssh_keys, config, config_file, wait):
- nsi_create(ctx, nst_name, nsi_name, vim_account, ssh_keys, config, config_file)
+ nsi_create(ctx, nst_name, nsi_name, vim_account, ssh_keys, config, config_file, wait=wait)
@cli.command(name='ns-delete', short_help='deletes a NS instance')
@click.argument('name')
@click.option('--force', is_flag=True, help='forces the deletion bypassing pre-conditions')
@cli.command(name='ns-delete', short_help='deletes a NS instance')
@click.argument('name')
@click.option('--force', is_flag=True, help='forces the deletion bypassing pre-conditions')
@cli.command(name='nsi-delete', short_help='deletes a Network Slice Instance (NSI)')
@click.argument('name')
@click.option('--force', is_flag=True, help='forces the deletion bypassing pre-conditions')
@cli.command(name='nsi-delete', short_help='deletes a Network Slice Instance (NSI)')
@click.argument('name')
@click.option('--force', is_flag=True, help='forces the deletion bypassing pre-conditions')
"""deletes a Network Slice Instance (NSI)
NAME: name or ID of the Network Slice instance to be deleted
"""
"""deletes a Network Slice Instance (NSI)
NAME: name or ID of the Network Slice instance to be deleted
"""
@cli.command(name='netslice-instance-delete', short_help='deletes a Network Slice Instance (NSI)')
@click.argument('name')
@click.option('--force', is_flag=True, help='forces the deletion bypassing pre-conditions')
@click.pass_context
@cli.command(name='netslice-instance-delete', short_help='deletes a Network Slice Instance (NSI)')
@click.argument('name')
@click.option('--force', is_flag=True, help='forces the deletion bypassing pre-conditions')
@click.pass_context
"""deletes a Network Slice Instance (NSI)
NAME: name or ID of the Network Slice instance to be deleted
"""
"""deletes a Network Slice Instance (NSI)
NAME: name or ID of the Network Slice instance to be deleted
"""
help='human readable description')
@click.option('--sdn_controller', default=None, help='Name or id of the SDN controller associated to this VIM account')
@click.option('--sdn_port_mapping', default=None, help="File describing the port mapping between compute nodes' ports and switch ports")
help='human readable description')
@click.option('--sdn_controller', default=None, help='Name or id of the SDN controller associated to this VIM account')
@click.option('--sdn_port_mapping', default=None, help="File describing the port mapping between compute nodes' ports and switch ports")
- ctx.obj.vim.create(name, vim, sdn_controller, sdn_port_mapping)
+ ctx.obj.vim.create(name, vim, sdn_controller, sdn_port_mapping, wait=wait)
@click.option('--description', help='human readable description')
@click.option('--sdn_controller', default=None, help='Name or id of the SDN controller associated to this VIM account')
@click.option('--sdn_port_mapping', default=None, help="File describing the port mapping between compute nodes' ports and switch ports")
@click.option('--description', help='human readable description')
@click.option('--sdn_controller', default=None, help='Name or id of the SDN controller associated to this VIM account')
@click.option('--sdn_port_mapping', default=None, help="File describing the port mapping between compute nodes' ports and switch ports")
if account_type: vim['vim_type'] = account_type
if description: vim['description'] = description
if config: vim['config'] = config
if account_type: vim['vim_type'] = account_type
if description: vim['description'] = description
if config: vim['config'] = config
- ctx.obj.vim.update(name, vim, sdn_controller, sdn_port_mapping)
+ ctx.obj.vim.update(name, vim, sdn_controller, sdn_port_mapping, wait=wait)
@cli.command(name='vim-delete')
@click.argument('name')
@click.option('--force', is_flag=True, help='forces the deletion bypassing pre-conditions')
@cli.command(name='vim-delete')
@click.argument('name')
@click.option('--force', is_flag=True, help='forces the deletion bypassing pre-conditions')
default='no description',
help='human readable description')
@click.option('--wim_port_mapping', default=None, help="File describing the port mapping between DC edge (datacenters, switches, ports) and WAN edge (WAN service endpoint id and info)")
default='no description',
help='human readable description')
@click.option('--wim_port_mapping', default=None, help="File describing the port mapping between DC edge (datacenters, switches, ports) and WAN edge (WAN service endpoint id and info)")
"""creates a new WIM account"""
try:
check_client_version(ctx.obj, ctx.command.name)
"""creates a new WIM account"""
try:
check_client_version(ctx.obj, ctx.command.name)
wim['wim_type'] = wim_type
if description: wim['description'] = description
if config: wim['config'] = config
wim['wim_type'] = wim_type
if description: wim['description'] = description
if config: wim['config'] = config
- ctx.obj.wim.create(name, wim, wim_port_mapping)
+ ctx.obj.wim.create(name, wim, wim_port_mapping, wait=wait)
@click.option('--wim_type', help='WIM type')
@click.option('--description', help='human readable description')
@click.option('--wim_port_mapping', default=None, help="File describing the port mapping between DC edge (datacenters, switches, ports) and WAN edge (WAN service endpoint id and info)")
@click.option('--wim_type', help='WIM type')
@click.option('--description', help='human readable description')
@click.option('--wim_port_mapping', default=None, help="File describing the port mapping between DC edge (datacenters, switches, ports) and WAN edge (WAN service endpoint id and info)")
if wim_type: wim['wim_type'] = wim_type
if description: wim['description'] = description
if config: wim['config'] = config
if wim_type: wim['wim_type'] = wim_type
if description: wim['description'] = description
if config: wim['config'] = config
- ctx.obj.wim.update(name, wim, wim_port_mapping)
+ ctx.obj.wim.update(name, wim, wim_port_mapping, wait=wait)
@cli.command(name='wim-delete')
@click.argument('name')
@click.option('--force', is_flag=True, help='forces the deletion bypassing pre-conditions')
@cli.command(name='wim-delete')
@click.argument('name')
@click.option('--force', is_flag=True, help='forces the deletion bypassing pre-conditions')
"""deletes a WIM account
NAME: name or ID of the WIM account to be deleted
"""
try:
check_client_version(ctx.obj, ctx.command.name)
"""deletes a WIM account
NAME: name or ID of the WIM account to be deleted
"""
try:
check_client_version(ctx.obj, ctx.command.name)
prompt=True,
help='SDN controller type')
@click.option('--sdn_controller_version',
prompt=True,
help='SDN controller type')
@click.option('--sdn_controller_version',
@click.option('--ip_address',
prompt=True,
help='SDN controller IP address')
@click.option('--ip_address',
prompt=True,
help='SDN controller IP address')
#@click.option('--description',
# default='no description',
# help='human readable description')
#@click.option('--description',
# default='no description',
# help='human readable description')
# sdncontroller['description'] = description
try:
check_client_version(ctx.obj, ctx.command.name)
# sdncontroller['description'] = description
try:
check_client_version(ctx.obj, ctx.command.name)
@click.option('--user', help='SDN controller username')
@click.option('--password', help='SDN controller password')
#@click.option('--description', default=None, help='human readable description')
@click.option('--user', help='SDN controller username')
@click.option('--password', help='SDN controller password')
#@click.option('--description', default=None, help='human readable description')
sdncontroller['password'] = user
try:
check_client_version(ctx.obj, ctx.command.name)
sdncontroller['password'] = user
try:
check_client_version(ctx.obj, ctx.command.name)
@cli.command(name='sdnc-delete')
@click.argument('name')
@click.option('--force', is_flag=True, help='forces the deletion bypassing pre-conditions')
@cli.command(name='sdnc-delete')
@click.argument('name')
@click.option('--force', is_flag=True, help='forces the deletion bypassing pre-conditions')
"""deletes an SDN controller
NAME: name or ID of the SDN controller to be deleted
"""
try:
check_client_version(ctx.obj, ctx.command.name)
"""deletes an SDN controller
NAME: name or ID of the SDN controller to be deleted
"""
try:
check_client_version(ctx.obj, ctx.command.name)
# try:
# check_client_version(ctx.obj, ctx.command.name)
# ctx.obj.ns.delete_alarm(name)
# try:
# check_client_version(ctx.obj, ctx.command.name)
# ctx.obj.ns.delete_alarm(name)
@click.argument('ns_name')
@click.option('--ns_scale_group', prompt=True)
@click.option('--index', prompt=True)
@click.argument('ns_name')
@click.option('--ns_scale_group', prompt=True)
@click.option('--index', prompt=True)
-def ns_scale(ctx, ns_name, ns_scale_group, index):
+def ns_scale(ctx, ns_name, ns_scale_group, index, wait):
"""scales NS
NS_NAME: name of the NS instance to be scaled
"""
try:
check_client_version(ctx.obj, ctx.command.name, 'v1')
"""scales NS
NS_NAME: name of the NS instance to be scaled
"""
try:
check_client_version(ctx.obj, ctx.command.name, 'v1')
- ctx.obj.ns.scale(ns_name, ns_scale_group, index)
+ ctx.obj.ns.scale(ns_name, ns_scale_group, index, wait=wait)
@click.option('--vnf_name', default=None)
@click.option('--action_name', prompt=True)
@click.option('--params', prompt=True)
@click.option('--vnf_name', default=None)
@click.option('--action_name', prompt=True)
@click.option('--params', prompt=True)
op_data['vnf_member_index'] = vnf_name
op_data['primitive'] = action_name
op_data['primitive_params'] = yaml.load(params)
op_data['vnf_member_index'] = vnf_name
op_data['primitive'] = action_name
op_data['primitive_params'] = yaml.load(params)
- ctx.obj.ns.exec_op(ns_name, op_name='action', op_data=op_data)
+ ctx.obj.ns.exec_op(ns_name, op_name='action', op_data=op_data, wait=wait)