Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
Dev (#187)
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
eKatchko authored Dec 6, 2019
2 parents 7a7244f + b538764 commit eb49d38
Show file tree
Hide file tree
Showing 15 changed files with 4,724 additions and 2,337 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## (2019-12-06)


#### Features

* **client:** multiple security groups for single vms ([52990be6](52990be6))


## (2019-11-19)

Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ thrift_py: ## Builds python code from thrift file
cp -a gen-py/VirtualMachineService/. VirtualMachineService
rm -rf gen-py
@echo Remember to fix the imports: for pip relative imports are needed, for others absolute imports

dev: ## Build and Start the docker-compose.dev.yml
docker-compose -f docker-compose.dev.yml up --build

production: ## Build Release from .env
docker-compose -f docker-compose.yml up --build -d



.PHONY: help lint docs thrift_py
.PHONY: help lint docs thrift_py
261 changes: 224 additions & 37 deletions VirtualMachineService/VirtualMachineHandler.py

Large diffs are not rendered by default.

86 changes: 78 additions & 8 deletions VirtualMachineService/VirtualMachineService-remote
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,21 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':
print(' delete_metadata_from_server(string servername, keys)')
print(' string add_floating_ip_to_server(string openstack_id, string network)')
print(' bool create_connection(string username, string password, string auth_url, string user_domain_name, string project_domain_name)')
print(' start_server(string flavor, string image, string public_key, string servername, metadata, string diskspace, string volumename)')
print(' start_server_with_custom_key(string flavor, string image, string servername, metadata, string diskspace, string volumename)')
print(' start_server(string flavor, string image, string public_key, string servername, metadata, string diskspace, string volumename, bool https, bool http)')
print(' start_server_with_custom_key(string flavor, string image, string servername, metadata, string diskspace, string volumename, bool http, bool https)')
print(' bool exist_server(string name)')
print(' int create_and_deploy_playbook(string public_key, playbooks_information, string openstack_id)')
print(' PlaybookResult get_playbook_logs(string openstack_id)')
print(' bool has_forc()')
print(' Backend create_backend(string elixir_id, string user_key_url, string template, string template_version, string upstream_url)')
print(' get_backends()')
print(' get_backends_by_owner(string elixir_id)')
print(' get_backends_by_template(string template)')
print(' Backend get_backend_by_id(i64 id)')
print(' string delete_backend(i64 id)')
print(' get_templates()')
print(' get_templates_by_template(string template_name)')
print(' check_template(string template_name, string template_version)')
print(' bool add_security_group_to_server(bool http, bool https, bool udp, string server_id)')
print(' get_servers()')
print(' get_servers_by_ids( server_ids)')
Expand Down Expand Up @@ -209,16 +219,16 @@ elif cmd == 'create_connection':
pp.pprint(client.create_connection(args[0], args[1], args[2], args[3], args[4],))

elif cmd == 'start_server':
if len(args) != 7:
print('start_server requires 7 args')
if len(args) != 9:
print('start_server requires 9 args')
sys.exit(1)
pp.pprint(client.start_server(args[0], args[1], args[2], args[3], eval(args[4]), args[5], args[6],))
pp.pprint(client.start_server(args[0], args[1], args[2], args[3], eval(args[4]), args[5], args[6], eval(args[7]), eval(args[8]),))

elif cmd == 'start_server_with_custom_key':
if len(args) != 6:
print('start_server_with_custom_key requires 6 args')
if len(args) != 8:
print('start_server_with_custom_key requires 8 args')
sys.exit(1)
pp.pprint(client.start_server_with_custom_key(args[0], args[1], args[2], eval(args[3]), args[4], args[5],))
pp.pprint(client.start_server_with_custom_key(args[0], args[1], args[2], eval(args[3]), args[4], args[5], eval(args[6]), eval(args[7]),))

elif cmd == 'exist_server':
if len(args) != 1:
Expand All @@ -238,6 +248,66 @@ elif cmd == 'get_playbook_logs':
sys.exit(1)
pp.pprint(client.get_playbook_logs(args[0],))

elif cmd == 'has_forc':
if len(args) != 0:
print('has_forc requires 0 args')
sys.exit(1)
pp.pprint(client.has_forc())

elif cmd == 'create_backend':
if len(args) != 5:
print('create_backend requires 5 args')
sys.exit(1)
pp.pprint(client.create_backend(args[0], args[1], args[2], args[3], args[4],))

elif cmd == 'get_backends':
if len(args) != 0:
print('get_backends requires 0 args')
sys.exit(1)
pp.pprint(client.get_backends())

elif cmd == 'get_backends_by_owner':
if len(args) != 1:
print('get_backends_by_owner requires 1 args')
sys.exit(1)
pp.pprint(client.get_backends_by_owner(args[0],))

elif cmd == 'get_backends_by_template':
if len(args) != 1:
print('get_backends_by_template requires 1 args')
sys.exit(1)
pp.pprint(client.get_backends_by_template(args[0],))

elif cmd == 'get_backend_by_id':
if len(args) != 1:
print('get_backend_by_id requires 1 args')
sys.exit(1)
pp.pprint(client.get_backend_by_id(eval(args[0]),))

elif cmd == 'delete_backend':
if len(args) != 1:
print('delete_backend requires 1 args')
sys.exit(1)
pp.pprint(client.delete_backend(eval(args[0]),))

elif cmd == 'get_templates':
if len(args) != 0:
print('get_templates requires 0 args')
sys.exit(1)
pp.pprint(client.get_templates())

elif cmd == 'get_templates_by_template':
if len(args) != 1:
print('get_templates_by_template requires 1 args')
sys.exit(1)
pp.pprint(client.get_templates_by_template(args[0],))

elif cmd == 'check_template':
if len(args) != 2:
print('check_template requires 2 args')
sys.exit(1)
pp.pprint(client.check_template(args[0], args[1],))

elif cmd == 'add_security_group_to_server':
if len(args) != 4:
print('add_security_group_to_server requires 4 args')
Expand Down
Loading

0 comments on commit eb49d38

Please sign in to comment.