containeranalysis

package
v0.27.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package containeranalysis is an auto-generated package for the Container Analysis API.

NOTE: This package is in beta. It is not stable, and may be subject to changes.

An implementation of the Grafeas API, which stores, and enables querying and retrieval of critical metadata about all of your software artifacts.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

Types

type ContainerAnalysisV1Beta1CallOptions

type ContainerAnalysisV1Beta1CallOptions struct {
	SetIamPolicy       []gax.CallOption
	GetIamPolicy       []gax.CallOption
	TestIamPermissions []gax.CallOption
	GetScanConfig      []gax.CallOption
	ListScanConfigs    []gax.CallOption
	UpdateScanConfig   []gax.CallOption
}

ContainerAnalysisV1Beta1CallOptions contains the retry settings for each method of ContainerAnalysisV1Beta1Client.

type ContainerAnalysisV1Beta1Client

type ContainerAnalysisV1Beta1Client struct {

	// The call options for this service.
	CallOptions *ContainerAnalysisV1Beta1CallOptions
	// contains filtered or unexported fields
}

ContainerAnalysisV1Beta1Client is a client for interacting with Container Analysis API.

Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

func NewContainerAnalysisV1Beta1Client

func NewContainerAnalysisV1Beta1Client(ctx context.Context, opts ...option.ClientOption) (*ContainerAnalysisV1Beta1Client, error)

NewContainerAnalysisV1Beta1Client creates a new container analysis v1 beta1 client.

Retrieves analysis results of Cloud components such as Docker container images. The Container Analysis API is an implementation of the Grafeas (at grafeas.io) API.

Analysis results are stored as a series of occurrences. An Occurrence contains information about a specific analysis instance on a resource. An occurrence refers to a Note. A note contains details describing the analysis and is generally stored in a separate project, called a Provider. Multiple occurrences can refer to the same note.

For example, an SSL vulnerability could affect multiple images. In this case, there would be one note for the vulnerability and an occurrence for each image with the vulnerability referring to that note.

Example
ctx := context.Background()
c, err := containeranalysis.NewContainerAnalysisV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use client.
_ = c
Output:

func (*ContainerAnalysisV1Beta1Client) Close

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*ContainerAnalysisV1Beta1Client) Connection

Connection returns the client's connection to the API service.

func (*ContainerAnalysisV1Beta1Client) GetIamPolicy

GetIamPolicy gets the access control policy for a note or an occurrence resource. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Example
ctx := context.Background()
c, err := containeranalysis.NewContainerAnalysisV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &iampb.GetIamPolicyRequest{
	// TODO: Fill request struct fields.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Output:

func (*ContainerAnalysisV1Beta1Client) GetScanConfig

GetScanConfig gets the specified scan configuration.

Example
ctx := context.Background()
c, err := containeranalysis.NewContainerAnalysisV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &containeranalysispb.GetScanConfigRequest{
	// TODO: Fill request struct fields.
}
resp, err := c.GetScanConfig(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Output:

func (*ContainerAnalysisV1Beta1Client) ListScanConfigs

ListScanConfigs lists scan configurations for the specified project.

Example
ctx := context.Background()
c, err := containeranalysis.NewContainerAnalysisV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &containeranalysispb.ListScanConfigsRequest{
	// TODO: Fill request struct fields.
}
it := c.ListScanConfigs(ctx, req)
for {
	resp, err := it.Next()
	if err == iterator.Done {
		break
	}
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*ContainerAnalysisV1Beta1Client) SetIamPolicy

SetIamPolicy sets the access control policy on the specified note or occurrence. Requires containeranalysis.notes.setIamPolicy or containeranalysis.occurrences.setIamPolicy permission if the resource is a note or an occurrence, respectively.

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Example
ctx := context.Background()
c, err := containeranalysis.NewContainerAnalysisV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &iampb.SetIamPolicyRequest{
	// TODO: Fill request struct fields.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Output:

func (*ContainerAnalysisV1Beta1Client) TestIamPermissions

TestIamPermissions returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, containeranalysis.notes.list).

The resource takes the format projects/[PROJECT_ID]/notes/[NOTE_ID] for notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for occurrences.

Example
ctx := context.Background()
c, err := containeranalysis.NewContainerAnalysisV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &iampb.TestIamPermissionsRequest{
	// TODO: Fill request struct fields.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Output:

func (*ContainerAnalysisV1Beta1Client) UpdateScanConfig

UpdateScanConfig updates the specified scan configuration.

Example
ctx := context.Background()
c, err := containeranalysis.NewContainerAnalysisV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &containeranalysispb.UpdateScanConfigRequest{
	// TODO: Fill request struct fields.
}
resp, err := c.UpdateScanConfig(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Output:

type GrafeasV1Beta1CallOptions

type GrafeasV1Beta1CallOptions struct {
	GetOccurrence                      []gax.CallOption
	ListOccurrences                    []gax.CallOption
	DeleteOccurrence                   []gax.CallOption
	CreateOccurrence                   []gax.CallOption
	BatchCreateOccurrences             []gax.CallOption
	UpdateOccurrence                   []gax.CallOption
	GetOccurrenceNote                  []gax.CallOption
	GetNote                            []gax.CallOption
	ListNotes                          []gax.CallOption
	DeleteNote                         []gax.CallOption
	CreateNote                         []gax.CallOption
	BatchCreateNotes                   []gax.CallOption
	UpdateNote                         []gax.CallOption
	ListNoteOccurrences                []gax.CallOption
	GetVulnerabilityOccurrencesSummary []gax.CallOption
}

GrafeasV1Beta1CallOptions contains the retry settings for each method of GrafeasV1Beta1Client.

type GrafeasV1Beta1Client

type GrafeasV1Beta1Client struct {

	// The call options for this service.
	CallOptions *GrafeasV1Beta1CallOptions
	// contains filtered or unexported fields
}

GrafeasV1Beta1Client is a client for interacting with Container Analysis API.

Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

func NewGrafeasV1Beta1Client

func NewGrafeasV1Beta1Client(ctx context.Context, opts ...option.ClientOption) (*GrafeasV1Beta1Client, error)

NewGrafeasV1Beta1Client creates a new grafeas v1 beta1 client.

Grafeas (at grafeas.io) API.

Retrieves analysis results of Cloud components such as Docker container images.

Analysis results are stored as a series of occurrences. An Occurrence contains information about a specific analysis instance on a resource. An occurrence refers to a Note. A note contains details describing the analysis and is generally stored in a separate project, called a Provider. Multiple occurrences can refer to the same note.

For example, an SSL vulnerability could affect multiple images. In this case, there would be one note for the vulnerability and an occurrence for each image with the vulnerability referring to that note.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use client.
_ = c
Output:

func (*GrafeasV1Beta1Client) BatchCreateNotes

BatchCreateNotes creates new notes in batch.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &grafeaspb.BatchCreateNotesRequest{
	// TODO: Fill request struct fields.
}
resp, err := c.BatchCreateNotes(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Output:

func (*GrafeasV1Beta1Client) BatchCreateOccurrences

BatchCreateOccurrences creates new occurrences in batch.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &grafeaspb.BatchCreateOccurrencesRequest{
	// TODO: Fill request struct fields.
}
resp, err := c.BatchCreateOccurrences(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Output:

func (*GrafeasV1Beta1Client) Close

func (c *GrafeasV1Beta1Client) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*GrafeasV1Beta1Client) Connection

func (c *GrafeasV1Beta1Client) Connection() *grpc.ClientConn

Connection returns the client's connection to the API service.

func (*GrafeasV1Beta1Client) CreateNote

CreateNote creates a new note.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &grafeaspb.CreateNoteRequest{
	// TODO: Fill request struct fields.
}
resp, err := c.CreateNote(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Output:

func (*GrafeasV1Beta1Client) CreateOccurrence

CreateOccurrence creates a new occurrence.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &grafeaspb.CreateOccurrenceRequest{
	// TODO: Fill request struct fields.
}
resp, err := c.CreateOccurrence(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Output:

func (*GrafeasV1Beta1Client) DeleteNote

DeleteNote deletes the specified note.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &grafeaspb.DeleteNoteRequest{
	// TODO: Fill request struct fields.
}
err = c.DeleteNote(ctx, req)
if err != nil {
	// TODO: Handle error.
}
Output:

func (*GrafeasV1Beta1Client) DeleteOccurrence

func (c *GrafeasV1Beta1Client) DeleteOccurrence(ctx context.Context, req *grafeaspb.DeleteOccurrenceRequest, opts ...gax.CallOption) error

DeleteOccurrence deletes the specified occurrence. For example, use this method to delete an occurrence when the occurrence is no longer applicable for the given resource.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &grafeaspb.DeleteOccurrenceRequest{
	// TODO: Fill request struct fields.
}
err = c.DeleteOccurrence(ctx, req)
if err != nil {
	// TODO: Handle error.
}
Output:

func (*GrafeasV1Beta1Client) GetNote

GetNote gets the specified note.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &grafeaspb.GetNoteRequest{
	// TODO: Fill request struct fields.
}
resp, err := c.GetNote(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Output:

func (*GrafeasV1Beta1Client) GetOccurrence

GetOccurrence gets the specified occurrence.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &grafeaspb.GetOccurrenceRequest{
	// TODO: Fill request struct fields.
}
resp, err := c.GetOccurrence(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Output:

func (*GrafeasV1Beta1Client) GetOccurrenceNote

GetOccurrenceNote gets the note attached to the specified occurrence. Consumer projects can use this method to get a note that belongs to a provider project.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &grafeaspb.GetOccurrenceNoteRequest{
	// TODO: Fill request struct fields.
}
resp, err := c.GetOccurrenceNote(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Output:

func (*GrafeasV1Beta1Client) GetVulnerabilityOccurrencesSummary

GetVulnerabilityOccurrencesSummary gets a summary of the number and severity of occurrences.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &grafeaspb.GetVulnerabilityOccurrencesSummaryRequest{
	// TODO: Fill request struct fields.
}
resp, err := c.GetVulnerabilityOccurrencesSummary(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Output:

func (*GrafeasV1Beta1Client) ListNoteOccurrences

ListNoteOccurrences lists occurrences referencing the specified note. Provider projects can use this method to get all occurrences across consumer projects referencing the specified note.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &grafeaspb.ListNoteOccurrencesRequest{
	// TODO: Fill request struct fields.
}
it := c.ListNoteOccurrences(ctx, req)
for {
	resp, err := it.Next()
	if err == iterator.Done {
		break
	}
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*GrafeasV1Beta1Client) ListNotes

ListNotes lists notes for the specified project.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &grafeaspb.ListNotesRequest{
	// TODO: Fill request struct fields.
}
it := c.ListNotes(ctx, req)
for {
	resp, err := it.Next()
	if err == iterator.Done {
		break
	}
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*GrafeasV1Beta1Client) ListOccurrences

ListOccurrences lists occurrences for the specified project.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &grafeaspb.ListOccurrencesRequest{
	// TODO: Fill request struct fields.
}
it := c.ListOccurrences(ctx, req)
for {
	resp, err := it.Next()
	if err == iterator.Done {
		break
	}
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*GrafeasV1Beta1Client) UpdateNote

UpdateNote updates the specified note.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &grafeaspb.UpdateNoteRequest{
	// TODO: Fill request struct fields.
}
resp, err := c.UpdateNote(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Output:

func (*GrafeasV1Beta1Client) UpdateOccurrence

UpdateOccurrence updates the specified occurrence.

Example
ctx := context.Background()
c, err := containeranalysis.NewGrafeasV1Beta1Client(ctx)
if err != nil {
	// TODO: Handle error.
}

req := &grafeaspb.UpdateOccurrenceRequest{
	// TODO: Fill request struct fields.
}
resp, err := c.UpdateOccurrence(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Output:

type NoteIterator

type NoteIterator struct {

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*grafeaspb.Note, nextPageToken string, err error)
	// contains filtered or unexported fields
}

NoteIterator manages a stream of *grafeaspb.Note.

func (*NoteIterator) Next

func (it *NoteIterator) Next() (*grafeaspb.Note, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*NoteIterator) PageInfo

func (it *NoteIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type OccurrenceIterator

type OccurrenceIterator struct {

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*grafeaspb.Occurrence, nextPageToken string, err error)
	// contains filtered or unexported fields
}

OccurrenceIterator manages a stream of *grafeaspb.Occurrence.

func (*OccurrenceIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*OccurrenceIterator) PageInfo

func (it *OccurrenceIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type ScanConfigIterator

type ScanConfigIterator struct {

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*containeranalysispb.ScanConfig, nextPageToken string, err error)
	// contains filtered or unexported fields
}

ScanConfigIterator manages a stream of *containeranalysispb.ScanConfig.

func (*ScanConfigIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*ScanConfigIterator) PageInfo

func (it *ScanConfigIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL