cai

package
v0.3.2-rc26 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Overview

Package cai helps with Cloud Asset Inventory

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAncestorsDisplayName added in v0.1.0

func BuildAncestorsDisplayName(ctx context.Context, ancestors []string, collectionID string, firestoreClient *firestore.Client, cloudresourcemanagerService *cloudresourcemanager.Service, cloudresourcemanagerServiceV2 *cloudresourcemanagerv2.Service) []string

BuildAncestorsDisplayName build a slice of Ancestor friendly name from a slice of ancestors

func BuildAncestryPath added in v0.1.0

func BuildAncestryPath(ancestors []string) string

BuildAncestryPath build a path from a slice of ancestors

func GetAssetLabelValue added in v0.1.2

func GetAssetLabelValue(labelKey string, resourceJSON json.RawMessage) (string, error)

GetAssetLabelValue retrieve a label value from a label key, e.g. owner of resolver contact from asset labels

func GetAssetShortTypeName

func GetAssetShortTypeName(assetType string) string

GetAssetShortTypeName returns a short version of asset type <serviceName>-<assetType>, like bigquery-Dataset. It deals with k8s exceptions

Types

type FeedDeployment

type FeedDeployment struct {
	Artifacts struct {
		TopicName    string `yaml:"topicName"`
		FeedName     string `yaml:"feedName"`
		ContentType  assetpb.ContentType
		FeedFullName string `yaml:"FeedFullName"`
	}
	Core     *deploy.Core
	Settings struct {
		Instance struct {
			CAI Parameters
		}
	}
}

FeedDeployment settings and artifacts structure

func NewFeedDeployment

func NewFeedDeployment() *FeedDeployment

NewFeedDeployment create deployment structure

func (*FeedDeployment) Deploy

func (feedDeployment *FeedDeployment) Deploy() (err error)

Deploy get-create resource feeds, get-create-update the iam policies feed

type FeedMessageGroup added in v0.1.0

type FeedMessageGroup struct {
	Asset     assetGroup    `json:"asset"`
	Window    Window        `json:"window"`
	Deleted   bool          `json:"deleted"`
	Origin    string        `json:"origin"`
	StepStack logging.Steps `json:"step_stack,omitempty"`
}

FeedMessageGroup CAI like format

type FeedMessageGroupSettings added in v0.1.0

type FeedMessageGroupSettings struct {
	Asset     assetGroupSettings `json:"asset"`
	Window    Window             `json:"window"`
	Deleted   bool               `json:"deleted"`
	Origin    string             `json:"origin"`
	StepStack logging.Steps      `json:"step_stack,omitempty"`
}

FeedMessageGroupSettings CAI like format

type FeedMessageMember added in v0.1.0

type FeedMessageMember struct {
	Asset     assetMember   `json:"asset"`
	Window    Window        `json:"window"`
	Deleted   bool          `json:"deleted"`
	Origin    string        `json:"origin"`
	StepStack logging.Steps `json:"step_stack,omitempty"`
}

FeedMessageMember CAI like format

type Parameters

type Parameters struct {
	Parent       string
	ContentType  string   `yaml:"contentType" valid:"isNotZeroValue"`
	AssetTypes   []string `yaml:"assetTypes" valid:"isNotZeroValue"`
	CronSchedule string   `yaml:"cronSchedule,omitempty"`
}

Parameters structure

type Window added in v0.1.0

type Window struct {
	StartTime time.Time `json:"startTime" firestore:"startTime"`
}

Window Cloud Asset Inventory feed message time window

Jump to

Keyboard shortcuts

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