Exemplo n.º 1
0
 def __init__(self):
     super(EnvironmentAction, self).__init__()
     self.args = [
         Args.get_env_arg(),
         group(
             Args.get_list_arg(
                 "List all available environments"
             ),
             Args.get_set_arg(
                 "Set environment parameters (e.g name, deployment mode)"
             ),
             Args.get_delete_arg(
                 "Delete environment with specific env or name"
             ),
             Args.get_create_arg(
                 "Create a new environment with "
                 "specific release id and name"
             ),
             Args.get_update_arg(
                 "Update OS to specified release id for given env"
             )
         ),
         Args.get_release_arg(
             "Release id"
         ),
         Args.get_force_arg(
             "Do it anyway"
         ),
         Args.get_name_arg(
             "Environment name"
         ),
         Args.get_mode_arg(
             "Set deployment mode for specific environment"
         ),
         Args.get_net_arg(
             "Set network mode for specific environment"
         ),
         Args.get_nst_arg(
             "Set network segment type"
         ),
         Args.get_deployment_tasks_arg("Environment tasks configuration"),
         Args.get_attributes_arg("Environment attributes"),
         group(
             Args.get_download_arg(
                 "Download configuration of specific cluster"),
             Args.get_upload_arg(
                 "Upload configuration to specific cluster")
         ),
         Args.get_dir_arg(
             "Select directory to which download release attributes"),
     ]
     self.flag_func_map = (
         ("deployment-tasks", self.deployment_tasks),
         ("attributes", self.attributes),
         ("create", self.create),
         ("set", self.set),
         ("delete", self.delete),
         ("update", self.update),
         (None, self.list)
     )
Exemplo n.º 2
0
 def __init__(self):
     super(EnvironmentAction, self).__init__()
     self.args = [
         Args.get_env_arg(),
         group(
             Args.get_list_arg("List all available environments"),
             Args.get_set_arg("Set environment parameters e.g., its name"),
             Args.get_delete_arg(
                 "Delete environment with a specific id or name"),
             Args.get_create_arg("Create a new environment with "
                                 "specific release id and name"),
         ),
         Args.get_release_arg("Release id"),
         Args.get_force_arg("Do it anyway"),
         Args.get_name_arg("Environment name"),
         Args.get_nst_arg("Set network segment type"),
         Args.get_deployment_tasks_arg("Environment tasks configuration"),
         Args.get_attributes_arg("Environment attributes"),
         group(
             Args.get_download_arg(
                 "Download configuration of specific cluster"),
             Args.get_upload_arg(
                 "Upload configuration to specific cluster")),
         Args.get_dir_arg(
             "Select directory to which download release attributes"),
     ]
     self.flag_func_map = (("deployment-tasks", self.deployment_tasks),
                           ("attributes", self.attributes),
                           ("create", self.create), ("set", self.set),
                           ("delete", self.delete), (None, self.list))
Exemplo n.º 3
0
 def __init__(self):
     super(VIPAction, self).__init__()
     # NOTE(aroma): 'serializer' attribute for action objects is
     # overwritten while building parser object
     # (fuelclient.cli.parser.Parser)
     self.file_serializer = serializers.FileFormatBasedSerializer()
     self.args = (
         Args.get_env_arg(required=True),
         Args.get_create_arg("Create VIP"),
         Args.get_upload_file_arg("Upload changed VIP configuration "
                                  "from given file"),
         Args.get_download_arg("Download VIP configuration"),
         Args.get_file_arg("Target file with vip data."),
         Args.get_ip_id_arg("IP address entity identifier"),
         Args.get_ip_address_arg("IP address string"),
         Args.get_network_id_arg("Network identifier"),
         Args.get_network_role_arg("Network role string"),
         Args.get_vip_name_arg("VIP name string"),
         Args.get_vip_namespace_arg("VIP namespace string"),
     )
     self.flag_func_map = (
         ("create", self.create),
         ("upload", self.upload),
         ("download", self.download)
     )
Exemplo n.º 4
0
 def __init__(self):
     super(EnvironmentAction, self).__init__()
     self.args = [
         Args.get_env_arg(),
         group(
             Args.get_list_arg("List all available environments."),
             Args.get_set_arg(
                 "Set environment parameters (e.g name, deployment mode)"),
             Args.get_delete_arg(
                 "Delete environment with specific env or name"),
             Args.get_create_arg("Create a new environment with "
                                 "specific release id and name."),
             Args.get_update_arg(
                 "Update OS to specified release id for given env.")),
         Args.get_release_arg("Release id"),
         Args.get_name_arg("environment name"),
         Args.get_mode_arg("Set deployment mode for specific environment."),
         Args.get_net_arg("Set network mode for specific environment."),
         Args.get_nst_arg("Set network segment type"),
         Args.get_deployment_tasks_arg("Environment tasks configuration."),
         group(
             Args.get_download_arg(
                 "Download configuration of specific cluster"),
             Args.get_upload_arg(
                 "Upload configuration to specific cluster")),
         Args.get_dir_arg(
             "Select directory to which download release attributes"),
     ]
     self.flag_func_map = (("deployment-tasks",
                            self.deployment_tasks), ("create", self.create),
                           ("set", self.set), ("delete", self.delete),
                           ("update", self.update), (None, self.list))
Exemplo n.º 5
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))
Exemplo n.º 6
0
 def __init__(self):
     super(EnvironmentAction, self).__init__()
     self.args = [
         Args.get_env_arg(),
         group(
             Args.get_list_arg(
                 "List all available environments."
             ),
             Args.get_set_arg(
                 "Set environment parameters (e.g name, deployment mode)"
             ),
             Args.get_delete_arg(
                 "Delete environment with specific env or name"
             ),
             Args.get_create_arg(
                 "Create a new environment with "
                 "specific release id and name."
             ),
             Args.get_update_arg(
                 "Update OS to specified release id for given env."
             )
         ),
         Args.get_release_arg(
             "Release id"
         ),
         Args.get_name_arg(
             "environment name"
         ),
         Args.get_mode_arg(
             "Set deployment mode for specific environment."
         ),
         Args.get_net_arg(
             "Set network mode for specific environment."
         ),
         Args.get_nst_arg(
             "Set network segment type"
         )
     ]
     self.flag_func_map = (
         ("create", self.create),
         ("set", self.set),
         ("delete", self.delete),
         ("update", self.update),
         (None, self.list)
     )
Exemplo n.º 7
0
 def __init__(self):
     # NOTE(dshulyak) this serializers are really messed up
     # it gets overwritten in several places
     self.file_serializer = FileFormatBasedSerializer()
     self.args = [
         Args.get_list_arg("List all roles"),
         Args.get_release_arg("Release id"),
         Args.get_str_arg("role", help="Name of the role"),
         Args.get_file_arg("File with role description"),
         group(Args.get_create_arg("Create role from file"),
               Args.get_boolean_arg("update", help="Update role from file"),
               Args.get_delete_arg("Delete role from fuel"))
     ]
     self.flag_func_map = (
         ("delete", self.delete),
         ("create", self.create),
         ("update", self.update),
         ("role", self.item),
         (None, self.list),
     )
Exemplo n.º 8
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)
     )
Exemplo n.º 9
0
    def __init__(self):
        # NOTE(dshulyak) this serializers are really messed up
        # it gets overwritten in several places
        self.file_serializer = FileFormatBasedSerializer()
        self.args = [
            Args.get_list_arg("List all roles"),

            Args.get_release_arg("Release id"),
            Args.get_str_arg("role", help="Name of the role"),
            Args.get_file_arg("File with role description"),

            group(
                Args.get_create_arg("Create role from file"),
                Args.get_boolean_arg("update", help="Update role from file"),
                Args.get_delete_arg("Delete role from fuel")
            )
        ]
        self.flag_func_map = (
            ("delete", self.delete),
            ("create", self.create),
            ("update", self.update),
            ("role", self.item),
            (None, self.list),
        )