示例#1
0
    def __init__(self):
        super(NodeAction, self).__init__()
        self.args = [
            Args.get_env_arg(),
            group(
                Args.get_list_arg("List all nodes."),
                Args.get_set_arg("Set role for specific node."),
                Args.get_delete_arg("Delete specific node from environment."),
                Args.get_network_arg("Node network configuration."),
                Args.get_disk_arg("Node disk configuration."),
                Args.get_deploy_arg("Deploy specific nodes."),
                Args.get_provision_arg("Provision specific nodes.")),
            group(
                Args.get_default_arg("Get default configuration of some node"),
                Args.get_download_arg(
                    "Download configuration of specific node"),
                Args.get_upload_arg("Upload configuration to specific node")),
            Args.get_dir_arg(
                "Select directory to which download node attributes"),
            Args.get_node_arg("Node id."),
            Args.get_force_arg("Bypassing parameter validation."),
            Args.get_all_arg("Select all nodes."),
            Args.get_role_arg("Role to assign for node.")
        ]

        self.flag_func_map = (("set", self.set), ("delete", self.delete),
                              ("network", self.attributes),
                              ("disk", self.attributes), ("deploy",
                                                          self.start),
                              ("provision", self.start), (None, self.list))
示例#2
0
    def __init__(self):
        super(OpenstackConfigAction, self).__init__()
        self.args = (
            Args.get_env_arg(),
            Args.get_file_arg("Openstack configuration file"),
            Args.get_node_arg("Node IDs list"),
            Args.get_single_role_arg("Node role"),
            Args.get_config_id_arg("Openstack config ID"),
            Args.get_deleted_arg("Get deleted configurations"),
            Args.get_force_arg("Force configuration update"),
            group(
                Args.get_list_arg("List openstack configurations"),
                Args.get_download_arg(
                    "Download current openstack configuration"),
                Args.get_upload_arg("Upload new openstack configuration"),
                Args.get_delete_arg("Delete openstack configuration"),
                Args.get_execute_arg("Apply openstack configuration"),
                required=True,
            )
        )

        self.flag_func_map = (
            ('list', self.list),
            ('download', self.download),
            ('upload', self.upload),
            ('delete', self.delete),
            ('execute', self.execute)
        )
示例#3
0
文件: fact.py 项目: Axam/fuel-web
 def __init__(self):
     super(FactAction, self).__init__()
     self.args = [
         Args.get_env_arg(required=True),
         group(
             Args.get_delete_arg(
                 "Delete current {0} data.".format(self.action_name)
             ),
             Args.get_download_arg(
                 "Download current {0} data.".format(self.action_name)
             ),
             Args.get_upload_arg(
                 "Upload current {0} data.".format(self.action_name)
             ),
             Args.get_default_arg(
                 "Download default {0} data.".format(self.action_name)
             ),
             required=True
         ),
         Args.get_dir_arg(
             "Directory with {0} data.".format(self.action_name)
         ),
         Args.get_node_arg(
             "Node ids."
         ),
     ]
     self.flag_func_map = (
         ("default", self.default),
         ("upload", self.upload),
         ("delete", self.delete),
         ("download", self.download)
     )
示例#4
0
    def __init__(self):
        super(NodeAction, self).__init__()
        self.args = [
            Args.get_env_arg(),
            group(
                Args.get_list_arg("List all nodes."),
                Args.get_set_arg("Set role for specific node."),
                Args.get_delete_arg("Delete specific node from environment."),
                Args.get_attributes_arg("Node attributes."),
                Args.get_network_arg("Node network configuration."),
                Args.get_disk_arg("Node disk configuration."),
                Args.get_deploy_arg("Deploy specific nodes."),
                Args.get_hostname_arg("Set node hostname."),
                Args.get_node_name_arg("Set node name."),
                Args.get_delete_from_db_arg(
                    "Delete specific nodes only from fuel db.\n"
                    "User should still delete node from cobbler"),
                Args.get_provision_arg("Provision specific nodes."),
            ),
            group(
                Args.get_default_arg(
                    "Get default configuration of some node"),
                Args.get_download_arg(
                    "Download configuration of specific node"),
                Args.get_upload_arg(
                    "Upload configuration to specific node")
            ),
            Args.get_dir_arg(
                "Select directory to which download node attributes"),
            Args.get_node_arg("Node id."),
            Args.get_force_arg("Bypassing parameter validation."),
            Args.get_all_arg("Select all nodes."),
            Args.get_role_arg("Role to assign for node."),
            group(
                Args.get_skip_tasks(),
                Args.get_tasks()
            ),
            Args.get_graph_endpoint(),
            Args.get_graph_startpoint(),
        ]

        self.flag_func_map = (
            ("set", self.set),
            ("delete", self.delete),
            ("network", self.attributes),
            ("disk", self.attributes),
            ("deploy", self.start),
            ("provision", self.start),
            ("hostname", self.set_hostname),
            ("name", self.set_name),
            ("delete-from-db", self.delete_from_db),
            ("tasks", self.execute_tasks),
            ("skip", self.execute_tasks),
            ("end", self.execute_tasks),
            ("start", self.execute_tasks),
            ("attributes", self.node_attributes),
            (None, self.list)
        )
示例#5
0
    def __init__(self):
        super(NodeAction, self).__init__()
        self.args = [
            Args.get_env_arg(),
            group(
                Args.get_list_arg("List all nodes."),
                Args.get_set_arg("Set role for specific node."),
                Args.get_delete_arg("Delete specific node from environment."),
                Args.get_network_arg("Node network configuration."),
                Args.get_disk_arg("Node disk configuration."),
                Args.get_deploy_arg("Deploy specific nodes."),
                Args.get_hostname_arg("Set node hostname."),
                Args.get_node_name_arg("Set node name."),
                Args.get_delete_from_db_arg(
                    "Delete specific nodes only from fuel db.\n"
                    "User should still delete node from cobbler"),
                Args.get_provision_arg("Provision specific nodes."),
            ),
            group(
                Args.get_default_arg(
                    "Get default configuration of some node"),
                Args.get_download_arg(
                    "Download configuration of specific node"),
                Args.get_upload_arg(
                    "Upload configuration to specific node")
            ),
            Args.get_dir_arg(
                "Select directory to which download node attributes"),
            Args.get_node_arg("Node id."),
            Args.get_force_arg("Bypassing parameter validation."),
            Args.get_all_arg("Select all nodes."),
            Args.get_role_arg("Role to assign for node."),
            group(
                Args.get_skip_tasks(),
                Args.get_tasks()
            ),
            Args.get_graph_endpoint(),
            Args.get_graph_startpoint(),
        ]

        self.flag_func_map = (
            ("set", self.set),
            ("delete", self.delete),
            ("network", self.attributes),
            ("disk", self.attributes),
            ("deploy", self.start),
            ("provision", self.start),
            ("hostname", self.set_hostname),
            ("name", self.set_name),
            ("delete-from-db", self.delete_from_db),
            ("tasks", self.execute_tasks),
            ("skip", self.execute_tasks),
            ("end", self.execute_tasks),
            ("start", self.execute_tasks),
            (None, self.list)
        )
示例#6
0
 def __init__(self):
     super(NodeGroupAction, self).__init__()
     self.args = (
         Args.get_env_arg(), Args.get_list_arg("List all node groups."),
         Args.get_name_arg("Name of new node group."),
         Args.get_group_arg("ID of node group."),
         Args.get_node_arg("List of nodes to assign specified group to."),
         group(
             Args.get_create_arg(
                 "Create a new node group in the specified environment."),
             Args.get_assign_arg("Download current network configuration."),
             Args.get_delete_arg("Verify current network configuration."),
         ))
     self.flag_func_map = (("create", self.create), ("delete", self.delete),
                           ("assign", self.assign), (None, self.list))
示例#7
0
 def __init__(self):
     super(FactAction, self).__init__()
     self.args = [
         Args.get_env_arg(required=True),
         group(Args.get_delete_arg("Delete current {0} data.".format(
             self.action_name)),
               Args.get_download_arg("Download current {0} data.".format(
                   self.action_name)),
               Args.get_upload_arg("Upload current {0} data.".format(
                   self.action_name)),
               Args.get_default_arg("Download default {0} data.".format(
                   self.action_name)),
               required=True),
         Args.get_dir_arg("Directory with {0} data.".format(
             self.action_name)),
         Args.get_node_arg("Node ids."),
     ]
     self.flag_func_map = (("default", self.default),
                           ("upload", self.upload), ("delete", self.delete),
                           ("download", self.download))
示例#8
0
文件: node.py 项目: sk4lf/fuel-web
    def __init__(self):
        super(NodeAction, self).__init__()
        self.args = [
            Args.get_env_arg(),
            group(
                Args.get_list_arg("List all nodes."),
                Args.get_set_arg("Set role for specific node."),
                Args.get_delete_arg("Delete specific node from environment."),
                Args.get_network_arg("Node network configuration."),
                Args.get_disk_arg("Node disk configuration."),
                Args.get_deploy_arg("Deploy specific nodes."),
                Args.get_provision_arg("Provision specific nodes.")
            ),
            group(
                Args.get_default_arg(
                    "Get default configuration of some node"),
                Args.get_download_arg(
                    "Download configuration of specific node"),
                Args.get_upload_arg(
                    "Upload configuration to specific node")
            ),
            Args.get_dir_arg(
                "Select directory to which download node attributes"),
            Args.get_node_arg("Node id."),
            Args.get_force_arg("Bypassing parameter validation."),
            Args.get_all_arg("Select all nodes."),
            Args.get_role_arg("Role to assign for node.")
        ]

        self.flag_func_map = (
            ("set", self.set),
            ("delete", self.delete),
            ("network", self.attributes),
            ("disk", self.attributes),
            ("deploy", self.start),
            ("provision", self.start),
            (None, self.list)
        )
示例#9
0
 def __init__(self):
     super(NodeGroupAction, self).__init__()
     self.args = (
         Args.get_env_arg(),
         Args.get_list_arg("List all node groups."),
         Args.get_name_arg("Name of new node group."),
         Args.get_group_arg("ID of node group."),
         Args.get_node_arg("List of nodes to assign specified group to."),
         group(
             Args.get_create_arg(
                 "Create a new node group in the specified environment."
             ),
             Args.get_assign_arg(
                 "Assign nodes to the specified node group."),
             Args.get_delete_arg(
                 "Delete specified node groups."),
         )
     )
     self.flag_func_map = (
         ("create", self.create),
         ("delete", self.delete),
         ("assign", self.assign),
         (None, self.list)
     )