pub struct ContainerAnalysis { /* private fields */ }Expand description
Implements a client for 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
ContainerAnalysis has various configuration parameters, the defaults should
work with most applications.
§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 async fn new_with_config(conf: ClientConfig) -> Result<Self>
pub async fn new_with_config(conf: ClientConfig) -> Result<Self>
Creates a new client with the specified configuration.
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 when mocking the client.
Sourcepub fn set_iam_policy(&self, resource: impl Into<String>) -> SetIamPolicy
pub fn set_iam_policy(&self, resource: impl Into<String>) -> 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, resource: impl Into<String>) -> GetIamPolicy
pub fn get_iam_policy(&self, resource: impl Into<String>) -> 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,
resource: impl Into<String>,
) -> TestIamPermissions
pub fn test_iam_permissions( &self, resource: impl Into<String>, ) -> 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,
parent: impl Into<String>,
) -> GetVulnerabilityOccurrencesSummary
pub fn get_vulnerability_occurrences_summary( &self, parent: impl Into<String>, ) -> GetVulnerabilityOccurrencesSummary
Gets a summary of the number and severity of occurrences.
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