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

@google-cloud/apihub

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/apihub

API hub API client for Node.js

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Google Cloud Platform logo

API hub API: Node.js Client

release level npm version

API hub API client for Node.js

A comprehensive list of changes in each version may be found in the CHANGELOG.

Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.

Table of contents:

Quickstart

Before you begin

  1. Select or create a Cloud Platform project.
  2. Enable billing for your project.
  3. Enable the API hub API API.
  4. Set up authentication with a service account so you can access the API from your local workstation.

Installing the client library

npm install @google-cloud/apihub

Using the client library

/**
 * This snippet has been automatically generated and should be regarded as a code template only.
 * It will require modifications to work.
 * It may require correct/in-range values for request initialization.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  Required. The parent, which owns this collection of deployment resources.
 *  Format: `projects/{project}/locations/{location}`
 */
// const parent = 'abc123'
/**
 *  Optional. An expression that filters the list of Deployments.
 *  A filter expression consists of a field name, a comparison
 *  operator, and a value for filtering. The value must be a string. The
 *  comparison operator must be one of: `<`, `>` or
 *  `=`. Filters are not case sensitive.
 *  The following fields in the `Deployments` are eligible for filtering:
 *    * `display_name` - The display name of the Deployment. Allowed
 *    comparison operators: `=`.
 *    * `create_time` - The time at which the Deployment was created. The
 *    value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339
 *    format. Allowed comparison operators: `>` and `<`.
 *    * `resource_uri` - A URI to the deployment resource. Allowed
 *    comparison operators: `=`.
 *    * `api_versions` - The API versions linked to this deployment. Allowed
 *    comparison operators: `:`.
 *    * `deployment_type.enum_values.values.id` - The allowed value id of the
 *    deployment_type attribute associated with the Deployment. Allowed
 *    comparison operators: `:`.
 *    * `deployment_type.enum_values.values.display_name` - The allowed value
 *    display name of the deployment_type attribute associated with the
 *    Deployment. Allowed comparison operators: `:`.
 *    * `slo.string_values.values` -The allowed string value of the slo
 *    attribute associated with the deployment. Allowed comparison
 *    operators: `:`.
 *    * `environment.enum_values.values.id` - The allowed value id of the
 *    environment attribute associated with the deployment. Allowed
 *    comparison operators: `:`.
 *    * `environment.enum_values.values.display_name` - The allowed value
 *    display name of the environment attribute associated with the deployment.
 *    Allowed comparison operators: `:`.
 *  Expressions are combined with either `AND` logic operator or `OR` logical
 *  operator but not both of them together i.e. only one of the `AND` or `OR`
 *  operator can be used throughout the filter string and both the operators
 *  cannot be used together. No other logical operators are supported. At most
 *  three filter fields are allowed in the filter string and if provided
 *  more than that then `INVALID_ARGUMENT` error is returned by the API.
 *  Here are a few examples:
 *    * `environment.enum_values.values.id: staging-id` - The allowed value id
 *    of the environment attribute associated with the Deployment is
 *    _staging-id_.
 *    * `environment.enum_values.values.display_name: \"Staging Deployment\"` -
 *    The allowed value display name of the environment attribute associated
 *    with the Deployment is `Staging Deployment`.
 *    * `environment.enum_values.values.id: production-id AND create_time <
 *    \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
 *    The allowed value id of the environment attribute associated with the
 *    Deployment is _production-id_ and Deployment was created before
 *    _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
 *    * `environment.enum_values.values.id: production-id OR
 *    slo.string_values.values: \"99.99%\"`
 *    - The allowed value id of the environment attribute Deployment is
 *    _production-id_ or string value of the slo attribute is _99.99%_.
 */
// const filter = 'abc123'
/**
 *  Optional. The maximum number of deployment resources to return. The service
 *  may return fewer than this value. If unspecified, at most 50 deployments
 *  will be returned. The maximum value is 1000; values above 1000 will be
 *  coerced to 1000.
 */
// const pageSize = 1234
/**
 *  Optional. A page token, received from a previous `ListDeployments` call.
 *  Provide this to retrieve the subsequent page.
 *  When paginating, all other parameters (except page_size) provided to
 *  `ListDeployments` must match the call that provided the page token.
 */
// const pageToken = 'abc123'

// Imports the Apihub library
const {ApiHubClient} = require('@google-cloud/apihub').v1;

// Instantiates a client
const apihubClient = new ApiHubClient({fallback: 'rest'});

async function callListDeployments() {
  // Construct request
  const request = {
    parent,
  };

  // Run request
  const iterable = apihubClient.listDeploymentsAsync(request);
  for await (const response of iterable) {
    console.log(response);
  }
}

callListDeployments();

Samples

Samples are in the samples/ directory. Each sample's README.md has instructions for running its sample.

SampleSource CodeTry it
Api_hub.create_apisource codeOpen in Cloud Shell
Api_hub.create_attributesource codeOpen in Cloud Shell
Api_hub.create_deploymentsource codeOpen in Cloud Shell
Api_hub.create_external_apisource codeOpen in Cloud Shell
Api_hub.create_specsource codeOpen in Cloud Shell
Api_hub.create_versionsource codeOpen in Cloud Shell
Api_hub.delete_apisource codeOpen in Cloud Shell
Api_hub.delete_attributesource codeOpen in Cloud Shell
Api_hub.delete_deploymentsource codeOpen in Cloud Shell
Api_hub.delete_external_apisource codeOpen in Cloud Shell
Api_hub.delete_specsource codeOpen in Cloud Shell
Api_hub.delete_versionsource codeOpen in Cloud Shell
Api_hub.get_apisource codeOpen in Cloud Shell
Api_hub.get_api_operationsource codeOpen in Cloud Shell
Api_hub.get_attributesource codeOpen in Cloud Shell
Api_hub.get_definitionsource codeOpen in Cloud Shell
Api_hub.get_deploymentsource codeOpen in Cloud Shell
Api_hub.get_external_apisource codeOpen in Cloud Shell
Api_hub.get_specsource codeOpen in Cloud Shell
Api_hub.get_spec_contentssource codeOpen in Cloud Shell
Api_hub.get_versionsource codeOpen in Cloud Shell
Api_hub.list_api_operationssource codeOpen in Cloud Shell
Api_hub.list_apissource codeOpen in Cloud Shell
Api_hub.list_attributessource codeOpen in Cloud Shell
Api_hub.list_deploymentssource codeOpen in Cloud Shell
Api_hub.list_external_apissource codeOpen in Cloud Shell
Api_hub.list_specssource codeOpen in Cloud Shell
Api_hub.list_versionssource codeOpen in Cloud Shell
Api_hub.search_resourcessource codeOpen in Cloud Shell
Api_hub.update_apisource codeOpen in Cloud Shell
Api_hub.update_attributesource codeOpen in Cloud Shell
Api_hub.update_deploymentsource codeOpen in Cloud Shell
Api_hub.update_external_apisource codeOpen in Cloud Shell
Api_hub.update_specsource codeOpen in Cloud Shell
Api_hub.update_versionsource codeOpen in Cloud Shell
Api_hub_dependencies.create_dependencysource codeOpen in Cloud Shell
Api_hub_dependencies.delete_dependencysource codeOpen in Cloud Shell
Api_hub_dependencies.get_dependencysource codeOpen in Cloud Shell
Api_hub_dependencies.list_dependenciessource codeOpen in Cloud Shell
Api_hub_dependencies.update_dependencysource codeOpen in Cloud Shell
Api_hub_plugin.disable_pluginsource codeOpen in Cloud Shell
Api_hub_plugin.enable_pluginsource codeOpen in Cloud Shell
Api_hub_plugin.get_pluginsource codeOpen in Cloud Shell
Host_project_registration_service.create_host_project_registrationsource codeOpen in Cloud Shell
Host_project_registration_service.get_host_project_registrationsource codeOpen in Cloud Shell
Host_project_registration_service.list_host_project_registrationssource codeOpen in Cloud Shell
Linting_service.get_style_guidesource codeOpen in Cloud Shell
Linting_service.get_style_guide_contentssource codeOpen in Cloud Shell
Linting_service.lint_specsource codeOpen in Cloud Shell
Linting_service.update_style_guidesource codeOpen in Cloud Shell
Provisioning.create_api_hub_instancesource codeOpen in Cloud Shell
Provisioning.get_api_hub_instancesource codeOpen in Cloud Shell
Provisioning.lookup_api_hub_instancesource codeOpen in Cloud Shell
Runtime_project_attachment_service.create_runtime_project_attachmentsource codeOpen in Cloud Shell
Runtime_project_attachment_service.delete_runtime_project_attachmentsource codeOpen in Cloud Shell
Runtime_project_attachment_service.get_runtime_project_attachmentsource codeOpen in Cloud Shell
Runtime_project_attachment_service.list_runtime_project_attachmentssource codeOpen in Cloud Shell
Runtime_project_attachment_service.lookup_runtime_project_attachmentsource codeOpen in Cloud Shell
Quickstartsource codeOpen in Cloud Shell

The API hub API Node.js Client API Reference documentation also contains samples.

Supported Node.js Versions

Our client libraries follow the Node.js release schedule. Libraries are compatible with all current active and maintenance versions of Node.js. If you are using an end-of-life version of Node.js, we recommend that you update as soon as possible to an actively supported LTS version.

Google's client libraries support legacy versions of Node.js runtimes on a best-efforts basis with the following warnings:

  • Legacy versions are not tested in continuous integration.
  • Some security patches and features cannot be backported.
  • Dependencies cannot be kept up-to-date.

Client libraries targeting some end-of-life versions of Node.js are available, and can be installed through npm dist-tags. The dist-tags follow the naming convention legacy-(version). For example, npm install @google-cloud/apihub@legacy-8 installs client libraries for versions compatible with Node.js 8.

Versioning

This library follows Semantic Versioning.

This library is considered to be in preview. This means it is still a work-in-progress and under active development. Any release is subject to backwards-incompatible changes at any time.

More Information: Google Cloud Platform Launch Stages

Contributing

Contributions welcome! See the Contributing Guide.

Please note that this README.md, the samples/README.md, and a variety of configuration files in this repository (including .nycrc and tsconfig.json) are generated from a central template. To edit one of these files, make an edit to its templates in directory.

License

Apache Version 2.0

See LICENSE

Keywords

FAQs

Package last updated on 10 Sep 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