Skip to content

Commit 8931a18

Browse files
committed
Add a set of api to support device distribution management, including CreateProductDistributeJob, CreateDeviceDistributeJob, QueryDeviceDistributeJob, ListDeviceDistributeJob, QueryDeviceDistributeDetail, DeleteDeviceDistributeJob, ListDistributedDevice, ListDistributedProduct etc.
1 parent 08a919d commit 8931a18

10 files changed

+450
-1
lines changed

aliyun-python-sdk-iot/ChangeLog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2021-01-18 Version: 8.19.1
2+
- Add a set of api to support device distribution management, including CreateProductDistributeJob, CreateDeviceDistributeJob, QueryDeviceDistributeJob, ListDeviceDistributeJob, QueryDeviceDistributeDetail, DeleteDeviceDistributeJob, ListDistributedDevice, ListDistributedProduct etc.
3+
14
2021-01-12 Version: 8.19.0
25
- Add support for IoT jobs, including job management and query APIs like CreateJob, UpdateJob, QueryJob, CancelJob, ListTask, QueryTask, QueryJobStatistics etc.
36

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '8.19.0'
1+
__version__ = '8.19.1'
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
from aliyunsdkcore.request import RpcRequest
21+
from aliyunsdkiot.endpoint import endpoint_data
22+
23+
class CreateDeviceDistributeJobRequest(RpcRequest):
24+
25+
def __init__(self):
26+
RpcRequest.__init__(self, 'Iot', '2018-01-20', 'CreateDeviceDistributeJob','iot')
27+
self.set_method('POST')
28+
if hasattr(self, "endpoint_map"):
29+
setattr(self, "endpoint_map", endpoint_data.getEndpointMap())
30+
if hasattr(self, "endpoint_regional"):
31+
setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional())
32+
33+
34+
def get_SourceInstanceId(self):
35+
return self.get_body_params().get('SourceInstanceId')
36+
37+
def set_SourceInstanceId(self,SourceInstanceId):
38+
self.add_body_params('SourceInstanceId', SourceInstanceId)
39+
40+
def get_TargetAliyunId(self):
41+
return self.get_body_params().get('TargetAliyunId')
42+
43+
def set_TargetAliyunId(self,TargetAliyunId):
44+
self.add_body_params('TargetAliyunId', TargetAliyunId)
45+
46+
def get_TargetInstanceConfig(self):
47+
return self.get_body_params().get('TargetInstanceConfig')
48+
49+
def set_TargetInstanceConfig(self, TargetInstanceConfigs):
50+
for depth1 in range(len(TargetInstanceConfigs)):
51+
if TargetInstanceConfigs[depth1].get('TargetInstanceId') is not None:
52+
self.add_body_params('TargetInstanceConfig.' + str(depth1 + 1) + '.TargetInstanceId', TargetInstanceConfigs[depth1].get('TargetInstanceId'))
53+
54+
def get_ProductKey(self):
55+
return self.get_body_params().get('ProductKey')
56+
57+
def set_ProductKey(self,ProductKey):
58+
self.add_body_params('ProductKey', ProductKey)
59+
60+
def get_DeviceName(self):
61+
return self.get_body_params().get('DeviceName')
62+
63+
def set_DeviceName(self, DeviceNames):
64+
for depth1 in range(len(DeviceNames)):
65+
if DeviceNames[depth1] is not None:
66+
self.add_body_params('DeviceName.' + str(depth1 + 1) , DeviceNames[depth1])
67+
68+
def get_TargetUid(self):
69+
return self.get_body_params().get('TargetUid')
70+
71+
def set_TargetUid(self,TargetUid):
72+
self.add_body_params('TargetUid', TargetUid)
73+
74+
def get_Strategy(self):
75+
return self.get_body_params().get('Strategy')
76+
77+
def set_Strategy(self,Strategy):
78+
self.add_body_params('Strategy', Strategy)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
from aliyunsdkcore.request import RpcRequest
21+
from aliyunsdkiot.endpoint import endpoint_data
22+
23+
class CreateProductDistributeJobRequest(RpcRequest):
24+
25+
def __init__(self):
26+
RpcRequest.__init__(self, 'Iot', '2018-01-20', 'CreateProductDistributeJob','iot')
27+
self.set_method('POST')
28+
if hasattr(self, "endpoint_map"):
29+
setattr(self, "endpoint_map", endpoint_data.getEndpointMap())
30+
if hasattr(self, "endpoint_regional"):
31+
setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional())
32+
33+
34+
def get_SourceInstanceId(self):
35+
return self.get_query_params().get('SourceInstanceId')
36+
37+
def set_SourceInstanceId(self,SourceInstanceId):
38+
self.add_query_param('SourceInstanceId',SourceInstanceId)
39+
40+
def get_TargetAliyunId(self):
41+
return self.get_query_params().get('TargetAliyunId')
42+
43+
def set_TargetAliyunId(self,TargetAliyunId):
44+
self.add_query_param('TargetAliyunId',TargetAliyunId)
45+
46+
def get_ProductKey(self):
47+
return self.get_query_params().get('ProductKey')
48+
49+
def set_ProductKey(self,ProductKey):
50+
self.add_query_param('ProductKey',ProductKey)
51+
52+
def get_TargetInstanceId(self):
53+
return self.get_query_params().get('TargetInstanceId')
54+
55+
def set_TargetInstanceId(self,TargetInstanceId):
56+
self.add_query_param('TargetInstanceId',TargetInstanceId)
57+
58+
def get_TargetUid(self):
59+
return self.get_query_params().get('TargetUid')
60+
61+
def set_TargetUid(self,TargetUid):
62+
self.add_query_param('TargetUid',TargetUid)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
from aliyunsdkcore.request import RpcRequest
21+
from aliyunsdkiot.endpoint import endpoint_data
22+
23+
class DeleteDeviceDistributeJobRequest(RpcRequest):
24+
25+
def __init__(self):
26+
RpcRequest.__init__(self, 'Iot', '2018-01-20', 'DeleteDeviceDistributeJob','iot')
27+
self.set_method('POST')
28+
if hasattr(self, "endpoint_map"):
29+
setattr(self, "endpoint_map", endpoint_data.getEndpointMap())
30+
if hasattr(self, "endpoint_regional"):
31+
setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional())
32+
33+
34+
def get_JobId(self):
35+
return self.get_query_params().get('JobId')
36+
37+
def set_JobId(self,JobId):
38+
self.add_query_param('JobId',JobId)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
from aliyunsdkcore.request import RpcRequest
21+
from aliyunsdkiot.endpoint import endpoint_data
22+
23+
class ListDeviceDistributeJobRequest(RpcRequest):
24+
25+
def __init__(self):
26+
RpcRequest.__init__(self, 'Iot', '2018-01-20', 'ListDeviceDistributeJob','iot')
27+
self.set_method('POST')
28+
if hasattr(self, "endpoint_map"):
29+
setattr(self, "endpoint_map", endpoint_data.getEndpointMap())
30+
if hasattr(self, "endpoint_regional"):
31+
setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional())
32+
33+
34+
def get_PageSize(self):
35+
return self.get_query_params().get('PageSize')
36+
37+
def set_PageSize(self,PageSize):
38+
self.add_query_param('PageSize',PageSize)
39+
40+
def get_CurrentPage(self):
41+
return self.get_query_params().get('CurrentPage')
42+
43+
def set_CurrentPage(self,CurrentPage):
44+
self.add_query_param('CurrentPage',CurrentPage)
45+
46+
def get_TargetUid(self):
47+
return self.get_query_params().get('TargetUid')
48+
49+
def set_TargetUid(self,TargetUid):
50+
self.add_query_param('TargetUid',TargetUid)
51+
52+
def get_Status(self):
53+
return self.get_query_params().get('Status')
54+
55+
def set_Status(self,Status):
56+
self.add_query_param('Status',Status)
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
from aliyunsdkcore.request import RpcRequest
21+
from aliyunsdkiot.endpoint import endpoint_data
22+
23+
class ListDistributedDeviceRequest(RpcRequest):
24+
25+
def __init__(self):
26+
RpcRequest.__init__(self, 'Iot', '2018-01-20', 'ListDistributedDevice','iot')
27+
self.set_method('POST')
28+
if hasattr(self, "endpoint_map"):
29+
setattr(self, "endpoint_map", endpoint_data.getEndpointMap())
30+
if hasattr(self, "endpoint_regional"):
31+
setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional())
32+
33+
34+
def get_PageSize(self):
35+
return self.get_query_params().get('PageSize')
36+
37+
def set_PageSize(self,PageSize):
38+
self.add_query_param('PageSize',PageSize)
39+
40+
def get_SourceInstanceId(self):
41+
return self.get_query_params().get('SourceInstanceId')
42+
43+
def set_SourceInstanceId(self,SourceInstanceId):
44+
self.add_query_param('SourceInstanceId',SourceInstanceId)
45+
46+
def get_CurrentPage(self):
47+
return self.get_query_params().get('CurrentPage')
48+
49+
def set_CurrentPage(self,CurrentPage):
50+
self.add_query_param('CurrentPage',CurrentPage)
51+
52+
def get_ProductKey(self):
53+
return self.get_query_params().get('ProductKey')
54+
55+
def set_ProductKey(self,ProductKey):
56+
self.add_query_param('ProductKey',ProductKey)
57+
58+
def get_DeviceName(self):
59+
return self.get_query_params().get('DeviceName')
60+
61+
def set_DeviceName(self,DeviceName):
62+
self.add_query_param('DeviceName',DeviceName)
63+
64+
def get_TargetUid(self):
65+
return self.get_query_params().get('TargetUid')
66+
67+
def set_TargetUid(self,TargetUid):
68+
self.add_query_param('TargetUid',TargetUid)
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
from aliyunsdkcore.request import RpcRequest
21+
from aliyunsdkiot.endpoint import endpoint_data
22+
23+
class ListDistributedProductRequest(RpcRequest):
24+
25+
def __init__(self):
26+
RpcRequest.__init__(self, 'Iot', '2018-01-20', 'ListDistributedProduct','iot')
27+
self.set_method('POST')
28+
if hasattr(self, "endpoint_map"):
29+
setattr(self, "endpoint_map", endpoint_data.getEndpointMap())
30+
if hasattr(self, "endpoint_regional"):
31+
setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional())
32+
33+
34+
def get_PageSize(self):
35+
return self.get_query_params().get('PageSize')
36+
37+
def set_PageSize(self,PageSize):
38+
self.add_query_param('PageSize',PageSize)
39+
40+
def get_SourceInstanceId(self):
41+
return self.get_query_params().get('SourceInstanceId')
42+
43+
def set_SourceInstanceId(self,SourceInstanceId):
44+
self.add_query_param('SourceInstanceId',SourceInstanceId)
45+
46+
def get_CurrentPage(self):
47+
return self.get_query_params().get('CurrentPage')
48+
49+
def set_CurrentPage(self,CurrentPage):
50+
self.add_query_param('CurrentPage',CurrentPage)
51+
52+
def get_ProductKey(self):
53+
return self.get_query_params().get('ProductKey')
54+
55+
def set_ProductKey(self,ProductKey):
56+
self.add_query_param('ProductKey',ProductKey)
57+
58+
def get_TargetInstanceId(self):
59+
return self.get_query_params().get('TargetInstanceId')
60+
61+
def set_TargetInstanceId(self,TargetInstanceId):
62+
self.add_query_param('TargetInstanceId',TargetInstanceId)
63+
64+
def get_TargetUid(self):
65+
return self.get_query_params().get('TargetUid')
66+
67+
def set_TargetUid(self,TargetUid):
68+
self.add_query_param('TargetUid',TargetUid)

0 commit comments

Comments
 (0)