@Generated(value="by gapic-generator") @BetaApi public class WebSecurityScannerClient extends Object implements BackgroundResource
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:
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().
The surface of this class includes several types of Java methods for each of the API's methods:
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:
WebSecurityScannerSettings webSecurityScannerSettings =
WebSecurityScannerSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
WebSecurityScannerClient webSecurityScannerClient =
WebSecurityScannerClient.create(webSecurityScannerSettings);
To customize the endpoint:
WebSecurityScannerSettings webSecurityScannerSettings =
WebSecurityScannerSettings.newBuilder().setEndpoint(myEndpoint).build();
WebSecurityScannerClient webSecurityScannerClient =
WebSecurityScannerClient.create(webSecurityScannerSettings);
Modifier and Type | Class and Description |
---|---|
static class |
WebSecurityScannerClient.ListCrawledUrlsFixedSizeCollection |
static class |
WebSecurityScannerClient.ListCrawledUrlsPage |
static class |
WebSecurityScannerClient.ListCrawledUrlsPagedResponse |
static class |
WebSecurityScannerClient.ListFindingsFixedSizeCollection |
static class |
WebSecurityScannerClient.ListFindingsPage |
static class |
WebSecurityScannerClient.ListFindingsPagedResponse |
static class |
WebSecurityScannerClient.ListScanConfigsFixedSizeCollection |
static class |
WebSecurityScannerClient.ListScanConfigsPage |
static class |
WebSecurityScannerClient.ListScanConfigsPagedResponse |
static class |
WebSecurityScannerClient.ListScanRunsFixedSizeCollection |
static class |
WebSecurityScannerClient.ListScanRunsPage |
static class |
WebSecurityScannerClient.ListScanRunsPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
WebSecurityScannerClient(WebSecurityScannerSettings settings)
Constructs an instance of WebSecurityScannerClient, using the given settings.
|
protected |
WebSecurityScannerClient(WebSecurityScannerStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static WebSecurityScannerClient |
create()
Constructs an instance of WebSecurityScannerClient with default settings.
|
static WebSecurityScannerClient |
create(WebSecurityScannerSettings settings)
Constructs an instance of WebSecurityScannerClient, using the given settings.
|
static WebSecurityScannerClient |
create(WebSecurityScannerStub stub)
Constructs an instance of WebSecurityScannerClient, using the given stub for making calls.
|
com.google.cloud.websecurityscanner.v1alpha.ScanConfig |
createScanConfig(com.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest request)
Creates a new ScanConfig.
|
com.google.cloud.websecurityscanner.v1alpha.ScanConfig |
createScanConfig(com.google.cloud.websecurityscanner.v1alpha.ProjectName parent,
com.google.cloud.websecurityscanner.v1alpha.ScanConfig scanConfig)
Creates a new ScanConfig.
|
com.google.cloud.websecurityscanner.v1alpha.ScanConfig |
createScanConfig(String parent,
com.google.cloud.websecurityscanner.v1alpha.ScanConfig scanConfig)
Creates a new ScanConfig.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest,com.google.cloud.websecurityscanner.v1alpha.ScanConfig> |
createScanConfigCallable()
Creates a new ScanConfig.
|
void |
deleteScanConfig(com.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest request)
Deletes an existing ScanConfig and its child resources.
|
void |
deleteScanConfig(com.google.cloud.websecurityscanner.v1alpha.ScanConfigName name)
Deletes an existing ScanConfig and its child resources.
|
void |
deleteScanConfig(String name)
Deletes an existing ScanConfig and its child resources.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest,Empty> |
deleteScanConfigCallable()
Deletes an existing ScanConfig and its child resources.
|
com.google.cloud.websecurityscanner.v1alpha.Finding |
getFinding(com.google.cloud.websecurityscanner.v1alpha.FindingName name)
Gets a Finding.
|
com.google.cloud.websecurityscanner.v1alpha.Finding |
getFinding(com.google.cloud.websecurityscanner.v1alpha.GetFindingRequest request)
Gets a Finding.
|
com.google.cloud.websecurityscanner.v1alpha.Finding |
getFinding(String name)
Gets a Finding.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.GetFindingRequest,com.google.cloud.websecurityscanner.v1alpha.Finding> |
getFindingCallable()
Gets a Finding.
|
com.google.cloud.websecurityscanner.v1alpha.ScanConfig |
getScanConfig(com.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest request)
Gets a ScanConfig.
|
com.google.cloud.websecurityscanner.v1alpha.ScanConfig |
getScanConfig(com.google.cloud.websecurityscanner.v1alpha.ScanConfigName name)
Gets a ScanConfig.
|
com.google.cloud.websecurityscanner.v1alpha.ScanConfig |
getScanConfig(String name)
Gets a ScanConfig.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest,com.google.cloud.websecurityscanner.v1alpha.ScanConfig> |
getScanConfigCallable()
Gets a ScanConfig.
|
com.google.cloud.websecurityscanner.v1alpha.ScanRun |
getScanRun(com.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest request)
Gets a ScanRun.
|
com.google.cloud.websecurityscanner.v1alpha.ScanRun |
getScanRun(com.google.cloud.websecurityscanner.v1alpha.ScanRunName name)
Gets a ScanRun.
|
com.google.cloud.websecurityscanner.v1alpha.ScanRun |
getScanRun(String name)
Gets a ScanRun.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest,com.google.cloud.websecurityscanner.v1alpha.ScanRun> |
getScanRunCallable()
Gets a ScanRun.
|
WebSecurityScannerSettings |
getSettings() |
WebSecurityScannerStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
WebSecurityScannerClient.ListCrawledUrlsPagedResponse |
listCrawledUrls(com.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest request)
List CrawledUrls under a given ScanRun.
|
WebSecurityScannerClient.ListCrawledUrlsPagedResponse |
listCrawledUrls(com.google.cloud.websecurityscanner.v1alpha.ScanRunName parent)
List CrawledUrls under a given ScanRun.
|
WebSecurityScannerClient.ListCrawledUrlsPagedResponse |
listCrawledUrls(String parent)
List CrawledUrls under a given ScanRun.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest,com.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse> |
listCrawledUrlsCallable()
List CrawledUrls under a given ScanRun.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest,WebSecurityScannerClient.ListCrawledUrlsPagedResponse> |
listCrawledUrlsPagedCallable()
List CrawledUrls under a given ScanRun.
|
WebSecurityScannerClient.ListFindingsPagedResponse |
listFindings(com.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest request)
List Findings under a given ScanRun.
|
WebSecurityScannerClient.ListFindingsPagedResponse |
listFindings(com.google.cloud.websecurityscanner.v1alpha.ScanRunName parent,
String filter)
List Findings under a given ScanRun.
|
WebSecurityScannerClient.ListFindingsPagedResponse |
listFindings(String parent,
String filter)
List Findings under a given ScanRun.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest,com.google.cloud.websecurityscanner.v1alpha.ListFindingsResponse> |
listFindingsCallable()
List Findings under a given ScanRun.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest,WebSecurityScannerClient.ListFindingsPagedResponse> |
listFindingsPagedCallable()
List Findings under a given ScanRun.
|
com.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse |
listFindingTypeStats(com.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest request)
List all FindingTypeStats under a given ScanRun.
|
com.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse |
listFindingTypeStats(com.google.cloud.websecurityscanner.v1alpha.ScanRunName parent)
List all FindingTypeStats under a given ScanRun.
|
com.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse |
listFindingTypeStats(String parent)
List all FindingTypeStats under a given ScanRun.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest,com.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse> |
listFindingTypeStatsCallable()
List all FindingTypeStats under a given ScanRun.
|
WebSecurityScannerClient.ListScanConfigsPagedResponse |
listScanConfigs(com.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest request)
Lists ScanConfigs under a given project.
|
WebSecurityScannerClient.ListScanConfigsPagedResponse |
listScanConfigs(com.google.cloud.websecurityscanner.v1alpha.ProjectName parent)
Lists ScanConfigs under a given project.
|
WebSecurityScannerClient.ListScanConfigsPagedResponse |
listScanConfigs(String parent)
Lists ScanConfigs under a given project.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest,com.google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse> |
listScanConfigsCallable()
Lists ScanConfigs under a given project.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest,WebSecurityScannerClient.ListScanConfigsPagedResponse> |
listScanConfigsPagedCallable()
Lists ScanConfigs under a given project.
|
WebSecurityScannerClient.ListScanRunsPagedResponse |
listScanRuns(com.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest request)
Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
|
WebSecurityScannerClient.ListScanRunsPagedResponse |
listScanRuns(com.google.cloud.websecurityscanner.v1alpha.ScanConfigName parent)
Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
|
WebSecurityScannerClient.ListScanRunsPagedResponse |
listScanRuns(String parent)
Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest,com.google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse> |
listScanRunsCallable()
Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest,WebSecurityScannerClient.ListScanRunsPagedResponse> |
listScanRunsPagedCallable()
Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.cloud.websecurityscanner.v1alpha.ScanRun |
startScanRun(com.google.cloud.websecurityscanner.v1alpha.ScanConfigName name)
Start a ScanRun according to the given ScanConfig.
|
com.google.cloud.websecurityscanner.v1alpha.ScanRun |
startScanRun(com.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest request)
Start a ScanRun according to the given ScanConfig.
|
com.google.cloud.websecurityscanner.v1alpha.ScanRun |
startScanRun(String name)
Start a ScanRun according to the given ScanConfig.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest,com.google.cloud.websecurityscanner.v1alpha.ScanRun> |
startScanRunCallable()
Start a ScanRun according to the given ScanConfig.
|
com.google.cloud.websecurityscanner.v1alpha.ScanRun |
stopScanRun(com.google.cloud.websecurityscanner.v1alpha.ScanRunName name)
Stops a ScanRun.
|
com.google.cloud.websecurityscanner.v1alpha.ScanRun |
stopScanRun(com.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest request)
Stops a ScanRun.
|
com.google.cloud.websecurityscanner.v1alpha.ScanRun |
stopScanRun(String name)
Stops a ScanRun.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest,com.google.cloud.websecurityscanner.v1alpha.ScanRun> |
stopScanRunCallable()
Stops a ScanRun.
|
com.google.cloud.websecurityscanner.v1alpha.ScanConfig |
updateScanConfig(com.google.cloud.websecurityscanner.v1alpha.ScanConfig scanConfig,
FieldMask updateMask)
Updates a ScanConfig.
|
com.google.cloud.websecurityscanner.v1alpha.ScanConfig |
updateScanConfig(com.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest request)
Updates a ScanConfig.
|
UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest,com.google.cloud.websecurityscanner.v1alpha.ScanConfig> |
updateScanConfigCallable()
Updates a ScanConfig.
|
protected WebSecurityScannerClient(WebSecurityScannerSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected WebSecurityScannerClient(WebSecurityScannerStub stub)
public static final WebSecurityScannerClient create() throws IOException
IOException
public static final WebSecurityScannerClient create(WebSecurityScannerSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final WebSecurityScannerClient create(WebSecurityScannerStub stub)
public final WebSecurityScannerSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public WebSecurityScannerStub getStub()
public final com.google.cloud.websecurityscanner.v1alpha.ScanConfig createScanConfig(com.google.cloud.websecurityscanner.v1alpha.ProjectName parent, com.google.cloud.websecurityscanner.v1alpha.ScanConfig scanConfig)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ScanConfig scanConfig = ScanConfig.newBuilder().build();
ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig);
}
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.ApiException
- if the remote call failspublic final com.google.cloud.websecurityscanner.v1alpha.ScanConfig createScanConfig(String parent, com.google.cloud.websecurityscanner.v1alpha.ScanConfig scanConfig)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ScanConfig scanConfig = ScanConfig.newBuilder().build();
ScanConfig response = webSecurityScannerClient.createScanConfig(parent.toString(), scanConfig);
}
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.ApiException
- if the remote call failspublic final com.google.cloud.websecurityscanner.v1alpha.ScanConfig createScanConfig(com.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest request)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ScanConfig scanConfig = ScanConfig.newBuilder().build();
CreateScanConfigRequest request = CreateScanConfigRequest.newBuilder()
.setParent(parent.toString())
.setScanConfig(scanConfig)
.build();
ScanConfig response = webSecurityScannerClient.createScanConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest,com.google.cloud.websecurityscanner.v1alpha.ScanConfig> createScanConfigCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ScanConfig scanConfig = ScanConfig.newBuilder().build();
CreateScanConfigRequest request = CreateScanConfigRequest.newBuilder()
.setParent(parent.toString())
.setScanConfig(scanConfig)
.build();
ApiFuture<ScanConfig> future = webSecurityScannerClient.createScanConfigCallable().futureCall(request);
// Do something
ScanConfig response = future.get();
}
public final void deleteScanConfig(com.google.cloud.websecurityscanner.v1alpha.ScanConfigName name)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
webSecurityScannerClient.deleteScanConfig(name);
}
name
- Required. The resource name of the ScanConfig to be deleted. The name follows the
format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.ApiException
- if the remote call failspublic final void deleteScanConfig(String name)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
webSecurityScannerClient.deleteScanConfig(name.toString());
}
name
- Required. The resource name of the ScanConfig to be deleted. The name follows the
format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.ApiException
- if the remote call failspublic final void deleteScanConfig(com.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest request)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
DeleteScanConfigRequest request = DeleteScanConfigRequest.newBuilder()
.setName(name.toString())
.build();
webSecurityScannerClient.deleteScanConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest,Empty> deleteScanConfigCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
DeleteScanConfigRequest request = DeleteScanConfigRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Void> future = webSecurityScannerClient.deleteScanConfigCallable().futureCall(request);
// Do something
future.get();
}
public final com.google.cloud.websecurityscanner.v1alpha.ScanConfig getScanConfig(com.google.cloud.websecurityscanner.v1alpha.ScanConfigName name)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
ScanConfig response = webSecurityScannerClient.getScanConfig(name);
}
name
- Required. The resource name of the ScanConfig to be returned. The name follows the
format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.ApiException
- if the remote call failspublic final com.google.cloud.websecurityscanner.v1alpha.ScanConfig getScanConfig(String name)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
ScanConfig response = webSecurityScannerClient.getScanConfig(name.toString());
}
name
- Required. The resource name of the ScanConfig to be returned. The name follows the
format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.ApiException
- if the remote call failspublic final com.google.cloud.websecurityscanner.v1alpha.ScanConfig getScanConfig(com.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest request)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
GetScanConfigRequest request = GetScanConfigRequest.newBuilder()
.setName(name.toString())
.build();
ScanConfig response = webSecurityScannerClient.getScanConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest,com.google.cloud.websecurityscanner.v1alpha.ScanConfig> getScanConfigCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
GetScanConfigRequest request = GetScanConfigRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<ScanConfig> future = webSecurityScannerClient.getScanConfigCallable().futureCall(request);
// Do something
ScanConfig response = future.get();
}
public final WebSecurityScannerClient.ListScanConfigsPagedResponse listScanConfigs(com.google.cloud.websecurityscanner.v1alpha.ProjectName parent)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (ScanConfig element : webSecurityScannerClient.listScanConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent resource name, which should be a project resource name in
the format 'projects/{projectId}'.ApiException
- if the remote call failspublic final WebSecurityScannerClient.ListScanConfigsPagedResponse listScanConfigs(String parent)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (ScanConfig element : webSecurityScannerClient.listScanConfigs(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent resource name, which should be a project resource name in
the format 'projects/{projectId}'.ApiException
- if the remote call failspublic final WebSecurityScannerClient.ListScanConfigsPagedResponse listScanConfigs(com.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest request)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ListScanConfigsRequest request = ListScanConfigsRequest.newBuilder()
.setParent(parent.toString())
.build();
for (ScanConfig element : webSecurityScannerClient.listScanConfigs(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest,WebSecurityScannerClient.ListScanConfigsPagedResponse> listScanConfigsPagedCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ListScanConfigsRequest request = ListScanConfigsRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListScanConfigsPagedResponse> future = webSecurityScannerClient.listScanConfigsPagedCallable().futureCall(request);
// Do something
for (ScanConfig element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest,com.google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse> listScanConfigsCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ListScanConfigsRequest request = ListScanConfigsRequest.newBuilder()
.setParent(parent.toString())
.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;
}
}
}
public final com.google.cloud.websecurityscanner.v1alpha.ScanConfig updateScanConfig(com.google.cloud.websecurityscanner.v1alpha.ScanConfig scanConfig, FieldMask updateMask)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfig scanConfig = ScanConfig.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
ScanConfig response = webSecurityScannerClient.updateScanConfig(scanConfig, updateMask);
}
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#fieldmaskApiException
- if the remote call failspublic final com.google.cloud.websecurityscanner.v1alpha.ScanConfig updateScanConfig(com.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest request)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfig scanConfig = ScanConfig.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
UpdateScanConfigRequest request = UpdateScanConfigRequest.newBuilder()
.setScanConfig(scanConfig)
.setUpdateMask(updateMask)
.build();
ScanConfig response = webSecurityScannerClient.updateScanConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest,com.google.cloud.websecurityscanner.v1alpha.ScanConfig> updateScanConfigCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfig scanConfig = ScanConfig.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
UpdateScanConfigRequest request = UpdateScanConfigRequest.newBuilder()
.setScanConfig(scanConfig)
.setUpdateMask(updateMask)
.build();
ApiFuture<ScanConfig> future = webSecurityScannerClient.updateScanConfigCallable().futureCall(request);
// Do something
ScanConfig response = future.get();
}
public final com.google.cloud.websecurityscanner.v1alpha.ScanRun startScanRun(com.google.cloud.websecurityscanner.v1alpha.ScanConfigName name)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
ScanRun response = webSecurityScannerClient.startScanRun(name);
}
name
- Required. The resource name of the ScanConfig to be used. The name follows the
format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.ApiException
- if the remote call failspublic final com.google.cloud.websecurityscanner.v1alpha.ScanRun startScanRun(String name)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
ScanRun response = webSecurityScannerClient.startScanRun(name.toString());
}
name
- Required. The resource name of the ScanConfig to be used. The name follows the
format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.ApiException
- if the remote call failspublic final com.google.cloud.websecurityscanner.v1alpha.ScanRun startScanRun(com.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest request)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
StartScanRunRequest request = StartScanRunRequest.newBuilder()
.setName(name.toString())
.build();
ScanRun response = webSecurityScannerClient.startScanRun(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest,com.google.cloud.websecurityscanner.v1alpha.ScanRun> startScanRunCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
StartScanRunRequest request = StartScanRunRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<ScanRun> future = webSecurityScannerClient.startScanRunCallable().futureCall(request);
// Do something
ScanRun response = future.get();
}
public final com.google.cloud.websecurityscanner.v1alpha.ScanRun getScanRun(com.google.cloud.websecurityscanner.v1alpha.ScanRunName name)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
ScanRun response = webSecurityScannerClient.getScanRun(name);
}
name
- Required. The resource name of the ScanRun to be returned. The name follows the
format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.ApiException
- if the remote call failspublic final com.google.cloud.websecurityscanner.v1alpha.ScanRun getScanRun(String name)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
ScanRun response = webSecurityScannerClient.getScanRun(name.toString());
}
name
- Required. The resource name of the ScanRun to be returned. The name follows the
format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.ApiException
- if the remote call failspublic final com.google.cloud.websecurityscanner.v1alpha.ScanRun getScanRun(com.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest request)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
GetScanRunRequest request = GetScanRunRequest.newBuilder()
.setName(name.toString())
.build();
ScanRun response = webSecurityScannerClient.getScanRun(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest,com.google.cloud.websecurityscanner.v1alpha.ScanRun> getScanRunCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
GetScanRunRequest request = GetScanRunRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<ScanRun> future = webSecurityScannerClient.getScanRunCallable().futureCall(request);
// Do something
ScanRun response = future.get();
}
public final WebSecurityScannerClient.ListScanRunsPagedResponse listScanRuns(com.google.cloud.websecurityscanner.v1alpha.ScanConfigName parent)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName parent = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
for (ScanRun element : webSecurityScannerClient.listScanRuns(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent resource name, which should be a scan resource name in the
format 'projects/{projectId}/scanConfigs/{scanConfigId}'.ApiException
- if the remote call failspublic final WebSecurityScannerClient.ListScanRunsPagedResponse listScanRuns(String parent)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName parent = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
for (ScanRun element : webSecurityScannerClient.listScanRuns(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent resource name, which should be a scan resource name in the
format 'projects/{projectId}/scanConfigs/{scanConfigId}'.ApiException
- if the remote call failspublic final WebSecurityScannerClient.ListScanRunsPagedResponse listScanRuns(com.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest request)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName parent = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
ListScanRunsRequest request = ListScanRunsRequest.newBuilder()
.setParent(parent.toString())
.build();
for (ScanRun element : webSecurityScannerClient.listScanRuns(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest,WebSecurityScannerClient.ListScanRunsPagedResponse> listScanRunsPagedCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName parent = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
ListScanRunsRequest request = ListScanRunsRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListScanRunsPagedResponse> future = webSecurityScannerClient.listScanRunsPagedCallable().futureCall(request);
// Do something
for (ScanRun element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest,com.google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse> listScanRunsCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfigName parent = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
ListScanRunsRequest request = ListScanRunsRequest.newBuilder()
.setParent(parent.toString())
.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;
}
}
}
public final com.google.cloud.websecurityscanner.v1alpha.ScanRun stopScanRun(com.google.cloud.websecurityscanner.v1alpha.ScanRunName name)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
ScanRun response = webSecurityScannerClient.stopScanRun(name);
}
name
- Required. The resource name of the ScanRun to be stopped. The name follows the
format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.ApiException
- if the remote call failspublic final com.google.cloud.websecurityscanner.v1alpha.ScanRun stopScanRun(String name)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
ScanRun response = webSecurityScannerClient.stopScanRun(name.toString());
}
name
- Required. The resource name of the ScanRun to be stopped. The name follows the
format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.ApiException
- if the remote call failspublic final com.google.cloud.websecurityscanner.v1alpha.ScanRun stopScanRun(com.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest request)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
StopScanRunRequest request = StopScanRunRequest.newBuilder()
.setName(name.toString())
.build();
ScanRun response = webSecurityScannerClient.stopScanRun(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest,com.google.cloud.websecurityscanner.v1alpha.ScanRun> stopScanRunCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
StopScanRunRequest request = StopScanRunRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<ScanRun> future = webSecurityScannerClient.stopScanRunCallable().futureCall(request);
// Do something
ScanRun response = future.get();
}
public final WebSecurityScannerClient.ListCrawledUrlsPagedResponse listCrawledUrls(com.google.cloud.websecurityscanner.v1alpha.ScanRunName parent)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
for (CrawledUrl element : webSecurityScannerClient.listCrawledUrls(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent resource name, which should be a scan run resource name in
the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.ApiException
- if the remote call failspublic final WebSecurityScannerClient.ListCrawledUrlsPagedResponse listCrawledUrls(String parent)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
for (CrawledUrl element : webSecurityScannerClient.listCrawledUrls(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent resource name, which should be a scan run resource name in
the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.ApiException
- if the remote call failspublic final WebSecurityScannerClient.ListCrawledUrlsPagedResponse listCrawledUrls(com.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest request)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
ListCrawledUrlsRequest request = ListCrawledUrlsRequest.newBuilder()
.setParent(parent.toString())
.build();
for (CrawledUrl element : webSecurityScannerClient.listCrawledUrls(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest,WebSecurityScannerClient.ListCrawledUrlsPagedResponse> listCrawledUrlsPagedCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
ListCrawledUrlsRequest request = ListCrawledUrlsRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListCrawledUrlsPagedResponse> future = webSecurityScannerClient.listCrawledUrlsPagedCallable().futureCall(request);
// Do something
for (CrawledUrl element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest,com.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse> listCrawledUrlsCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
ListCrawledUrlsRequest request = ListCrawledUrlsRequest.newBuilder()
.setParent(parent.toString())
.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;
}
}
}
public final com.google.cloud.websecurityscanner.v1alpha.Finding getFinding(com.google.cloud.websecurityscanner.v1alpha.FindingName name)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
FindingName name = FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]");
Finding response = webSecurityScannerClient.getFinding(name);
}
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}'.ApiException
- if the remote call failspublic final com.google.cloud.websecurityscanner.v1alpha.Finding getFinding(String name)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
FindingName name = FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]");
Finding response = webSecurityScannerClient.getFinding(name.toString());
}
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}'.ApiException
- if the remote call failspublic final com.google.cloud.websecurityscanner.v1alpha.Finding getFinding(com.google.cloud.websecurityscanner.v1alpha.GetFindingRequest request)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
FindingName name = FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]");
GetFindingRequest request = GetFindingRequest.newBuilder()
.setName(name.toString())
.build();
Finding response = webSecurityScannerClient.getFinding(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.GetFindingRequest,com.google.cloud.websecurityscanner.v1alpha.Finding> getFindingCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
FindingName name = FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]");
GetFindingRequest request = GetFindingRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Finding> future = webSecurityScannerClient.getFindingCallable().futureCall(request);
// Do something
Finding response = future.get();
}
public final WebSecurityScannerClient.ListFindingsPagedResponse listFindings(com.google.cloud.websecurityscanner.v1alpha.ScanRunName parent, String filter)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
String filter = "";
for (Finding element : webSecurityScannerClient.listFindings(parent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent resource name, which should be a scan run resource name in
the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.filter
- The filter expression. The expression must be in the format: <field>
<operator> <value>. Supported field: 'finding_type'. Supported operator: '='.ApiException
- if the remote call failspublic final WebSecurityScannerClient.ListFindingsPagedResponse listFindings(String parent, String filter)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
String filter = "";
for (Finding element : webSecurityScannerClient.listFindings(parent.toString(), filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent resource name, which should be a scan run resource name in
the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.filter
- The filter expression. The expression must be in the format: <field>
<operator> <value>. Supported field: 'finding_type'. Supported operator: '='.ApiException
- if the remote call failspublic final WebSecurityScannerClient.ListFindingsPagedResponse listFindings(com.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest request)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
String filter = "";
ListFindingsRequest request = ListFindingsRequest.newBuilder()
.setParent(parent.toString())
.setFilter(filter)
.build();
for (Finding element : webSecurityScannerClient.listFindings(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest,WebSecurityScannerClient.ListFindingsPagedResponse> listFindingsPagedCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
String filter = "";
ListFindingsRequest request = ListFindingsRequest.newBuilder()
.setParent(parent.toString())
.setFilter(filter)
.build();
ApiFuture<ListFindingsPagedResponse> future = webSecurityScannerClient.listFindingsPagedCallable().futureCall(request);
// Do something
for (Finding element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest,com.google.cloud.websecurityscanner.v1alpha.ListFindingsResponse> listFindingsCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
String filter = "";
ListFindingsRequest request = ListFindingsRequest.newBuilder()
.setParent(parent.toString())
.setFilter(filter)
.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;
}
}
}
public final com.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse listFindingTypeStats(com.google.cloud.websecurityscanner.v1alpha.ScanRunName parent)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
ListFindingTypeStatsResponse response = webSecurityScannerClient.listFindingTypeStats(parent);
}
parent
- Required. The parent resource name, which should be a scan run resource name in
the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.ApiException
- if the remote call failspublic final com.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse listFindingTypeStats(String parent)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
ListFindingTypeStatsResponse response = webSecurityScannerClient.listFindingTypeStats(parent.toString());
}
parent
- Required. The parent resource name, which should be a scan run resource name in
the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.ApiException
- if the remote call failspublic final com.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse listFindingTypeStats(com.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest request)
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
ListFindingTypeStatsRequest request = ListFindingTypeStatsRequest.newBuilder()
.setParent(parent.toString())
.build();
ListFindingTypeStatsResponse response = webSecurityScannerClient.listFindingTypeStats(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest,com.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse> listFindingTypeStatsCallable()
Sample code:
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
ListFindingTypeStatsRequest request = ListFindingTypeStatsRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListFindingTypeStatsResponse> future = webSecurityScannerClient.listFindingTypeStatsCallable().futureCall(request);
// Do something
ListFindingTypeStatsResponse response = future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface BackgroundResource
public boolean isShutdown()
isShutdown
in interface BackgroundResource
public boolean isTerminated()
isTerminated
in interface BackgroundResource
public void shutdownNow()
shutdownNow
in interface BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.