google / cloud-asset
Google Cloud Asset PHP客户端
v2.0.1
2024-09-13 22:45 UTC
Requires
- php: ^8.0
- google/access-context-manager: ^1.0
- google/cloud-osconfig: ^1.0
- google/gax: ^1.34.0
Requires (Dev)
- google/cloud-core: ^1.52.7
- phpunit/phpunit: ^9.0
Suggests
- ext-grpc: Enables use of gRPC, a universal high-performance RPC framework created by Google.
- ext-protobuf: Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions.
- dev-main
- v2.0.1
- v2.0.0
- v2.0.0-RC1
- v1.16.4
- v1.16.3
- v1.16.2
- v1.16.1
- v1.16.0
- v1.15.1
- v1.15.0
- v1.14.4
- v1.14.3
- v1.14.2
- v1.14.1
- v1.14.0
- v1.13.2
- v1.13.1
- v1.13.0
- v1.12.2
- v1.12.1
- v1.12.0
- v1.11.3
- v1.11.2
- v1.11.1
- v1.11.0
- v1.10.2
- v1.10.1
- v1.10.0
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.0
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.8
- v1.6.7
- v1.6.6
- v1.6.5
- v1.6.4
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.0
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.0
- v0.6.1
- v0.6.0
- v0.5.0
- v0.4.0
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
This package is auto-updated.
Last update: 2024-09-13 22:49:00 UTC
README
Google Cloud Asset的惯用PHP客户端。
注意:此存储库是Google Cloud PHP的一部分。有关支持请求、错误报告或开发贡献,请将该项目指向该项目。
安装
首先,安装PHP首选的依赖关系管理器 Composer。
现在安装此组件
$ composer require google/cloud-asset
此组件支持HTTP/1.1上的REST和gRPC。为了利用gRPC(如流方法)提供的优势,请参阅我们的gRPC安装指南。
身份验证
有关对客户端进行身份验证的更多信息,请参阅我们的身份验证指南。一旦身份验证,您就可以开始发送请求。
示例
require_once __DIR__ . '/vendor/autoload.php'; use Google\Cloud\Asset\V1\AssetServiceClient; use Google\Cloud\Asset\V1\GcsDestination; use Google\Cloud\Asset\V1\OutputConfig; $objectPath = 'gs://your-bucket/cai-export'; // Now you need to change this with your project number (numeric id) $project = 'example-project'; $client = new AssetServiceClient(); $gcsDestination = new GcsDestination(['uri' => $objectPath]); $outputConfig = new OutputConfig(['gcs_destination' => $gcsDestination]); $resp = $client->exportAssets("projects/$project", $outputConfig); $resp->pollUntilComplete(); if ($resp->operationSucceeded()) { echo "The result is dumped to $objectPath successfully." . PHP_EOL; } else { $error = $resp->getError(); // handleError($error) }
版本
此组件被认为是GA(通常可用)。因此,它不会在任何次要或补丁版本中引入不兼容的更改。我们将优先解决问题和请求。
下一步
- 了解官方文档。