Exemplo n.º 1
0
    def bind_eip(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
        """BindEIP - 将尚未使用的弹性IP绑定到指定的资源

        **Request**

        - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写
        - **Region** (str) - (Config) 地域
        - **EIPId** (str) - (Required) 弹性IP的资源Id
        - **ResourceId** (str) - (Required) 弹性IP请求绑定的资源ID
        - **ResourceType** (str) - (Required) 弹性IP请求绑定的资源类型, 枚举值为: uhost: 云主机; ulb, 负载均衡器 upm: 物理机; hadoophost: 大数据集群;fortresshost:堡垒机;udockhost:容器;udhost:私有专区主机;natgw:natgw;udb:udb;vpngw:ipsec vpn;ucdr:云灾备;dbaudit:数据库审计;uni:虚拟网卡;cube,Cube容器。如果EIP为普通带宽计费,且带宽值高于2G,则只允许绑定在快杰型云主机和ULB

        **Response**


        """
        # build request
        d = {
            "ProjectId": self.config.project_id,
            "Region": self.config.region,
        }
        req and d.update(req)
        d = apis.BindEIPRequestSchema().dumps(d)

        resp = self.invoke("BindEIP", d, **kwargs)
        return apis.BindEIPResponseSchema().loads(resp)
Exemplo n.º 2
0
    def bind_e_ip(self, req=None, **kwargs):
        """ BindEIP - 将尚未使用的弹性IP绑定到指定的资源

        :param ProjectId: (Config) 项目ID。不填写为默认项目,子帐号必须填写
        :param Region: (Config) 地域
        :param EIPId: (Required) 弹性IP的资源Id
        :param ResourceId: (Required) 弹性IP请求绑定的资源ID
        :param ResourceType: (Required) 弹性IP请求绑定的资源类型, 枚举值为: uhost: 云主机; ulb, 负载均衡器 upm: 物理机; hadoophost: 大数据集群;fortresshost:堡垒机;udockhost:容器;udhost:私有专区主机;natgw:natgw;udb:udb;vpngw:ipsec vpn;ucdr:云灾备;dbaudit:数据库审计;uni:虚拟网卡。
        """
        d = {"ProjectId": self.config.project_id, "Region": self.config.region}
        req and d.update(req)
        d = apis.BindEIPRequestSchema().dumps(d)
        resp = self.invoke("BindEIP", d, **kwargs)
        return apis.BindEIPResponseSchema().loads(resp)