Skip to content

Commit 509246e

Browse files
author
金山云SDK
authored
Merge pull request KscSDK#96 from KscSDK/trunk
Trunk
2 parents f1e2614 + 5cde67a commit 509246e

File tree

4 files changed

+216
-7
lines changed

4 files changed

+216
-7
lines changed

kscore/data/endpoints.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ partitions:
44
- partition: ksc
55
partitionName: KSC China
66
dnsSuffix: api.ksyun.com
7-
regionRegex: "^cn\\-\\w+\\-\\d+$"
7+
regionRegex: "^[a-z]{2,5}\\-\\w+\\-\\d+$"
88
defaults:
99
# eg: iam.cn-beijing-6.api.ksyun.com
10-
hostname: "{service}.{region}.{dnsSuffix}"
10+
hostname: "{service}.{dnsSuffix}"
1111
protocols:
1212
- http
1313
- https
@@ -43,6 +43,7 @@ partitions:
4343

4444
cn-shanghai-3:
4545
description: China ShangHai (PengBoShiVPC)
46+
4647
# services
4748
services:
4849

kscore/data/epc/2015-11-01/service-2.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ operations:
102102
name: ModifyRemoteManagement
103103
http:
104104
method: GET
105+
DeleteRemoteManagement:
106+
name: DeleteRemoteManagement
107+
http:
108+
method: GET
105109
GetDynamicCode:
106110
name: GetDynamicCode
107111
http:
@@ -122,6 +126,14 @@ operations:
122126
name: DescribeCertificates
123127
http:
124128
method: GET
129+
ModifyHyperThreading:
130+
name: ModifyHyperThreading
131+
http:
132+
method: GET
133+
ResetPassword:
134+
name: ResetPassword
135+
http:
136+
method: GET
125137

126138
shapes:
127139
Id:

kscore/data/vpc/2016-03-04/service-2.yaml

Lines changed: 194 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ operations:
2525
name: DeleteVpc
2626
http:
2727
method: GET
28+
ModifyVpc:
29+
name: ModifyVpc
30+
http:
31+
method: GET
2832
DescribeVpcs:
2933
name: DescribeVpcs
3034
http:
@@ -57,6 +61,10 @@ operations:
5761
name: DescribeSubnetAvailableAddresses
5862
http:
5963
method: GET
64+
DescribeSubnetAllocatedIpAddresses:
65+
name: DescribeSubnetAllocatedIpAddresses
66+
http:
67+
method: GET
6068
CreateRoute:
6169
name: CreateRoute
6270
http:
@@ -89,6 +97,10 @@ operations:
8997
name: DeleteNetworkAclEntry
9098
http:
9199
method: GET
100+
ModifyNetworkAclEntry:
101+
name: ModifyNetworkAclEntry
102+
http:
103+
method: GET
92104
DescribeNetworkAcls:
93105
name: DescribeNetworkAcls
94106
http:
@@ -113,6 +125,10 @@ operations:
113125
name: RevokeSecurityGroupEntry
114126
http:
115127
method: GET
128+
ModifySecurityGroupEntry:
129+
name: ModifySecurityGroupEntry
130+
http:
131+
method: GET
116132
DescribeSecurityGroups:
117133
name: DescribeSecurityGroups
118134
http:
@@ -141,10 +157,34 @@ operations:
141157
name: ModifyNat
142158
http:
143159
method: GET
160+
AddNatIp:
161+
name: AddNatIp
162+
http:
163+
method: GET
164+
DeleteNatIp:
165+
name: DeleteNatIp
166+
http:
167+
method: GET
144168
DescribeNats:
145169
name: DescribeNats
146170
http:
147171
method: GET
172+
AssociateDirectConnectGateway:
173+
name: AssociateDirectConnectGateway
174+
http:
175+
method: GET
176+
DisassociateDirectConnectGateway:
177+
name: DisassociateDirectConnectGateway
178+
http:
179+
method: GET
180+
AssociateVpnGateway:
181+
name: AssociateVpnGateway
182+
http:
183+
method: GET
184+
DisassociateVpnGateway:
185+
name: DisassociateVpnGateway
186+
http:
187+
method: GET
148188
AssociateNat:
149189
name: AssociateNat
150190
http:
@@ -157,16 +197,168 @@ operations:
157197
name: DescribeAvailabilityZones
158198
http:
159199
method: GET
200+
CreateDirectConnect:
201+
name: CreateDirectConnect
202+
http:
203+
method: GET
204+
ModifyDirectConnect:
205+
name: ModifyDirectConnect
206+
http:
207+
method: GET
208+
DeleteDirectConnect:
209+
name: DeleteDirectConnect
210+
http:
211+
method: GET
212+
DescribeDirectConnects:
213+
name: DescribeDirectConnects
214+
http:
215+
method: GET
216+
CreateDirectConnectInterface:
217+
name: CreateDirectConnectInterface
218+
http:
219+
method: GET
220+
ModifyDirectConnectInterface:
221+
name: ModifyDirectConnectInterface
222+
http:
223+
method: GET
224+
DeleteDirectConnectInterface:
225+
name: DeleteDirectConnectInterface
226+
http:
227+
method: GET
228+
DescribeDirectConnectInterfaces:
229+
name: DescribeDirectConnectInterfaces
230+
http:
231+
method: GET
232+
CreateDirectConnectGateway:
233+
name: CreateDirectConnectGateway
234+
http:
235+
method: GET
236+
ModifyDirectConnectGateway:
237+
name: ModifyDirectConnectGateway
238+
http:
239+
method: GET
240+
DeleteDirectConnectGateway:
241+
name: DeleteDirectConnectGateway
242+
http:
243+
method: GET
244+
DescribeDirectConnectGateways:
245+
name: DescribeDirectConnectGateways
246+
http:
247+
method: GET
248+
AttachDirectConnectGateway:
249+
name: AttachDirectConnectGateway
250+
http:
251+
method: GET
252+
DetachDirectConnectGateway:
253+
name: DetachDirectConnectGateway
254+
http:
255+
method: GET
256+
CreateVpnGateway:
257+
name: CreateVpnGateway
258+
http:
259+
method: GET
260+
ModifyVpnGateway:
261+
name: ModifyVpnGateway
262+
http:
263+
method: GET
264+
DeleteVpnGateway:
265+
name: DeleteVpnGateway
266+
http:
267+
method: GET
268+
DescribeVpnGateways:
269+
name: DescribeVpnGateways
270+
http:
271+
method: GET
272+
CreateVpnTunnel:
273+
name: CreateVpnTunnel
274+
http:
275+
method: POST
276+
ModifyVpnTunnel:
277+
name: ModifyVpnTunnel
278+
http:
279+
method: GET
280+
DeleteVpnTunnel:
281+
name: DeleteVpnTunnel
282+
http:
283+
method: GET
284+
DescribeVpnTunnels:
285+
name: DescribeVpnTunnels
286+
http:
287+
method: GET
288+
CreateCustomerGateway:
289+
name: CreateCustomerGateway
290+
http:
291+
method: GET
292+
ModifyCustomerGateway:
293+
name: ModifyCustomerGateway
294+
http:
295+
method: GET
296+
DeleteCustomerGateway:
297+
name: DeleteCustomerGateway
298+
http:
299+
method: GET
300+
DescribeCustomerGateways:
301+
name: DescribeCustomerGateways
302+
http:
303+
method: GET
304+
DescribeTunnels:
305+
name: DescribeTunnels
306+
http:
307+
method: GET
308+
ModifyTunnel:
309+
name: ModifyTunnel
310+
http:
311+
method: GET
312+
AssociateSubnet:
313+
name: AssociateSubnet
314+
http:
315+
method: GET
316+
DisassociateSubnet:
317+
name: DisassociateSubnet
318+
http:
319+
method: GET
320+
AssociateRemoteCidr:
321+
name: AssociateRemoteCidr
322+
http:
323+
method: GET
324+
DisassociateRemoteCidr:
325+
name: DisassociateRemoteCidr
326+
http:
327+
method: GET
328+
CreateVpcPeeringConnection:
329+
name: CreateVpcPeeringConnection
330+
http:
331+
method: GET
332+
AcceptVpcPeeringConnection:
333+
name: AcceptVpcPeeringConnection
334+
http:
335+
method: GET
336+
RejectVpcPeeringConnection:
337+
name: RejectVpcPeeringConnection
338+
http:
339+
method: GET
340+
DeleteVpcPeeringConnection:
341+
name: DeleteVpcPeeringConnection
342+
http:
343+
method: GET
344+
ModifyVpcPeeringConnection:
345+
name: ModifyVpcPeeringConnection
346+
http:
347+
method: GET
348+
DescribeVpcPeeringConnections:
349+
name: DescribeVpcPeeringConnections
350+
http:
351+
method: GET
160352

161353
shapes:
162354
Id:
163355
type: string #list/map/structure
164356

165357
Bool:
166-
type: bool
358+
type: boolean
167359

168360
Int:
169-
type: int
361+
type: integer
170362

171363
DataTime:
172364
type: timestamp

kscore/regions.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from kscore.exceptions import NoRegionError
2323

2424
LOG = logging.getLogger(__name__)
25-
DEFAULT_URI_TEMPLATE = '{service}.{region}.{dnsSuffix}'
25+
DEFAULT_URI_TEMPLATE = '{service}.{dnsSuffix}'
2626
DEFAULT_SERVICE_DATA = {'endpoints': {}}
2727

2828

@@ -167,8 +167,8 @@ def _resolve(self, partition, service_name, service_data, endpoint_name):
167167
self._merge_keys(service_data.get('defaults', {}), result)
168168
self._merge_keys(partition.get('defaults', {}), result)
169169
hostname = result.get('hostname', DEFAULT_URI_TEMPLATE)
170-
result['hostname'] = self._expand_template(
171-
partition, result['hostname'], service_name, endpoint_name)
170+
result['hostname'] = self._expand_domain_template(
171+
partition,hostname, service_name)
172172
if 'sslCommonName' in result:
173173
result['sslCommonName'] = self._expand_template(
174174
partition, result['sslCommonName'], service_name,
@@ -180,6 +180,10 @@ def _merge_keys(self, from_data, result):
180180
if key not in result:
181181
result[key] = from_data[key]
182182

183+
def _expand_domain_template(self, partition, template, service_name):
184+
return template.format(
185+
service=service_name, dnsSuffix=partition['dnsSuffix'])
186+
183187
def _expand_template(self, partition, template, service_name,
184188
endpoint_name):
185189
return template.format(

0 commit comments

Comments
 (0)