Class ContainerAnalysisV1Beta1Client
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
Analysis results are stored as a series of occurrences. An `Occurrence` contains information about a specific analysis instance on a resource. An occurrence refers to a `Note`. A note contains details describing the analysis and is generally stored in a separate project, called a `Provider`. Multiple occurrences can refer to the same note.
For example, an SSL vulnerability could affect multiple images. In this case, there would be one note for the vulnerability and an occurrence for each image with the vulnerability referring to that note.
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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
ContainerAnalysisV1Beta1Client.create()) {
ResourceName resource =
new ResourceName() {
{@literal @}Override
public Map<String, String> getFieldValuesMap() {
Map<String, String> fieldValuesMap = new HashMap<>();
fieldValuesMap.put("resource", "projects/project-8432/notes/note-8432");
return fieldValuesMap;
}
{@literal @}Override
public String getFieldValue(String fieldName) {
return getFieldValuesMap().get(fieldName);
}
{@literal @}Override
public String toString() {
return "projects/project-8432/notes/note-8432";
}
};
Policy policy = Policy.newBuilder().build();
Policy response = containerAnalysisV1Beta1Client.setIamPolicy(resource, policy);
}
Note: close() needs to be called on the ContainerAnalysisV1Beta1Client 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 |
|---|---|---|
SetIamPolicy |
Sets the access control policy on the specified note or occurrence. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or an occurrence, respectively. The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences. |
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.
|
GetIamPolicy |
Gets the access control policy for a note or an occurrence resource. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or occurrence, respectively. The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences. |
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.
|
TestIamPermissions |
Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, `containeranalysis.notes.list`). The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences. |
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.
|
GeneratePackagesSummary |
Gets a summary of the packages within a given resource. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ExportSBOM |
Generates an SBOM and other dependency information for the given resource. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
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 ContainerAnalysisV1Beta1Settings 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
ContainerAnalysisV1Beta1Settings containerAnalysisV1Beta1Settings =
ContainerAnalysisV1Beta1Settings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
ContainerAnalysisV1Beta1Client.create(containerAnalysisV1Beta1Settings);
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
ContainerAnalysisV1Beta1Settings containerAnalysisV1Beta1Settings =
ContainerAnalysisV1Beta1Settings.newBuilder().setEndpoint(myEndpoint).build();
ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
ContainerAnalysisV1Beta1Client.create(containerAnalysisV1Beta1Settings);
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
ContainerAnalysisV1Beta1Settings containerAnalysisV1Beta1Settings =
ContainerAnalysisV1Beta1Settings.newHttpJsonBuilder().build();
ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
ContainerAnalysisV1Beta1Client.create(containerAnalysisV1Beta1Settings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs an instance of ContainerAnalysisV1Beta1Client, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final ContainerAnalysisV1Beta1Clientcreate()Constructs an instance of ContainerAnalysisV1Beta1Client with default settings.static final ContainerAnalysisV1Beta1Clientcreate(ContainerAnalysisV1Beta1Settings settings) Constructs an instance of ContainerAnalysisV1Beta1Client, using the given settings.static final ContainerAnalysisV1Beta1ClientConstructs an instance of ContainerAnalysisV1Beta1Client, using the given stub for making calls.final ExportSBOMResponseexportSBOM(ExportSBOMRequest request) Generates an SBOM and other dependency information for the given resource.Generates an SBOM and other dependency information for the given resource.final PackagesSummaryResponseGets a summary of the packages within a given resource.Gets a summary of the packages within a given resource.final PolicygetIamPolicy(ResourceName resource) Gets the access control policy for a note or an occurrence resource.final PolicygetIamPolicy(GetIamPolicyRequest request) Gets the access control policy for a note or an occurrence resource.final PolicygetIamPolicy(String resource) Gets the access control policy for a note or an occurrence resource.Gets the access control policy for a note or an occurrence resource.getStub()booleanbooleanfinal PolicysetIamPolicy(ResourceName resource, Policy policy) Sets the access control policy on the specified note or occurrence.final PolicysetIamPolicy(SetIamPolicyRequest request) Sets the access control policy on the specified note or occurrence.final PolicysetIamPolicy(String resource, Policy policy) Sets the access control policy on the specified note or occurrence.Sets the access control policy on the specified note or occurrence.voidshutdown()voidtestIamPermissions(ResourceName resource, List<String> permissions) Returns the permissions that a caller has on the specified note or occurrence.Returns the permissions that a caller has on the specified note or occurrence.testIamPermissions(String resource, List<String> permissions) Returns the permissions that a caller has on the specified note or occurrence.Returns the permissions that a caller has on the specified note or occurrence.
-
Constructor Details
-
ContainerAnalysisV1Beta1Client
protected ContainerAnalysisV1Beta1Client(ContainerAnalysisV1Beta1Settings settings) throws IOException Constructs an instance of ContainerAnalysisV1Beta1Client, 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
-
ContainerAnalysisV1Beta1Client
-
-
Method Details
-
create
Constructs an instance of ContainerAnalysisV1Beta1Client with default settings.- Throws:
IOException
-
create
public static final ContainerAnalysisV1Beta1Client create(ContainerAnalysisV1Beta1Settings settings) throws IOException Constructs an instance of ContainerAnalysisV1Beta1Client, 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 ContainerAnalysisV1Beta1Client, using the given stub for making calls. This is for advanced usage - prefer using create(ContainerAnalysisV1Beta1Settings). -
getSettings
-
getStub
-
setIamPolicy
Sets the access control policy on the specified note or occurrence. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or an occurrence, respectively.The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.
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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { ResourceName resource = new ResourceName() { {@literal @}Override public Map<String, String> getFieldValuesMap() { Map<String, String> fieldValuesMap = new HashMap<>(); fieldValuesMap.put("resource", "projects/project-8432/notes/note-8432"); return fieldValuesMap; } {@literal @}Override public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } {@literal @}Override public String toString() { return "projects/project-8432/notes/note-8432"; } }; Policy policy = Policy.newBuilder().build(); Policy response = containerAnalysisV1Beta1Client.setIamPolicy(resource, policy); }- Parameters:
resource- REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.policy- REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.- Throws:
ApiException- if the remote call fails
-
setIamPolicy
Sets the access control policy on the specified note or occurrence. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or an occurrence, respectively.The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.
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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { String resource = new ResourceName() { {@literal @}Override public Map<String, String> getFieldValuesMap() { Map<String, String> fieldValuesMap = new HashMap<>(); fieldValuesMap.put("resource", "resource-341064690"); return fieldValuesMap; } {@literal @}Override public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } {@literal @}Override public String toString() { return "resource-341064690"; } }.toString(); Policy policy = Policy.newBuilder().build(); Policy response = containerAnalysisV1Beta1Client.setIamPolicy(resource, policy); }- Parameters:
resource- REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.policy- REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.- Throws:
ApiException- if the remote call fails
-
setIamPolicy
Sets the access control policy on the specified note or occurrence. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or an occurrence, respectively.The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.
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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource("SetIamPolicyRequest1223629066".toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = containerAnalysisV1Beta1Client.setIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setIamPolicyCallable
Sets the access control policy on the specified note or occurrence. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or an occurrence, respectively.The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.
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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource("SetIamPolicyRequest1223629066".toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Policy> future = containerAnalysisV1Beta1Client.setIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
getIamPolicy
Gets the access control policy for a note or an occurrence resource. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or occurrence, respectively.The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.
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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { ResourceName resource = new ResourceName() { {@literal @}Override public Map<String, String> getFieldValuesMap() { Map<String, String> fieldValuesMap = new HashMap<>(); fieldValuesMap.put("resource", "projects/project-8432/notes/note-8432"); return fieldValuesMap; } {@literal @}Override public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } {@literal @}Override public String toString() { return "projects/project-8432/notes/note-8432"; } }; Policy response = containerAnalysisV1Beta1Client.getIamPolicy(resource); }- Parameters:
resource- REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.- Throws:
ApiException- if the remote call fails
-
getIamPolicy
Gets the access control policy for a note or an occurrence resource. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or occurrence, respectively.The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.
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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { String resource = new ResourceName() { {@literal @}Override public Map<String, String> getFieldValuesMap() { Map<String, String> fieldValuesMap = new HashMap<>(); fieldValuesMap.put("resource", "resource-341064690"); return fieldValuesMap; } {@literal @}Override public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } {@literal @}Override public String toString() { return "resource-341064690"; } }.toString(); Policy response = containerAnalysisV1Beta1Client.getIamPolicy(resource); }- Parameters:
resource- REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.- Throws:
ApiException- if the remote call fails
-
getIamPolicy
Gets the access control policy for a note or an occurrence resource. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or occurrence, respectively.The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.
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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource("GetIamPolicyRequest-1527610370".toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); Policy response = containerAnalysisV1Beta1Client.getIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getIamPolicyCallable
Gets the access control policy for a note or an occurrence resource. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or occurrence, respectively.The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.
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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource("GetIamPolicyRequest-1527610370".toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); ApiFuture<Policy> future = containerAnalysisV1Beta1Client.getIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
testIamPermissions
public final TestIamPermissionsResponse testIamPermissions(ResourceName resource, List<String> permissions) Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, `containeranalysis.notes.list`).The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.
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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { ResourceName resource = new ResourceName() { {@literal @}Override public Map<String, String> getFieldValuesMap() { Map<String, String> fieldValuesMap = new HashMap<>(); fieldValuesMap.put("resource", "projects/project-8432/notes/note-8432"); return fieldValuesMap; } {@literal @}Override public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } {@literal @}Override public String toString() { return "projects/project-8432/notes/note-8432"; } }; List<String> permissions = new ArrayList<>(); TestIamPermissionsResponse response = containerAnalysisV1Beta1Client.testIamPermissions(resource, permissions); }- Parameters:
resource- REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.permissions- The set of permissions to check for the `resource`. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).- Throws:
ApiException- if the remote call fails
-
testIamPermissions
public final TestIamPermissionsResponse testIamPermissions(String resource, List<String> permissions) Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, `containeranalysis.notes.list`).The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.
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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { String resource = new ResourceName() { {@literal @}Override public Map<String, String> getFieldValuesMap() { Map<String, String> fieldValuesMap = new HashMap<>(); fieldValuesMap.put("resource", "resource-341064690"); return fieldValuesMap; } {@literal @}Override public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } {@literal @}Override public String toString() { return "resource-341064690"; } }.toString(); List<String> permissions = new ArrayList<>(); TestIamPermissionsResponse response = containerAnalysisV1Beta1Client.testIamPermissions(resource, permissions); }- Parameters:
resource- REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.permissions- The set of permissions to check for the `resource`. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).- Throws:
ApiException- if the remote call fails
-
testIamPermissions
Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, `containeranalysis.notes.list`).The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.
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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource("TestIamPermissionsRequest942398222".toString()) .addAllPermissions(new ArrayList<String>()) .build(); TestIamPermissionsResponse response = containerAnalysisV1Beta1Client.testIamPermissions(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
testIamPermissionsCallable
public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, `containeranalysis.notes.list`).The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.
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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource("TestIamPermissionsRequest942398222".toString()) .addAllPermissions(new ArrayList<String>()) .build(); ApiFuture<TestIamPermissionsResponse> future = containerAnalysisV1Beta1Client.testIamPermissionsCallable().futureCall(request); // Do something. TestIamPermissionsResponse response = future.get(); } -
generatePackagesSummary
public final PackagesSummaryResponse generatePackagesSummary(GeneratePackagesSummaryRequest request) Gets a summary of the packages within a given resource.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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { GeneratePackagesSummaryRequest request = GeneratePackagesSummaryRequest.newBuilder().setName("name3373707").build(); PackagesSummaryResponse response = containerAnalysisV1Beta1Client.generatePackagesSummary(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
generatePackagesSummaryCallable
public final UnaryCallable<GeneratePackagesSummaryRequest,PackagesSummaryResponse> generatePackagesSummaryCallable()Gets a summary of the packages within a given resource.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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { GeneratePackagesSummaryRequest request = GeneratePackagesSummaryRequest.newBuilder().setName("name3373707").build(); ApiFuture<PackagesSummaryResponse> future = containerAnalysisV1Beta1Client.generatePackagesSummaryCallable().futureCall(request); // Do something. PackagesSummaryResponse response = future.get(); } -
exportSBOM
Generates an SBOM and other dependency information for the given resource.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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { ExportSBOMRequest request = ExportSBOMRequest.newBuilder().setName("name3373707").build(); ExportSBOMResponse response = containerAnalysisV1Beta1Client.exportSBOM(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
exportSBOMCallable
Generates an SBOM and other dependency information for the given resource.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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) { ExportSBOMRequest request = ExportSBOMRequest.newBuilder().setName("name3373707").build(); ApiFuture<ExportSBOMResponse> future = containerAnalysisV1Beta1Client.exportSBOMCallable().futureCall(request); // Do something. ExportSBOMResponse 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
-