Esempio n. 1
0
    def ModifyAccessRules(self, request):
        """云API旧版本2019-07-18预下线,所有功能由新版本2020-11-12替代,目前云API主要用作控制台使用。

        批量修改权限规则属性,需要指定权限规则ID,支持修改权限规则地址、访问模式和优先级。

        :param request: Request instance for ModifyAccessRules.
        :type request: :class:`tencentcloud.chdfs.v20190718.models.ModifyAccessRulesRequest`
        :rtype: :class:`tencentcloud.chdfs.v20190718.models.ModifyAccessRulesResponse`

        """
        try:
            params = request._serialize()
            body = self.call("ModifyAccessRules", params)
            response = json.loads(body)
            if "Error" not in response["Response"]:
                model = models.ModifyAccessRulesResponse()
                model._deserialize(response["Response"])
                return model
            else:
                code = response["Response"]["Error"]["Code"]
                message = response["Response"]["Error"]["Message"]
                reqid = response["Response"]["RequestId"]
                raise TencentCloudSDKException(code, message, reqid)
        except Exception as e:
            if isinstance(e, TencentCloudSDKException):
                raise
            else:
                raise TencentCloudSDKException(e.message, e.message)
Esempio n. 2
0
    def ModifyAccessRules(self, request):
        """批量修改权限规则属性,需要指定权限规则ID。

        :param request: 调用ModifyAccessRules所需参数的结构体。
        :type request: :class:`tencentcloud.chdfs.v20190718.models.ModifyAccessRulesRequest`
        :rtype: :class:`tencentcloud.chdfs.v20190718.models.ModifyAccessRulesResponse`

        """
        try:
            params = request._serialize()
            body = self.call("ModifyAccessRules", params)
            response = json.loads(body)
            if "Error" not in response["Response"]:
                model = models.ModifyAccessRulesResponse()
                model._deserialize(response["Response"])
                return model
            else:
                code = response["Response"]["Error"]["Code"]
                message = response["Response"]["Error"]["Message"]
                reqid = response["Response"]["RequestId"]
                raise TencentCloudSDKException(code, message, reqid)
        except Exception as e:
            if isinstance(e, TencentCloudSDKException):
                raise
            else:
                raise TencentCloudSDKException(e.message, e.message)