【问题标题】:gcloud stop exception - regex / Values must match the following regular expressiongcloud 停止异常 - 正则表达式 / 值必须与以下正则表达式匹配
【发布时间】:2017-06-10 16:26:44
【问题描述】:

我尝试使用gcloud compute instances stop 来停止一台或多台机器。我使用以下命令:

sudo gcloud compute instances stop machine1,machine2 --zone=europe-west1-b

所以它会发送列表,因为我知道我应该按照文档进行操作。它给了我以下例外:

Invalid value '[machine1,machine2]'. Values must match the following regular expression: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?

我应该如何发送?

【问题讨论】:

    标签: regex gcloud


    【解决方案1】:

    gcloud 中,这应该是一个正则表达式参数(看起来)

    machine1,machine2
    

    从错误中,

    [a-z](?:[-a-z0-9]{0,61}[a-z0-9])?
    

    很明显,正则表达式参数不应包含 alphanumerics- 以外的任何内容。参数 machine1,machine2 包含 , 这就是您收到错误的原因。

    尝试在机器名称中留出空格machine1 machine2

    P.S:我对 gcloud 没有任何线索。

    【讨论】:

    • 这是正确答案。试试sudo gcloud compute instances stop machine1 machine2
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-07
    • 2011-08-05
    • 1970-01-01
    • 1970-01-01
    • 2022-07-20
    • 1970-01-01
    相关资源
    最近更新 更多