当前位置: 首页>>代码示例>>Python>>正文


Python Environment.create方法代码示例

本文整理汇总了Python中fuelclient.objects.environment.Environment.create方法的典型用法代码示例。如果您正苦于以下问题:Python Environment.create方法的具体用法?Python Environment.create怎么用?Python Environment.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fuelclient.objects.environment.Environment的用法示例。


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

示例1: create

# 需要导入模块: from fuelclient.objects.environment import Environment [as 别名]
# 或者: from fuelclient.objects.environment.Environment import create [as 别名]
    def create(self, params):
        """To create an environment with name MyEnv and release id=1 run:
                fuel env create --name MyEnv --rel 1

            By default, it creates environment with ha_compact mode and
            neutron with VLAN network segmentation as network provider
            (WARNING: nova-network is deprecated since 6.1 release).
            To specify other modes add optional arguments:
                fuel env create --name MyEnv --rel 1 \\
                --mode ha --network-mode neutron
        """
        if params.net == "nova":
            self.serializer.print_to_output(
                {},
                "Warning: nova-network is deprecated since 6.1 release."
            )

        env = Environment.create(
            params.name,
            params.release,
            params.net,
            params.nst
        )

        if params.mode:
            data = env.set({'mode': params.mode})
        else:
            data = env.get_fresh_data()

        self.serializer.print_to_output(
            data,
            u"Environment '{name}' with id={id}, mode={mode}"
            u" and network-mode={net_provider} was created!"
            .format(**data)
        )
开发者ID:kendriu,项目名称:python-fuelclient,代码行数:37,代码来源:environment.py

示例2: create

# 需要导入模块: from fuelclient.objects.environment import Environment [as 别名]
# 或者: from fuelclient.objects.environment.Environment import create [as 别名]
    def create(self, params):
        """To create an environment with name MyEnv and release id=1 run:
                fuel env create --name MyEnv --rel 1

            By default, it creates environment setting neutron with VLAN
            network segmentation as network provider
            To specify other modes add optional arguments:
                fuel env create --name MyEnv --rel 1 --net-segment-type vlan
        """

        if params.nst == 'gre':
            self.serializer.print_to_output(
                {},
                "WARNING: GRE network segmentation type is deprecated "
                "since 7.0 release."
            )

        env = Environment.create(
            params.name,
            params.release,
            params.nst,
        )

        data = env.get_fresh_data()

        self.serializer.print_to_output(
            data,
            u"Environment '{name}' with id={id} was created!"
            .format(**data)
        )
开发者ID:tinyxiao,项目名称:python-fuelclient,代码行数:32,代码来源:environment.py

示例3: create

# 需要导入模块: from fuelclient.objects.environment import Environment [as 别名]
# 或者: from fuelclient.objects.environment.Environment import create [as 别名]
    def create(self, params):
        """To create an environment with name MyEnv and release id=1 run:
                fuel env create --name MyEnv --rel 1

           By default it creates environment in multinode mode, and nova
           network mode, to specify other modes add optional arguments:
                fuel env create --name MyEnv --rel 1 \\
                --mode ha --network-mode neutron
        """
        env = Environment.create(
            params.name,
            params.release,
            params.net,
            net_segment_type=params.nst
        )

        if params.mode:
            data = env.set({'mode': params.mode})
        else:
            data = env.get_fresh_data()

        self.serializer.print_to_output(
            data,
            u"Environment '{name}' with id={id}, mode={mode}"
            u" and network-mode={net_provider} was created!"
            .format(**data)
        )
开发者ID:Axam,项目名称:fuel-web,代码行数:29,代码来源:environment.py


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