【问题标题】:Access a table on BigQuery using the API on APP Scritps使用 APP 脚本上的 API 访问 BigQuery 上的表
【发布时间】:2021-04-27 17:32:27
【问题描述】:

我正在尝试执行以下功能。但是,我收到一个错误:

GoogleJsonResponseException:对 bigquery.jobs.query 的 API 调用失败并出现错误:VPC 服务控制:组织政策禁止请求。 vpcServiceControlsUniqueIdentifier:09RldtnW9WG7f6KXB0Mnq6Sdp9a9PNeHnH5do8kyQJWFebex6fz65w。

我可以访问项目,它不存在任何禁止的东西。

我需要插入一个授权令牌吗?我该怎么做?

function runQuery() {
  // Replace this value with the project ID listed in the Google
  // Cloud Platform project.
  var projectId = 'vf-grp-ngbi-prd-svcs-01';

  var request = {
    useQueryCache: false,
    allowLargeResults: true,
    useLegacySql: false,
    query: " SELECT DISTINCT  ct.cust_type_loc_1_lvl_1_name FROM   `vf-pt-datahub.vfpt_dh_lake_edw_integrated_s.d_customer_type` ct WHERE end_dttm is not null"
  };
  var queryResults = BigQuery.Jobs.query(request, projectId)
  
  return queryResults;
}

【问题讨论】:

    标签: google-apps-script google-api google-bigquery google-oauth


    【解决方案1】:

    该错误与您的组织管理员建立了阻止此交互的其他控制一致。有关 VPC 服务控制的更多信息,请参阅https://cloud.google.com/vpc-service-controls

    下一步可能是与您自己的管理员联系以了解更多信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-07
      • 2018-11-29
      相关资源
      最近更新 更多