Skip to content

Support Resource Manager API #851

Description

@stephenplusplus

Let's add support for the Resource Manager API to gcloud. I'm pretty excited about this one!

What is Resource Manager?

Resource Manager API

Activity

  1. stephenplusplus commented on Sep 10, 2015

    @stephenplusplus
    ContributorAuthor

    Given that Resource Manager is a lengthy term... and the concept is really just "projects"... and a project is so close to the core concept of using a gcp client library... I'm wondering if this is the first thing we should put directly onto the gcloud instance:

    var gcloud = require('gcloud')(/*...*/);
    
    gcloud.createProject('new-project-123', function(err, project) {});
    
    gcloud.getProjects(function(err, projects) {});
    
    var project = gcloud.project('grape-spaceship-123');
    
    project.delete(function(err) {});
    project.restore(function(err) {});
    
    project.getMetadata(function(err, metadata) {});
    project.setMetadata({/*...*/}, function(err) {});

    Edit: This idea doesn't really work. We need to be able to support lazy auth info, so we have to have a nested "Projects" class of some sort.


    Revised:

    var gcloud = require('gcloud');
    var projects = gcloud.projects(/* auth */);
    
    projects.createProject('new-project-123', function(err, project) {});
    
    projects.getProjects(function(err, projects) {});
    
    var project = projects.project('grape-spaceship-123');
    
    project.delete(function(err) {});
    project.restore(function(err) {});
    
    project.getMetadata(function(err, metadata) {});
    project.setMetadata({/*...*/}, function(err) {});
  2. callmehiphop commented on Sep 10, 2015

    @callmehiphop
    Contributor

    Is it likely that the resource manager api will ever do more than just projects?

  3. stephenplusplus commented on Sep 10, 2015

    @stephenplusplus
    ContributorAuthor

    It looks like there are Organizations as well (https://developers.google.com/apis-explorer/?hl=en_US#p/cloudresourcemanager/v1beta1/)

    Maybe it's best to just keep resources:

    var gcloud = require('gcloud');
    var resources = gcloud.resources({...});
    
    resources.getProjects();
    var project = resources.project('grape-spaceship-123');
  4. callmehiphop commented on Sep 10, 2015

    @callmehiphop
    Contributor

    I like that, projects.getProjects(...) read kinda funny to me.

  5. stephenplusplus commented on Sep 10, 2015

    @stephenplusplus
    ContributorAuthor

    Vote!

    // a
    var resources = gcloud.resources();
    resources.getProjects();
    resources.project('grape-spaceship-123');
    
    // b
    var resourceManager = gcloud.resourcemanager();
    resourceManager.getProjects();
    resourceManager.project('grape-spaceship-123');
    
    // c
    var resource = gcloud.resource();
    resource.getProjects();
    resource.project('grape-spaceship-123');
    
    // d
    ??
  6. callmehiphop commented on Sep 10, 2015

    @callmehiphop
    Contributor

    I like c.

    a sounds kinda funny to me with back to back plural nouns
    b is maybe a little too lengthy for my tastes

  7. stephenplusplus commented on Sep 10, 2015

    @stephenplusplus
    ContributorAuthor

    C it is!

  8. jgeewax commented on Sep 16, 2015

    @jgeewax
    Contributor

    Yea, creating right now can only be done by a "person". In Python, this works by first running gcloud auth login on the command-line.

    Does gcloud-node pick up the Cloud SDK's credentials in the same way? If so, these will work nicely.

    Eventually, service accounts will be able to create projects, but that isn't the case yet.

  9. stephenplusplus commented on Sep 16, 2015

    @stephenplusplus
    ContributorAuthor

    Replied over at #864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions