Class WebSecurityScannerClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// 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.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ScanConfig scanConfig = ScanConfig.newBuilder().build();
ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig);
}
Note: close() needs to be called on the WebSecurityScannerClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
CreateScanConfig |
Creates a new ScanConfig. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteScanConfig |
Deletes an existing ScanConfig and its child resources. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetScanConfig |
Gets a ScanConfig. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListScanConfigs |
Lists ScanConfigs under a given project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateScanConfig |
Updates a ScanConfig. This method support partial update of a ScanConfig. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
StartScanRun |
Start a ScanRun according to the given ScanConfig. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetScanRun |
Gets a ScanRun. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListScanRuns |
Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
StopScanRun |
Stops a ScanRun. The stopped ScanRun is returned. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListCrawledUrls |
List CrawledUrls under a given ScanRun. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetFinding |
Gets a Finding. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListFindings |
List Findings under a given ScanRun. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListFindingTypeStats |
List all FindingTypeStats under a given ScanRun. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of WebSecurityScannerSettings to create(). For example:
To customize credentials:
// 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.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
WebSecurityScannerSettings webSecurityScannerSettings =
WebSecurityScannerSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
WebSecurityScannerClient webSecurityScannerClient =
WebSecurityScannerClient.create(webSecurityScannerSettings);
To customize the endpoint:
// 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.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
WebSecurityScannerSettings webSecurityScannerSettings =
WebSecurityScannerSettings.newBuilder().setEndpoint(myEndpoint).build();
WebSecurityScannerClient webSecurityScannerClient =
WebSecurityScannerClient.create(webSecurityScannerSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// 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.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
WebSecurityScannerSettings webSecurityScannerSettings =
WebSecurityScannerSettings.newHttpJsonBuilder().build();
WebSecurityScannerClient webSecurityScannerClient =
WebSecurityScannerClient.create(webSecurityScannerSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedConstructs an instance of WebSecurityScannerClient, using the given settings. -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final WebSecurityScannerClientcreate()Constructs an instance of WebSecurityScannerClient with default settings.static final WebSecurityScannerClientcreate(WebSecurityScannerStub stub) Constructs an instance of WebSecurityScannerClient, using the given stub for making calls.static final WebSecurityScannerClientcreate(WebSecurityScannerSettings settings) Constructs an instance of WebSecurityScannerClient, using the given settings.final ScanConfigcreateScanConfig(CreateScanConfigRequest request) Creates a new ScanConfig.final ScanConfigcreateScanConfig(ProjectName parent, ScanConfig scanConfig) Creates a new ScanConfig.final ScanConfigcreateScanConfig(String parent, ScanConfig scanConfig) Creates a new ScanConfig.Creates a new ScanConfig.final voiddeleteScanConfig(DeleteScanConfigRequest request) Deletes an existing ScanConfig and its child resources.final voidDeletes an existing ScanConfig and its child resources.final voiddeleteScanConfig(String name) Deletes an existing ScanConfig and its child resources.final UnaryCallable<DeleteScanConfigRequest,com.google.protobuf.Empty> Deletes an existing ScanConfig and its child resources.final FindinggetFinding(FindingName name) Gets a Finding.final FindinggetFinding(GetFindingRequest request) Gets a Finding.final FindinggetFinding(String name) Gets a Finding.Gets a Finding.final ScanConfiggetScanConfig(GetScanConfigRequest request) Gets a ScanConfig.final ScanConfiggetScanConfig(ScanConfigName name) Gets a ScanConfig.final ScanConfiggetScanConfig(String name) Gets a ScanConfig.Gets a ScanConfig.final ScanRungetScanRun(GetScanRunRequest request) Gets a ScanRun.final ScanRungetScanRun(ScanRunName name) Gets a ScanRun.final ScanRungetScanRun(String name) Gets a ScanRun.Gets a ScanRun.getStub()booleanbooleanlistCrawledUrls(ListCrawledUrlsRequest request) List CrawledUrls under a given ScanRun.listCrawledUrls(ScanRunName parent) List CrawledUrls under a given ScanRun.listCrawledUrls(String parent) List CrawledUrls under a given ScanRun.List CrawledUrls under a given ScanRun.List CrawledUrls under a given ScanRun.listFindings(ListFindingsRequest request) List Findings under a given ScanRun.listFindings(ScanRunName parent, String filter) List Findings under a given ScanRun.listFindings(String parent, String filter) List Findings under a given ScanRun.List Findings under a given ScanRun.List Findings under a given ScanRun.List all FindingTypeStats under a given ScanRun.listFindingTypeStats(ScanRunName parent) List all FindingTypeStats under a given ScanRun.listFindingTypeStats(String parent) List all FindingTypeStats under a given ScanRun.List all FindingTypeStats under a given ScanRun.listScanConfigs(ListScanConfigsRequest request) Lists ScanConfigs under a given project.listScanConfigs(ProjectName parent) Lists ScanConfigs under a given project.listScanConfigs(String parent) Lists ScanConfigs under a given project.Lists ScanConfigs under a given project.Lists ScanConfigs under a given project.listScanRuns(ListScanRunsRequest request) Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.listScanRuns(ScanConfigName parent) Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.listScanRuns(String parent) Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.voidshutdown()voidfinal ScanRunstartScanRun(ScanConfigName name) Start a ScanRun according to the given ScanConfig.final ScanRunstartScanRun(StartScanRunRequest request) Start a ScanRun according to the given ScanConfig.final ScanRunstartScanRun(String name) Start a ScanRun according to the given ScanConfig.Start a ScanRun according to the given ScanConfig.final ScanRunstopScanRun(ScanRunName name) Stops a ScanRun.final ScanRunstopScanRun(StopScanRunRequest request) Stops a ScanRun.final ScanRunstopScanRun(String name) Stops a ScanRun.Stops a ScanRun.final ScanConfigupdateScanConfig(ScanConfig scanConfig, com.google.protobuf.FieldMask updateMask) Updates a ScanConfig.final ScanConfigupdateScanConfig(UpdateScanConfigRequest request) Updates a ScanConfig.Updates a ScanConfig.
-
Constructor Details
-
WebSecurityScannerClient
Constructs an instance of WebSecurityScannerClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
WebSecurityScannerClient
-
-
Method Details
-
create
Constructs an instance of WebSecurityScannerClient with default settings.- Throws:
IOException
-
create
public static final WebSecurityScannerClient create(WebSecurityScannerSettings settings) throws IOException Constructs an instance of WebSecurityScannerClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of WebSecurityScannerClient, using the given stub for making calls. This is for advanced usage - prefer using create(WebSecurityScannerSettings). -
getSettings
-
getStub
-
createScanConfig
Creates a new ScanConfig.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); ScanConfig scanConfig = ScanConfig.newBuilder().build(); ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig); }- Parameters:
parent- Required. The parent resource name where the scan is created, which should be a project resource name in the format 'projects/{projectId}'.scanConfig- Required. The ScanConfig to be created.- Throws:
ApiException- if the remote call fails
-
createScanConfig
Creates a new ScanConfig.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); ScanConfig scanConfig = ScanConfig.newBuilder().build(); ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig); }- Parameters:
parent- Required. The parent resource name where the scan is created, which should be a project resource name in the format 'projects/{projectId}'.scanConfig- Required. The ScanConfig to be created.- Throws:
ApiException- if the remote call fails
-
createScanConfig
Creates a new ScanConfig.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { CreateScanConfigRequest request = CreateScanConfigRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setScanConfig(ScanConfig.newBuilder().build()) .build(); ScanConfig response = webSecurityScannerClient.createScanConfig(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createScanConfigCallable
Creates a new ScanConfig.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { CreateScanConfigRequest request = CreateScanConfigRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setScanConfig(ScanConfig.newBuilder().build()) .build(); ApiFuture<ScanConfig> future = webSecurityScannerClient.createScanConfigCallable().futureCall(request); // Do something. ScanConfig response = future.get(); } -
deleteScanConfig
Deletes an existing ScanConfig and its child resources.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]"); webSecurityScannerClient.deleteScanConfig(name); }- Parameters:
name- Required. The resource name of the ScanConfig to be deleted. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.- Throws:
ApiException- if the remote call fails
-
deleteScanConfig
Deletes an existing ScanConfig and its child resources.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { String name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString(); webSecurityScannerClient.deleteScanConfig(name); }- Parameters:
name- Required. The resource name of the ScanConfig to be deleted. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.- Throws:
ApiException- if the remote call fails
-
deleteScanConfig
Deletes an existing ScanConfig and its child resources.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { DeleteScanConfigRequest request = DeleteScanConfigRequest.newBuilder() .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString()) .build(); webSecurityScannerClient.deleteScanConfig(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteScanConfigCallable
public final UnaryCallable<DeleteScanConfigRequest,com.google.protobuf.Empty> deleteScanConfigCallable()Deletes an existing ScanConfig and its child resources.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { DeleteScanConfigRequest request = DeleteScanConfigRequest.newBuilder() .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString()) .build(); ApiFuture<Empty> future = webSecurityScannerClient.deleteScanConfigCallable().futureCall(request); // Do something. future.get(); } -
getScanConfig
Gets a ScanConfig.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]"); ScanConfig response = webSecurityScannerClient.getScanConfig(name); }- Parameters:
name- Required. The resource name of the ScanConfig to be returned. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.- Throws:
ApiException- if the remote call fails
-
getScanConfig
Gets a ScanConfig.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { String name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString(); ScanConfig response = webSecurityScannerClient.getScanConfig(name); }- Parameters:
name- Required. The resource name of the ScanConfig to be returned. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.- Throws:
ApiException- if the remote call fails
-
getScanConfig
Gets a ScanConfig.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { GetScanConfigRequest request = GetScanConfigRequest.newBuilder() .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString()) .build(); ScanConfig response = webSecurityScannerClient.getScanConfig(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getScanConfigCallable
Gets a ScanConfig.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { GetScanConfigRequest request = GetScanConfigRequest.newBuilder() .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString()) .build(); ApiFuture<ScanConfig> future = webSecurityScannerClient.getScanConfigCallable().futureCall(request); // Do something. ScanConfig response = future.get(); } -
listScanConfigs
public final WebSecurityScannerClient.ListScanConfigsPagedResponse listScanConfigs(ProjectName parent) Lists ScanConfigs under a given project.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); for (ScanConfig element : webSecurityScannerClient.listScanConfigs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name, which should be a project resource name in the format 'projects/{projectId}'.- Throws:
ApiException- if the remote call fails
-
listScanConfigs
Lists ScanConfigs under a given project.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); for (ScanConfig element : webSecurityScannerClient.listScanConfigs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name, which should be a project resource name in the format 'projects/{projectId}'.- Throws:
ApiException- if the remote call fails
-
listScanConfigs
public final WebSecurityScannerClient.ListScanConfigsPagedResponse listScanConfigs(ListScanConfigsRequest request) Lists ScanConfigs under a given project.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ListScanConfigsRequest request = ListScanConfigsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); for (ScanConfig element : webSecurityScannerClient.listScanConfigs(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listScanConfigsPagedCallable
public final UnaryCallable<ListScanConfigsRequest,WebSecurityScannerClient.ListScanConfigsPagedResponse> listScanConfigsPagedCallable()Lists ScanConfigs under a given project.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ListScanConfigsRequest request = ListScanConfigsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); ApiFuture<ScanConfig> future = webSecurityScannerClient.listScanConfigsPagedCallable().futureCall(request); // Do something. for (ScanConfig element : future.get().iterateAll()) { // doThingsWith(element); } } -
listScanConfigsCallable
public final UnaryCallable<ListScanConfigsRequest,ListScanConfigsResponse> listScanConfigsCallable()Lists ScanConfigs under a given project.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ListScanConfigsRequest request = ListScanConfigsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); while (true) { ListScanConfigsResponse response = webSecurityScannerClient.listScanConfigsCallable().call(request); for (ScanConfig element : response.getScanConfigsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
updateScanConfig
public final ScanConfig updateScanConfig(ScanConfig scanConfig, com.google.protobuf.FieldMask updateMask) Updates a ScanConfig. This method support partial update of a ScanConfig.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ScanConfig scanConfig = ScanConfig.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); ScanConfig response = webSecurityScannerClient.updateScanConfig(scanConfig, updateMask); }- Parameters:
scanConfig- Required. The ScanConfig to be updated. The name field must be set to identify the resource to be updated. The values of fields not covered by the mask will be ignored.updateMask- Required. The update mask applies to the resource. For the `FieldMask` definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask- Throws:
ApiException- if the remote call fails
-
updateScanConfig
Updates a ScanConfig. This method support partial update of a ScanConfig.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { UpdateScanConfigRequest request = UpdateScanConfigRequest.newBuilder() .setScanConfig(ScanConfig.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ScanConfig response = webSecurityScannerClient.updateScanConfig(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateScanConfigCallable
Updates a ScanConfig. This method support partial update of a ScanConfig.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { UpdateScanConfigRequest request = UpdateScanConfigRequest.newBuilder() .setScanConfig(ScanConfig.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<ScanConfig> future = webSecurityScannerClient.updateScanConfigCallable().futureCall(request); // Do something. ScanConfig response = future.get(); } -
startScanRun
Start a ScanRun according to the given ScanConfig.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]"); ScanRun response = webSecurityScannerClient.startScanRun(name); }- Parameters:
name- Required. The resource name of the ScanConfig to be used. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.- Throws:
ApiException- if the remote call fails
-
startScanRun
Start a ScanRun according to the given ScanConfig.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { String name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString(); ScanRun response = webSecurityScannerClient.startScanRun(name); }- Parameters:
name- Required. The resource name of the ScanConfig to be used. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.- Throws:
ApiException- if the remote call fails
-
startScanRun
Start a ScanRun according to the given ScanConfig.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { StartScanRunRequest request = StartScanRunRequest.newBuilder() .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString()) .build(); ScanRun response = webSecurityScannerClient.startScanRun(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
startScanRunCallable
Start a ScanRun according to the given ScanConfig.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { StartScanRunRequest request = StartScanRunRequest.newBuilder() .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString()) .build(); ApiFuture<ScanRun> future = webSecurityScannerClient.startScanRunCallable().futureCall(request); // Do something. ScanRun response = future.get(); } -
getScanRun
Gets a ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ScanRunName name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]"); ScanRun response = webSecurityScannerClient.getScanRun(name); }- Parameters:
name- Required. The resource name of the ScanRun to be returned. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.- Throws:
ApiException- if the remote call fails
-
getScanRun
Gets a ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { String name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString(); ScanRun response = webSecurityScannerClient.getScanRun(name); }- Parameters:
name- Required. The resource name of the ScanRun to be returned. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.- Throws:
ApiException- if the remote call fails
-
getScanRun
Gets a ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { GetScanRunRequest request = GetScanRunRequest.newBuilder() .setName(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString()) .build(); ScanRun response = webSecurityScannerClient.getScanRun(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getScanRunCallable
Gets a ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { GetScanRunRequest request = GetScanRunRequest.newBuilder() .setName(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString()) .build(); ApiFuture<ScanRun> future = webSecurityScannerClient.getScanRunCallable().futureCall(request); // Do something. ScanRun response = future.get(); } -
listScanRuns
Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ScanConfigName parent = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]"); for (ScanRun element : webSecurityScannerClient.listScanRuns(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name, which should be a scan resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}'.- Throws:
ApiException- if the remote call fails
-
listScanRuns
Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { String parent = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString(); for (ScanRun element : webSecurityScannerClient.listScanRuns(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name, which should be a scan resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}'.- Throws:
ApiException- if the remote call fails
-
listScanRuns
public final WebSecurityScannerClient.ListScanRunsPagedResponse listScanRuns(ListScanRunsRequest request) Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ListScanRunsRequest request = ListScanRunsRequest.newBuilder() .setParent(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); for (ScanRun element : webSecurityScannerClient.listScanRuns(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listScanRunsPagedCallable
public final UnaryCallable<ListScanRunsRequest,WebSecurityScannerClient.ListScanRunsPagedResponse> listScanRunsPagedCallable()Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ListScanRunsRequest request = ListScanRunsRequest.newBuilder() .setParent(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); ApiFuture<ScanRun> future = webSecurityScannerClient.listScanRunsPagedCallable().futureCall(request); // Do something. for (ScanRun element : future.get().iterateAll()) { // doThingsWith(element); } } -
listScanRunsCallable
Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ListScanRunsRequest request = ListScanRunsRequest.newBuilder() .setParent(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); while (true) { ListScanRunsResponse response = webSecurityScannerClient.listScanRunsCallable().call(request); for (ScanRun element : response.getScanRunsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
stopScanRun
Stops a ScanRun. The stopped ScanRun is returned.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ScanRunName name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]"); ScanRun response = webSecurityScannerClient.stopScanRun(name); }- Parameters:
name- Required. The resource name of the ScanRun to be stopped. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.- Throws:
ApiException- if the remote call fails
-
stopScanRun
Stops a ScanRun. The stopped ScanRun is returned.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { String name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString(); ScanRun response = webSecurityScannerClient.stopScanRun(name); }- Parameters:
name- Required. The resource name of the ScanRun to be stopped. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.- Throws:
ApiException- if the remote call fails
-
stopScanRun
Stops a ScanRun. The stopped ScanRun is returned.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { StopScanRunRequest request = StopScanRunRequest.newBuilder() .setName(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString()) .build(); ScanRun response = webSecurityScannerClient.stopScanRun(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
stopScanRunCallable
Stops a ScanRun. The stopped ScanRun is returned.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { StopScanRunRequest request = StopScanRunRequest.newBuilder() .setName(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString()) .build(); ApiFuture<ScanRun> future = webSecurityScannerClient.stopScanRunCallable().futureCall(request); // Do something. ScanRun response = future.get(); } -
listCrawledUrls
public final WebSecurityScannerClient.ListCrawledUrlsPagedResponse listCrawledUrls(ScanRunName parent) List CrawledUrls under a given ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]"); for (CrawledUrl element : webSecurityScannerClient.listCrawledUrls(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name, which should be a scan run resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.- Throws:
ApiException- if the remote call fails
-
listCrawledUrls
List CrawledUrls under a given ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { String parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString(); for (CrawledUrl element : webSecurityScannerClient.listCrawledUrls(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name, which should be a scan run resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.- Throws:
ApiException- if the remote call fails
-
listCrawledUrls
public final WebSecurityScannerClient.ListCrawledUrlsPagedResponse listCrawledUrls(ListCrawledUrlsRequest request) List CrawledUrls under a given ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ListCrawledUrlsRequest request = ListCrawledUrlsRequest.newBuilder() .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); for (CrawledUrl element : webSecurityScannerClient.listCrawledUrls(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listCrawledUrlsPagedCallable
public final UnaryCallable<ListCrawledUrlsRequest,WebSecurityScannerClient.ListCrawledUrlsPagedResponse> listCrawledUrlsPagedCallable()List CrawledUrls under a given ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ListCrawledUrlsRequest request = ListCrawledUrlsRequest.newBuilder() .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); ApiFuture<CrawledUrl> future = webSecurityScannerClient.listCrawledUrlsPagedCallable().futureCall(request); // Do something. for (CrawledUrl element : future.get().iterateAll()) { // doThingsWith(element); } } -
listCrawledUrlsCallable
public final UnaryCallable<ListCrawledUrlsRequest,ListCrawledUrlsResponse> listCrawledUrlsCallable()List CrawledUrls under a given ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ListCrawledUrlsRequest request = ListCrawledUrlsRequest.newBuilder() .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); while (true) { ListCrawledUrlsResponse response = webSecurityScannerClient.listCrawledUrlsCallable().call(request); for (CrawledUrl element : response.getCrawledUrlsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getFinding
Gets a Finding.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { FindingName name = FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]"); Finding response = webSecurityScannerClient.getFinding(name); }- Parameters:
name- Required. The resource name of the Finding to be returned. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.- Throws:
ApiException- if the remote call fails
-
getFinding
Gets a Finding.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { String name = FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]").toString(); Finding response = webSecurityScannerClient.getFinding(name); }- Parameters:
name- Required. The resource name of the Finding to be returned. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.- Throws:
ApiException- if the remote call fails
-
getFinding
Gets a Finding.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { GetFindingRequest request = GetFindingRequest.newBuilder() .setName( FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]") .toString()) .build(); Finding response = webSecurityScannerClient.getFinding(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getFindingCallable
Gets a Finding.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { GetFindingRequest request = GetFindingRequest.newBuilder() .setName( FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]") .toString()) .build(); ApiFuture<Finding> future = webSecurityScannerClient.getFindingCallable().futureCall(request); // Do something. Finding response = future.get(); } -
listFindings
public final WebSecurityScannerClient.ListFindingsPagedResponse listFindings(ScanRunName parent, String filter) List Findings under a given ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]"); String filter = "filter-1274492040"; for (Finding element : webSecurityScannerClient.listFindings(parent, filter).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name, which should be a scan run resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.filter- Required. The filter expression. The expression must be in the format: <field> <operator> <value>. Supported field: 'finding_type'. Supported operator: '='.- Throws:
ApiException- if the remote call fails
-
listFindings
public final WebSecurityScannerClient.ListFindingsPagedResponse listFindings(String parent, String filter) List Findings under a given ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { String parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString(); String filter = "filter-1274492040"; for (Finding element : webSecurityScannerClient.listFindings(parent, filter).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name, which should be a scan run resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.filter- Required. The filter expression. The expression must be in the format: <field> <operator> <value>. Supported field: 'finding_type'. Supported operator: '='.- Throws:
ApiException- if the remote call fails
-
listFindings
public final WebSecurityScannerClient.ListFindingsPagedResponse listFindings(ListFindingsRequest request) List Findings under a given ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ListFindingsRequest request = ListFindingsRequest.newBuilder() .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString()) .setFilter("filter-1274492040") .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); for (Finding element : webSecurityScannerClient.listFindings(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listFindingsPagedCallable
public final UnaryCallable<ListFindingsRequest,WebSecurityScannerClient.ListFindingsPagedResponse> listFindingsPagedCallable()List Findings under a given ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ListFindingsRequest request = ListFindingsRequest.newBuilder() .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString()) .setFilter("filter-1274492040") .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); ApiFuture<Finding> future = webSecurityScannerClient.listFindingsPagedCallable().futureCall(request); // Do something. for (Finding element : future.get().iterateAll()) { // doThingsWith(element); } } -
listFindingsCallable
List Findings under a given ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ListFindingsRequest request = ListFindingsRequest.newBuilder() .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString()) .setFilter("filter-1274492040") .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); while (true) { ListFindingsResponse response = webSecurityScannerClient.listFindingsCallable().call(request); for (Finding element : response.getFindingsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
listFindingTypeStats
List all FindingTypeStats under a given ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]"); ListFindingTypeStatsResponse response = webSecurityScannerClient.listFindingTypeStats(parent); }- Parameters:
parent- Required. The parent resource name, which should be a scan run resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.- Throws:
ApiException- if the remote call fails
-
listFindingTypeStats
List all FindingTypeStats under a given ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { String parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString(); ListFindingTypeStatsResponse response = webSecurityScannerClient.listFindingTypeStats(parent); }- Parameters:
parent- Required. The parent resource name, which should be a scan run resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.- Throws:
ApiException- if the remote call fails
-
listFindingTypeStats
List all FindingTypeStats under a given ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ListFindingTypeStatsRequest request = ListFindingTypeStatsRequest.newBuilder() .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString()) .build(); ListFindingTypeStatsResponse response = webSecurityScannerClient.listFindingTypeStats(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listFindingTypeStatsCallable
public final UnaryCallable<ListFindingTypeStatsRequest,ListFindingTypeStatsResponse> listFindingTypeStatsCallable()List all FindingTypeStats under a given ScanRun.Sample code:
// 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. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { ListFindingTypeStatsRequest request = ListFindingTypeStatsRequest.newBuilder() .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString()) .build(); ApiFuture<ListFindingTypeStatsResponse> future = webSecurityScannerClient.listFindingTypeStatsCallable().futureCall(request); // Do something. ListFindingTypeStatsResponse response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-