Skip to content

Latest commit

 

History

History
696 lines (496 loc) · 23.8 KB

GrafeasApi.md

File metadata and controls

696 lines (496 loc) · 23.8 KB

grafeas.GrafeasApi

All URIs are relative to http://localhost

Method HTTP request Description
create_note POST /v1alpha1/{parent=projects/*}/notes Creates a new `Note`.
create_occurrence POST /v1alpha1/{parent=projects/*}/occurrences Creates a new `Occurrence`. Use this method to create `Occurrences` for a resource.
create_operation POST /v1alpha1/{parent=projects/*}/operations Creates a new `Operation`.
delete_note DELETE /v1alpha1/{name=projects//notes/} Deletes the given `Note` from the system.
delete_occurrence DELETE /v1alpha1/{name=projects//occurrences/} Deletes the given `Occurrence` from the system. Use this when an `Occurrence` is no longer applicable for the given resource.
get_note GET /v1alpha1/{name=projects//notes/} Returns the requested `Note`.
get_occurrence GET /v1alpha1/{name=projects//occurrences/} Returns the requested `Occurrence`.
get_occurrence_note GET /v1alpha1/{name=projects//occurrences/}/notes Gets the `Note` attached to the given `Occurrence`.
list_note_occurrences GET /v1alpha1/{name=projects//notes/}/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=projects/*}/notes Lists all `Notes` for a given project.
list_occurrences GET /v1alpha1/{parent=projects/*}/occurrences Lists active `Occurrences` for a given project matching the filters.
update_note PATCH /v1alpha1/{name=projects//notes/} Updates an existing `Note`.
update_occurrence PATCH /v1alpha1/{name=projects//occurrences/} Updates an existing occurrence.
update_operation PATCH /v1alpha1/{name=projects//operations/} Updates an existing operation returns an error if operation does not exist. The only valid operations are to update mark the done bit change the result.

create_note

ApiNote create_note(parent, body)

Creates a new Note.

Example

from __future__ import print_function
import time
import grafeas
from grafeas.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = grafeas.GrafeasApi()
parent = 'parent_example' # str | This field contains the project Id for example: \"project/{project_id}
body = grafeas.ApiNote() # ApiNote | The Note to be inserted

try:
    # Creates a new `Note`.
    api_response = api_instance.create_note(parent, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GrafeasApi->create_note: %s\n" % e)

Parameters

Name Type Description Notes
parent str This field contains the project Id for example: "project/{project_id}
body ApiNote The Note to be inserted

Return type

ApiNote

Authorization

No authorization required

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_occurrence

ApiOccurrence create_occurrence(parent, body)

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

Example

from __future__ import print_function
import time
import grafeas
from grafeas.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = grafeas.GrafeasApi()
parent = 'parent_example' # str | This field contains the project Id for example: \"projects/{project_id}\"
body = grafeas.ApiOccurrence() # ApiOccurrence | The occurrence to be inserted.

try:
    # Creates a new `Occurrence`. Use this method to create `Occurrences` for a resource.
    api_response = api_instance.create_occurrence(parent, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GrafeasApi->create_occurrence: %s\n" % e)

Parameters

Name Type Description Notes
parent str This field contains the project Id for example: "projects/{project_id}"
body ApiOccurrence The occurrence to be inserted.

Return type

ApiOccurrence

Authorization

No authorization required

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_operation

GooglelongrunningOperation create_operation(parent, body)

Creates a new Operation.

Example

from __future__ import print_function
import time
import grafeas
from grafeas.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = grafeas.GrafeasApi()
parent = 'parent_example' # str | The projectId that this operation should be created under.
body = grafeas.ApiCreateOperationRequest() # ApiCreateOperationRequest | 

try:
    # Creates a new `Operation`.
    api_response = api_instance.create_operation(parent, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GrafeasApi->create_operation: %s\n" % e)

Parameters

Name Type Description Notes
parent str The projectId that this operation should be created under.
body ApiCreateOperationRequest

Return type

GooglelongrunningOperation

Authorization

No authorization required

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_note

object delete_note(name)

Deletes the given Note from the system.

Example

from __future__ import print_function
import time
import grafeas
from grafeas.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = grafeas.GrafeasApi()
name = 'name_example' # str | The name of the note in the form of \"providers/{provider_id}/notes/{NOTE_ID}\"

try:
    # Deletes the given `Note` from the system.
    api_response = api_instance.delete_note(name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GrafeasApi->delete_note: %s\n" % e)

Parameters

Name Type Description Notes
name str The name of the note in the form of "providers/{provider_id}/notes/{NOTE_ID}"

Return type

object

Authorization

No authorization required

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_occurrence

object delete_occurrence(name)

Deletes the given Occurrence from the system. Use this when an Occurrence is no longer applicable for the given resource.

Example

from __future__ import print_function
import time
import grafeas
from grafeas.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = grafeas.GrafeasApi()
name = 'name_example' # str | The name of the occurrence in the form of \"projects/{project_id}/occurrences/{OCCURRENCE_ID}\"

try:
    # Deletes the given `Occurrence` from the system. Use this when an `Occurrence` is no longer applicable for the given resource.
    api_response = api_instance.delete_occurrence(name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GrafeasApi->delete_occurrence: %s\n" % e)

Parameters

Name Type Description Notes
name str The name of the occurrence in the form of "projects/{project_id}/occurrences/{OCCURRENCE_ID}"

Return type

object

Authorization

No authorization required

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_note

ApiNote get_note(name)

Returns the requested Note.

Example

from __future__ import print_function
import time
import grafeas
from grafeas.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = grafeas.GrafeasApi()
name = 'name_example' # str | The name of the note in the form of \"providers/{provider_id}/notes/{NOTE_ID}\"

try:
    # Returns the requested `Note`.
    api_response = api_instance.get_note(name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GrafeasApi->get_note: %s\n" % e)

Parameters

Name Type Description Notes
name str The name of the note in the form of "providers/{provider_id}/notes/{NOTE_ID}"

Return type

ApiNote

Authorization

No authorization required

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_occurrence

ApiOccurrence get_occurrence(name)

Returns the requested Occurrence.

Example

from __future__ import print_function
import time
import grafeas
from grafeas.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = grafeas.GrafeasApi()
name = 'name_example' # str | The name of the occurrence of the form \"projects/{project_id}/occurrences/{OCCURRENCE_ID}\"

try:
    # Returns the requested `Occurrence`.
    api_response = api_instance.get_occurrence(name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GrafeasApi->get_occurrence: %s\n" % e)

Parameters

Name Type Description Notes
name str The name of the occurrence of the form "projects/{project_id}/occurrences/{OCCURRENCE_ID}"

Return type

ApiOccurrence

Authorization

No authorization required

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_occurrence_note

ApiNote get_occurrence_note(name)

Gets the Note attached to the given Occurrence.

Example

from __future__ import print_function
import time
import grafeas
from grafeas.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = grafeas.GrafeasApi()
name = 'name_example' # str | The name of the occurrence in the form \"projects/{project_id}/occurrences/{OCCURRENCE_ID}\"

try:
    # Gets the `Note` attached to the given `Occurrence`.
    api_response = api_instance.get_occurrence_note(name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GrafeasApi->get_occurrence_note: %s\n" % e)

Parameters

Name Type Description Notes
name str The name of the occurrence in the form "projects/{project_id}/occurrences/{OCCURRENCE_ID}"

Return type

ApiNote

Authorization

No authorization required

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_note_occurrences

ApiListNoteOccurrencesResponse list_note_occurrences(name, filter=filter, page_size=page_size, page_token=page_token)

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

Example

from __future__ import print_function
import time
import grafeas
from grafeas.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = grafeas.GrafeasApi()
name = 'name_example' # str | The name field will contain the note name for example:   \"provider/{provider_id}/notes/{note_id}\"
filter = 'filter_example' # str | The filter expression. (optional)
page_size = 56 # int | Number of notes to return in the list. (optional)
page_token = 'page_token_example' # str | Token to provide to skip to a particular spot in the list. (optional)

try:
    # Lists `Occurrences` referencing the specified `Note`. Use this method to get all occurrences referencing your `Note` across all your customer projects.
    api_response = api_instance.list_note_occurrences(name, filter=filter, page_size=page_size, page_token=page_token)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GrafeasApi->list_note_occurrences: %s\n" % e)

Parameters

Name Type Description Notes
name str The name field will contain the note name for example: "provider/{provider_id}/notes/{note_id}"
filter str The filter expression. [optional]
page_size int Number of notes to return in the list. [optional]
page_token str 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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_notes

ApiListNotesResponse list_notes(parent, filter=filter, page_size=page_size, page_token=page_token)

Lists all Notes for a given project.

Example

from __future__ import print_function
import time
import grafeas
from grafeas.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = grafeas.GrafeasApi()
parent = 'parent_example' # str | This field contains the project ID for example: \"projects/{project_id}\".
filter = 'filter_example' # str | The filter expression. (optional)
page_size = 56 # int | Number of notes to return in the list. (optional)
page_token = 'page_token_example' # str | Token to provide to skip to a particular spot in the list. (optional)

try:
    # Lists all `Notes` for a given project.
    api_response = api_instance.list_notes(parent, filter=filter, page_size=page_size, page_token=page_token)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GrafeasApi->list_notes: %s\n" % e)

Parameters

Name Type Description Notes
parent str This field contains the project ID for example: "projects/{project_id}".
filter str The filter expression. [optional]
page_size int Number of notes to return in the list. [optional]
page_token str 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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_occurrences

ApiListOccurrencesResponse list_occurrences(parent, filter=filter, page_size=page_size, page_token=page_token)

Lists active Occurrences for a given project matching the filters.

Example

from __future__ import print_function
import time
import grafeas
from grafeas.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = grafeas.GrafeasApi()
parent = 'parent_example' # str | This contains the project Id for example: projects/{project_id}.
filter = 'filter_example' # str | The filter expression. (optional)
page_size = 56 # int | Number of occurrences to return in the list. (optional)
page_token = 'page_token_example' # str | Token to provide to skip to a particular spot in the list. (optional)

try:
    # Lists active `Occurrences` for a given project matching the filters.
    api_response = api_instance.list_occurrences(parent, filter=filter, page_size=page_size, page_token=page_token)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GrafeasApi->list_occurrences: %s\n" % e)

Parameters

Name Type Description Notes
parent str This contains the project Id for example: projects/{project_id}.
filter str The filter expression. [optional]
page_size int Number of occurrences to return in the list. [optional]
page_token str 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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_note

ApiNote update_note(name, body)

Updates an existing Note.

Example

from __future__ import print_function
import time
import grafeas
from grafeas.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = grafeas.GrafeasApi()
name = 'name_example' # str | The name of the note. Should be of the form \"projects/{provider_id}/notes/{note_id}\".
body = grafeas.ApiNote() # ApiNote | The updated note.

try:
    # Updates an existing `Note`.
    api_response = api_instance.update_note(name, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GrafeasApi->update_note: %s\n" % e)

Parameters

Name Type Description Notes
name str The name of the note. Should be of the form "projects/{provider_id}/notes/{note_id}".
body ApiNote The updated note.

Return type

ApiNote

Authorization

No authorization required

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_occurrence

ApiOccurrence update_occurrence(name, body)

Updates an existing occurrence.

Example

from __future__ import print_function
import time
import grafeas
from grafeas.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = grafeas.GrafeasApi()
name = 'name_example' # str | The name of the occurrence. Should be of the form \"projects/{project_id}/occurrences/{OCCURRENCE_ID}\".
body = grafeas.ApiOccurrence() # ApiOccurrence | The updated occurrence.

try:
    # Updates an existing occurrence.
    api_response = api_instance.update_occurrence(name, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GrafeasApi->update_occurrence: %s\n" % e)

Parameters

Name Type Description Notes
name str The name of the occurrence. Should be of the form "projects/{project_id}/occurrences/{OCCURRENCE_ID}".
body ApiOccurrence The updated occurrence.

Return type

ApiOccurrence

Authorization

No authorization required

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_operation

GooglelongrunningOperation update_operation(name, body)

Updates an existing operation returns an error if operation does not exist. The only valid operations are to update mark the done bit change the result.

Example

from __future__ import print_function
import time
import grafeas
from grafeas.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = grafeas.GrafeasApi()
name = 'name_example' # str | The name of the Operation. Should be of the form \"projects/{provider_id}/operations/{operation_id}\".
body = grafeas.ApiUpdateOperationRequest() # ApiUpdateOperationRequest | 

try:
    # Updates an existing operation returns an error if operation  does not exist. The only valid operations are to update mark the done bit change the result.
    api_response = api_instance.update_operation(name, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GrafeasApi->update_operation: %s\n" % e)

Parameters

Name Type Description Notes
name str The name of the Operation. Should be of the form "projects/{provider_id}/operations/{operation_id}".
body ApiUpdateOperationRequest

Return type

GooglelongrunningOperation

Authorization

No authorization required

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]