Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
command: |
python3 -m venv venv
. venv/bin/activate
python v1alpha1/setup.py install
python setup.py install

- save_cache:
paths:
Expand Down
172 changes: 90 additions & 82 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# swagger_client
# Grafeas
An API to insert and retrieve annotations on cloud artifacts.

This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 0.1
- Package version: 1.0.0
- Build date: 2017-10-08T15:14:38.092-04:00
- Build package: class io.swagger.codegen.languages.PythonClientCodegen
- API version: v1alpha1
- Package version: v1alpha1
- Build package: io.swagger.codegen.languages.PythonClientCodegen

## Requirements.

Expand All @@ -24,7 +23,7 @@ pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

Then import the package:
```python
import swagger_client
import grafeas
```

### Setuptools
Expand All @@ -38,29 +37,30 @@ python setup.py install --user

Then import the package:
```python
import swagger_client
import grafeas
```

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
import grafeas
from grafeas.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.GrafeasApi
projects_id = 'projects_id_example' # str | Part of `parent`. This field contains the projectId for example: \"project/{project_id}
note_id = 'note_id_example' # str | The ID to use for this note. (optional)
note = swagger_client.Note() # Note | The Note to be inserted (optional)
api_instance = grafeas.GrafeasApi()
parent = 'parent_example' # str |
body = grafeas.ApiNote() # ApiNote |

try:
api_response = api_instance.create_note(projects_id, note_id=note_id, note=note)
# 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
print("Exception when calling GrafeasApi->create_note: %s\n" % e)

```

Expand All @@ -70,77 +70,85 @@ All URIs are relative to *http://localhost*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*GrafeasApi* | [**create_note**](docs/GrafeasApi.md#create_note) | **POST** /v1alpha1/projects/{projectsId}/notes |
*GrafeasApi* | [**create_occurrence**](docs/GrafeasApi.md#create_occurrence) | **POST** /v1alpha1/projects/{projectsId}/occurrences |
*GrafeasApi* | [**delete_note**](docs/GrafeasApi.md#delete_note) | **DELETE** /v1alpha1/projects/{projectsId}/notes/{notesId} |
*GrafeasApi* | [**delete_occurrence**](docs/GrafeasApi.md#delete_occurrence) | **DELETE** /v1alpha1/projects/{projectsId}/occurrences/{occurrencesId} |
*GrafeasApi* | [**get_note**](docs/GrafeasApi.md#get_note) | **GET** /v1alpha1/projects/{projectsId}/notes/{notesId} |
*GrafeasApi* | [**get_occurrence**](docs/GrafeasApi.md#get_occurrence) | **GET** /v1alpha1/projects/{projectsId}/occurrences/{occurrencesId} |
*GrafeasApi* | [**get_occurrence_note**](docs/GrafeasApi.md#get_occurrence_note) | **GET** /v1alpha1/projects/{projectsId}/occurrences/{occurrencesId}/notes |
*GrafeasApi* | [**get_operation**](docs/GrafeasApi.md#get_operation) | **GET** /v1alpha1/projects/{projectsId}/operations/{operationsId} |
*GrafeasApi* | [**list_note_occurrences**](docs/GrafeasApi.md#list_note_occurrences) | **GET** /v1alpha1/projects/{projectsId}/notes/{notesId}/occurrences |
*GrafeasApi* | [**list_notes**](docs/GrafeasApi.md#list_notes) | **GET** /v1alpha1/projects/{projectsId}/notes |
*GrafeasApi* | [**list_occurrences**](docs/GrafeasApi.md#list_occurrences) | **GET** /v1alpha1/projects/{projectsId}/occurrences |
*GrafeasApi* | [**list_operations**](docs/GrafeasApi.md#list_operations) | **GET** /v1alpha1/projects/{projectsId}/operations |
*GrafeasApi* | [**update_note**](docs/GrafeasApi.md#update_note) | **PUT** /v1alpha1/projects/{projectsId}/notes/{notesId} |
*GrafeasApi* | [**update_occurrence**](docs/GrafeasApi.md#update_occurrence) | **PUT** /v1alpha1/projects/{projectsId}/occurrences/{occurrencesId} |
*GrafeasApi* | [**update_operation**](docs/GrafeasApi.md#update_operation) | **PUT** /v1alpha1/projects/{projectsId}/operations/{operationsId} |
*GrafeasApi* | [**create_note**](docs/GrafeasApi.md#create_note) | **POST** /v1alpha1/{parent}/notes | Creates a new `Note`.
*GrafeasApi* | [**create_occurrence**](docs/GrafeasApi.md#create_occurrence) | **POST** /v1alpha1/{parent}/occurrences | Creates a new `Occurrence`. Use this method to create `Occurrences` for a resource.
*GrafeasApi* | [**create_operation**](docs/GrafeasApi.md#create_operation) | **POST** /v1alpha1/{parent}/operations | Creates a new `Operation`.
*GrafeasApi* | [**get_occurrence_note**](docs/GrafeasApi.md#get_occurrence_note) | **GET** /v1alpha1/{name}/notes | Gets the `Note` attached to the given `Occurrence`.
*GrafeasApi* | [**list_note_occurrences**](docs/GrafeasApi.md#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.
*GrafeasApi* | [**list_notes**](docs/GrafeasApi.md#list_notes) | **GET** /v1alpha1/{parent}/notes | Lists all `Notes` for a given project.
*GrafeasApi* | [**list_occurrences**](docs/GrafeasApi.md#list_occurrences) | **GET** /v1alpha1/{parent}/occurrences | Lists active `Occurrences` for a given project matching the filters.
*GrafeasApi* | [**update_note**](docs/GrafeasApi.md#update_note) | **PATCH** /v1alpha1/{name} | Updates an existing `Note`.
*GrafeasProjectsApi* | [**create_project**](docs/GrafeasProjectsApi.md#create_project) | **POST** /v1alpha1/projects | Creates a new `Project`.
*GrafeasProjectsApi* | [**delete_project**](docs/GrafeasProjectsApi.md#delete_project) | **DELETE** /v1alpha1/{name} | Deletes the given `Project` from the system.
*GrafeasProjectsApi* | [**get_project**](docs/GrafeasProjectsApi.md#get_project) | **GET** /v1alpha1/{name} | Returns the requested `Project`.
*GrafeasProjectsApi* | [**list_projects**](docs/GrafeasProjectsApi.md#list_projects) | **GET** /v1alpha1/projects | Lists `Projects`


## Documentation For Models

- [AliasContext](docs/AliasContext.md)
- [Artifact](docs/Artifact.md)
- [Basis](docs/Basis.md)
- [BuildDetails](docs/BuildDetails.md)
- [BuildProvenance](docs/BuildProvenance.md)
- [BuildSignature](docs/BuildSignature.md)
- [BuildType](docs/BuildType.md)
- [CloudRepoSourceContext](docs/CloudRepoSourceContext.md)
- [CloudWorkspaceId](docs/CloudWorkspaceId.md)
- [CloudWorkspaceSourceContext](docs/CloudWorkspaceSourceContext.md)
- [Command](docs/Command.md)
- [CreateOperationRequest](docs/CreateOperationRequest.md)
- [CustomDetails](docs/CustomDetails.md)
- [Deployable](docs/Deployable.md)
- [Deployment](docs/Deployment.md)
- [Derived](docs/Derived.md)
- [Detail](docs/Detail.md)
- [Discovered](docs/Discovered.md)
- [Discovery](docs/Discovery.md)
- [Distribution](docs/Distribution.md)
- [Empty](docs/Empty.md)
- [ExtendedSourceContext](docs/ExtendedSourceContext.md)
- [FileHashes](docs/FileHashes.md)
- [Fingerprint](docs/Fingerprint.md)
- [GerritSourceContext](docs/GerritSourceContext.md)
- [GitSourceContext](docs/GitSourceContext.md)
- [Hash](docs/Hash.md)
- [Installation](docs/Installation.md)
- [Layer](docs/Layer.md)
- [ListNoteOccurrencesResponse](docs/ListNoteOccurrencesResponse.md)
- [ListNotesResponse](docs/ListNotesResponse.md)
- [ListOccurrencesResponse](docs/ListOccurrencesResponse.md)
- [ListOperationsResponse](docs/ListOperationsResponse.md)
- [Location](docs/Location.md)
- [Note](docs/Note.md)
- [Occurrence](docs/Occurrence.md)
- [Operation](docs/Operation.md)
- [Package](docs/Package.md)
- [PackageIssue](docs/PackageIssue.md)
- [ProjectRepoId](docs/ProjectRepoId.md)
- [RelatedUrl](docs/RelatedUrl.md)
- [RepoId](docs/RepoId.md)
- [RepoSource](docs/RepoSource.md)
- [Source](docs/Source.md)
- [SourceContext](docs/SourceContext.md)
- [Status](docs/Status.md)
- [StorageSource](docs/StorageSource.md)
- [UpdateOperationRequest](docs/UpdateOperationRequest.md)
- [Version](docs/Version.md)
- [VulnerabilityDetails](docs/VulnerabilityDetails.md)
- [VulnerabilityLocation](docs/VulnerabilityLocation.md)
- [VulnerabilityType](docs/VulnerabilityType.md)
- [ApiAliasContext](docs/ApiAliasContext.md)
- [ApiAliasContextKind](docs/ApiAliasContextKind.md)
- [ApiArtifact](docs/ApiArtifact.md)
- [ApiBuildDetails](docs/ApiBuildDetails.md)
- [ApiBuildProvenance](docs/ApiBuildProvenance.md)
- [ApiBuildSignature](docs/ApiBuildSignature.md)
- [ApiBuildType](docs/ApiBuildType.md)
- [ApiCloudRepoSourceContext](docs/ApiCloudRepoSourceContext.md)
- [ApiCommand](docs/ApiCommand.md)
- [ApiCreateOperationRequest](docs/ApiCreateOperationRequest.md)
- [ApiDeployable](docs/ApiDeployable.md)
- [ApiDiscovery](docs/ApiDiscovery.md)
- [ApiFileHashes](docs/ApiFileHashes.md)
- [ApiGerritSourceContext](docs/ApiGerritSourceContext.md)
- [ApiGitSourceContext](docs/ApiGitSourceContext.md)
- [ApiHash](docs/ApiHash.md)
- [ApiListNoteOccurrencesResponse](docs/ApiListNoteOccurrencesResponse.md)
- [ApiListNotesResponse](docs/ApiListNotesResponse.md)
- [ApiListOccurrencesResponse](docs/ApiListOccurrencesResponse.md)
- [ApiListProjectsResponse](docs/ApiListProjectsResponse.md)
- [ApiNote](docs/ApiNote.md)
- [ApiNoteKind](docs/ApiNoteKind.md)
- [ApiOccurrence](docs/ApiOccurrence.md)
- [ApiPackageManagerLocation](docs/ApiPackageManagerLocation.md)
- [ApiPgpSignedAttestation](docs/ApiPgpSignedAttestation.md)
- [ApiProject](docs/ApiProject.md)
- [ApiProjectRepoId](docs/ApiProjectRepoId.md)
- [ApiRepoId](docs/ApiRepoId.md)
- [ApiRepoSource](docs/ApiRepoSource.md)
- [ApiSource](docs/ApiSource.md)
- [ApiSourceContext](docs/ApiSourceContext.md)
- [ApiStorageSource](docs/ApiStorageSource.md)
- [ApiUpdateOperationRequest](docs/ApiUpdateOperationRequest.md)
- [ApiVulnerabilityType](docs/ApiVulnerabilityType.md)
- [AttestationAuthorityAttestationDetails](docs/AttestationAuthorityAttestationDetails.md)
- [BuildSignatureKeyType](docs/BuildSignatureKeyType.md)
- [DeployableDeploymentDetails](docs/DeployableDeploymentDetails.md)
- [DeploymentDetailsPlatform](docs/DeploymentDetailsPlatform.md)
- [DiscoveryDiscoveredDetails](docs/DiscoveryDiscoveredDetails.md)
- [DockerImageBasis](docs/DockerImageBasis.md)
- [DockerImageDerivedDetails](docs/DockerImageDerivedDetails.md)
- [DockerImageFingerprint](docs/DockerImageFingerprint.md)
- [DockerImageLayer](docs/DockerImageLayer.md)
- [HashHashType](docs/HashHashType.md)
- [LayerDirective](docs/LayerDirective.md)
- [LongrunningOperation](docs/LongrunningOperation.md)
- [NoteRelatedUrl](docs/NoteRelatedUrl.md)
- [PackageManagerArchitecture](docs/PackageManagerArchitecture.md)
- [PackageManagerDistribution](docs/PackageManagerDistribution.md)
- [PackageManagerInstallationDetails](docs/PackageManagerInstallationDetails.md)
- [PackageManagerPackage](docs/PackageManagerPackage.md)
- [PgpSignedAttestationContentType](docs/PgpSignedAttestationContentType.md)
- [ProtobufAny](docs/ProtobufAny.md)
- [ProtobufEmpty](docs/ProtobufEmpty.md)
- [ProtobufFieldMask](docs/ProtobufFieldMask.md)
- [RpcStatus](docs/RpcStatus.md)
- [VersionVersionKind](docs/VersionVersionKind.md)
- [VulnerabilityTypeDetail](docs/VulnerabilityTypeDetail.md)
- [VulnerabilityTypePackageIssue](docs/VulnerabilityTypePackageIssue.md)
- [VulnerabilityTypeSeverity](docs/VulnerabilityTypeSeverity.md)
- [VulnerabilityTypeVersion](docs/VulnerabilityTypeVersion.md)
- [VulnerabilityTypeVulnerabilityDetails](docs/VulnerabilityTypeVulnerabilityDetails.md)
- [VulnerabilityTypeVulnerabilityLocation](docs/VulnerabilityTypeVulnerabilityLocation.md)


## Documentation For Authorization
Expand Down
4 changes: 2 additions & 2 deletions v1alpha1/docs/AliasContext.md → docs/ApiAliasContext.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# AliasContext
# ApiAliasContext

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**kind** | **str** | The alias kind. | [optional]
**kind** | [**ApiAliasContextKind**](ApiAliasContextKind.md) | The alias kind. | [optional]
**name** | **str** | The alias name. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
3 changes: 1 addition & 2 deletions v1alpha1/docs/FileHashes.md → docs/ApiAliasContextKind.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# FileHashes
# ApiAliasContextKind

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**file_hash** | [**list[Hash]**](Hash.md) | Collection of file hashes. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
5 changes: 3 additions & 2 deletions v1alpha1/docs/Artifact.md → docs/ApiArtifact.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Artifact
# ApiArtifact

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | Name of the artifact. This may be the path to a binary or jar file, or in the case of a container build, the name used to push the container image to Google Container Registry, as presented to `docker push`. This field is deprecated in favor of the plural `names` field; it continues to exist here to allow existing BuildProvenance serialized to json in google.devtools.containeranalysis.v1alpha1.BuildDetails.provenance_bytes to deserialize back into proto. | [optional]
**checksum** | **str** | Hash or checksum value of a binary, or Docker Registry 2.0 digest of a container. | [optional]
**id** | **str** | Artifact ID, if any; for container images, this will be a URL by digest like gcr.io/projectID/imagename@sha256:123456 | [optional]
**id** | **str** | | [optional]
**names** | **list[str]** | Related artifact names. This may be the path to a binary or jar file, or in the case of a container build, the name used to push the container image to Google Container Registry, as presented to `docker push`. Note that a single Artifact ID can have multiple names, for example if two tags are applied to one image. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
11 changes: 11 additions & 0 deletions docs/ApiBuildDetails.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ApiBuildDetails

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**provenance** | [**ApiBuildProvenance**](ApiBuildProvenance.md) | | [optional]
**provenance_bytes** | **str** | Serialized JSON representation of the provenance, used in generating the `BuildSignature` in the corresponding Result. After verifying the signature, `provenance_bytes` can be unmarshalled and compared to the provenance to confirm that it is unchanged. A base64-encoded string representation of the provenance bytes is used for the signature in order to interoperate with openssl which expects this format for signature verification. The serialized form is captured both to avoid ambiguity in how the provenance is marshalled to json as well to prevent incompatibilities with future changes. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


16 changes: 7 additions & 9 deletions v1alpha1/docs/BuildProvenance.md → docs/ApiBuildProvenance.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# BuildProvenance
# ApiBuildProvenance

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | Unique identifier of the build. | [optional]
**project_id** | **str** | ID of the project. | [optional]
**project_num** | **str** | Numerical ID of the project. | [optional]
**commands** | [**list[Command]**](Command.md) | Commands requested by the build. | [optional]
**built_artifacts** | [**list[Artifact]**](Artifact.md) | Output of the build. | [optional]
**create_time** | **str** | Time at which the build was created. | [optional]
**start_time** | **str** | Time at which execution of the build was started. | [optional]
**finish_time** | **str** | Time at whihc execution of the build was finished. | [optional]
**user_id** | **str** | GAIA ID of end user who initiated this build; at the time that the BuildProvenance is uploaded to Analysis, this will be resolved to the primary e-mail address of the user and stored in the Creator field. | [optional]
**commands** | [**list[ApiCommand]**](ApiCommand.md) | Commands requested by the build. | [optional]
**built_artifacts** | [**list[ApiArtifact]**](ApiArtifact.md) | Output of the build. | [optional]
**create_time** | **datetime** | Time at which the build was created. | [optional]
**start_time** | **datetime** | Time at which execution of the build was started. | [optional]
**finish_time** | **datetime** | Time at which execution of the build was finished. | [optional]
**creator** | **str** | E-mail address of the user who initiated this build. Note that this was the user's e-mail address at the time the build was initiated; this address may not represent the same end-user for all time. | [optional]
**logs_bucket** | **str** | Google Cloud Storage bucket where logs were written. | [optional]
**source_provenance** | [**Source**](Source.md) | Details of the Source input to the build. | [optional]
**source_provenance** | [**ApiSource**](ApiSource.md) | Details of the Source input to the build. | [optional]
**trigger_id** | **str** | Trigger identifier if the build was triggered automatically; empty if not. | [optional]
**build_options** | **dict(str, str)** | Special options applied to this build. This is a catch-all field where build providers can enter any desired additional details. | [optional]
**builder_version** | **str** | Version string of the builder at the time this build was executed. | [optional]
Expand Down
13 changes: 13 additions & 0 deletions docs/ApiBuildSignature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ApiBuildSignature

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**public_key** | **str** | Public key of the builder which can be used to verify that the related findings are valid and unchanged. If `key_type` is empty, this defaults to PEM encoded public keys. This field may be empty if `key_id` references an external key. For Cloud Container Builder based signatures, this is a PEM encoded public key. To verify the Cloud Container Builder signature, place the contents of this field into a file (public.pem). The signature field is base64-decoded into its binary representation in signature.bin, and the provenance bytes from `BuildDetails` are base64-decoded into a binary representation in signed.bin. OpenSSL can then verify the signature: `openssl sha256 -verify public.pem -signature signature.bin signed.bin` | [optional]
**signature** | **str** | Signature of the related `BuildProvenance`, encoded in a base64 string. | [optional]
**key_id** | **str** | An Id for the key used to sign. This could be either an Id for the key stored in `public_key` (such as the Id or fingerprint for a PGP key, or the CN for a cert), or a reference to an external key (such as a reference to a key in Cloud Key Management Service). | [optional]
**key_type** | [**BuildSignatureKeyType**](BuildSignatureKeyType.md) | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Loading