MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / deploy_on_cloud

Function deploy_on_cloud

web/pgadmin/misc/cloud/__init__.py:110–150  ·  view source on GitHub ↗

Deploy on Cloud.

()

Source from the content-addressed store, hash-verified

108)
109@pga_login_required
110def 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
153def update_server(data):

Callers

nothing calls this directly

Calls 6

deploy_on_rdsFunction · 0.90
deploy_on_azureFunction · 0.90
deploy_on_googleFunction · 0.90
make_json_responseFunction · 0.90
sanitize_external_textFunction · 0.90
gettextFunction · 0.85

Tested by

no test coverage detected