Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud storage 无法删除Google云存储对象更改通知webhook_Google Cloud Storage - Fatal编程技术网

Google cloud storage 无法删除Google云存储对象更改通知webhook

Google cloud storage 无法删除Google云存储对象更改通知webhook,google-cloud-storage,Google Cloud Storage,2015年,我创建了一个webhook,使用命令gsutil notification watchbucket来监视bucket上的更改https://my-project.appspot.com/myWebHook gs://my bucket/ 今天我想删除它,但我不能这样做 gsutil通知列表-o gs://my bucket/向我显示当前的webhook 它返回的是这样的东西: Notification channel 1: Channel identifier: so

2015年,我创建了一个webhook,使用命令
gsutil notification watchbucket来监视bucket上的更改https://my-project.appspot.com/myWebHook gs://my bucket/

今天我想删除它,但我不能这样做

gsutil通知列表-o gs://my bucket/
向我显示当前的webhook

它返回的是这样的东西:

Notification channel 1:
        Channel identifier: someid-905e-905e-905e-1fdca170d689
        Resource identifier: myIdentifierXXXfncnI0SuU-U
        Application URL: url=https://my-project.appspot.com/myWebHook&appEngine=true
        Created by:
        Creation time: 2015-09-08 11:44:26.775000
当我尝试使用命令
gsutil notification stopchannel someid-905e-905e-905e-1fdca170d689 myIdentifierXXXfncnI0SuU-U将其删除时

我明白了:
NotFoundException:404频道“someid-905e-905e-905e-1fdca170d689”未找到用于项目“32555940559”的


所有这些都是用我的账户完成的,我的账户是项目的所有者。顺便说一下,根据官方文档,错误消息中的项目id不是我的项目的id

在对象更改中配置授权有三个步骤 通知场景:

1.创建服务帐户

2.配置gsutil以使用服务帐户

3.识别要接收通知的域


要删除通知频道,您必须标识用于创建频道的服务帐户(此频道的所有者服务帐户)。然后,您必须配置
gsutil
以使用特定的服务帐户并删除通知通道。因此,试图通过授权使用您的个人帐户执行此操作将不起作用。

根据官方文档:

在对象更改中配置授权有三个步骤 通知场景:

1.创建服务帐户

2.配置gsutil以使用服务帐户

3.识别要接收通知的域


要删除通知频道,您必须标识用于创建频道的服务帐户(此频道的所有者服务帐户)。然后,您必须配置
gsutil
以使用特定的服务帐户并删除通知通道。因此,尝试通过授权使用您的个人帐户执行此操作将不起作用。

我遇到了同样的问题,并通过使用我的主默认服务帐户验证
gcloud
解决了此问题(这可能是创建观察者时使用的帐户):

然后,我可以列出我的所有观察者,以获取通道ID和资源ID

gsutil notification list -o gs://my-project.appspot.com/
注意,在下一个命令中,我不能像
gs://my project.appspot.com/
那样使用bucket路径,而是必须使用
列表中的“Resource identifier”值

Bucket my-project.appspot.com has the following active Object Change Notifications:
        Notification channel 1:
                Channel identifier: prod
                Resource identifier: asdf1234
                Application URL: url=https://my-project.appspot.com/api/gcs&appEngine=true
                Created by: 
                Creation time: 2019-02-11 16:16:07.955000
        Notification channel 2:
                Channel identifier: dev
                Resource identifier: 1234asdf
                Application URL: url=https://my-project.appspot.com/api/gcs&appEngine=true
                Created by: 
                Creation time: 2019-02-11 16:21:40.864000

然后,此命令删除了prod通道:

gsutil notification stopchannel prod asdf1234
Removing channel prod with resource identifier asdf1234 ...
Succesfully removed channel.

我遇到了同样的问题,通过使用我的主默认服务帐户(这可能是创建观察者时使用的帐户)验证
gcloud
解决了这个问题:

然后,我可以列出我的所有观察者,以获取通道ID和资源ID

gsutil notification list -o gs://my-project.appspot.com/
注意,在下一个命令中,我不能像
gs://my project.appspot.com/
那样使用bucket路径,而是必须使用
列表中的“Resource identifier”值

Bucket my-project.appspot.com has the following active Object Change Notifications:
        Notification channel 1:
                Channel identifier: prod
                Resource identifier: asdf1234
                Application URL: url=https://my-project.appspot.com/api/gcs&appEngine=true
                Created by: 
                Creation time: 2019-02-11 16:16:07.955000
        Notification channel 2:
                Channel identifier: dev
                Resource identifier: 1234asdf
                Application URL: url=https://my-project.appspot.com/api/gcs&appEngine=true
                Created by: 
                Creation time: 2019-02-11 16:21:40.864000

然后,此命令删除了prod通道:

gsutil notification stopchannel prod asdf1234
Removing channel prod with resource identifier asdf1234 ...
Succesfully removed channel.

2015年,当我创建webhook时,我认为不需要服务帐户。所以现在我不确定是否能够删除它:/2015年我建议您联系GCP支持部门,当我创建我的webhook时,我认为不需要服务帐户。因此,现在我不确定是否能够删除它:/I我建议您联系GCP支持部门,感谢您的回复,不幸的是,在我使用默认服务帐户时,我收到了错误:
AccessDeniedException:403呼叫方不是订阅所有者
感谢您的回复,不幸的是,在我使用默认服务帐户的情况下,我得到了一个错误:
AccessDeniedException:403调用者不是订阅的所有者
项目32555940559似乎属于谷歌(Google.com:cloudsdktool)项目32555940559似乎属于谷歌(Google.com:cloudsdktool)