gcp.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:dcos-launch 作者: dcos 项目源码 文件源码
def __init__(self, credentials_dict):
        """
        Build GCE service account credentials from info stored in environment variables, then build a GCE API wrapper
            with those credentials. Only one of the two environment variables must be set.
        :param creds_env_var_name: JSON string that contains your GCE service account credentials
        :param creds_path_env_var_name: string that contains the path to the file containing your GCE service account
            credentials.
        """
        credentials = ServiceAccountCredentials.from_json_keyfile_dict(
            credentials_dict, scopes='https://www.googleapis.com/auth/cloud-platform')

        self.compute = discovery.build('compute', 'v1', credentials=credentials)
        self.deployment_manager = discovery.build('deploymentmanager', 'v2', credentials=credentials)
        self.project_id = credentials_dict['project_id']
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号