def delete_monitor(ctx, monitor, confirm):
if not confirm:
confirm = click.prompt('''
! WARNING: Destructive Action
! This command will destroy the monitor: {monitor}
! To proceed, type "{monitor}" or
re-run this command with --confirm={monitor}
'''.format(monitor=monitor), prompt_suffix='> ')
if confirm.strip() != monitor:
print('abort')
sys.exit(1)
with Spinner('Deleting monitor {}: '.format(monitor), remove_message=False):
newrelic.delete_monitor(ctx.obj['ACCOUNT'], monitor)
print(click.style(u'OK', fg='green', bold=True))
评论列表
文章目录