• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python common.text_var函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中storops.lib.common.text_var函数的典型用法代码示例。如果您正苦于以下问题:Python text_var函数的具体用法?Python text_var怎么用?Python text_var使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了text_var函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: mount

 def mount(mover_name, name, rw='rw', path=None):
     if path is None:
         path = '/{}'.format(name)
     cmd = text_var('/nas/bin/server_mount', mover_name)
     cmd += text_var('rw', rw)
     cmd += [name, path]
     return cmd
开发者ID:crook,项目名称:storops,代码行数:7,代码来源:nas_cmd.py


示例2: add_mirror_view_image

 def add_mirror_view_image(self, name, sp_ip, lun_id,
                           recovery_policy=VNXMirrorViewRecoveryPolicy.AUTO,
                           sync_rate=VNXMirrorViewSyncRate.HIGH):
     cmd = 'mirror -sync -addimage'.split()
     cmd += text_var('-name', name)
     cmd += text_var('-arrayhost', sp_ip)
     cmd += int_var('-lun', lun_id)
     cmd += VNXMirrorViewRecoveryPolicy.get_opt(recovery_policy)
     cmd += enum_var('-syncrate', sync_rate, VNXMirrorViewSyncRate)
     return cmd
开发者ID:optionalg,项目名称:storops,代码行数:10,代码来源:cli.py


示例3: copy_snap

 def copy_snap(self, src_name, tgt_name,
               ignore_migration_check=False,
               ignore_dedup_check=False):
     cmd = ['snap', '-copy']
     cmd += text_var('-id', src_name)
     cmd += text_var('-name', tgt_name)
     if ignore_migration_check:
         cmd.append('-ignoreMigrationCheck')
     if ignore_dedup_check:
         cmd.append('-ignoreDeduplicationCheck')
     return cmd
开发者ID:optionalg,项目名称:storops,代码行数:11,代码来源:cli.py


示例4: copy_ckpt

 def copy_ckpt(snap_name, fs_name, connect_id, session_name=None):
     if session_name is None:
         session_name = '{}:{}'.format(fs_name, snap_name)
     cmd = ['/nas/bin/nas_copy']
     cmd += text_var('-name', session_name[0:63])
     cmd.append('-source')
     cmd += text_var('-ckpt', snap_name)
     cmd.append('-destination')
     cmd += text_var('-fs', fs_name)
     cmd += text_var('-interconnect', 'id={}'.format(connect_id))
     cmd += ['-overwrite_destination', '-full_copy']
     return cmd
开发者ID:crook,项目名称:storops,代码行数:12,代码来源:nas_cmd.py


示例5: add_user

    def add_user(self, name, password, scope=None, role=None):
        if scope is None:
            scope = VNXUserScopeEnum.GLOBAL
        if role is None:
            role = VNXUserRoleEnum.ADMIN

        cmd = ['security', '-adduser']
        cmd += text_var('-user', name)
        cmd += text_var('-password', password)
        cmd += enum_var('-scope', scope, VNXUserScopeEnum)
        cmd += enum_var('-role', role, VNXUserRoleEnum)
        cmd.append('-o')
        return cmd
开发者ID:crook,项目名称:storops,代码行数:13,代码来源:block_cli.py


示例6: set_path

    def set_path(self, sg_name, hba_uid, sp, port_id,
                 ip, host, vport_id=None):

        cmd = ['storagegroup', '-setpath']
        cmd += text_var('-gname', sg_name)
        cmd += text_var('-hbauid', hba_uid)
        cmd += ['-sp', VNXSPEnum.get_sp_index(sp)]
        cmd += int_var('-spport', port_id)
        cmd += int_var('-spvport', vport_id)
        cmd += ['-ip', ip]
        cmd += text_var('-host', host)
        cmd.append('-o')
        return cmd
开发者ID:optionalg,项目名称:storops,代码行数:13,代码来源:cli.py


示例7: modify_snap

 def modify_snap(self, name, new_name=None, desc=None,
                 auto_delete=None, rw=None):
     opt = []
     if new_name is not None and name != new_name:
         opt += text_var('-name', new_name)
     opt += text_var('-descr', desc)
     opt += yes_no_var('-allowAutoDelete', auto_delete)
     opt += yes_no_var('-allowReadWrite', rw)
     if len(opt) > 0:
         cmd = ['snap', '-modify', '-id', name] + opt
     else:
         cmd = []
     return cmd
开发者ID:optionalg,项目名称:storops,代码行数:13,代码来源:cli.py


示例8: create_snap

    def create_snap(self, res_id, snap_name,
                    allow_rw=True, auto_delete=False):
        cmd = ['snap', '-create']
        try:
            cmd += int_var('-res', res_id)
        except ValueError:
            # string type meaning cg name
            cmd += text_var('-res', res_id)
            cmd += ['-resType', 'CG']

        cmd += text_var('-name', snap_name)
        cmd += yes_no_var('-allowReadWrite', allow_rw)
        cmd += yes_no_var('-allowAutoDelete', auto_delete)
        return cmd
开发者ID:optionalg,项目名称:storops,代码行数:14,代码来源:cli.py


示例9: config_iscsi_ip

    def config_iscsi_ip(self, sp, port_id, ip, netmask, gateway,
                        vport_id=None, vlan_id=None):
        if vport_id is None:
            vport_id = 0

        cmd = ['connection', '-setport', '-iscsi']
        cmd += ['-sp', VNXSPEnum.get_sp_index(sp)]
        cmd += int_var('-portid', port_id)
        cmd += int_var('-vportid', vport_id)
        cmd += int_var('-vlanid', vlan_id)
        cmd += text_var('-address', ip)
        cmd += text_var('-subnetmask', netmask)
        cmd += text_var('-gateway', gateway)
        cmd.append('-o')
        return cmd
开发者ID:crook,项目名称:storops,代码行数:15,代码来源:block_cli.py


示例10: ping_node

 def ping_node(self, address, sp, port_id, vport_id=None, packet_size=None,
               count=None, timeout=None, delay=None):
     if vport_id is None:
         vport_id = 0
     cmd = ['connection', '-pingnode']
     sp = VNXSPEnum.get_sp_index(sp)
     cmd += text_var('-sp', sp)
     cmd += int_var('-portid', port_id)
     cmd += int_var('-vportid', vport_id)
     cmd += text_var('-address', address)
     cmd += int_var('-packetSize', packet_size)
     cmd += int_var('-count', count)
     cmd += int_var('-timeout', timeout)
     cmd += int_var('-delay', delay)
     return cmd
开发者ID:crook,项目名称:storops,代码行数:15,代码来源:block_cli.py


示例11: modify_storage_pool

 def modify_storage_pool(self, name=None, pool_id=None,
                         new_name=None):
     cmd = ['storagepool', '-modify']
     cmd += self._get_id_name_opt(pool_id, name)
     cmd += text_var('-newName', new_name)
     cmd.append('-o')
     return cmd
开发者ID:optionalg,项目名称:storops,代码行数:7,代码来源:cli.py


示例12: create_pool

 def create_pool(self, name, disks, raid_type=None):
     cmd = ['storagepool', '-create', '-disks']
     cmd += disks
     cmd += enum_var('-rtype', raid_type, VNXPoolRaidType)
     cmd += text_var('-name', name)
     cmd.append('-skiprules')
     return cmd
开发者ID:optionalg,项目名称:storops,代码行数:7,代码来源:cli.py


示例13: sg_add_hlu

 def sg_add_hlu(self, sg_name, hlu_id, alu_id):
     cmd = ['storagegroup', '-addhlu']
     cmd += int_var('-hlu', hlu_id)
     cmd += int_var('-alu', alu_id)
     cmd += text_var('-gname', sg_name)
     cmd.append('-o')
     return cmd
开发者ID:optionalg,项目名称:storops,代码行数:7,代码来源:cli.py


示例14: _get_id_name_opt

 def _get_id_name_opt(cls, _id, name, allow_empty=False):
     try:
         ret = cls._select_one(
             [int_var('-id', _id), text_var('-name', name)],
             allow_empty)
     except OptionMissingError:
         raise ValueError('id or name need to be specified.')
     return ret
开发者ID:optionalg,项目名称:storops,代码行数:8,代码来源:cli.py


示例15: _get_pool_opt

 def _get_pool_opt(cls, pool_id, pool_name, allow_empty=False):
     try:
         ret = cls._select_one([int_var('-poolId', pool_id),
                                text_var('-poolName', pool_name)],
                               allow_empty=allow_empty)
     except OptionMissingError:
         raise ValueError('pool_id or pool_name need to be specified.')
     return ret
开发者ID:optionalg,项目名称:storops,代码行数:8,代码来源:cli.py


示例16: create_cg

    def create_cg(self, name, members=None, auto_delete=None):
        cmd = 'snap -group -create'.split()
        cmd += text_var('-name', name)
        cmd += yes_no_var('-allowSnapAutoDelete', auto_delete)

        if members is not None and len(members) > 0:
            cmd += ['-res', self._get_cg_member_repr(members)]

        return cmd
开发者ID:optionalg,项目名称:storops,代码行数:9,代码来源:cli.py


示例17: _get_primary_lun_opt

 def _get_primary_lun_opt(cls, primary_lun_id=None, primary_lun_name=None):
     try:
         ret = cls._select_one([int_var('-primaryLun', primary_lun_id),
                                text_var('-primaryLunName',
                                         primary_lun_name)])
     except OptionMissingError:
         raise ValueError(
             'primary_lun_id or primary_lun_name need to be specified.')
     return ret
开发者ID:optionalg,项目名称:storops,代码行数:9,代码来源:cli.py


示例18: delete_user

    def delete_user(self, name, scope=None):
        if scope is None:
            scope = VNXUserScopeEnum.GLOBAL

        cmd = ['security', '-rmuser']
        cmd += text_var('-user', name)
        cmd += enum_var('-scope', scope, VNXUserScopeEnum)
        cmd.append('-o')
        return cmd
开发者ID:crook,项目名称:storops,代码行数:9,代码来源:block_cli.py


示例19: create_fs

 def create_fs(fs_name, source_fs_name, pool_name, is_thin=False):
     cmd = ['/nas/bin/nas_fs']
     cmd += text_var('-name', fs_name)
     cmd += ['-type', 'uxfs', '-create']
     cmd.append('samesize={}'.format(source_fs_name))
     cmd.append('pool={}'.format(pool_name))
     cmd += ['storage=SINGLE', 'worm=off']
     cmd += yes_no_var('-thin', is_thin)
     cmd += ['-option', 'slice=y']
     return cmd
开发者ID:crook,项目名称:storops,代码行数:10,代码来源:nas_cmd.py


示例20: enable_compression

 def enable_compression(self, lun_id=None, rate=None, pool_id=None,
                        pool_name=None, ignore_thresholds=False):
     cmd = ['compression', '-on']
     cmd += int_var('-l', lun_id)
     cmd += int_var('-destPoolId', pool_id)
     cmd += text_var('-destPoolName', pool_name)
     cmd += enum_var('-rate', rate, VNXCompressionRate)
     if ignore_thresholds:
         cmd.append('-ignoreThresholds')
     cmd.append('-o')
     return cmd
开发者ID:optionalg,项目名称:storops,代码行数:11,代码来源:cli.py



注:本文中的storops.lib.common.text_var函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python lun.VNXLun类代码示例发布时间:2022-05-27
下一篇:
Python custom_data.CustomData类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap