File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
"""
3
3
* *******************************************************
4
- * Copyright (c) VMware, Inc. 2017. All Rights Reserved.
4
+ * Copyright (c) VMware, Inc. 2017-2019 . All Rights Reserved.
5
5
* SPDX-License-Identifier: MIT
6
6
* *******************************************************
7
7
*
@@ -161,6 +161,15 @@ def create_sddc(self):
161
161
self .print_output ([sddc ])
162
162
163
163
def delete_sddc (self ):
164
+ # Get SDDC ID by name
165
+ sddcs = self .vmc_client .orgs .Sddcs .list (self .org_id )
166
+ for sddc in sddcs :
167
+ if sddc .name == self .sddc_name :
168
+ self .sddc_id = sddc .id
169
+ break
170
+ else :
171
+ raise ValueError ('Cannot find sddc "{}"' .format (sddc_name ))
172
+
164
173
print ('\n # Example: Delete SDDC {} from org {}' .format (
165
174
self .sddc_id , self .org_id ))
166
175
@@ -192,8 +201,7 @@ def list_sddc(self):
192
201
193
202
def print_output (self , sddcs ):
194
203
for sddc in sddcs :
195
- print ('ID: {}, Name: {}, AWS Region: {}' .format (
196
- sddc .id , sddc .name , sddc .resource_config .region ))
204
+ print ('ID: {}, Name: {}' .format (sddc .id , sddc .name ))
197
205
198
206
def get_subnet_id (self , vpc_map ):
199
207
for v in vpc_map .values ():
You can’t perform that action at this time.
0 commit comments