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

Integrate resource manager support #860

Merged

Conversation

stephenplusplus
Copy link
Contributor

Fixes #851

To Dos

Preview

var gcoud = require('gcloud');
var resource = gcloud.resource({/*...*/});

// Resource Level:
resource.createProject('grape-spaceship-123', function(err) {}); // (not sure if this works, see "Problems")

resource.getProjects([options], function(err, projects) {});
resource.getProjects([options]).on('data', function(project) {});

// Project Level:
var myProject = resource.project('grape-spaceship-123');

myProject.delete(function(err, apiResponse) {});
myProject.restore(function(err, apiResponse) {});

myProject.getMetadata(function(err, metadata, apiResponse) {});
myProject.setMetadata({/*...*/}, function(err, apiResponse) {});

Problems

I haven't been able to create a project programmatically, receiving a 403 error:

My project (that has resource manager API enabled) can list my projects and get their metadata. However, I get a 403 when I try to create one:

REQUEST
  method: 'POST'
  uri: 'https://cloudresourcemanager.googleapis.com/v1beta1/projects/'
  json: { projectId: 'gcloud-tests-1441915137564' }
  headers
   { Authorization: 'Bearer /*token*/',
     'User-Agent': 'gcloud-node/0.21.0' }

RESPONSE
  https://cloudresourcemanager.googleapis.com/v1beta1/projects/
  403
  Error: The caller does not have permission

  vary: 'X-Origin, Referer, Origin,Accept-Encoding'
  'content-type': 'application/json; charset=UTF-8'
  date: 'Thu, 10 Sep 2015 20:02:52 GMT'
  server: 'ESF'
  'cache-control': 'private'
  'x-xss-protection': '1; mode=block'
  'x-frame-options': 'SAMEORIGIN'
  'x-content-type-options': 'nosniff'
  'alternate-protocol': '443:quic,p=1'
  'alt-svc': 'quic=":443"; p="1"; ma=604800'
  'accept-ranges': 'none'
  connection: 'close'

I'm not sure how to auth this one; so far, gcloud lets users control one project's sub-services using a service account for it. What do we need to get to have control over all of their projects?

Maybe we just want to support modifying the project the user is on already? Deleting, undeleting, getting and setting metadata?

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 11, 2015
@jgeewax
Copy link
Contributor

jgeewax commented Sep 11, 2015

/cc @dhermes re system testing... I forget what we said here, I think it
may have been "meh, let's punt on that until service accounts can create
projects and stuff..." Correct me if I'm wrong?

On Fri, Sep 11, 2015 at 1:59 PM, Stephen Sawchuk [email protected]
wrote:

Fixes #851 #851
To Dos

  • Tests
    • Unit
      • project.js
      • index.js
    • System (Having issues with this...)
  • Docs
    • JSDocs
    • Build script
    • FE Overview

Problems

I haven't been able to create a project programmatically, receiving a 403
error:

My project (that has resource manager API enabled) can list my projects
and get their metadata. However, I get a 403 when I try to create one:

REQUEST
method: 'POST'
uri: 'https://cloudresourcemanager.googleapis.com/v1beta1/projects/'
json: { projectId: 'gcloud-tests-1441915137564' }
headers
{ Authorization: 'Bearer /token/',
'User-Agent': 'gcloud-node/0.21.0' }

RESPONSE
https://cloudresourcemanager.googleapis.com/v1beta1/projects/
403
Error: The caller does not have permission

vary: 'X-Origin, Referer, Origin,Accept-Encoding'
'content-type': 'application/json; charset=UTF-8'
date: 'Thu, 10 Sep 2015 20:02:52 GMT'
server: 'ESF'
'cache-control': 'private'
'x-xss-protection': '1; mode=block'
'x-frame-options': 'SAMEORIGIN'
'x-content-type-options': 'nosniff'
'alternate-protocol': '443:quic,p=1'
'alt-svc': 'quic=":443"; p="1"; ma=604800'
'accept-ranges': 'none'
connection: 'close'

I'm not sure how to auth this one; so far, gcloud lets users control one
project's sub-services using a service account for it. What do we need to
get to have control over all of their projects?

Maybe we just want to support modifying the project the user is on

already? Deleting, undeleting, getting and setting metadata?

You can view, comment on, or merge this pull request online at:

#860
Commit Summary

  • Integrate resource manager support

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#860.

@stephenplusplus
Copy link
Contributor Author

Checked off all the bullet points. It's ready to merge with these methods currently implemented and unit tested, but not exposed to our docs:

  • resource.createProject
  • project.delete
  • project.restore
  • project.setMetadata

These methods are exposed:

  • resource.getProjects
  • project.getMetadata

* @resource [Projects Overview]{@link https://cloud.google.com/compute/docs/networking#networks}
* @resource [projects: create API Documentation]{@link https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/create}
*
* @private

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

callmehiphop added a commit that referenced this pull request Sep 15, 2015
@callmehiphop callmehiphop merged commit 360940e into googleapis:master Sep 15, 2015
@callmehiphop
Copy link
Contributor

Looks good, thanks! Should we open a separate issue to keep track of project creation, etc.?

@stephenplusplus
Copy link
Contributor Author

Done!

@callmehiphop
Copy link
Contributor

👍

@callmehiphop
Copy link
Contributor

@jgeewax can you enable the resource manager api on the Travis project?

@jgeewax
Copy link
Contributor

jgeewax commented Sep 16, 2015 via email

@callmehiphop
Copy link
Contributor

Thanks!

sofisl pushed a commit that referenced this pull request Nov 11, 2022
…ialogflow products; fixed some API annotations (#860)

* feat: expose `Locations` service to get/list avaliable locations of Dialogflow products; fixed some API annotations

PiperOrigin-RevId: 389905442

Source-Link: googleapis/googleapis@4c984f3

Source-Link: googleapis/googleapis-gen@ea3337a

* 🦉 Updates from OwlBot

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

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this pull request Nov 11, 2022
🤖 I have created a release \*beep\* \*boop\*
---
## [4.3.0](https://www.github.com/googleapis/nodejs-dialogflow/compare/v4.2.0...v4.3.0) (2021-08-16)


### Features

* expose `Locations` service to get/list avaliable locations of Dialogflow products; fixed some API annotations ([#860](https://www.github.com/googleapis/nodejs-dialogflow/issues/860)) ([05ea702](https://www.github.com/googleapis/nodejs-dialogflow/commit/05ea702372c08d0f0f157419799e59ea983df32a))


### Bug Fixes

* **build:** migrate to using main branch ([#862](https://www.github.com/googleapis/nodejs-dialogflow/issues/862)) ([ec0635c](https://www.github.com/googleapis/nodejs-dialogflow/commit/ec0635c17384c4fc5661d8a046b50b3fc2920505))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
sofisl pushed a commit that referenced this pull request Jan 17, 2023
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/1bcecc39-aa5c-40f4-9453-955704c7ca01/targets

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

Source-Link: googleapis/synthtool@57c23fa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Resource Manager API
4 participants