Grafeas API.
Retrieves analysis results of Cloud components such as Docker container images.
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.
Equality
Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection>
objects compare equal. Objects that compare equal share the same underlying resources.
Performance
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Thread Safety
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
Constructors
GrafeasClient(GrafeasClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
GrafeasClient const &
|
GrafeasClient(GrafeasClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
GrafeasClient &&
|
GrafeasClient(std::shared_ptr< GrafeasConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< GrafeasConnection >
|
opts |
Options
|
Operators
operator=(GrafeasClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
GrafeasClient const &
|
Returns | |
---|---|
Type | Description |
GrafeasClient & |
operator=(GrafeasClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
GrafeasClient &&
|
Returns | |
---|---|
Type | Description |
GrafeasClient & |
Functions
GetOccurrence(std::string const &, Options)
Gets the specified occurrence.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the occurrence in the form of |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::Occurrence > |
the result of the RPC. The response message type (grafeas.v1.Occurrence) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetOccurrence(grafeas::v1::GetOccurrenceRequest const &, Options)
Gets the specified occurrence.
Parameters | |
---|---|
Name | Description |
request |
grafeas::v1::GetOccurrenceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::Occurrence > |
the result of the RPC. The response message type (grafeas.v1.Occurrence) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListOccurrences(std::string const &, std::string const &, Options)
Lists occurrences for the specified project.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
The name of the project to list occurrences for in the form of |
filter |
std::string const &
The filter expression. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< grafeas::v1::Occurrence > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListOccurrences(grafeas::v1::ListOccurrencesRequest, Options)
Lists occurrences for the specified project.
Parameters | |
---|---|
Name | Description |
request |
grafeas::v1::ListOccurrencesRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< grafeas::v1::Occurrence > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
DeleteOccurrence(std::string const &, Options)
Deletes the specified occurrence.
For example, use this method to delete an occurrence when the occurrence is no longer applicable for the given resource.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the occurrence in the form of |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
DeleteOccurrence(grafeas::v1::DeleteOccurrenceRequest const &, Options)
Deletes the specified occurrence.
For example, use this method to delete an occurrence when the occurrence is no longer applicable for the given resource.
Parameters | |
---|---|
Name | Description |
request |
grafeas::v1::DeleteOccurrenceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
CreateOccurrence(std::string const &, grafeas::v1::Occurrence const &, Options)
Creates a new occurrence.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
The name of the project in the form of |
occurrence |
grafeas::v1::Occurrence const &
The occurrence to create. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::Occurrence > |
the result of the RPC. The response message type (grafeas.v1.Occurrence) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateOccurrence(grafeas::v1::CreateOccurrenceRequest const &, Options)
Creates a new occurrence.
Parameters | |
---|---|
Name | Description |
request |
grafeas::v1::CreateOccurrenceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::Occurrence > |
the result of the RPC. The response message type (grafeas.v1.Occurrence) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
BatchCreateOccurrences(std::string const &, std::vector< grafeas::v1::Occurrence > const &, Options)
Creates new occurrences in batch.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
The name of the project in the form of |
occurrences |
std::vector< grafeas::v1::Occurrence > const &
The occurrences to create. Max allowed length is 1000. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::BatchCreateOccurrencesResponse > |
the result of the RPC. The response message type (grafeas.v1.BatchCreateOccurrencesResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
BatchCreateOccurrences(grafeas::v1::BatchCreateOccurrencesRequest const &, Options)
Creates new occurrences in batch.
Parameters | |
---|---|
Name | Description |
request |
grafeas::v1::BatchCreateOccurrencesRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::BatchCreateOccurrencesResponse > |
the result of the RPC. The response message type (grafeas.v1.BatchCreateOccurrencesResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateOccurrence(std::string const &, grafeas::v1::Occurrence const &, google::protobuf::FieldMask const &, Options)
Updates the specified occurrence.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the occurrence in the form of |
occurrence |
grafeas::v1::Occurrence const &
The updated occurrence. |
update_mask |
google::protobuf::FieldMask const &
The fields to update. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::Occurrence > |
the result of the RPC. The response message type (grafeas.v1.Occurrence) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateOccurrence(grafeas::v1::UpdateOccurrenceRequest const &, Options)
Updates the specified occurrence.
Parameters | |
---|---|
Name | Description |
request |
grafeas::v1::UpdateOccurrenceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::Occurrence > |
the result of the RPC. The response message type (grafeas.v1.Occurrence) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetOccurrenceNote(std::string const &, Options)
Gets the note attached to the specified occurrence.
Consumer projects can use this method to get a note that belongs to a provider project.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the occurrence in the form of |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::Note > |
the result of the RPC. The response message type (grafeas.v1.Note) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetOccurrenceNote(grafeas::v1::GetOccurrenceNoteRequest const &, Options)
Gets the note attached to the specified occurrence.
Consumer projects can use this method to get a note that belongs to a provider project.
Parameters | |
---|---|
Name | Description |
request |
grafeas::v1::GetOccurrenceNoteRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::Note > |
the result of the RPC. The response message type (grafeas.v1.Note) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetNote(std::string const &, Options)
Gets the specified note.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the note in the form of |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::Note > |
the result of the RPC. The response message type (grafeas.v1.Note) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetNote(grafeas::v1::GetNoteRequest const &, Options)
Gets the specified note.
Parameters | |
---|---|
Name | Description |
request |
grafeas::v1::GetNoteRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::Note > |
the result of the RPC. The response message type (grafeas.v1.Note) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListNotes(std::string const &, std::string const &, Options)
Lists notes for the specified project.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
The name of the project to list notes for in the form of |
filter |
std::string const &
The filter expression. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< grafeas::v1::Note > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListNotes(grafeas::v1::ListNotesRequest, Options)
Lists notes for the specified project.
Parameters | |
---|---|
Name | Description |
request |
grafeas::v1::ListNotesRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< grafeas::v1::Note > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
DeleteNote(std::string const &, Options)
Deletes the specified note.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the note in the form of |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
DeleteNote(grafeas::v1::DeleteNoteRequest const &, Options)
Deletes the specified note.
Parameters | |
---|---|
Name | Description |
request |
grafeas::v1::DeleteNoteRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
CreateNote(std::string const &, std::string const &, grafeas::v1::Note const &, Options)
Creates a new note.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
The name of the project in the form of |
note_id |
std::string const &
The ID to use for this note. |
note |
grafeas::v1::Note const &
The note to create. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::Note > |
the result of the RPC. The response message type (grafeas.v1.Note) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateNote(grafeas::v1::CreateNoteRequest const &, Options)
Creates a new note.
Parameters | |
---|---|
Name | Description |
request |
grafeas::v1::CreateNoteRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::Note > |
the result of the RPC. The response message type (grafeas.v1.Note) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
BatchCreateNotes(std::string const &, std::map< std::string, grafeas::v1::Note > const &, Options)
Creates new notes in batch.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
The name of the project in the form of |
notes |
std::map< std::string, grafeas::v1::Note > const &
The notes to create. Max allowed length is 1000. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::BatchCreateNotesResponse > |
the result of the RPC. The response message type (grafeas.v1.BatchCreateNotesResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
BatchCreateNotes(grafeas::v1::BatchCreateNotesRequest const &, Options)
Creates new notes in batch.
Parameters | |
---|---|
Name | Description |
request |
grafeas::v1::BatchCreateNotesRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::BatchCreateNotesResponse > |
the result of the RPC. The response message type (grafeas.v1.BatchCreateNotesResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateNote(std::string const &, grafeas::v1::Note const &, google::protobuf::FieldMask const &, Options)
Updates the specified note.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the note in the form of |
note |
grafeas::v1::Note const &
The updated note. |
update_mask |
google::protobuf::FieldMask const &
The fields to update. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::Note > |
the result of the RPC. The response message type (grafeas.v1.Note) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateNote(grafeas::v1::UpdateNoteRequest const &, Options)
Updates the specified note.
Parameters | |
---|---|
Name | Description |
request |
grafeas::v1::UpdateNoteRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< grafeas::v1::Note > |
the result of the RPC. The response message type (grafeas.v1.Note) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListNoteOccurrences(std::string const &, std::string const &, Options)
Lists occurrences referencing the specified note.
Provider projects can use this method to get all occurrences across consumer projects referencing the specified note.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the note to list occurrences for in the form of |
filter |
std::string const &
The filter expression. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< grafeas::v1::Occurrence > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListNoteOccurrences(grafeas::v1::ListNoteOccurrencesRequest, Options)
Lists occurrences referencing the specified note.
Provider projects can use this method to get all occurrences across consumer projects referencing the specified note.
Parameters | |
---|---|
Name | Description |
request |
grafeas::v1::ListNoteOccurrencesRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< grafeas::v1::Occurrence > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |