简体   繁体   English

Google Compute Engine重新启动实例

[英]Google Compute Engine Restart Instances

I'm using java script to create/delate/restart instances in google cloud compute engine, create and delete works fine but with reset I have some issues. 我正在使用Java脚本在Google云计算引擎中创建/删除/重新启动实例,创建和删除的效果很好,但是在重置时出现了一些问题。

function resetInstances() {
                var request = gapi.client.compute.instances.reset({
                    'project': 'project-name',
                    'name': 'instaces-name',
                    'zone': 'europe-west1-a'
                });
                executeRequest(request, 'resetInstances');
            }

API_VERSION = 'v1beta16', I have the same issues with v1. API_VERSION ='v1beta16',我对v1有相同的问题。 scopes = ' https://www.googleapis.com/auth/compute '; scopes =' https://www.googleapis.com/auth/compute ';

When I execute gapi.client.compute.instances.reset method I get "undefined" nothing more ;/ Could you provide me with some information to help me resolve this issues. 当我执行gapi.client.compute.instances.reset方法时,我什么也没得到“未定义”; /您能否提供一些信息来帮助我解决此问题。

The instance name parameter should be 'instance' rather than 'name'. 实例名称参数应为“实例”而不是“名称”。 Try the following code: 尝试以下代码:

function resetInstances() {
  var request = gapi.client.compute.instances.reset({
    'project': 'project-name',
    'instance': 'instance-name',
    'zone': 'europe-west1-a'
  });
  executeRequest(request, 'resetInstances');
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM