Deploy on Cloud.
()
| 108 | ) |
| 109 | @pga_login_required |
| 110 | def deploy_on_cloud(): |
| 111 | """Deploy on Cloud.""" |
| 112 | |
| 113 | data = json.loads(request.data) |
| 114 | if data['cloud'] == 'aws': |
| 115 | status, p, resp = deploy_on_rds(data) |
| 116 | elif data['cloud'] == 'azure': |
| 117 | status, p, resp = deploy_on_azure(data) |
| 118 | elif data['cloud'] == 'google': |
| 119 | status, p, resp = deploy_on_google(data) |
| 120 | else: |
| 121 | status = False |
| 122 | resp = gettext('No cloud implementation.') |
| 123 | |
| 124 | if not status: |
| 125 | return make_json_response( |
| 126 | status=410, |
| 127 | success=0, |
| 128 | errormsg=sanitize_external_text(resp) |
| 129 | ) |
| 130 | |
| 131 | # Return response |
| 132 | return make_json_response( |
| 133 | success=1, |
| 134 | data={ |
| 135 | 'job_id': p.id, |
| 136 | 'desc': p.desc.message, |
| 137 | 'node': { |
| 138 | '_id': resp['sid'], |
| 139 | '_pid': data['db_details']['gid'], |
| 140 | 'connected': False, |
| 141 | '_type': 'server', |
| 142 | 'icon': 'icon-server-cloud-deploy', |
| 143 | 'id': 'server_{}'.format(resp['sid']), |
| 144 | 'inode': True, |
| 145 | 'label': resp['label'], |
| 146 | 'server_type': 'pg', |
| 147 | 'module': 'pgadmin.node.server', |
| 148 | 'cloud_status': -1 |
| 149 | }} |
| 150 | ) |
| 151 | |
| 152 | |
| 153 | def update_server(data): |
nothing calls this directly
no test coverage detected