久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何以編程方式使用 PHP Lib 在 Google Console Cloud 平

How to create project in Google Console Cloud platform using PHP Lib programmatically?(如何以編程方式使用 PHP Lib 在 Google Console Cloud 平臺中創建項目?)
本文介紹了如何以編程方式使用 PHP Lib 在 Google Console Cloud 平臺中創建項目?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在嘗試使用 PHP 客戶端庫在 Google 控制臺云中創建一個項目.我從 https://cloud 復制了此示例代碼.google.com/resource-manager/reference/rest/v1/projects/create#php

I am trying to create a project in the Google console cloud using the PHP client library. I copied this sample code from https://cloud.google.com/resource-manager/reference/rest/v1/projects/create#php

采取的步驟/遇到問題:

  1. 這一行"$requestBody = new Google_Service_CloudResourceManager_Project(); ".

拋出錯誤:未找到 Google_Service_CloudResourceManager_Project 類".

Throwing error : 'Class Google_Service_CloudResourceManager_Project not found'.

然后我檢查了試試這個 API"菜單,我們可以使用 Google API Explorer 將 JSON 傳遞給 API.我使用 Google API Explorer 進行了測試,結果運行良好.(看截圖)

Then I checked in the "Try this API" menu, we can pass the JSON to API with Google API Explorer. I tested with Google API Explorer and the results are working fine. (See screenshot)

注釋這一行$requestBody = new Google_Service_CloudResourceManager_Project();";并嘗試傳遞創建方法所需的 json(因為我已經檢查了試試這個 API"菜單).

Commenting this line "$requestBody = new Google_Service_CloudResourceManager_Project();" and trying to pass the json required to create method ( as i have checked in "Try this API" menu).

拋出錯誤:調用成員函數 create() 在這一行的 null 上"$response = $service->projects->create($requestBody);".

Throwing error : Call to a member function create() on null at this line "$response = $service->projects->create($requestBody);".

我的 Google OAuth 腳本工作正常,只有這個項目創建腳本有問題

PHP 腳本:

$client = new Google_Client();

$client->setApplicationName('Google-CloudResourceManagerSample/0.1');
//$client->useApplicationDefaultCredentials();
$client->addScope('https://www.googleapis.com/auth/cloud-platform');

$service = new Google_Service_CloudResourceManager($client);

// TODO: Assign values to desired properties of `requestBody`:

//$requestBody = new Google_Service_CloudResourceManager_Project();

$requestBody = '{
                  "name": "bob kris project 2",
                  "projectId": "bk-project-290016"
                }';

$response = $service->projects->create($requestBody);

// TODO: Change code below to process the `response` object:
echo '<pre>', var_export($response, true), '</pre>', "
";

die;

推薦答案

這似乎是 Google 內部的問題.我重新創建了您的場景并得到了相同的結果.我聯系了 Cloud App Engine 工程團隊并重定向了您的請求.另外,我們已經開通了一個公眾票,所有與谷歌的交流都會在那里繼續.

It seems that this is a Google internal issue. I recreated your scenario and have the same result. I contacted a Cloud App Engine engineering team and redirected your request. Also, we have already opened a public ticket, and all communication with Google will continue there.

這篇關于如何以編程方式使用 PHP Lib 在 Google Console Cloud 平臺中創建項目?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數組自動填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 久久亚洲一区二区 | 一区免费观看 | 国产精品99久久久久久宅男 | 日本免费黄色 | 国产精品九九九 | 夜夜夜操 | www.日本在线播放 | 日韩中文字幕在线不卡 | 色综合网站 | 美女三区 | 亚洲精品一二三区 | 日韩精品一区二区三区在线观看 | 日韩中文一区二区三区 | 欧美亚洲一级 | 成人在线免费av | 精品国产一级 | 成人亚洲性情网站www在线观看 | 人人天天操 | 欧美一区2区三区4区公司 | 久久99久久 | 国产一区二区三区色淫影院 | 日韩精品在线一区二区 | 一级片av | 国产精品久久一区二区三区 | 欧美一级二级视频 | 国产成人精品在线播放 | 久久久久久成人 | 96久久久久久 | 伊人狠狠操| 国产成人综合在线 | 久久综合成人精品亚洲另类欧美 | 亚洲一区二区精品视频在线观看 | 亚洲综合首页 | 日本黄色免费视频 | 精品久久国产 | 国产日本精品视频 | 北条麻妃99精品青青久久主播 | 国产99久久久久 | 午夜在线小视频 | 不卡一区 | 亚州午夜精品 |