An API to insert and retrieve annotations on cloud artifacts.
This Python package is automatically generated by the Swagger Codegen project:
- API version: v1alpha1
- Package version: v1alpha1
- Build package: io.swagger.codegen.languages.PythonClientCodegen
Python 2.7 and 3.4+
To install the package from this repository:
pip3 install git+https://github.com/grafeas/client-python.git#egg=Grafeas --user
Then import the package:
import grafeas
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import grafeas
Please follow the installation procedure and then run the following:
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(grafeas.ApiClient(configuration))
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)
All URIs are relative to http://localhost
Class | Method | HTTP request | Description |
---|---|---|---|
GrafeasApi | create_note | POST /v1alpha1/{parent=projects/*}/notes | Creates a new `Note`. |
GrafeasApi | create_occurrence | POST /v1alpha1/{parent=projects/*}/occurrences | Creates a new `Occurrence`. Use this method to create `Occurrences` for a resource. |
GrafeasApi | create_operation | POST /v1alpha1/{parent=projects/*}/operations | Creates a new `Operation`. |
GrafeasApi | delete_note | DELETE /v1alpha1/{name=projects//notes/} | Deletes the given `Note` from the system. |
GrafeasApi | 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. |
GrafeasApi | get_note | GET /v1alpha1/{name=projects//notes/} | Returns the requested `Note`. |
GrafeasApi | get_occurrence | GET /v1alpha1/{name=projects//occurrences/} | Returns the requested `Occurrence`. |
GrafeasApi | get_occurrence_note | GET /v1alpha1/{name=projects//occurrences/}/notes | Gets the `Note` attached to the given `Occurrence`. |
GrafeasApi | 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. |
GrafeasApi | list_notes | GET /v1alpha1/{parent=projects/*}/notes | Lists all `Notes` for a given project. |
GrafeasApi | list_occurrences | GET /v1alpha1/{parent=projects/*}/occurrences | Lists active `Occurrences` for a given project matching the filters. |
GrafeasApi | update_note | PATCH /v1alpha1/{name=projects//notes/} | Updates an existing `Note`. |
GrafeasApi | update_occurrence | PATCH /v1alpha1/{name=projects//occurrences/} | Updates an existing occurrence. |
GrafeasApi | 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. |
GrafeasProjectsApi | create_project | POST /v1alpha1/projects | Creates a new project. |
GrafeasProjectsApi | delete_project | DELETE /v1alpha1/{name=projects/*} | Deletes the specified project. |
GrafeasProjectsApi | get_project | GET /v1alpha1/{name=projects/*} | Gets the specified project. |
GrafeasProjectsApi | list_projects | GET /v1alpha1/projects | Lists projects. |
- ApiAliasContext
- ApiAliasContextKind
- ApiArtifact
- ApiAttestationAuthority
- ApiBuildDetails
- ApiBuildProvenance
- ApiBuildSignature
- ApiBuildType
- ApiCloudRepoSourceContext
- ApiCommand
- ApiCreateOperationRequest
- ApiDeployable
- ApiDiscovery
- ApiFileHashes
- ApiGerritSourceContext
- ApiGitSourceContext
- ApiHash
- ApiListNoteOccurrencesResponse
- ApiListNotesResponse
- ApiListOccurrencesResponse
- ApiListProjectsResponse
- ApiNote
- ApiNoteKind
- ApiOccurrence
- ApiPackageManagerLocation
- ApiPgpSignedAttestation
- ApiProject
- ApiProjectRepoId
- ApiRepoId
- ApiRepoSource
- ApiSource
- ApiSourceContext
- ApiStorageSource
- ApiUpdateOperationRequest
- ApiVulnerabilityType
- AttestationAuthorityAttestationAuthorityHint
- AttestationAuthorityAttestationDetails
- BuildSignatureKeyType
- DeployableDeploymentDetails
- DeploymentDetailsPlatform
- DiscoveryDiscoveredDetails
- DockerImageBasis
- DockerImageDerivedDetails
- DockerImageFingerprint
- DockerImageLayer
- GooglelongrunningOperation
- HashHashType
- LayerDirective
- NoteRelatedUrl
- PackageManagerArchitecture
- PackageManagerDistribution
- PackageManagerInstallationDetails
- PackageManagerPackage
- PgpSignedAttestationContentType
- ProtobufAny
- ProtobufFieldMask
- RpcStatus
- VersionVersionKind
- VulnerabilityTypeDetail
- VulnerabilityTypePackageIssue
- VulnerabilityTypeSeverity
- VulnerabilityTypeVersion
- VulnerabilityTypeVulnerabilityDetails
- VulnerabilityTypeVulnerabilityLocation
All endpoints do not require authorization.