Skip to content

Commit

Permalink
build: use repo-metadata to generate the README (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Apr 24, 2019
1 parent efda438 commit aa8840e
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 72 deletions.
7 changes: 0 additions & 7 deletions packages/google-cloud-oslogin/.cloud-repo-tools.json

This file was deleted.

3 changes: 1 addition & 2 deletions packages/google-cloud-oslogin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ system-test/secrets.js
system-test/*key.json
*.lock
.DS_Store
google-cloud-logging-winston-*.tgz
google-cloud-logging-bunyan-*.tgz
__pycache__
package-lock.json
13 changes: 13 additions & 0 deletions packages/google-cloud-oslogin/.repo-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "oslogin",
"name_pretty": "Google Cloud OS Login",
"product_documentation": "https://cloud.google.com/compute/docs/oslogin/",
"client_documentation": "https://cloud.google.com/nodejs/docs/reference/os-login/latest/",
"issue_tracker": "https://issuetracker.google.com/savedsearches/559755",
"release_level": "alpha",
"language": "nodejs",
"repo": "googleapis/nodejs-os-login",
"distribution_name": "@google-cloud/os-login",
"api_id": "oslogin.googleapis.com",
"requires_billing": true
}
120 changes: 63 additions & 57 deletions packages/google-cloud-oslogin/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
[//]: # "To regenerate it, use `npm run generate-scaffolding`."
[//]: # "To regenerate it, use `python -m synthtool`."
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>

# [Google Cloud OS Login API: Node.js Client](https://github.com/googleapis/nodejs-os-login)
# [Google Cloud OS Login: Node.js Client](https://github.com/googleapis/nodejs-os-login)

[![release level](https://img.shields.io/badge/release%20level-alpha-orange.svg?style&#x3D;flat)](https://cloud.google.com/terms/launch-stages)
[![release level](https://img.shields.io/badge/release%20level-alpha-orange.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
[![npm version](https://img.shields.io/npm/v/@google-cloud/os-login.svg)](https://www.npmjs.org/package/@google-cloud/os-login)
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-os-login/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-os-login)

> Node.js idiomatic client for [Cloud OS Login API][product-docs].

The [Google Cloud OS Login API](https://cloud.google.com/compute/docs/oslogin/rest) manages OS login configuration for Google account users.


* [Cloud OS Login API Node.js Client API Reference][client-docs]
Google Cloud OS Login API client for Node.js


* [Google Cloud OS Login Node.js Client API Reference][client-docs]
* [Google Cloud OS Login Documentation][product-docs]
* [github.com/googleapis/nodejs-os-login](https://github.com/googleapis/nodejs-os-login)
* [Cloud OS Login API Documentation][product-docs]

Read more about the client libraries for Cloud APIs, including the older
Google APIs Client Libraries, in [Client Libraries Explained][explained].
Expand All @@ -24,10 +25,12 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].

**Table of contents:**


* [Quickstart](#quickstart)
* [Before you begin](#before-you-begin)
* [Installing the client library](#installing-the-client-library)
* [Using the client library](#using-the-client-library)
* [Samples](#samples)
* [Versioning](#versioning)
* [Contributing](#contributing)
* [License](#license)
Expand All @@ -36,77 +39,77 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].

### Before you begin

1. Select or create a Cloud Platform project.
1. [Select or create a Cloud Platform project][projects].
1. [Enable billing for your project][billing].
1. [Enable the Google Cloud OS Login API][enable_api].
1. [Set up authentication with a service account][auth] so you can access the
API from your local workstation.

[Go to the projects page][projects]
### Installing the client library

1. Enable billing for your project.
```bash
npm install @google-cloud/os-login
```

[Enable billing][billing]

1. Enable the Google Cloud OS Login API API.
### Using the client library

[Enable the API][enable_api]
```javascript
if (
!process.env.GCLOUD_PROJECT ||
!process.env.GOOGLE_APPLICATION_CREDENTIALS
) {
throw new Error(
'Usage: GCLOUD_PROJECT=<project_id> GOOGLE_APPLICATION_CREDENTIALS=<path to key json file> node #{$0}'
);
}

1. [Set up authentication with a service account][auth] so you can access the
API from your local workstation.
const oslogin = require('@google-cloud/os-login');

[projects]: https://console.cloud.google.com/project
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=oslogin.googleapis.com
[auth]: https://cloud.google.com/docs/authentication/getting-started
const projectId = process.env.GCLOUD_PROJECT;

### Installing the client library
const client = new oslogin.OsLoginServiceClient({
projectId: projectId,
});

npm install --save @google-cloud/os-login
const request = {
name: 'users/1234abcd',
};

### Using the client library
const [loginProfile] = await client.getLoginProfile(request);
console.log(loginProfile);

```javascript
if (
!process.env.GCLOUD_PROJECT ||
!process.env.GOOGLE_APPLICATION_CREDENTIALS
) {
throw new Error(
'Usage: GCLOUD_PROJECT=<project_id> GOOGLE_APPLICATION_CREDENTIALS=<path to key json file> node #{$0}'
);
}

const oslogin = require('@google-cloud/os-login');

const projectId = process.env.GCLOUD_PROJECT;

const client = new oslogin.OsLoginServiceClient({
projectId: projectId,
});

const request = {
name: 'users/1234abcd',
};

client
.getLoginProfile(request)
.then(responses => {
const loginProfile = responses[0];
console.log(loginProfile);
})
.catch(err => {
console.error('ERROR:', err);
});
```


The [Cloud OS Login API Node.js Client API Reference][client-docs] documentation

## Samples

Samples are in the [`samples/`](https://github.com/googleapis/nodejs-os-login/tree/master/samples) directory. The samples' `README.md`
has instructions for running the samples.

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Quickstart | [source code](https://github.com/googleapis/nodejs-os-login/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-os-login&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |



The [Google Cloud OS Login Node.js Client API Reference][client-docs] documentation
also contains samples.

## Versioning

This library follows [Semantic Versioning](http://semver.org/).




This library is considered to be in **alpha**. 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][launch_stages]

[launch_stages]: https://cloud.google.com/terms/launch-stages
Expand All @@ -122,6 +125,9 @@ Apache Version 2.0
See [LICENSE](https://github.com/googleapis/nodejs-os-login/blob/master/LICENSE)

[client-docs]: https://cloud.google.com/nodejs/docs/reference/os-login/latest/
[product-docs]: https://cloud.google.com/compute/docs/oslogin/rest
[shell_img]: //gstatic.com/cloudssh/images/open-btn.png

[product-docs]: https://cloud.google.com/compute/docs/oslogin/
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
[projects]: https://console.cloud.google.com/project
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=oslogin.googleapis.com
[auth]: https://cloud.google.com/docs/authentication/getting-started
3 changes: 0 additions & 3 deletions packages/google-cloud-oslogin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
],
"scripts": {
"test": "npm run cover",
"generate-scaffolding": "repo-tools generate all",
"generate-scaffolding-samples": "repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json",
"cover": "nyc --reporter=lcov mocha test/*.js && nyc report",
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
"test-no-cover": "mocha test/*.js",
Expand All @@ -47,7 +45,6 @@
"lodash.merge": "^4.6.0"
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "^3.0.0",
"codecov": "^3.0.0",
"eslint": "^5.0.0",
"eslint-config-prettier": "^4.0.0",
Expand Down
44 changes: 44 additions & 0 deletions packages/google-cloud-oslogin/samples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
[//]: # "To regenerate it, use `python -m synthtool`."
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>

# [Google Cloud OS Login: Node.js Samples](https://github.com/googleapis/nodejs-os-login)

[![Open in Cloud Shell][shell_img]][shell_link]



## Table of Contents

* [Before you begin](#before-you-begin)
* [Samples](#samples)
* [Quickstart](#quickstart)

## Before you begin

Before running the samples, make sure you've followed the steps outlined in
[Using the client library](https://github.com/googleapis/nodejs-os-login#using-the-client-library).

## Samples



### Quickstart

View the [source code](https://github.com/googleapis/nodejs-os-login/blob/master/samples/quickstart.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-os-login&page=editor&open_in_editor=samples/quickstart.js,samples/README.md)

__Usage:__


`node quickstart.js`






[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-os-login&page=editor&open_in_editor=samples/README.md
[product-docs]: https://cloud.google.com/compute/docs/oslogin/
6 changes: 3 additions & 3 deletions packages/google-cloud-oslogin/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"updateTime": "2019-04-23T11:16:25.036325Z",
"updateTime": "2019-04-24T18:14:09.570889Z",
"sources": [
{
"generator": {
Expand All @@ -12,8 +12,8 @@
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "547e19e7df398e9290e8e3674d7351efc500f9b0",
"internalRef": "244712781"
"sha": "45199a22a4e47c8d53213d1ac4a5ad7f22382c56",
"internalRef": "244925894"
}
},
{
Expand Down

0 comments on commit aa8840e

Please sign in to comment.