0
私はpythonスクリプトからgoogle pubsubを接続するためのサンプルコードを使用しています。私の組織はプロキシを使ってインターネットに接続しています。 googleクラウドでプロキシ設定を構成する方法を教えてください。私はHTTP_PROXY env変数を設定しようとしましたが、それでも失敗します。google pubsubのプロキシ設定
import json
from oauth2client.contrib.gce import AppAssertionCredentials
from oauth2client.service_account import ServiceAccountCredentials
from httplib2 import Http
from apiclient.discovery import build
credentials = AppAssertionCredentials('https://www.googleapis.com/auth/pubsub')
scopes = ['https://www.googleapis.com/auth/pubsub', ' https://www.googleapis.com/auth/cloud-platform','https://www.googleapis.com/auth/monitoring', 'https://www.googleapis.com/auth/monitoring.write' ,'https://www.googleapis.com/auth/cloud-platform' , 'https://www.googleapis.com/auth/monitoring.read']
credentials = ServiceAccountCredentials.from_json_keyfile_name('path to json file', scopes=scopes)
http_auth = credentials.authorize(Http())
pubsub1 = build('pubsub', 'v1',http=http_auth)