Skip to content
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

Support Resource Manager API #851

Closed
stephenplusplus opened this issue Sep 4, 2015 · 9 comments · Fixed by #860
Closed

Support Resource Manager API #851

stephenplusplus opened this issue Sep 4, 2015 · 9 comments · Fixed by #860
Assignees

Comments

@stephenplusplus
Copy link
Contributor

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

@stephenplusplus
Copy link
Contributor Author

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) {});

@callmehiphop
Copy link
Contributor

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

@stephenplusplus
Copy link
Contributor Author

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');

@callmehiphop
Copy link
Contributor

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

@stephenplusplus
Copy link
Contributor Author

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
??

@callmehiphop
Copy link
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

@stephenplusplus
Copy link
Contributor Author

C it is!

@jgeewax
Copy link
Contributor

jgeewax commented Sep 16, 2015

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.

@stephenplusplus
Copy link
Contributor Author

Replied over at #864

sofisl pushed a commit that referenced this issue Jan 17, 2023
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/959b7829-922a-41dc-a5a7-1178c3a8f0e7/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@363fe30
sofisl pushed a commit that referenced this issue Jan 24, 2023
* docs(samples): include metadata file, add exclusions for samples to handwritten libraries

PiperOrigin-RevId: 429395631

Source-Link: googleapis/googleapis@84594b3

Source-Link: googleapis/googleapis-gen@ed74f97
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: update v2.14.1 gapic-generator-typescript

Committer: @summer-ji-eng
PiperOrigin-RevId: 433031262

Source-Link: googleapis/googleapis@2a55d13

Source-Link: googleapis/googleapis-gen@2fce389
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZjZTM4OTNhZTlkYTQ3NzYzZTA4NzJjNGEzYTg3ZDlmZjc4NzcxZiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: update v2.14.2 gapic-generator-typescript

Committer: @summer-ji-eng
PiperOrigin-RevId: 434859890

Source-Link: googleapis/googleapis@bc2432d

Source-Link: googleapis/googleapis-gen@930b673
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTMwYjY3MzEwM2U5MjUyM2Y4Y2ZlZDM4ZGVjZDdkM2FmYWU4ZWJlNyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: remove unused imports

PiperOrigin-RevId: 439629269

Source-Link: googleapis/googleapis@8d458c8

Source-Link: googleapis/googleapis-gen@065f181
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDY1ZjE4MTM4NjMwYWM0YzkyMGFjNGJjNzFiNDQ3MDk4Mzg5ZGJhMiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix: use full link in comment to fix JSDoc broken link

Committer: @summer-ji-eng
PiperOrigin-RevId: 440481666

Source-Link: googleapis/googleapis@6a21110

Source-Link: googleapis/googleapis-gen@e6e39af
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTZlMzlhZmYzM2I5MGE2M2ExOGU5MDgxZTQ4MGIwOGE0MWM1NDhhYyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix: manual test

* fix test case for recognize voice

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Jeffrey Rennie <rennie@google.com>
Co-authored-by: Summer Ji <summerji@google.com>
sofisl pushed a commit that referenced this issue Jan 25, 2023
* docs(samples): include metadata file, add exclusions for samples to handwritten libraries

PiperOrigin-RevId: 429395631

Source-Link: googleapis/googleapis@84594b3

Source-Link: googleapis/googleapis-gen@ed74f97
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: update v2.14.1 gapic-generator-typescript

Committer: @summer-ji-eng
PiperOrigin-RevId: 433031262

Source-Link: googleapis/googleapis@2a55d13

Source-Link: googleapis/googleapis-gen@2fce389
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZjZTM4OTNhZTlkYTQ3NzYzZTA4NzJjNGEzYTg3ZDlmZjc4NzcxZiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: update v2.14.2 gapic-generator-typescript

Committer: @summer-ji-eng
PiperOrigin-RevId: 434859890

Source-Link: googleapis/googleapis@bc2432d

Source-Link: googleapis/googleapis-gen@930b673
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTMwYjY3MzEwM2U5MjUyM2Y4Y2ZlZDM4ZGVjZDdkM2FmYWU4ZWJlNyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: remove unused imports

PiperOrigin-RevId: 439629269

Source-Link: googleapis/googleapis@8d458c8

Source-Link: googleapis/googleapis-gen@065f181
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDY1ZjE4MTM4NjMwYWM0YzkyMGFjNGJjNzFiNDQ3MDk4Mzg5ZGJhMiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix: use full link in comment to fix JSDoc broken link

Committer: @summer-ji-eng
PiperOrigin-RevId: 440481666

Source-Link: googleapis/googleapis@6a21110

Source-Link: googleapis/googleapis-gen@e6e39af
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTZlMzlhZmYzM2I5MGE2M2ExOGU5MDgxZTQ4MGIwOGE0MWM1NDhhYyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix: manual test

* fix test case for recognize voice

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Jeffrey Rennie <rennie@google.com>
Co-authored-by: Summer Ji <summerji@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants