@@ -74,7 +74,7 @@ def __init__(self, baseUrl):
74
74
self .baseUrl = baseUrl
75
75
# Create appProfile
76
76
def createAppProfile (self , obj ):
77
- postUrl = self .baseUrl + '/api/appProfiles/' + obj .tenantName + ":" + obj .appProfileName + '/'
77
+ postUrl = self .baseUrl + '/api/v1/ appProfiles/' + obj .tenantName + ":" + obj .appProfileName + '/'
78
78
79
79
jdata = json .dumps ({
80
80
"appProfileName" : obj .appProfileName ,
@@ -91,7 +91,7 @@ def createAppProfile(self, obj):
91
91
# Delete appProfile
92
92
def deleteAppProfile (self , tenantName , appProfileName ):
93
93
# Delete AppProfile
94
- deleteUrl = self .baseUrl + '/api/appProfiles/' + tenantName + ":" + appProfileName + '/'
94
+ deleteUrl = self .baseUrl + '/api/v1/ appProfiles/' + tenantName + ":" + appProfileName + '/'
95
95
response = httpDelete (deleteUrl )
96
96
97
97
if response == "Error" :
@@ -100,14 +100,14 @@ def deleteAppProfile(self, tenantName, appProfileName):
100
100
# List all appProfile objects
101
101
def listAppProfile (self ):
102
102
# Get a list of appProfile objects
103
- retDate = urllib2 .urlopen (self .baseUrl + '/api/appProfiles/' )
103
+ retDate = urllib2 .urlopen (self .baseUrl + '/api/v1/ appProfiles/' )
104
104
if retData == "Error" :
105
105
errorExit ("list AppProfile failed" )
106
106
107
107
return json .loads (retData )
108
108
# Create Bgp
109
109
def createBgp (self , obj ):
110
- postUrl = self .baseUrl + '/api/Bgps/' + obj .hostname + '/'
110
+ postUrl = self .baseUrl + '/api/v1/ Bgps/' + obj .hostname + '/'
111
111
112
112
jdata = json .dumps ({
113
113
"as" : obj .as ,
@@ -126,7 +126,7 @@ def createBgp(self, obj):
126
126
# Delete Bgp
127
127
def deleteBgp (self , hostname ):
128
128
# Delete Bgp
129
- deleteUrl = self .baseUrl + '/api/Bgps/' + hostname + '/'
129
+ deleteUrl = self .baseUrl + '/api/v1/ Bgps/' + hostname + '/'
130
130
response = httpDelete (deleteUrl )
131
131
132
132
if response == "Error" :
@@ -135,14 +135,14 @@ def deleteBgp(self, hostname):
135
135
# List all Bgp objects
136
136
def listBgp (self ):
137
137
# Get a list of Bgp objects
138
- retDate = urllib2 .urlopen (self .baseUrl + '/api/Bgps/' )
138
+ retDate = urllib2 .urlopen (self .baseUrl + '/api/v1/ Bgps/' )
139
139
if retData == "Error" :
140
140
errorExit ("list Bgp failed" )
141
141
142
142
return json .loads (retData )
143
143
# Create endpointGroup
144
144
def createEndpointGroup (self , obj ):
145
- postUrl = self .baseUrl + '/api/endpointGroups/' + obj .tenantName + ":" + obj .groupName + '/'
145
+ postUrl = self .baseUrl + '/api/v1/ endpointGroups/' + obj .tenantName + ":" + obj .groupName + '/'
146
146
147
147
jdata = json .dumps ({
148
148
"extContractsGrps" : obj .extContractsGrps ,
@@ -161,7 +161,7 @@ def createEndpointGroup(self, obj):
161
161
# Delete endpointGroup
162
162
def deleteEndpointGroup (self , tenantName , groupName ):
163
163
# Delete EndpointGroup
164
- deleteUrl = self .baseUrl + '/api/endpointGroups/' + tenantName + ":" + groupName + '/'
164
+ deleteUrl = self .baseUrl + '/api/v1/ endpointGroups/' + tenantName + ":" + groupName + '/'
165
165
response = httpDelete (deleteUrl )
166
166
167
167
if response == "Error" :
@@ -170,7 +170,7 @@ def deleteEndpointGroup(self, tenantName, groupName):
170
170
# List all endpointGroup objects
171
171
def listEndpointGroup (self ):
172
172
# Get a list of endpointGroup objects
173
- retDate = urllib2 .urlopen (self .baseUrl + '/api/endpointGroups/' )
173
+ retDate = urllib2 .urlopen (self .baseUrl + '/api/v1/ endpointGroups/' )
174
174
if retData == "Error" :
175
175
errorExit ("list EndpointGroup failed" )
176
176
@@ -211,7 +211,7 @@ def listExtContractsGroup(self):
211
211
return json .loads (retData )
212
212
# Create global
213
213
def createGlobal (self , obj ):
214
- postUrl = self .baseUrl + '/api/globals/' + obj .name + '/'
214
+ postUrl = self .baseUrl + '/api/v1/ globals/' + obj .name + '/'
215
215
216
216
jdata = json .dumps ({
217
217
"name" : obj .name ,
@@ -229,7 +229,7 @@ def createGlobal(self, obj):
229
229
# Delete global
230
230
def deleteGlobal (self , name ):
231
231
# Delete Global
232
- deleteUrl = self .baseUrl + '/api/globals/' + name + '/'
232
+ deleteUrl = self .baseUrl + '/api/v1/ globals/' + name + '/'
233
233
response = httpDelete (deleteUrl )
234
234
235
235
if response == "Error" :
@@ -238,14 +238,14 @@ def deleteGlobal(self, name):
238
238
# List all global objects
239
239
def listGlobal (self ):
240
240
# Get a list of global objects
241
- retDate = urllib2 .urlopen (self .baseUrl + '/api/globals/' )
241
+ retDate = urllib2 .urlopen (self .baseUrl + '/api/v1/ globals/' )
242
242
if retData == "Error" :
243
243
errorExit ("list Global failed" )
244
244
245
245
return json .loads (retData )
246
246
# Create network
247
247
def createNetwork (self , obj ):
248
- postUrl = self .baseUrl + '/api/networks/' + obj .tenantName + ":" + obj .networkName + '/'
248
+ postUrl = self .baseUrl + '/api/v1/ networks/' + obj .tenantName + ":" + obj .networkName + '/'
249
249
250
250
jdata = json .dumps ({
251
251
"encap" : obj .encap ,
@@ -268,7 +268,7 @@ def createNetwork(self, obj):
268
268
# Delete network
269
269
def deleteNetwork (self , tenantName , networkName ):
270
270
# Delete Network
271
- deleteUrl = self .baseUrl + '/api/networks/' + tenantName + ":" + networkName + '/'
271
+ deleteUrl = self .baseUrl + '/api/v1/ networks/' + tenantName + ":" + networkName + '/'
272
272
response = httpDelete (deleteUrl )
273
273
274
274
if response == "Error" :
@@ -277,14 +277,14 @@ def deleteNetwork(self, tenantName, networkName):
277
277
# List all network objects
278
278
def listNetwork (self ):
279
279
# Get a list of network objects
280
- retDate = urllib2 .urlopen (self .baseUrl + '/api/networks/' )
280
+ retDate = urllib2 .urlopen (self .baseUrl + '/api/v1/ networks/' )
281
281
if retData == "Error" :
282
282
errorExit ("list Network failed" )
283
283
284
284
return json .loads (retData )
285
285
# Create policy
286
286
def createPolicy (self , obj ):
287
- postUrl = self .baseUrl + '/api/policys/' + obj .tenantName + ":" + obj .policyName + '/'
287
+ postUrl = self .baseUrl + '/api/v1/ policys/' + obj .tenantName + ":" + obj .policyName + '/'
288
288
289
289
jdata = json .dumps ({
290
290
"policyName" : obj .policyName ,
@@ -300,7 +300,7 @@ def createPolicy(self, obj):
300
300
# Delete policy
301
301
def deletePolicy (self , tenantName , policyName ):
302
302
# Delete Policy
303
- deleteUrl = self .baseUrl + '/api/policys/' + tenantName + ":" + policyName + '/'
303
+ deleteUrl = self .baseUrl + '/api/v1/ policys/' + tenantName + ":" + policyName + '/'
304
304
response = httpDelete (deleteUrl )
305
305
306
306
if response == "Error" :
@@ -309,14 +309,14 @@ def deletePolicy(self, tenantName, policyName):
309
309
# List all policy objects
310
310
def listPolicy (self ):
311
311
# Get a list of policy objects
312
- retDate = urllib2 .urlopen (self .baseUrl + '/api/policys/' )
312
+ retDate = urllib2 .urlopen (self .baseUrl + '/api/v1/ policys/' )
313
313
if retData == "Error" :
314
314
errorExit ("list Policy failed" )
315
315
316
316
return json .loads (retData )
317
317
# Create rule
318
318
def createRule (self , obj ):
319
- postUrl = self .baseUrl + '/api/rules/' + obj .tenantName + ":" + obj .policyName + ":" + obj .ruleId + '/'
319
+ postUrl = self .baseUrl + '/api/v1/ rules/' + obj .tenantName + ":" + obj .policyName + ":" + obj .ruleId + '/'
320
320
321
321
jdata = json .dumps ({
322
322
"action" : obj .action ,
@@ -344,7 +344,7 @@ def createRule(self, obj):
344
344
# Delete rule
345
345
def deleteRule (self , tenantName , policyName , ruleId ):
346
346
# Delete Rule
347
- deleteUrl = self .baseUrl + '/api/rules/' + tenantName + ":" + policyName + ":" + ruleId + '/'
347
+ deleteUrl = self .baseUrl + '/api/v1/ rules/' + tenantName + ":" + policyName + ":" + ruleId + '/'
348
348
response = httpDelete (deleteUrl )
349
349
350
350
if response == "Error" :
@@ -353,14 +353,14 @@ def deleteRule(self, tenantName, policyName, ruleId):
353
353
# List all rule objects
354
354
def listRule (self ):
355
355
# Get a list of rule objects
356
- retDate = urllib2 .urlopen (self .baseUrl + '/api/rules/' )
356
+ retDate = urllib2 .urlopen (self .baseUrl + '/api/v1/ rules/' )
357
357
if retData == "Error" :
358
358
errorExit ("list Rule failed" )
359
359
360
360
return json .loads (retData )
361
361
# Create serviceLB
362
362
def createServiceLB (self , obj ):
363
- postUrl = self .baseUrl + '/api/serviceLBs/' + obj .tenantName + ":" + obj .serviceName + '/'
363
+ postUrl = self .baseUrl + '/api/v1/ serviceLBs/' + obj .tenantName + ":" + obj .serviceName + '/'
364
364
365
365
jdata = json .dumps ({
366
366
"ipAddress" : obj .ipAddress ,
@@ -380,7 +380,7 @@ def createServiceLB(self, obj):
380
380
# Delete serviceLB
381
381
def deleteServiceLB (self , tenantName , serviceName ):
382
382
# Delete ServiceLB
383
- deleteUrl = self .baseUrl + '/api/serviceLBs/' + tenantName + ":" + serviceName + '/'
383
+ deleteUrl = self .baseUrl + '/api/v1/ serviceLBs/' + tenantName + ":" + serviceName + '/'
384
384
response = httpDelete (deleteUrl )
385
385
386
386
if response == "Error" :
@@ -389,14 +389,14 @@ def deleteServiceLB(self, tenantName, serviceName):
389
389
# List all serviceLB objects
390
390
def listServiceLB (self ):
391
391
# Get a list of serviceLB objects
392
- retDate = urllib2 .urlopen (self .baseUrl + '/api/serviceLBs/' )
392
+ retDate = urllib2 .urlopen (self .baseUrl + '/api/v1/ serviceLBs/' )
393
393
if retData == "Error" :
394
394
errorExit ("list ServiceLB failed" )
395
395
396
396
return json .loads (retData )
397
397
# Create tenant
398
398
def createTenant (self , obj ):
399
- postUrl = self .baseUrl + '/api/tenants/' + obj .tenantName + '/'
399
+ postUrl = self .baseUrl + '/api/v1/ tenants/' + obj .tenantName + '/'
400
400
401
401
jdata = json .dumps ({
402
402
"defaultNetwork" : obj .defaultNetwork ,
@@ -412,7 +412,7 @@ def createTenant(self, obj):
412
412
# Delete tenant
413
413
def deleteTenant (self , tenantName ):
414
414
# Delete Tenant
415
- deleteUrl = self .baseUrl + '/api/tenants/' + tenantName + '/'
415
+ deleteUrl = self .baseUrl + '/api/v1/ tenants/' + tenantName + '/'
416
416
response = httpDelete (deleteUrl )
417
417
418
418
if response == "Error" :
@@ -421,14 +421,14 @@ def deleteTenant(self, tenantName):
421
421
# List all tenant objects
422
422
def listTenant (self ):
423
423
# Get a list of tenant objects
424
- retDate = urllib2 .urlopen (self .baseUrl + '/api/tenants/' )
424
+ retDate = urllib2 .urlopen (self .baseUrl + '/api/v1/ tenants/' )
425
425
if retData == "Error" :
426
426
errorExit ("list Tenant failed" )
427
427
428
428
return json .loads (retData )
429
429
# Create volume
430
430
def createVolume (self , obj ):
431
- postUrl = self .baseUrl + '/api/volumes/' + obj .tenantName + ":" + obj .volumeName + '/'
431
+ postUrl = self .baseUrl + '/api/v1/ volumes/' + obj .tenantName + ":" + obj .volumeName + '/'
432
432
433
433
jdata = json .dumps ({
434
434
"datastoreType" : obj .datastoreType ,
@@ -448,7 +448,7 @@ def createVolume(self, obj):
448
448
# Delete volume
449
449
def deleteVolume (self , tenantName , volumeName ):
450
450
# Delete Volume
451
- deleteUrl = self .baseUrl + '/api/volumes/' + tenantName + ":" + volumeName + '/'
451
+ deleteUrl = self .baseUrl + '/api/v1/ volumes/' + tenantName + ":" + volumeName + '/'
452
452
response = httpDelete (deleteUrl )
453
453
454
454
if response == "Error" :
@@ -457,14 +457,14 @@ def deleteVolume(self, tenantName, volumeName):
457
457
# List all volume objects
458
458
def listVolume (self ):
459
459
# Get a list of volume objects
460
- retDate = urllib2 .urlopen (self .baseUrl + '/api/volumes/' )
460
+ retDate = urllib2 .urlopen (self .baseUrl + '/api/v1/ volumes/' )
461
461
if retData == "Error" :
462
462
errorExit ("list Volume failed" )
463
463
464
464
return json .loads (retData )
465
465
# Create volumeProfile
466
466
def createVolumeProfile (self , obj ):
467
- postUrl = self .baseUrl + '/api/volumeProfiles/' + obj .tenantName + ":" + obj .volumeProfileName + '/'
467
+ postUrl = self .baseUrl + '/api/v1/ volumeProfiles/' + obj .tenantName + ":" + obj .volumeProfileName + '/'
468
468
469
469
jdata = json .dumps ({
470
470
"datastoreType" : obj .datastoreType ,
@@ -484,7 +484,7 @@ def createVolumeProfile(self, obj):
484
484
# Delete volumeProfile
485
485
def deleteVolumeProfile (self , tenantName , volumeProfileName ):
486
486
# Delete VolumeProfile
487
- deleteUrl = self .baseUrl + '/api/volumeProfiles/' + tenantName + ":" + volumeProfileName + '/'
487
+ deleteUrl = self .baseUrl + '/api/v1/ volumeProfiles/' + tenantName + ":" + volumeProfileName + '/'
488
488
response = httpDelete (deleteUrl )
489
489
490
490
if response == "Error" :
@@ -493,7 +493,7 @@ def deleteVolumeProfile(self, tenantName, volumeProfileName):
493
493
# List all volumeProfile objects
494
494
def listVolumeProfile (self ):
495
495
# Get a list of volumeProfile objects
496
- retDate = urllib2 .urlopen (self .baseUrl + '/api/volumeProfiles/' )
496
+ retDate = urllib2 .urlopen (self .baseUrl + '/api/v1/ volumeProfiles/' )
497
497
if retData == "Error" :
498
498
errorExit ("list VolumeProfile failed" )
499
499
0 commit comments