Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@google-cloud/resource-manager

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/resource-manager

Cloud Resource Manager Client Library for Node.js

  • 5.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created

What is @google-cloud/resource-manager?

@google-cloud/resource-manager is a Node.js client library for Google Cloud Resource Manager. It allows you to programmatically manage Google Cloud resources such as projects, folders, and organizations. This package provides a way to create, update, delete, and retrieve metadata about these resources.

What are @google-cloud/resource-manager's main functionalities?

Create a Project

This feature allows you to create a new Google Cloud project programmatically. The code sample demonstrates how to use the ResourceManagerClient to create a project with a specified name and project ID.

const {ResourceManagerClient} = require('@google-cloud/resource-manager');
const client = new ResourceManagerClient();

async function createProject() {
  const [operation] = await client.createProject({
    project: {
      name: 'my-new-project',
      projectId: 'my-new-project-id'
    }
  });
  const [response] = await operation.promise();
  console.log('Project created:', response);
}

createProject().catch(console.error);

List Projects

This feature allows you to list all the projects under your Google Cloud account. The code sample demonstrates how to use the ResourceManagerClient to retrieve and print a list of projects.

const {ResourceManagerClient} = require('@google-cloud/resource-manager');
const client = new ResourceManagerClient();

async function listProjects() {
  const [projects] = await client.listProjects();
  projects.forEach(project => console.log(project));
}

listProjects().catch(console.error);

Get Project Details

This feature allows you to retrieve details of a specific project by its project ID. The code sample demonstrates how to use the ResourceManagerClient to get and print the details of a specified project.

const {ResourceManagerClient} = require('@google-cloud/resource-manager');
const client = new ResourceManagerClient();

async function getProjectDetails(projectId) {
  const [project] = await client.getProject({projectId});
  console.log('Project details:', project);
}

getProjectDetails('my-project-id').catch(console.error);

Delete a Project

This feature allows you to delete a specific project by its project ID. The code sample demonstrates how to use the ResourceManagerClient to delete a specified project.

const {ResourceManagerClient} = require('@google-cloud/resource-manager');
const client = new ResourceManagerClient();

async function deleteProject(projectId) {
  const [operation] = await client.deleteProject({projectId});
  await operation.promise();
  console.log('Project deleted:', projectId);
}

deleteProject('my-project-id').catch(console.error);

Other packages similar to @google-cloud/resource-manager

Keywords

FAQs

Package last updated on 21 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc