Skip to content

Commit 196da66

Browse files
jmdobryalexander-fenster
authored andcommitted
Upgrade repo-tools and regenerate scaffolding. (#14)
* Upgrade repo-tools and regenerate scaffolding. * make lint work in circleci
1 parent 313ef5f commit 196da66

File tree

9 files changed

+14133
-17
lines changed

9 files changed

+14133
-17
lines changed

packages/google-cloud-oslogin/.circleci/config.yml

+9
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ jobs:
105105
npm link
106106
environment:
107107
NPM_CONFIG_PREFIX: /home/node/.npm-global
108+
- run:
109+
name: Link the module being tested to the samples.
110+
command: |
111+
cd samples/
112+
npm link ../
113+
npm install
114+
cd ..
115+
environment:
116+
NPM_CONFIG_PREFIX: /home/node/.npm-global
108117
- run:
109118
name: Run linting.
110119
command: npm run lint

packages/google-cloud-oslogin/.cloud-repo-tools.json

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
{
2-
"_product": "oslogin",
3-
"id": "oslogin",
4-
"name": "Google Cloud OS Login API",
5-
"short_name": "OS Login",
6-
"docs_url": "https://cloud.google.com/compute/docs/oslogin/rest/",
7-
"description": "Manages OS login configuration for Directory API users.",
8-
"api_id": "oslogin.googleapis.com",
2+
"product": "oslogin",
93
"requiresKeyFile": true,
104
"requiresProjectId": true,
115
"client_reference_url": "https://cloud.google.com/nodejs/docs/reference/oslogin/latest/",

packages/google-cloud-oslogin/.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
.nyc_output
55
docs/
66
out/
7+
build/
78
system-test/secrets.js
89
system-test/*key.json
910
*.lock
10-
*-lock.js*
11+
.DS_Store
12+
google-cloud-logging-winston-*.tgz
13+
google-cloud-logging-bunyan-*.tgz

packages/google-cloud-oslogin/CONTRIBUTORS

+4
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
# name <email>
55
#
66
Alexander Fenster <[email protected]>
7+
Alexander Fenster <[email protected]>
8+
Dave Gramlich <[email protected]>
9+
10+
greenkeeper[bot] <greenkeeper[bot]@users.noreply.github.com>

packages/google-cloud-oslogin/README.md

+40-7
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/googleapis/nodejs-os-login?branch=master&svg=true)](https://ci.appveyor.com/project/googleapis/nodejs-os-login)
88
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-os-login/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-os-login)
99

10-
> Node.js idiomatic client for [OS Login][product-docs].
10+
> Node.js idiomatic client for [Cloud OS Login API][product-docs].
1111
12-
Manages OS login configuration for Directory API users.
12+
The [Google Cloud OS Login API](https://cloud.google.com/compute/docs/oslogin/rest) manages OS login configuration for Google account users.
1313

1414

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

1919
Read more about the client libraries for Cloud APIs, including the older
2020
Google APIs Client Libraries, in [Client Libraries Explained][explained].
@@ -59,9 +59,42 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
5959

6060
npm install --save @google-cloud/os-login
6161

62+
### Using the client library
6263

64+
```javascript
65+
if (
66+
!process.env.GCLOUD_PROJECT ||
67+
!process.env.GOOGLE_APPLICATION_CREDENTIALS
68+
) {
69+
throw new Error(
70+
'Usage: GCLOUD_PROJECT=<project_id> GOOGLE_APPLICATION_CREDENTIALS=<path to key json file> node #{$0}'
71+
);
72+
}
6373

64-
The [OS Login Node.js Client API Reference][client-docs] documentation
74+
const oslogin = require('@google-cloud/oslogin');
75+
76+
const projectId = process.env.GCLOUD_PROJECT;
77+
78+
const client = new oslogin.OsLoginServiceClient({
79+
projectId: projectId
80+
});
81+
82+
const request = {
83+
name: 'users/1234abcd'
84+
};
85+
86+
client.getLoginProfile(request)
87+
.then(responses => {
88+
const loginProfile = responses[0];
89+
console.log(loginProfile);
90+
})
91+
.catch(err => {
92+
console.error('ERROR:', err);
93+
});
94+
```
95+
96+
97+
The [Cloud OS Login API Node.js Client API Reference][client-docs] documentation
6598
also contains samples.
6699

67100
## Versioning
@@ -87,5 +120,5 @@ Apache Version 2.0
87120
See [LICENSE](https://github.com/googleapis/nodejs-os-login/blob/master/LICENSE)
88121

89122
[client-docs]: https://cloud.google.com/nodejs/docs/reference/oslogin/latest/
90-
[product-docs]: https://cloud.google.com/compute/docs/oslogin/rest/
91-
[shell_img]: http://gstatic.com/cloudssh/images/open-btn.png
123+
[product-docs]: https://cloud.google.com/compute/docs/oslogin/rest
124+
[shell_img]: //gstatic.com/cloudssh/images/open-btn.png

0 commit comments

Comments
 (0)