vFW and vDNS support added to azure-plugin
[multicloud/azure.git] / azure / aria / aria-extension-cloudify / src / aria / aria / cli / commands / reset.py
1 # Licensed to the Apache Software Foundation (ASF) under one or more
2 # contributor license agreements.  See the NOTICE file distributed with
3 # this work for additional information regarding copyright ownership.
4 # The ASF licenses this file to You under the Apache License, Version 2.0
5 # (the "License"); you may not use this file except in compliance with
6 # the License.  You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 """
17 CLI ``reset`` command.
18 """
19
20 from .. import helptexts
21 from ..core import aria
22 from ..env import env
23 from ..exceptions import AriaCliError
24
25
26 @aria.command(name='reset',
27               short_help="Reset ARIA working directory")
28 @aria.options.force(help=helptexts.FORCE_RESET)
29 @aria.options.reset_config
30 @aria.pass_logger
31 @aria.options.verbose()
32 def reset(force, reset_config, logger):
33     """
34     Reset ARIA working directory
35
36     Deletes installed plugins, service templates, services, executions, and logs. The user
37     configuration will remain intact unless the `--reset_config` flag has been set as well, in
38     which case the entire ARIA working directory shall be removed.
39     """
40     if not force:
41         raise AriaCliError("To reset the ARIA's working directory, you must also provide the force"
42                            " flag ('-f'/'--force').")
43
44     env.reset(reset_config=reset_config)
45     logger.info("ARIA's working directory has been reset")