google-app-engine

WebSocket WS SSL

家住魔仙堡 提交于 2020-07-19 05:05:39
问题 I'm using Google App Engine/Managed VMs to develop a nodeJS application using web sockets. As part of the app, the front end needs to connect using Websockets e.g. connection = new WebSocket('wss://127.0.0.1:3001'); The bit that I'm struggling with is how to ensure that the SSL part works. My current code to start the WebSocketServer is: var WebSocketServer = require('ws').Server; var wss = new WebSocketServer({port:3001}); but this only creates a standard server (ie ws://127.0.0.1:3001). My

How to Mock a Google API Library with Python 3.7 for Unit Testing

两盒软妹~` 提交于 2020-07-18 05:09:34
问题 I'm trying to create a set of Unit Tests to test the Google Client Library for Bigquery. I'm struggling to make a Unittest file which will mock the client and will let me test my inputs. I've provided a simple script with some set functionality to return a list of Tables that belong to the DataSet. Would somebody show me a sample example of mocking the Google Client Library as the documentation I have found @ https://github.com/googleapis/google-cloud-python/blob/master/bigquery/tests/unit

How to Mock a Google API Library with Python 3.7 for Unit Testing

岁酱吖の 提交于 2020-07-18 05:08:49
问题 I'm trying to create a set of Unit Tests to test the Google Client Library for Bigquery. I'm struggling to make a Unittest file which will mock the client and will let me test my inputs. I've provided a simple script with some set functionality to return a list of Tables that belong to the DataSet. Would somebody show me a sample example of mocking the Google Client Library as the documentation I have found @ https://github.com/googleapis/google-cloud-python/blob/master/bigquery/tests/unit

How to upload an image to Google Cloud Storage from an image url in Node?

删除回忆录丶 提交于 2020-07-17 06:45:20
问题 Given an image url, how can I upload that image to Google Cloud Storage for image processing using Node.js? 回答1: It's a 2 steps process: Download file locally using request or fetch. Upload to GCL with the official library. var fs = require('fs'); var gcloud = require('gcloud'); // Authenticating on a per-API-basis. You don't need to do this if you auth on a // global basis (see Authentication section above). var gcs = gcloud.storage({ projectId: 'my-project', keyFilename: '/path/to/keyfile

How to upload an image to Google Cloud Storage from an image url in Node?

戏子无情 提交于 2020-07-17 06:45:15
问题 Given an image url, how can I upload that image to Google Cloud Storage for image processing using Node.js? 回答1: It's a 2 steps process: Download file locally using request or fetch. Upload to GCL with the official library. var fs = require('fs'); var gcloud = require('gcloud'); // Authenticating on a per-API-basis. You don't need to do this if you auth on a // global basis (see Authentication section above). var gcs = gcloud.storage({ projectId: 'my-project', keyFilename: '/path/to/keyfile

Google App Engine - Static IP address (Custom Domain)

孤人 提交于 2020-07-10 06:36:09
问题 I have a question regarding IP Address in Google App Engine . I know there is no way to have a static IP-address, but my client have setup a Custom Domain with some IP-address showing up. My problem is: There is an endpoint(API) that they are connected on, the problem is that the destination requires IP-address and PORT to open in their firewall-policy. Since there is no "Static IP" on Google App Engine, can i use those IP-address showing under "data" in Google App Engine in Custom Domains ?

How to setup psycopg2 with Google App Engine PostgreSQL database

时光总嘲笑我的痴心妄想 提交于 2020-07-09 19:56:27
问题 I have an application that is being run on Google's App Engine and I want it to use the associated PostgreSQL database. I'm using psycopg2 to help me with my SQL queries. However I am not sure how I can set up the connection. This is what I currently have: con = psycopg2.connect( host=HOST_NAME, # the IP address of the SQL database database=DATABASE_NAME, # the name of the database (I'm using the default, so this is "postgres" user=USER_NAME, # just the user name that I created password

Server App Engine Standard at localhost failed to start

限于喜欢 提交于 2020-07-09 12:34:24
问题 From eclipse, I created a Google App Engine Standard project and tried to Run it on local App Engine. It is not starting and throwing the below errors - java.lang.NullPointerException at java.base/java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011) at java.base/java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1006) at java.base/java.util.Properties.put(Properties.java:1316) at java.base/java.util.Collections$CheckedMap.put(Collections.java:3636) at com

gcloud app deploy - updating service default fails with code 13 Quota for instances limit exceeded, and 401 unathorizeed

◇◆丶佛笑我妖孽 提交于 2020-07-09 11:54:06
问题 Created a new project, on first deploy I get this: Updating service [default] (this may take several minutes)...failed. ERROR: (gcloud.app.deploy) Error Response: [13] Flex operation projects/primalexchange/regions/us-east1/operations/b5a5813a-14bf-43b6-af7f-e17b15866c4f error [INTERNAL]: An internal error occurred while processing task /appengine-flex-v1/insert_flex_deployment/flex_create_resources>2020-05-16T23:23:08.373Z4721.jc.14: Deployment Manager operation primalexchange/operation

Google App Engine deployment fails because of failing readiness check

早过忘川 提交于 2020-07-09 11:51:14
问题 A custom app engine environment fails to start up and it seems to be due to failing health checks. The app has a few custom dependencies (e.g. PostGIS, GDAL) so a few layers on top of the app engine image. It builds successfully and it runs locally in a Docker container. ERROR: (gcloud.app.deploy) Error Response: [4] Your deployment has failed to become healthy in the allotted time and therefore was rolled back. If you believe this was an error, try adjusting the 'app_start_timeout_sec'