Constructor
new OsLoginServiceClient(optionsopt)
Construct an instance of OsLoginServiceClient.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
The configuration object. See the subsequent parameters for more details. Properties
|
- Source:
Members
(static) apiEndpoint
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
(static) port
The port for this API service.
(static) scopes
The scopes needed to make gRPC calls for every method defined in this service.
(static) servicePath
The DNS address for this API service.
Methods
deletePosixAccount(request, optionsopt, callbackopt) → {Promise}
Deletes a POSIX account.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. |
Example
const osLogin = require('@google-cloud/os-login');
const client = new osLogin.v1beta.OsLoginServiceClient({
// optional auth parameters.
});
const formattedName = client.projectPath('[USER]', '[PROJECT]');
client.deletePosixAccount({name: formattedName}).catch(err => {
console.error(err);
});
deleteSshPublicKey(request, optionsopt, callbackopt) → {Promise}
Deletes an SSH public key.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. |
Example
const osLogin = require('@google-cloud/os-login');
const client = new osLogin.v1beta.OsLoginServiceClient({
// optional auth parameters.
});
const formattedName = client.fingerprintPath('[USER]', '[FINGERPRINT]');
client.deleteSshPublicKey({name: formattedName}).catch(err => {
console.error(err);
});
fingerprintPath(user, fingerprint) → {String}
Return a fully-qualified fingerprint resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
String | |
fingerprint |
String |
getLoginProfile(request, optionsopt, callbackopt) → {Promise}
Retrieves the profile information used for logging in to a virtual machine on Google Compute Engine.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing LoginProfile. |
Example
const osLogin = require('@google-cloud/os-login');
const client = new osLogin.v1beta.OsLoginServiceClient({
// optional auth parameters.
});
const formattedName = client.userPath('[USER]');
client.getLoginProfile({name: formattedName})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
getProjectId(callback)
Return the project ID used by this class.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
the callback to be called with the current project Id. |
getSshPublicKey(request, optionsopt, callbackopt) → {Promise}
Retrieves an SSH public key.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing SshPublicKey. |
Example
const osLogin = require('@google-cloud/os-login');
const client = new osLogin.v1beta.OsLoginServiceClient({
// optional auth parameters.
});
const formattedName = client.fingerprintPath('[USER]', '[FINGERPRINT]');
client.getSshPublicKey({name: formattedName})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
importSshPublicKey(request, optionsopt, callbackopt) → {Promise}
Adds an SSH public key and returns the profile information. Default POSIX account information is set when no username and UID exist as part of the login profile.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing ImportSshPublicKeyResponse. |
Example
const osLogin = require('@google-cloud/os-login');
const client = new osLogin.v1beta.OsLoginServiceClient({
// optional auth parameters.
});
const formattedParent = client.userPath('[USER]');
const sshPublicKey = {};
const request = {
parent: formattedParent,
sshPublicKey: sshPublicKey,
};
client.importSshPublicKey(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
matchFingerprintFromFingerprintName(fingerprintName) → {String}
Parse the fingerprintName from a fingerprint resource.
Parameters:
| Name | Type | Description |
|---|---|---|
fingerprintName |
String |
A fully-qualified path representing a fingerprint resources. |
matchProjectFromProjectName(projectName) → {String}
Parse the projectName from a project resource.
Parameters:
| Name | Type | Description |
|---|---|---|
projectName |
String |
A fully-qualified path representing a project resources. |
matchUserFromFingerprintName(fingerprintName) → {String}
Parse the fingerprintName from a fingerprint resource.
Parameters:
| Name | Type | Description |
|---|---|---|
fingerprintName |
String |
A fully-qualified path representing a fingerprint resources. |
matchUserFromProjectName(projectName) → {String}
Parse the projectName from a project resource.
Parameters:
| Name | Type | Description |
|---|---|---|
projectName |
String |
A fully-qualified path representing a project resources. |
matchUserFromUserName(userName) → {String}
Parse the userName from a user resource.
Parameters:
| Name | Type | Description |
|---|---|---|
userName |
String |
A fully-qualified path representing a user resources. |
projectPath(user, project) → {String}
Return a fully-qualified project resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
String | |
project |
String |
updateSshPublicKey(request, optionsopt, callbackopt) → {Promise}
Updates an SSH public key and returns the profile information. This method supports patch semantics.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing SshPublicKey. |
Example
const osLogin = require('@google-cloud/os-login');
const client = new osLogin.v1beta.OsLoginServiceClient({
// optional auth parameters.
});
const formattedName = client.fingerprintPath('[USER]', '[FINGERPRINT]');
const sshPublicKey = {};
const request = {
name: formattedName,
sshPublicKey: sshPublicKey,
};
client.updateSshPublicKey(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
userPath(user) → {String}
Return a fully-qualified user resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
String |