代码拉取完成,页面将自动刷新
import importlib
import json
from huaweicloudsdkcore.sdk_stream_request import SdkStreamRequest
from huaweicloudsdkcore.utils import http_utils
from huaweicloudsdkiotda.v5 import IoTDAClient
class IoTDAClientEx(IoTDAClient):
def __init__(self):
self.preset_headers = {}
self._agent = {"User-Agent": "huaweicloud-usdk-python/3.0"}
self._logger = self._init_logger()
self._credentials = None
self._config = None
self._endpoint = None
self._http_client = None
self._http_handler = None
self.model_package = None
try:
exception_handler_model_name = "huaweicloudsdkiotda.v5.exception_handler"
self.exception_handler_model = importlib.import_module(exception_handler_model_name)
except ImportError:
self.exception_handler_model = None
self.model_package = importlib.import_module("huaweicloudsdkiotda.v5.model")
self.preset_headers = {'User-Agent': 'HuaweiCloud-SDK-Python'}
def update_product_ex(self, request, shadow_store):
return self.update_product_with_http_info_ex(request, shadow_store)
def update_product_with_http_info_ex(self, request, shadow_store):
all_params = ['product_id', 'update_product_request_body', 'instance_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'product_id' in local_var_params:
path_params['product_id'] = local_var_params['product_id']
query_params = []
header_params = {}
if 'instance_id' in local_var_params:
header_params['Instance-Id'] = local_var_params['instance_id']
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
body_params = body_params.to_dict()
body_params["settings"] = {"shadow.store": shadow_store}
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v5/iot/{project_id}/products/{product_id}',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='UpdateProductResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。