Esempio n. 1
0
    def modify_domain_cifs_server(self, name, mover_id, is_vdm=False,
                                  join_domain=None, username=None,
                                  password=None):
        body = self.ModifyW2KCifsServer(
            self.DomainSetting(
                join_domain=converter.boolean_to_str(join_domain),
                username=username, password=password),
            mover=mover_id,
            moverIdIsVdm=converter.boolean_to_str(is_vdm),
            name=name)

        return self.task_package(body)
Esempio n. 2
0
    def _create_domain_cifs_server(self,
                                   name,
                                   domain,
                                   mover_id,
                                   is_vdm=False,
                                   ip_list=None,
                                   alias_name=None,
                                   local_admin_password=None):
        if domain.comp_name is None:
            domain.comp_name = name
        alias_li = self._get_alias_name_li(alias_name, name)

        attributes = {
            'compName': domain.comp_name,
            'domain': domain.name,
            'name': name
        }
        if ip_list is not None:
            attributes['interfaces'] = ip_list
        if local_admin_password is not None:
            attributes['localAdminPassword'] = local_admin_password

        elements = [
            self.MoverOrVdm(mover=str(mover_id),
                            moverIdIsVdm=converter.boolean_to_str(is_vdm)),
            self.Aliases(*alias_li)
        ]
        if domain.user is not None:
            elements.append(
                self.JoinDomain(userName=domain.user,
                                password=domain.password))

        body = self.NewW2KCifsServer(*elements, **attributes)
        return self.task_package(body)
Esempio n. 3
0
 def construct(*sub_nodes, **attrib):
     return XNode(
         name, *sub_nodes, **{
             k: converter.boolean_to_str(v)
             if isinstance(v, bool) else str(v)
             for k, v in attrib.items() if v is not None
         })
Esempio n. 4
0
    def _create_standalone_cifs_server(self,
                                       name,
                                       workgroup,
                                       mover_id,
                                       is_vdm=False,
                                       ip_list=None,
                                       alias_name=None,
                                       local_admin_password=None):
        if local_admin_password is None:
            raise ValueError('local admin password is required for '
                             'stand alone CIFS server.')

        alias_li = self._get_alias_name_li(alias_name, name)

        attributes = {'name': name, 'workgroup': workgroup}
        if ip_list is not None:
            attributes['interfaces'] = ip_list
        if local_admin_password is not None:
            attributes['localAdminPassword'] = local_admin_password

        elements = [
            self.MoverOrVdm(mover=str(mover_id),
                            moverIdIsVdm=converter.boolean_to_str(is_vdm)),
            self.Aliases(*alias_li)
        ]

        body = self.NewStandaloneCifsServer(*elements, **attributes)
        return self.task_package(body)
Esempio n. 5
0
    def _create_standalone_cifs_server(self, name, workgroup, mover_id,
                                       is_vdm=False, ip_list=None,
                                       alias_name=None,
                                       local_admin_password=None):
        if local_admin_password is None:
            raise ValueError('local admin password is required for '
                             'stand alone CIFS server.')

        alias_li = self._get_alias_name_li(alias_name, name)

        attributes = {'name': name,
                      'workgroup': workgroup}
        if ip_list is not None:
            attributes['interfaces'] = ip_list
        if local_admin_password is not None:
            attributes['localAdminPassword'] = local_admin_password

        elements = [self.MoverOrVdm(
            mover=str(mover_id),
            moverIdIsVdm=converter.boolean_to_str(is_vdm)
        ),
            self.Aliases(*alias_li)]

        body = self.NewStandaloneCifsServer(*elements, **attributes)
        return self.task_package(body)
Esempio n. 6
0
 def create_fs_mp(self, path, fs_id, mover_id, is_vdm=False):
     body = self.NewMount(
         self.MoverOrVdm(mover=str(mover_id),
                         moverIdIsVdm=converter.boolean_to_str(is_vdm)),
         fileSystem=str(fs_id),
         path=path)
     return self.task_package(body)
Esempio n. 7
0
 def remove_cifs_share(self, name, mover_id, server_names, is_vdm=False):
     body = self.DeleteCifsShare(
         self.list_element('CifsServers', server_names),
         mover=str(mover_id),
         moverIdIsVdm=converter.boolean_to_str(is_vdm),
         name=name)
     return self.task_package(body)
Esempio n. 8
0
 def remove_cifs_share(self, name, mover_id, server_names, is_vdm=False):
     body = self.DeleteCifsShare(
         self.list_element('CifsServers', server_names),
         mover=str(mover_id),
         moverIdIsVdm=converter.boolean_to_str(is_vdm),
         name=name)
     return self.task_package(body)
Esempio n. 9
0
    def _create_domain_cifs_server(self, name, domain, mover_id, is_vdm=False,
                                   ip_list=None, alias_name=None,
                                   local_admin_password=None):
        if domain.comp_name is None:
            domain.comp_name = name
        alias_li = self._get_alias_name_li(alias_name, name)

        attributes = {'compName': domain.comp_name,
                      'domain': domain.name,
                      'name': name}
        if ip_list is not None:
            attributes['interfaces'] = ip_list
        if local_admin_password is not None:
            attributes['localAdminPassword'] = local_admin_password

        elements = [self.MoverOrVdm(
            mover=str(mover_id),
            moverIdIsVdm=converter.boolean_to_str(is_vdm)
        ),
            self.Aliases(*alias_li)]
        if domain.user is not None:
            elements.append(self.JoinDomain(userName=domain.user,
                                            password=domain.password))

        body = self.NewW2KCifsServer(*elements, **attributes)
        return self.task_package(body)
Esempio n. 10
0
    def modify_domain_cifs_server(self,
                                  name,
                                  mover_id,
                                  is_vdm=False,
                                  join_domain=None,
                                  username=None,
                                  password=None):
        body = self.ModifyW2KCifsServer(
            self.DomainSetting(
                join_domain=converter.boolean_to_str(join_domain),
                username=username,
                password=password),
            mover=mover_id,
            moverIdIsVdm=converter.boolean_to_str(is_vdm),
            name=name)

        return self.task_package(body)
Esempio n. 11
0
 def create_fs_mp(self, path, fs_id, mover_id, is_vdm=False):
     body = self.NewMount(
         self.MoverOrVdm(
             mover=str(mover_id),
             moverIdIsVdm=converter.boolean_to_str(is_vdm)),
         fileSystem=str(fs_id),
         path=path)
     return self.task_package(body)
Esempio n. 12
0
 def create_nfs_export(self, mover_id, path, ro=False, host_config=None):
     if host_config is not None:
         param = host_config.get_xml_node()
     else:
         param = []
     body = self.NewNfsExport(mover=str(mover_id), path=path,
                              readOnly=converter.boolean_to_str(ro),
                              *param)
     return self.task_package(body)
Esempio n. 13
0
 def create_cifs_share(self, name, server_name, mover_id,
                       is_vdm=False, path=None):
     if path is None:
         path = r'\{}'.format(name)
     mover = self.MoverOrVdm(mover=str(mover_id),
                             moverIdIsVdm=converter.boolean_to_str(is_vdm))
     body = self.NewCifsShare(mover, self.CifsServers(self.li(server_name)),
                              name=name, path=path)
     return self.task_package(body)
Esempio n. 14
0
 def modify_nfs_export(self, mover_id, path, ro=None, host_config=None):
     if host_config is not None:
         param = host_config.get_xml_node()
     else:
         param = []
     kwargs = {'mover': str(mover_id), 'path': path}
     if ro is not None:
         kwargs['readOnly'] = converter.boolean_to_str(ro)
     body = self.ModifyNfsExport(*param, **kwargs)
     return self.task_package(body)
Esempio n. 15
0
 def create_nfs_export(self, mover_id, path, ro=False, host_config=None):
     if host_config is not None:
         param = host_config.get_xml_node()
     else:
         param = []
     body = self.NewNfsExport(mover=str(mover_id),
                              path=path,
                              readOnly=converter.boolean_to_str(ro),
                              *param)
     return self.task_package(body)
Esempio n. 16
0
 def modify_nfs_export(self, mover_id, path, ro=None, host_config=None):
     if host_config is not None:
         param = host_config.get_xml_node()
     else:
         param = []
     kwargs = {'mover': str(mover_id), 'path': path}
     if ro is not None:
         kwargs['readOnly'] = converter.boolean_to_str(ro)
     body = self.ModifyNfsExport(*param, **kwargs)
     return self.task_package(body)
Esempio n. 17
0
 def get_cifs_server(self, name=None, mover_id=None, is_vdm=False):
     params = []
     if mover_id is not None:
         params.append(
             self.MoverOrVdm(mover=str(mover_id),
                             moverIdIsVdm=converter.boolean_to_str(is_vdm)))
     kwargs = {}
     if name is not None:
         kwargs['name'] = name.upper()
     body = self.CifsServerQueryParams(*params, **kwargs)
     return self.query_package(body)
Esempio n. 18
0
 def get_fs_mp(self, path=None, mover_id=None, is_vdm=False):
     param = []
     if mover_id is not None:
         param.append(self.MoverOrVdm(
             mover=str(mover_id),
             moverIdIsVdm=converter.boolean_to_str(is_vdm)))
     kwargs = {}
     if path is not None:
         kwargs['path'] = path
     body = self.MountQueryParams(*param, **kwargs)
     return self.query_package(body)
Esempio n. 19
0
 def get_cifs_server(self, name=None, mover_id=None, is_vdm=False):
     params = []
     if mover_id is not None:
         params.append(
             self.MoverOrVdm(mover=str(mover_id),
                             moverIdIsVdm=converter.boolean_to_str(is_vdm)))
     kwargs = {}
     if name is not None:
         kwargs['name'] = name.upper()
     body = self.CifsServerQueryParams(*params, **kwargs)
     return self.query_package(body)
Esempio n. 20
0
 def get_fs_mp(self, path=None, mover_id=None, is_vdm=False):
     param = []
     if mover_id is not None:
         param.append(
             self.MoverOrVdm(mover=str(mover_id),
                             moverIdIsVdm=converter.boolean_to_str(is_vdm)))
     kwargs = {}
     if path is not None:
         kwargs['path'] = path
     body = self.MountQueryParams(*param, **kwargs)
     return self.query_package(body)
Esempio n. 21
0
 def get_cifs_share(self, server_name=None, share_name=None, mover_id=None,
                    is_vdm=False):
     kwargs = {}
     if server_name is not None:
         kwargs['cifsServer'] = server_name
     if share_name is not None:
         kwargs['name'] = share_name
     argv = []
     if mover_id is not None:
         argv.append(self.MoverOrVdm(mover=str(mover_id),
                                     moverIdIsVdm=converter.boolean_to_str(
                                         is_vdm)))
     body = self.CifsShareQueryParams(*argv, **kwargs)
     return self.query_package(body)
Esempio n. 22
0
 def create_cifs_share(self,
                       name,
                       server_name,
                       mover_id,
                       is_vdm=False,
                       path=None):
     if path is None:
         path = r'\{}'.format(name)
     mover = self.MoverOrVdm(mover=str(mover_id),
                             moverIdIsVdm=converter.boolean_to_str(is_vdm))
     body = self.NewCifsShare(mover,
                              self.CifsServers(self.li(server_name)),
                              name=name,
                              path=path)
     return self.task_package(body)
Esempio n. 23
0
 def get_cifs_share(self,
                    server_name=None,
                    share_name=None,
                    mover_id=None,
                    is_vdm=False):
     kwargs = {}
     if server_name is not None:
         kwargs['cifsServer'] = server_name
     if share_name is not None:
         kwargs['name'] = share_name
     argv = []
     if mover_id is not None:
         argv.append(
             self.MoverOrVdm(mover=str(mover_id),
                             moverIdIsVdm=converter.boolean_to_str(is_vdm)))
     body = self.CifsShareQueryParams(*argv, **kwargs)
     return self.query_package(body)
Esempio n. 24
0
 def remove_fs_mp(self, path, mover_id, is_vdm=False):
     body = self.DeleteMount(mover=str(mover_id),
                             moverIdIsVdm=converter.boolean_to_str(is_vdm),
                             path=path)
     return self.task_package(body)
Esempio n. 25
0
 def remove_cifs_server(self, name, mover_id, is_vdm=False):
     body = self.DeleteCifsServer(
         mover=str(mover_id),
         moverIdIsVdm=converter.boolean_to_str(is_vdm),
         name=name)
     return self.task_package(body)
Esempio n. 26
0
 def remove_cifs_server(self, name, mover_id, is_vdm=False):
     body = self.DeleteCifsServer(
         mover=str(mover_id),
         moverIdIsVdm=converter.boolean_to_str(is_vdm),
         name=name)
     return self.task_package(body)
Esempio n. 27
0
 def remove_fs_mp(self, path, mover_id, is_vdm=False):
     body = self.DeleteMount(
         mover=str(mover_id),
         moverIdIsVdm=converter.boolean_to_str(is_vdm),
         path=path)
     return self.task_package(body)