久久久久久久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)
主站蜘蛛池模板: 精品国产乱码久久久久久中文 | 国产精品一区二区三区在线 | 欧美一a一片一级一片 | 看a网站 | 免费观看一级特黄欧美大片 | 四虎影 | 在线看免费的a | 天天拍夜夜爽 | 亚洲成人av一区二区 | 国产福利资源 | 成年人黄色一级片 | 中文av网站| 婷婷色国产偷v国产偷v小说 | 亚洲二区视频 | 国产一区二区三区色淫影院 | 亚洲午夜视频在线观看 | 欧美精品在线一区 | 99色综合| 国产精品成av人在线视午夜片 | 精品国产一区探花在线观看 | 久久久婷婷 | 国产一区二区三区视频 | 国产激情视频在线 | 国精产品一品二品国精在线观看 | 91久久精品日日躁夜夜躁国产 | 日韩精品一区二区三区在线观看 | av黄色免费在线观看 | 日本a视频| 久色网 | aaa一区 | 国产一级片 | 精品在线一区二区三区 | 国产精品久久久久久久久久久久久 | 国产精品视频一区二区三区不卡 | 黄色一级大片在线免费看产 | 综合激情av | 99视频免费在线观看 | 欧美一级三级在线观看 | 国产成人精品一区二区三区视频 | 亚洲精品乱码 | 亚洲a视|