Tony Mack | 2d81e63 | 2013-04-09 02:34:10 -0400 | [diff] [blame] | 1 | from plstackapi.openstack.client import OpenStackClient |
| 2 | from plstackapi.openstack.driver import OpenStackDriver |
| 3 | from plstackapi.planetstack.api.auth import auth_check |
| 4 | from plstackapi.planetstack.models import DeploymentNetwork |
| 5 | |
| 6 | |
| 7 | def add_deployment_network(auth, name): |
| 8 | auth_check(auth) |
| 9 | deployment = DeploymentNetwork(name=name) |
| 10 | deployment.save() |
| 11 | return deployment |
| 12 | |
| 13 | def delete_deployment_network(auth, filter={}): |
| 14 | auth_check(auth) |
| 15 | deployments = DeploymentNetwork.objects.filter(**filter) |
| 16 | for deployment in deployments: |
| 17 | deployment.delete() |
| 18 | return 1 |
| 19 | |
| 20 | def get_deployment_networks(auth, filter={}): |
| 21 | auth_check(auth) |
| 22 | deployments = DeploymentNetwork.objects.filter(**filter) |
| 23 | return deployments |
| 24 | |
| 25 | |
| 26 | |