api - 谷歌防火墙 API 的 PHP 脚本
问题描述
我正在尝试做一个简单的脚本来更改我的虚拟机主机上的防火墙规则。我用的是google API explorer,生成的脚本如下
curl --request PUT \ 'https://www.googleapis.com/compute/v1/projects/learnstoresg/global/firewalls/intranet2?requestId=00000000-0000-0000-0000-000000000033' \
--header 'Authorization: Bearer [YOUR_BEARER_TOKEN]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"allowed":[{"IPProtocol":"TCP","ports":["4033","4016"]}],"sourceRanges":["101.127.7.227"]}' \
--compressed
任何人都有用于谷歌防火墙的 php 脚本示例,或者可以帮助我将此 CURL 语句转换为 php 脚本吗?
解决方案
推荐阅读
- laravel-5 - 访问存储在 Amazon S3 中的图像时出错
- python - 如何从该站点获取图像?
- kubernetes - 从远程客户端访问 kubernetes web ui
- websphere - 将决策服务器配置为使用 WAS 8.5.5 JDK 1.7_64 的独立配置文件 IBM ODM 8.9.2 时出错
- mongodb - 如何在 Mongodb 中找到没有 _id 的单个值?
- sql - 如何使用触发器根据日期更改列值?
- facebook - 如何使用 Facebook 的开放图形标签“product.group”?
- python - IDLE 识别的错误 python 安装/或 IDLE 不识别 Anaconda
- sql - 转换为实体框架 Lambda
- php - 创建事务控制器导致意外错误