Skip to content

Create images #1672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
positlabs opened this issue Oct 6, 2016 · 3 comments
Closed

Create images #1672

positlabs opened this issue Oct 6, 2016 · 3 comments
Assignees
Labels
api: compute Issues related to the Compute Engine API. type: question Request for information or clarification. Not an issue.

Comments

@positlabs
Copy link

I'm attempting to automate our deployment process for compute engine, but I don't see any way to create images with this module. Is it possible?

Looking at the compute engine docs, it seems like it should be.

@callmehiphop
Copy link
Contributor

We currently don't support the Image API, however as a temporary workaround I think you can use Compute#request to make the request.

var compute = gcloud.compute();

compute.request({
  method: 'POST',
  uri: '/global/images',
  json: {
    name: 'image-name',
    rawDisk: {
      source: 'storage-path'
    }
  }
}, function(err, resp) {
  if (err) {
    // request error
  }

  var operation = compute.operation(resp.name);

  operation.on('complete', function() {
    // image is created
  });

  operation.on('error', function() {
    // error occured
  });
});

@callmehiphop callmehiphop added type: question Request for information or clarification. Not an issue. api: compute Issues related to the Compute Engine API. labels Oct 6, 2016
@stephenplusplus
Copy link
Contributor

Thanks for writing up that code @callmehiphop. That should indeed work.

We have an issue tracking all of the missing APIs from GCE that we still have to implement: #1073. Help is very welcome :)

@matsilva
Copy link

matsilva commented Jan 2, 2017

@callmehiphop thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: compute Issues related to the Compute Engine API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

4 participants