Skip to content

Commit c3439d0

Browse files
committed
Sync code from internal source control
1 parent a836f45 commit c3439d0

20 files changed

+816
-28
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__author__ = 'alex jiang'
2-
__version__ = '2.1.2'
2+
__version__ = '2.1.3'

aliyun-python-sdk-core/aliyunsdkcore/acs_exception/error_msg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"""
2929

3030
__dict = dict(SDK_INVALID_REGION_ID='Can not find endpoint to access.',
31-
SDK_SERVER_UNREACHABLE='Specified endpoint or uri is not valid.',
31+
SDK_SERVER_UNREACHABLE='Unable to connect server',
3232
SDK_INVALID_REQUEST='The request is not a valid AcsRequest.',
3333
SDK_MISSING_ENDPOINTS_FILER='Internal endpoints info is missing.')
3434

aliyun-python-sdk-core/aliyunsdkcore/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ def do_action(self, acs_request):
174174
# if _body is None:
175175
# raise exs.ClientException(error_code.SDK_SERVER_UNREACHABLE, error_msg.get_msg('SDK_SERVER_UNREACHABLE'))
176176
return _body
177-
except IOError:
178-
raise exs.ClientException(error_code.SDK_SERVER_UNREACHABLE, error_msg.get_msg('SDK_SERVER_UNREACHABLE'))
177+
except IOError, e:
178+
raise exs.ClientException(error_code.SDK_SERVER_UNREACHABLE, error_msg.get_msg('SDK_SERVER_UNREACHABLE') + ': ' + str(e))
179179
except AttributeError:
180180
raise exs.ClientException(error_code.SDK_INVALID_REQUEST, error_msg.get_msg('SDK_INVALID_REQUEST'))
181181

@@ -209,8 +209,8 @@ def get_response(self, acs_request):
209209
content, self.__port)
210210
return _response.get_response_object()
211211

212-
except IOError:
213-
raise exs.ClientException(error_code.SDK_SERVER_UNREACHABLE, error_msg.get_msg('SDK_SERVER_UNREACHABLE'))
212+
except IOError, e:
213+
raise exs.ClientException(error_code.SDK_SERVER_UNREACHABLE, error_msg.get_msg('SDK_SERVER_UNREACHABLE') + ': ' + str(e))
214214
except AttributeError:
215215
raise exs.ClientException(error_code.SDK_INVALID_REQUEST, error_msg.get_msg('SDK_INVALID_REQUEST'))
216216

aliyun-python-sdk-core/aliyunsdkcore/http/http_response.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ def get_http_response(self):
6565
headers=self.get_headers())
6666
response=self.__connection.getresponse()
6767
return response.getheaders(),response.read()
68-
except Exception as e:
69-
return None, None
7068
finally:
7169
self.__close_connection()
7270

@@ -81,8 +79,6 @@ def get_http_response_object(self):
8179
headers=self.get_headers())
8280
response=self.__connection.getresponse()
8381
return response.status,response.getheaders(),response.read()
84-
except Exception as e:
85-
return None, None
8682
finally:
8783
self.__close_connection()
8884

@@ -99,8 +95,6 @@ def get_https_response(self):
9995
headers=self.get_headers())
10096
response=self.__connection.getresponse()
10197
return response.getheaders(),response.read()
102-
except Exception as e:
103-
return None, None
10498
finally:
10599
self.__close_connection()
106100

@@ -117,17 +111,13 @@ def get_https_response_object(self):
117111
headers=self.get_headers())
118112
response=self.__connection.getresponse()
119113
return response.status,response.getheaders(),response.read()
120-
except Exception as e:
121-
return None, None
122114
finally:
123115
self.__close_connection()
124116

125117

126118
def __close_connection(self):
127-
try:
128-
if self.__connection is not None:
129-
self.__connection.close()
130-
except Exception as e:
131-
pass
119+
if self.__connection is not None:
120+
self.__connection.close()
121+
self.__connection = None
132122

133123

aliyun-python-sdk-core/aliyunsdkcore/profile/region_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
__endpoints[endpoint.getAttribute('name')] = dict(regions=region_list, products=product_list)
6464

65-
except Exception:
65+
except Exception, ex:
6666
raise ClientException(error_code.SDK_MISSING_ENDPOINTS_FILER, error_msg.get_msg('SDK_MISSING_ENDPOINTS_FILER'))
6767

6868

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2.0.2'
1+
__version__ = '2.1.0'

aliyun-python-sdk-live/aliyunsdklive/request/v20161101/AddLiveAppRecordConfigRequest.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ class AddLiveAppRecordConfigRequest(RpcRequest):
2323
def __init__(self):
2424
RpcRequest.__init__(self, 'live', '2016-11-01', 'AddLiveAppRecordConfig','live')
2525

26-
def get_RecordFormat(self):
27-
return self.get_query_params().get('RecordFormat')
28-
29-
def set_RecordFormat(self,RecordFormat):
30-
self.add_query_param('RecordFormat',RecordFormat)
31-
3226
def get_SecurityToken(self):
3327
return self.get_query_params().get('SecurityToken')
3428

@@ -63,4 +57,10 @@ def get_OssBucket(self):
6357
return self.get_query_params().get('OssBucket')
6458

6559
def set_OssBucket(self,OssBucket):
66-
self.add_query_param('OssBucket',OssBucket)
60+
self.add_query_param('OssBucket',OssBucket)
61+
62+
def get_RecordFormat(self):
63+
return self.get_query_params().get('RecordFormat')
64+
65+
def set_RecordFormat(self,RecordFormat):
66+
self.add_query_param('RecordFormat',RecordFormat)
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
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+
class AddLiveStreamTranscodeRequest(RpcRequest):
22+
23+
def __init__(self):
24+
RpcRequest.__init__(self, 'live', '2016-11-01', 'AddLiveStreamTranscode','live')
25+
26+
def get_SecurityToken(self):
27+
return self.get_query_params().get('SecurityToken')
28+
29+
def set_SecurityToken(self,SecurityToken):
30+
self.add_query_param('SecurityToken',SecurityToken)
31+
32+
def get_OwnerId(self):
33+
return self.get_query_params().get('OwnerId')
34+
35+
def set_OwnerId(self,OwnerId):
36+
self.add_query_param('OwnerId',OwnerId)
37+
38+
def get_Domain(self):
39+
return self.get_query_params().get('Domain')
40+
41+
def set_Domain(self,Domain):
42+
self.add_query_param('Domain',Domain)
43+
44+
def get_App(self):
45+
return self.get_query_params().get('App')
46+
47+
def set_App(self,App):
48+
self.add_query_param('App',App)
49+
50+
def get_Template(self):
51+
return self.get_query_params().get('Template')
52+
53+
def set_Template(self,Template):
54+
self.add_query_param('Template',Template)
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
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+
class DeleteLiveStreamTranscodeRequest(RpcRequest):
22+
23+
def __init__(self):
24+
RpcRequest.__init__(self, 'live', '2016-11-01', 'DeleteLiveStreamTranscode','live')
25+
26+
def get_SecurityToken(self):
27+
return self.get_query_params().get('SecurityToken')
28+
29+
def set_SecurityToken(self,SecurityToken):
30+
self.add_query_param('SecurityToken',SecurityToken)
31+
32+
def get_OwnerId(self):
33+
return self.get_query_params().get('OwnerId')
34+
35+
def set_OwnerId(self,OwnerId):
36+
self.add_query_param('OwnerId',OwnerId)
37+
38+
def get_Domain(self):
39+
return self.get_query_params().get('Domain')
40+
41+
def set_Domain(self,Domain):
42+
self.add_query_param('Domain',Domain)
43+
44+
def get_App(self):
45+
return self.get_query_params().get('App')
46+
47+
def set_App(self,App):
48+
self.add_query_param('App',App)
49+
50+
def get_Template(self):
51+
return self.get_query_params().get('Template')
52+
53+
def set_Template(self,Template):
54+
self.add_query_param('Template',Template)
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
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+
class DescribeLiveStreamOnlineUserNumRequest(RpcRequest):
22+
23+
def __init__(self):
24+
RpcRequest.__init__(self, 'live', '2016-11-01', 'DescribeLiveStreamOnlineUserNum','live')
25+
26+
def get_SecurityToken(self):
27+
return self.get_query_params().get('SecurityToken')
28+
29+
def set_SecurityToken(self,SecurityToken):
30+
self.add_query_param('SecurityToken',SecurityToken)
31+
32+
def get_OwnerId(self):
33+
return self.get_query_params().get('OwnerId')
34+
35+
def set_OwnerId(self,OwnerId):
36+
self.add_query_param('OwnerId',OwnerId)
37+
38+
def get_DomainName(self):
39+
return self.get_query_params().get('DomainName')
40+
41+
def set_DomainName(self,DomainName):
42+
self.add_query_param('DomainName',DomainName)
43+
44+
def get_AppName(self):
45+
return self.get_query_params().get('AppName')
46+
47+
def set_AppName(self,AppName):
48+
self.add_query_param('AppName',AppName)
49+
50+
def get_StreamName(self):
51+
return self.get_query_params().get('StreamName')
52+
53+
def set_StreamName(self,StreamName):
54+
self.add_query_param('StreamName',StreamName)
55+
56+
def get_StartTime(self):
57+
return self.get_query_params().get('StartTime')
58+
59+
def set_StartTime(self,StartTime):
60+
self.add_query_param('StartTime',StartTime)
61+
62+
def get_EndTime(self):
63+
return self.get_query_params().get('EndTime')
64+
65+
def set_EndTime(self,EndTime):
66+
self.add_query_param('EndTime',EndTime)
67+
68+
def get_HlsSwitch(self):
69+
return self.get_query_params().get('HlsSwitch')
70+
71+
def set_HlsSwitch(self,HlsSwitch):
72+
self.add_query_param('HlsSwitch',HlsSwitch)

0 commit comments

Comments
 (0)