pub struct ContainerAnalysis { /* private fields */ }Expand description
Implements a client for the Container Analysis API.
§Example
let client = ContainerAnalysis::builder().build().await?;
// use `client` to make requests to the Container Analysis API.§Service Description
Retrieves analysis results of Cloud components such as Docker container images. The Container Analysis API is an implementation of the Grafeas API.
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.
§Configuration
To configure ContainerAnalysis use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://containeranalysis.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
ContainerAnalysis holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap ContainerAnalysis in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl ContainerAnalysis
impl ContainerAnalysis
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for ContainerAnalysis.
let client = ContainerAnalysis::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: ContainerAnalysis + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: ContainerAnalysis + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn set_iam_policy(&self) -> SetIamPolicy
pub fn set_iam_policy(&self) -> 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.
Sourcepub fn get_iam_policy(&self) -> GetIamPolicy
pub fn get_iam_policy(&self) -> 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.
Sourcepub fn test_iam_permissions(&self) -> TestIamPermissions
pub fn test_iam_permissions(&self) -> 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.
Sourcepub fn get_vulnerability_occurrences_summary(
&self,
) -> GetVulnerabilityOccurrencesSummary
pub fn get_vulnerability_occurrences_summary( &self, ) -> GetVulnerabilityOccurrencesSummary
Gets a summary of the number and severity of occurrences.
Sourcepub fn export_sbom(&self) -> ExportSBOM
pub fn export_sbom(&self) -> ExportSBOM
Generates an SBOM for the given resource.
Trait Implementations§
Source§impl Clone for ContainerAnalysis
impl Clone for ContainerAnalysis
Source§fn clone(&self) -> ContainerAnalysis
fn clone(&self) -> ContainerAnalysis
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more