/client-ruby

ruby grafeas client

Primary LanguageRuby

grafeas

Grafeas - the Ruby gem for the Grafeas API

An API to insert and retrieve annotations on cloud artifacts.

This SDK is automatically generated by the Swagger Codegen project:

  • API version: v1alpha1
  • Package version: 0.1.0.pre
  • Build package: io.swagger.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build grafeas.gemspec

Then either install the gem locally:

gem install ./grafeas-0.1.0.pre.gem

(for development, run gem install --dev ./grafeas-0.1.0.pre.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'grafeas', '~> 0.1.0.pre'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'grafeas', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'grafeas'

api_instance = Grafeas::GrafeasApi.new

parent = 'parent_example' # String | 

body = Grafeas::ApiNote.new # ApiNote | 


begin
  #Creates a new `Note`.
  result = api_instance.create_note(parent, body)
  p result
rescue Grafeas::ApiError => e
  puts "Exception when calling GrafeasApi->create_note: #{e}"
end

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
Grafeas::GrafeasApi create_note POST /v1alpha1/{parent}/notes Creates a new Note.
Grafeas::GrafeasApi create_occurrence POST /v1alpha1/{parent}/occurrences Creates a new Occurrence. Use this method to create Occurrences for a resource.
Grafeas::GrafeasApi create_operation POST /v1alpha1/{parent}/operations Creates a new Operation.
Grafeas::GrafeasApi get_occurrence_note GET /v1alpha1/{name}/notes Gets the Note attached to the given Occurrence.
Grafeas::GrafeasApi list_note_occurrences GET /v1alpha1/{name}/occurrences Lists Occurrences referencing the specified Note. Use this method to get all occurrences referencing your Note across all your customer projects.
Grafeas::GrafeasApi list_notes GET /v1alpha1/{parent}/notes Lists all Notes for a given project.
Grafeas::GrafeasApi list_occurrences GET /v1alpha1/{parent}/occurrences Lists active Occurrences for a given project matching the filters.
Grafeas::GrafeasApi update_note PATCH /v1alpha1/{name} Updates an existing Note.
Grafeas::GrafeasProjectsApi create_project POST /v1alpha1/projects Creates a new Project.
Grafeas::GrafeasProjectsApi delete_project DELETE /v1alpha1/{name} Deletes the given Project from the system.
Grafeas::GrafeasProjectsApi get_project GET /v1alpha1/{name} Returns the requested Project.
Grafeas::GrafeasProjectsApi list_projects GET /v1alpha1/projects Lists Projects

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.