# Grafeas API - Module Grafeas (v1.8.0)

1.8.0 (latest) 1.7.0 1.6.0 1.5.3 1.4.0 1.3.0 1.2.0 1.1.2 Reference documentation and code samples for the Grafeas API module Grafeas.

## Methods

### .grafeas

    def self.grafeas(version: :v1, &block) -> ::Object

Create a new client object for Grafeas.


By default, this returns an instance of
[Grafeas::V1::Grafeas::Client](https://cloud.google.com/ruby/docs/reference/grafeas-v1/latest/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?](https://docs.cloud.google.com/ruby/docs/reference/grafeas/latest/Grafeas#Grafeas_grafeas_available__class_ "Grafeas.grafeas_available? (method)").

#### About Grafeas

[Grafeas](https://grafeas.io) 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.

<br />

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?

    def self.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](https://docs.cloud.google.com/ruby/docs/reference/grafeas/latest/Grafeas#Grafeas_grafeas_class_ "Grafeas.grafeas (method)").
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`.
**Returns**

- (boolean) --- Whether the service is available.

## Constants

### VERSION

**value:**"1.8.0"