Exemplo n.º 1
0
    def describe_e_ip(self, req=None, **kwargs):
        """ DescribeEIP - 获取弹性IP信息

        :param ProjectId: (Config) 项目ID。不填写为默认项目,子帐号必须填写
        :param Region: (Config) 地域
        :param EIPIds: (Optional) 弹性IP的资源ID如果为空, 则返回当前 Region中符合条件的的所有EIP
        :param Limit: (Optional) 数据分页值, 默认为20
        :param Offset: (Optional) 数据偏移量, 默认为0
        """
        d = {"ProjectId": self.config.project_id, "Region": self.config.region}
        req and d.update(req)
        d = apis.DescribeEIPRequestSchema().dumps(d)
        resp = self.invoke("DescribeEIP", d, **kwargs)
        return apis.DescribeEIPResponseSchema().loads(resp)
Exemplo n.º 2
0
    def describe_eip(self, req=None, **kwargs):
        """ DescribeEIP - 获取弹性IP信息

        **Request**

        - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写
        - **Region** (str) - (Config) 地域
        - **EIPIds** (list) - 弹性IP的资源ID如果为空, 则返回当前 Region中符合条件的的所有EIP
        - **Limit** (int) - 数据分页值, 默认为20
        - **Offset** (int) - 数据偏移量, 默认为0
        
        **Response**

        - **EIPSet** (list) - 见 **UnetEIPSet** 模型定义
        - **TotalBandwidth** (int) - 满足条件的弹性IP带宽总和, 单位Mbps
        - **TotalCount** (int) - 满足条件的弹性IP总数
        
        **Response Model**
        
        **ShareBandwidthSet** 
        
        - **ShareBandwidth** (int) - 共享带宽带宽值
        - **ShareBandwidthId** (str) - 共享带宽ID
        - **ShareBandwidthName** (str) - 共享带宽的资源名称

        **UnetEIPAddrSet** 
        
        - **IP** (str) - IP地址
        - **OperatorName** (str) - 运营商信息如: 电信: Telecom, 联通: Unicom, 国际: International, Duplet: 双线IP(电信+联通), BGP: Bgp

        **UnetEIPResourceSet** 
        
        - **EIPId** (str) - 弹性IP的资源ID
        - **ResourceId** (str) - 已绑定资源的资源ID
        - **ResourceName** (str) - 已绑定的资源名称
        - **ResourceType** (str) - 已绑定的资源类型, 枚举值为: uhost, 云主机;natgw:NAT网关;ulb:负载均衡器;upm: 物理机; hadoophost: 大数据集群;fortresshost:堡垒机;udockhost:容器;udhost:私有专区主机;vpngw:IPSec VPN;ucdr:云灾备;dbaudit:数据库审计,uni:虚拟网卡。
        - **SubResourceId** (str) - 资源绑定的虚拟网卡的ID
        - **SubResourceName** (str) - 资源绑定的虚拟网卡的名称
        - **SubResourceType** (str) - 资源绑定的虚拟网卡的类型。uni,虚拟网卡。

        **UnetEIPSet** 
        
        - **Bandwidth** (int) - 弹性IP的带宽, 单位为Mbps, 当BandwidthType=1时, 该处显示为共享带宽值. 当BandwidthType=0时, 该处显示这个弹性IP的带宽.
        - **BandwidthType** (int) - 带宽模式, 枚举值为: 0: 非共享带宽模式, 1: 共享带宽模式
        - **ChargeType** (str) - 付费方式, 枚举值为: Year, 按年付费; Month, 按月付费; Dynamic, 按小时付费; Trial, 试用. 按小时付费和试用这两种付费模式需要开通权限.
        - **CreateTime** (int) - 弹性IP的创建时间, 格式为Unix Timestamp
        - **EIPAddr** (list) - 见 **UnetEIPAddrSet** 模型定义
        - **EIPId** (str) - 弹性IP的资源ID
        - **Expire** (bool) - 弹性IP是否到期
        - **ExpireTime** (int) - 弹性IP的到期时间, 格式为Unix Timestamp
        - **Name** (str) - 弹性IP的名称,缺省值为 "EIP"
        - **PayMode** (str) - 弹性IP的计费模式, 枚举值为: "Bandwidth", 带宽计费; "Traffic", 流量计费; "ShareBandwidth",共享带宽模式. 默认为 "Bandwidth".
        - **Remark** (str) - 弹性IP的备注, 缺省值为 ""
        - **Resource** (dict) - 见 **UnetEIPResourceSet** 模型定义
        - **ShareBandwidthSet** (dict) - 见 **ShareBandwidthSet** 模型定义
        - **Status** (str) - 弹性IP的资源绑定状态, 枚举值为: used: 已绑定, free: 未绑定, freeze: 已冻结
        - **Tag** (str) - 弹性IP的业务组标识, 缺省值为 "Default"
        - **Weight** (int) - 外网出口权重, 默认为50, 范围[0-100]

        """
        d = {"ProjectId": self.config.project_id, "Region": self.config.region}
        req and d.update(req)
        d = apis.DescribeEIPRequestSchema().dumps(d)
        resp = self.invoke("DescribeEIP", d, **kwargs)
        return apis.DescribeEIPResponseSchema().loads(resp)