Reference documentation and code samples for the Grafeas API module Grafeas.
Methods
.grafeas
defself.grafeas(version::v1,&block)->::Object
Create a new client object for Grafeas.
By default, this returns an instance of
Grafeas::V1::Grafeas::Client
for a gRPC client for version V1 of the API.
However, you can specify a different API version by passing it in the
version parameter. If the Grafeas service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
Raises an exception if the currently installed versioned client gem for the
given API version does not support the Grafeas service.
You can determine whether the method will succeed by calling
Grafeas.grafeas_available?.
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.
Parameter
version (::String, ::Symbol) (defaults to: :v1) โ The API version to connect to. Optional.
Defaults to :v1.
Returns
(::Object) โ A client object for the specified version.
.grafeas_available?
defself.grafeas_available?(version::v1)->boolean
Determines whether the Grafeas service is supported by the current client.
If true, you can retrieve a client object by calling Grafeas.grafeas.
If false, that method will raise an exception. This could happen if the given
API version does not exist or does not support the Grafeas service,
or if the versioned client gem needs an update to support the Grafeas service.
Parameter
version (::String, ::Symbol) (defaults to: :v1) โ The API version to connect to. Optional.
Defaults to :v1.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Grafeas API - Module Grafeas (v1.5.2)\n\nVersion latestkeyboard_arrow_down\n\n- [1.5.2 (latest)](/ruby/docs/reference/grafeas/latest/Grafeas)\n- [1.5.1](/ruby/docs/reference/grafeas/1.5.1/Grafeas)\n- [1.4.0](/ruby/docs/reference/grafeas/1.4.0/Grafeas)\n- [1.3.0](/ruby/docs/reference/grafeas/1.3.0/Grafeas)\n- [1.2.0](/ruby/docs/reference/grafeas/1.2.0/Grafeas)\n- [1.1.2](/ruby/docs/reference/grafeas/1.1.2/Grafeas) \nReference documentation and code samples for the Grafeas API module Grafeas.\n\nMethods\n-------\n\n### .grafeas\n\n def self.grafeas(version: :v1, &block) -\u003e ::Object\n\nCreate a new client object for Grafeas.\n\n\nBy default, this returns an instance of\n[Grafeas::V1::Grafeas::Client](https://cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Grafeas-Client)\nfor a gRPC client for version V1 of the API.\nHowever, you can specify a different API version by passing it in the\n`version` parameter. If the Grafeas service is\nsupported by that API version, and the corresponding gem is available, the\nappropriate versioned client will be returned.\n\nRaises an exception if the currently installed versioned client gem for the\ngiven API version does not support the Grafeas service.\nYou can determine whether the method will succeed by calling\n[Grafeas.grafeas_available?](/ruby/docs/reference/grafeas/latest/Grafeas#Grafeas_grafeas_available__class_ \"Grafeas.grafeas_available? (method)\").\n\n#### About Grafeas\n\n[Grafeas](https://grafeas.io) API.\n\nRetrieves analysis results of Cloud components such as Docker container\nimages.\n\nAnalysis results are stored as a series of occurrences. An `Occurrence`\ncontains information about a specific analysis instance on a resource. An\noccurrence refers to a `Note`. A note contains details describing the\nanalysis and is generally stored in a separate project, called a `Provider`.\nMultiple occurrences can refer to the same note.\n\n\u003cbr /\u003e\n\nFor example, an SSL vulnerability could affect multiple images. In this case,\nthere would be one note for the vulnerability and an occurrence for each\nimage with the vulnerability referring to that note. \n**Parameter**\n\n- **version** (::String, ::Symbol) *(defaults to: :v1)* --- The API version to connect to. Optional. Defaults to `:v1`. \n**Returns**\n\n- (::Object) --- A client object for the specified version.\n\n### .grafeas_available?\n\n def self.grafeas_available?(version: :v1) -\u003e boolean\n\nDetermines whether the Grafeas service is supported by the current client.\nIf true, you can retrieve a client object by calling [Grafeas.grafeas](/ruby/docs/reference/grafeas/latest/Grafeas#Grafeas_grafeas_class_ \"Grafeas.grafeas (method)\").\nIf false, that method will raise an exception. This could happen if the given\nAPI version does not exist or does not support the Grafeas service,\nor if the versioned client gem needs an update to support the Grafeas service. \n**Parameter**\n\n- **version** (::String, ::Symbol) *(defaults to: :v1)* --- The API version to connect to. Optional. Defaults to `:v1`. \n**Returns**\n\n- (boolean) --- Whether the service is available.\n\nConstants\n---------\n\n### VERSION\n\n**value:**\"1.5.2\""]]