Skip to content
This repository was archived by the owner on Aug 19, 2022. It is now read-only.

Latest commit

 

History

History
412 lines (268 loc) · 9.99 KB

File metadata and controls

412 lines (268 loc) · 9.99 KB

Grafeas::GrafeasApi

All URIs are relative to http://localhost

Method HTTP request Description
create_note POST /v1alpha1/{parent}/notes Creates a new `Note`.
create_occurrence POST /v1alpha1/{parent}/occurrences Creates a new `Occurrence`. Use this method to create `Occurrences` for a resource.
create_operation POST /v1alpha1/{parent}/operations Creates a new `Operation`.
get_occurrence_note GET /v1alpha1/{name}/notes Gets the `Note` attached to the given `Occurrence`.
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.
list_notes GET /v1alpha1/{parent}/notes Lists all `Notes` for a given project.
list_occurrences GET /v1alpha1/{parent}/occurrences Lists active `Occurrences` for a given project matching the filters.
update_note PATCH /v1alpha1/{name} Updates an existing `Note`.

create_note

ApiNote create_note(parent, body)

Creates a new Note.

Example

# 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

Parameters

Name Type Description Notes
parent String
body ApiNote

Return type

ApiNote

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

create_occurrence

ApiOccurrence create_occurrence(parent, body)

Creates a new Occurrence. Use this method to create Occurrences for a resource.

Example

# load the gem
require 'grafeas'

api_instance = Grafeas::GrafeasApi.new

parent = 'parent_example' # String | 

body = Grafeas::ApiOccurrence.new # ApiOccurrence | 


begin
  #Creates a new `Occurrence`. Use this method to create `Occurrences` for a resource.
  result = api_instance.create_occurrence(parent, body)
  p result
rescue Grafeas::ApiError => e
  puts "Exception when calling GrafeasApi->create_occurrence: #{e}"
end

Parameters

Name Type Description Notes
parent String
body ApiOccurrence

Return type

ApiOccurrence

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

create_operation

LongrunningOperation create_operation(parent, body)

Creates a new Operation.

Example

# load the gem
require 'grafeas'

api_instance = Grafeas::GrafeasApi.new

parent = 'parent_example' # String | 

body = Grafeas::ApiCreateOperationRequest.new # ApiCreateOperationRequest | 


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

Parameters

Name Type Description Notes
parent String
body ApiCreateOperationRequest

Return type

LongrunningOperation

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_occurrence_note

ApiNote get_occurrence_note(name)

Gets the Note attached to the given Occurrence.

Example

# load the gem
require 'grafeas'

api_instance = Grafeas::GrafeasApi.new

name = 'name_example' # String | 


begin
  #Gets the `Note` attached to the given `Occurrence`.
  result = api_instance.get_occurrence_note(name)
  p result
rescue Grafeas::ApiError => e
  puts "Exception when calling GrafeasApi->get_occurrence_note: #{e}"
end

Parameters

Name Type Description Notes
name String

Return type

ApiNote

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

list_note_occurrences

ApiListNoteOccurrencesResponse list_note_occurrences(name, opts)

Lists Occurrences referencing the specified Note. Use this method to get all occurrences referencing your Note across all your customer projects.

Example

# load the gem
require 'grafeas'

api_instance = Grafeas::GrafeasApi.new

name = 'name_example' # String | 

opts = { 
  filter: 'filter_example', # String | The filter expression.
  page_size: 56, # Integer | Number of notes to return in the list.
  page_token: 'page_token_example' # String | Token to provide to skip to a particular spot in the list.
}

begin
  #Lists `Occurrences` referencing the specified `Note`. Use this method to get all occurrences referencing your `Note` across all your customer projects.
  result = api_instance.list_note_occurrences(name, opts)
  p result
rescue Grafeas::ApiError => e
  puts "Exception when calling GrafeasApi->list_note_occurrences: #{e}"
end

Parameters

Name Type Description Notes
name String
filter String The filter expression. [optional]
page_size Integer Number of notes to return in the list. [optional]
page_token String Token to provide to skip to a particular spot in the list. [optional]

Return type

ApiListNoteOccurrencesResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

list_notes

ApiListNotesResponse list_notes(parent, opts)

Lists all Notes for a given project.

Example

# load the gem
require 'grafeas'

api_instance = Grafeas::GrafeasApi.new

parent = 'parent_example' # String | 

opts = { 
  filter: 'filter_example', # String | The filter expression.
  page_size: 56, # Integer | Number of notes to return in the list.
  page_token: 'page_token_example' # String | Token to provide to skip to a particular spot in the list.
}

begin
  #Lists all `Notes` for a given project.
  result = api_instance.list_notes(parent, opts)
  p result
rescue Grafeas::ApiError => e
  puts "Exception when calling GrafeasApi->list_notes: #{e}"
end

Parameters

Name Type Description Notes
parent String
filter String The filter expression. [optional]
page_size Integer Number of notes to return in the list. [optional]
page_token String Token to provide to skip to a particular spot in the list. [optional]

Return type

ApiListNotesResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

list_occurrences

ApiListOccurrencesResponse list_occurrences(parent, opts)

Lists active Occurrences for a given project matching the filters.

Example

# load the gem
require 'grafeas'

api_instance = Grafeas::GrafeasApi.new

parent = 'parent_example' # String | 

opts = { 
  filter: 'filter_example', # String | The filter expression.
  page_size: 56, # Integer | Number of occurrences to return in the list.
  page_token: 'page_token_example' # String | Token to provide to skip to a particular spot in the list.
}

begin
  #Lists active `Occurrences` for a given project matching the filters.
  result = api_instance.list_occurrences(parent, opts)
  p result
rescue Grafeas::ApiError => e
  puts "Exception when calling GrafeasApi->list_occurrences: #{e}"
end

Parameters

Name Type Description Notes
parent String
filter String The filter expression. [optional]
page_size Integer Number of occurrences to return in the list. [optional]
page_token String Token to provide to skip to a particular spot in the list. [optional]

Return type

ApiListOccurrencesResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

update_note

ApiNote update_note(name, body)

Updates an existing Note.

Example

# load the gem
require 'grafeas'

api_instance = Grafeas::GrafeasApi.new

name = 'name_example' # String | 

body = Grafeas::ApiNote.new # ApiNote | 


begin
  #Updates an existing `Note`.
  result = api_instance.update_note(name, body)
  p result
rescue Grafeas::ApiError => e
  puts "Exception when calling GrafeasApi->update_note: #{e}"
end

Parameters

Name Type Description Notes
name String
body ApiNote

Return type

ApiNote

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json