本文整理匯總了Python中quantumclient.Client.delete_port方法的典型用法代碼示例。如果您正苦於以下問題:Python Client.delete_port方法的具體用法?Python Client.delete_port怎麽用?Python Client.delete_port使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類quantumclient.Client
的用法示例。
在下文中一共展示了Client.delete_port方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: delete_service
# 需要導入模塊: from quantumclient import Client [as 別名]
# 或者: from quantumclient.Client import delete_port [as 別名]
def delete_service(tenant_id, service_instance_id, *args):
"""
Removes a service and all the network configuration
"""
l2db.initialize()
print ("Terminating Service VM")
service_logic = servlogcs.ServicesLogistics()
vms_list = []
vms_list.append(servconts.DELETE_VM_CMD)
vms_list.append(service_instance_id)
if not service_logic.image_exist(service_instance_id):
print ("Service VM does not exist")
sys.exit()
result = subprocess.call(vms_list)
service_logic.image_shutdown_verification(service_instance_id)
client = Client(HOST, PORT, USE_SSL, format='json', tenant=tenant_id)
service_nets = sdb.get_service_bindings(service_instance_id)
print ("Terminating Ports and Networks")
network_name = db.network_get(service_nets.mngnet_id)
port_id_net = db.port_list(service_nets.mngnet_id)
for ports_uuid in port_id_net:
client.delete_port(service_nets.mngnet_id, ports_uuid.uuid)
client.delete_network(service_nets.mngnet_id)
network_name = db.network_get(service_nets.nbnet_id)
port_id_net = db.port_list(service_nets.nbnet_id)
for ports_uuid in port_id_net:
client.delete_port(service_nets.nbnet_id, ports_uuid.uuid)
client.delete_network(service_nets.nbnet_id)
network_name = db.network_get(service_nets.sbnet_id)
port_id_net = db.port_list(service_nets.sbnet_id)
for ports_uuid in port_id_net:
client.delete_port(service_nets.sbnet_id, ports_uuid.uuid)
client.delete_network(service_nets.sbnet_id)
service_list = sdb.remove_services_binding(service_instance_id)
print ("Configuration Removed Successfully")