Constructor
new WebSecurityScannerClient(optionsopt, gaxInstanceopt)
Construct an instance of WebSecurityScannerClient.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
The configuration object. The options accepted by the constructor are described in detail in this document. The common options are: Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||
gaxInstance |
gax |
<optional> |
loaded instance of |
Members
apiEndpoint
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
port
The port for this API service.
scopes
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
The DNS address for this API service.
Methods
close() → {Promise}
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns:
Type | Description |
---|---|
Promise |
A promise that resolves when the client is closed. |
findingPath(project, scan_config, scan_run, finding) → {string}
Return a fully-qualified finding resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
scan_config |
string | |
scan_run |
string | |
finding |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
getProjectId() → {Promise}
Return the project ID used by this class.
Returns:
Type | Description |
---|---|
Promise |
A promise that resolves to string containing the project ID. |
initialize() → {Promise}
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns:
Type | Description |
---|---|
Promise |
A promise that resolves to an authenticated service stub. |
listCrawledUrlsAsync(request, optionsopt) → {Object}
Equivalent to listCrawledUrls
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing CrawledUrl. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
/**
* 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 resource name, which should be a scan run resource name in the
* format
* 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
*/
// const parent = 'abc123'
/**
* A token identifying a page of results to be returned. This should be a
* `next_page_token` value returned from a previous List request.
* If unspecified, the first page of results is returned.
*/
// const pageToken = 'abc123'
/**
* The maximum number of CrawledUrls to return, can be limited by server.
* If not specified or not positive, the implementation will select a
* reasonable value.
*/
// const pageSize = 1234
// Imports the Websecurityscanner library
const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha;
// Instantiates a client
const websecurityscannerClient = new WebSecurityScannerClient();
async function callListCrawledUrls() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await websecurityscannerClient.listCrawledUrlsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListCrawledUrls();
listCrawledUrlsStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Stream |
An object stream which emits an object representing CrawledUrl on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listFindingsAsync(request, optionsopt) → {Object}
Equivalent to listFindings
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Finding. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
/**
* 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 resource name, which should be a scan run resource name in the
* format
* 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
*/
// const parent = 'abc123'
/**
* Required. The filter expression. The expression must be in the format: <field>
* <operator> <value>.
* Supported field: 'finding_type'.
* Supported operator: '='.
*/
// const filter = 'abc123'
/**
* A token identifying a page of results to be returned. This should be a
* `next_page_token` value returned from a previous List request.
* If unspecified, the first page of results is returned.
*/
// const pageToken = 'abc123'
/**
* The maximum number of Findings to return, can be limited by server.
* If not specified or not positive, the implementation will select a
* reasonable value.
*/
// const pageSize = 1234
// Imports the Websecurityscanner library
const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha;
// Instantiates a client
const websecurityscannerClient = new WebSecurityScannerClient();
async function callListFindings() {
// Construct request
const request = {
parent,
filter,
};
// Run request
const iterable = await websecurityscannerClient.listFindingsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListFindings();
listFindingsStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Stream |
An object stream which emits an object representing Finding on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listScanConfigsAsync(request, optionsopt) → {Object}
Equivalent to listScanConfigs
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing ScanConfig. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
/**
* 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 resource name, which should be a project resource name in the
* format 'projects/{projectId}'.
*/
// const parent = 'abc123'
/**
* A token identifying a page of results to be returned. This should be a
* `next_page_token` value returned from a previous List request.
* If unspecified, the first page of results is returned.
*/
// const pageToken = 'abc123'
/**
* The maximum number of ScanConfigs to return, can be limited by server.
* If not specified or not positive, the implementation will select a
* reasonable value.
*/
// const pageSize = 1234
// Imports the Websecurityscanner library
const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha;
// Instantiates a client
const websecurityscannerClient = new WebSecurityScannerClient();
async function callListScanConfigs() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await websecurityscannerClient.listScanConfigsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListScanConfigs();
listScanConfigsStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Stream |
An object stream which emits an object representing ScanConfig on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listScanRunsAsync(request, optionsopt) → {Object}
Equivalent to listScanRuns
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing ScanRun. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
/**
* 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 resource name, which should be a scan resource name in the
* format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
*/
// const parent = 'abc123'
/**
* A token identifying a page of results to be returned. This should be a
* `next_page_token` value returned from a previous List request.
* If unspecified, the first page of results is returned.
*/
// const pageToken = 'abc123'
/**
* The maximum number of ScanRuns to return, can be limited by server.
* If not specified or not positive, the implementation will select a
* reasonable value.
*/
// const pageSize = 1234
// Imports the Websecurityscanner library
const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha;
// Instantiates a client
const websecurityscannerClient = new WebSecurityScannerClient();
async function callListScanRuns() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await websecurityscannerClient.listScanRunsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListScanRuns();
listScanRunsStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Stream |
An object stream which emits an object representing ScanRun on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
matchFindingFromFindingName(findingName) → {string}
Parse the finding from Finding resource.
Parameters:
Name | Type | Description |
---|---|---|
findingName |
string |
A fully-qualified path representing Finding resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the finding. |
matchProjectFromFindingName(findingName) → {string}
Parse the project from Finding resource.
Parameters:
Name | Type | Description |
---|---|---|
findingName |
string |
A fully-qualified path representing Finding resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromProjectName(projectName) → {string}
Parse the project from Project resource.
Parameters:
Name | Type | Description |
---|---|---|
projectName |
string |
A fully-qualified path representing Project resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromScanConfigName(scanConfigName) → {string}
Parse the project from ScanConfig resource.
Parameters:
Name | Type | Description |
---|---|---|
scanConfigName |
string |
A fully-qualified path representing ScanConfig resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromScanRunName(scanRunName) → {string}
Parse the project from ScanRun resource.
Parameters:
Name | Type | Description |
---|---|---|
scanRunName |
string |
A fully-qualified path representing ScanRun resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchScanConfigFromFindingName(findingName) → {string}
Parse the scan_config from Finding resource.
Parameters:
Name | Type | Description |
---|---|---|
findingName |
string |
A fully-qualified path representing Finding resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the scan_config. |
matchScanConfigFromScanConfigName(scanConfigName) → {string}
Parse the scan_config from ScanConfig resource.
Parameters:
Name | Type | Description |
---|---|---|
scanConfigName |
string |
A fully-qualified path representing ScanConfig resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the scan_config. |
matchScanConfigFromScanRunName(scanRunName) → {string}
Parse the scan_config from ScanRun resource.
Parameters:
Name | Type | Description |
---|---|---|
scanRunName |
string |
A fully-qualified path representing ScanRun resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the scan_config. |
matchScanRunFromFindingName(findingName) → {string}
Parse the scan_run from Finding resource.
Parameters:
Name | Type | Description |
---|---|---|
findingName |
string |
A fully-qualified path representing Finding resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the scan_run. |
matchScanRunFromScanRunName(scanRunName) → {string}
Parse the scan_run from ScanRun resource.
Parameters:
Name | Type | Description |
---|---|---|
scanRunName |
string |
A fully-qualified path representing ScanRun resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the scan_run. |
projectPath(project) → {string}
Return a fully-qualified project resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
scanConfigPath(project, scan_config) → {string}
Return a fully-qualified scanConfig resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
scan_config |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
scanRunPath(project, scan_config, scan_run) → {string}
Return a fully-qualified scanRun resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
scan_config |
string | |
scan_run |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |