tasks

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TaskCollectIAMPolicies is the name of the task for collecting GCP IAM Policies.
	TaskCollectIAMPolicies = "gcp:task:collect-iam-policies"

	// ResourceTypeProject represents a resource of type project in the IAMPolicy model.
	// alternatives are 'organisation' and 'folder', which are currently not used.
	ResourceTypeProject = "project"
)
View Source
const (
	// TaskCollectAll is a meta task, which enqueues all relevant GCP tasks.
	TaskCollectAll = "gcp:task:collect-all"

	// TaskLinkAll is a task, which establishes links between GCP models.
	TaskLinkAll = "gcp:task:link-all"
)
View Source
const TaskCollectAddresses = "gcp:task:collect-addresses"

TaskCollectAddresses is the name of the task for collecting global and regional static IP addresses.

View Source
const (
	// TaskCollectBuckets is the name of the task for collecting GCP
	// Buckets.
	TaskCollectBuckets = "gcp:task:collect-buckets"
)
View Source
const (
	// TaskCollectDisks is the name of the task for collecting GCP
	// disks.
	TaskCollectDisks = "gcp:task:collect-disks"
)
View Source
const TaskCollectForwardingRules = "gcp:task:collect-forwarding-rules"

TaskCollectForwardingRules is the name of the task for collecting GCP Forwarding Rules.

For more information about Forwarding Rules, please refer to the Forwarding Rules overview documentation.

View Source
const TaskCollectGKEClusters = "gcp:task:collect-gke-clusters"

TaskCollectGKEClusters is the name of the task for collecting GKE clusters.

View Source
const TaskCollectInstances = "gcp:task:collect-instances"

TaskCollectInstances is the name of the task for collecting GCP Instances

View Source
const TaskCollectProjects = "gcp:task:collect-projects"

TaskCollectProjects is the name of the task for collecting GCP Projects

View Source
const (
	// TaskCollectSubnets is the name of the task for collecting GCP
	// subnets.
	TaskCollectSubnets = "gcp:task:collect-subnets"
)
View Source
const TaskCollectTargetPools = "gcp:task:collect-target-pools"

TaskCollectTargetPools is the name of the task for collecting GCP Target Pools.

For more information about Target Pools, please refer to the Target Pools documentation.

View Source
const (
	// TaskCollectVPCs is the name of the task for collecting GCP
	// VPCs.
	TaskCollectVPCs = "gcp:task:collect-vpcs"
)

Variables

View Source
var ErrClientNotFound = errors.New("client not found")

ErrClientNotFound is an error, which is returned when an API client was not found in the clientset registries.

View Source
var ErrNoProjectID = errors.New("no project id specified")

ErrNoProjectID is an error, which is returned when a task expects a project id to be sent as part of the payload, but none was provided.

View Source
var ErrNoSourceImage = errors.New("no source image found")

ErrNoSourceImage is an error returned when a source image was not found for an instance.

Functions

func ClientNotFound

func ClientNotFound(projectID string) error

ClientNotFound wraps ErrClientNotFound with the given project id.

func HandleCollectAddressesTask

func HandleCollectAddressesTask(ctx context.Context, t *asynq.Task) error

HandleCollectAddressesTask is the handler, which collects static global and regional IP addresses.

func HandleCollectAllTask

func HandleCollectAllTask(ctx context.Context, _ *asynq.Task) error

HandleCollectAllTask is a handler, which enqueues tasks for collecting all GCP objects.

func HandleCollectBucketsTask

func HandleCollectBucketsTask(ctx context.Context, t *asynq.Task) error

HandleCollectBucketsTask is the handler, which collects GCP Buckets.

func HandleCollectDisksTask added in v0.1.1

func HandleCollectDisksTask(ctx context.Context, t *asynq.Task) error

HandleCollectDisksTask is the handler, which collects GCP disks.

func HandleCollectForwardingRules

func HandleCollectForwardingRules(ctx context.Context, t *asynq.Task) error

HandleCollectForwardingRules is the handler, which collects GCP Forwarding Rules.

func HandleCollectGKEClusters added in v0.1.2

func HandleCollectGKEClusters(ctx context.Context, t *asynq.Task) error

HandleCollectGKEClusters is the handler, which collects GKE Clusters.

func HandleCollectIAMPoliciesTask added in v0.1.19

func HandleCollectIAMPoliciesTask(ctx context.Context, t *asynq.Task) error

HandleCollectIAMPoliciesTask is the handler, which collects GCP IAM Policies.

func HandleCollectInstancesTask

func HandleCollectInstancesTask(ctx context.Context, t *asynq.Task) error

HandleCollectInstancesTask is the handler, which collects GCP Instances.

func HandleCollectProjectsTask

func HandleCollectProjectsTask(ctx context.Context, _ *asynq.Task) error

HandleCollectProjectsTask is the handler, which collects GCP projects

func HandleCollectSubnetsTask

func HandleCollectSubnetsTask(ctx context.Context, t *asynq.Task) error

HandleCollectSubnetsTask is the handler, which collects GCP subnets.

func HandleCollectTargetPools added in v0.1.6

func HandleCollectTargetPools(ctx context.Context, t *asynq.Task) error

HandleCollectTargetPools is the handler, which collects GCP Target Pools.

func HandleCollectVPCsTask

func HandleCollectVPCsTask(ctx context.Context, t *asynq.Task) error

HandleCollectVPCsTask is the handler, which collects GCP VPCs.

func HandleLinkAllTask

func HandleLinkAllTask(ctx context.Context, _ *asynq.Task) error

HandleLinkAllTask is a handler, which establishes links between the various GCP models.

func LinkAddressWithProject

func LinkAddressWithProject(ctx context.Context, db *bun.DB) error

LinkAddressWithProject creates links between the models.Address and models.Project models.

func LinkForwardingRuleWithProject

func LinkForwardingRuleWithProject(ctx context.Context, db *bun.DB) error

LinkForwardingRuleWithProject creates links between the models.ForwardingRule and models.Project models.

func LinkGKEClusterWithProject added in v0.1.2

func LinkGKEClusterWithProject(ctx context.Context, db *bun.DB) error

LinkGKEClusterWithProject creates links between the models.GKECluster and models.Project models.

func LinkInstanceWithDisk added in v0.1.1

func LinkInstanceWithDisk(ctx context.Context, db *bun.DB) error

LinkInstanceWithDisk creates links between the models.Instance and models.Disk models.

func LinkInstanceWithNetworkInterface

func LinkInstanceWithNetworkInterface(ctx context.Context, db *bun.DB) error

LinkInstanceWithNetworkInterface creates links between the models.NetworkInterface and models.Instance models.

func LinkInstanceWithProject

func LinkInstanceWithProject(ctx context.Context, db *bun.DB) error

LinkInstanceWithProject creates links between the models.Instance and models.Project models.

func LinkSubnetWithProject

func LinkSubnetWithProject(ctx context.Context, db *bun.DB) error

LinkSubnetWithProject creates links between the models.Subnet and models.Project models.

func LinkSubnetWithVPC

func LinkSubnetWithVPC(ctx context.Context, db *bun.DB) error

LinkSubnetWithVPC creates links between the models.Subnet and models.VPC models.

func LinkTargetPoolWithInstance added in v0.1.6

func LinkTargetPoolWithInstance(ctx context.Context, db *bun.DB) error

LinkTargetPoolWithInstance creates links between the models.TargetPool and models.TargetPoolInstance models.

func LinkTargetPoolWithProject added in v0.1.6

func LinkTargetPoolWithProject(ctx context.Context, db *bun.DB) error

LinkTargetPoolWithProject creates links between the models.TargetPool and models.Project models.

func LinkVPCWithProject

func LinkVPCWithProject(ctx context.Context, db *bun.DB) error

LinkVPCWithProject creates links between the models.VPC and models.Project models.

func NewCollectAddressesTask

func NewCollectAddressesTask() *asynq.Task

NewCollectAddressesTask creates a new asynq.Task for collecting global and regional static IP addresses, without specifying a payload.

func NewCollectBucketsTask

func NewCollectBucketsTask() *asynq.Task

NewCollectBucketsTask creates a new asynq.Task task for collecting GCP Buckets without specifying a payload.

func NewCollectDisksTask added in v0.1.1

func NewCollectDisksTask() *asynq.Task

NewCollectDisksTask creates a new asynq.Task task for collecting GCP disks without specifying a payload.

func NewCollectForwardingRulesTask

func NewCollectForwardingRulesTask() *asynq.Task

NewCollectForwardingRulesTask creates a new asynq.Task for collecting GCP Forwarding Rules, without specifying a payload.

func NewCollectGKEClustersTask added in v0.1.2

func NewCollectGKEClustersTask() *asynq.Task

NewCollectGKEClustersTask creates a new asynq.Task for collecting GKE Clusters, without specifying a payload.

func NewCollectIAMPoliciesTask added in v0.1.19

func NewCollectIAMPoliciesTask() *asynq.Task

NewCollectIAMPoliciesTask creates a new asynq.Task task for collecting GCP IAM Policies without specifying a payload.

func NewCollectInstancesTask

func NewCollectInstancesTask() *asynq.Task

NewCollectInstancesTask creates a new asynq.Task for collecting GCP Compute Engine Instances, without specifying a payload.

func NewCollectProjectsTask

func NewCollectProjectsTask() *asynq.Task

NewCollectProjectsTask creates a new asynq.Task for collecting GCP Projects, without specifying a payload.

func NewCollectSubnetsTask

func NewCollectSubnetsTask() *asynq.Task

NewCollectSubnetsTask creates a new asynq.Task task for collecting GCP subnets without specifying a payload.

func NewCollectTargetPoolsTask added in v0.1.6

func NewCollectTargetPoolsTask() *asynq.Task

NewCollectTargetPoolsTask creates a new asynq.Task for collecting GCP Target Pools, without specifying a payload.

func NewCollectVPCsTask

func NewCollectVPCsTask() *asynq.Task

NewCollectVPCsTask creates a new asynq.Task task for collecting GCP VPCs without specifying a payload.

Types

type CollectAddressesPayload

type CollectAddressesPayload struct {
	// ProjectID specifies the globally unique project id from which to
	// collect.
	ProjectID string `json:"project_id" yaml:"project_id"`
}

CollectAddressesPayload is the payload used for collecting global and regional static IP addresses.

type CollectBucketsPayload

type CollectBucketsPayload struct {
	// ProjectID specifies the GCP project ID, which is associated with a
	// registered client.
	ProjectID string `json:"project_id" yaml:"project_id"`
}

CollectBucketsPayload is the payload, which is used to collect GCP Buckets.

type CollectDisksPayload added in v0.1.1

type CollectDisksPayload struct {
	// ProjectID specifies the GCP project ID, which is associated with a
	// registered client.
	ProjectID string `json:"project_id" yaml:"project_id"`
}

CollectDisksPayload is the payload, which is used to collect GCP disks.

type CollectForwardingRulesPayload

type CollectForwardingRulesPayload struct {
	// ProjectID specifies the globally unique project id from which to
	// collect GCP Forwarding Rules.
	ProjectID string `json:"project_id" yaml:"project_id"`
}

CollectForwardingRulesPayload is the payload used for collecting GCP Forwarding Rules for a given project.

type CollectGKEClustersPayload added in v0.1.2

type CollectGKEClustersPayload struct {
	// ProjectID specifies the globally unique project id from which to
	// collect.
	ProjectID string `json:"project_id" yaml:"project_id"`
}

CollectGKEClustersPayload is the payload used for collecting GKE Clusters.

type CollectIAMPoliciesPayload added in v0.1.19

type CollectIAMPoliciesPayload struct {
	// ProjectID specifies the GCP project ID, which is associated with a
	// registered client.
	ProjectID string `json:"project_id" yaml:"project_id"`
}

CollectIAMPoliciesPayload is the payload, which is used to collect GCP IAM Policies.

type CollectInstancesPayload

type CollectInstancesPayload struct {
	// ProjectID specifies the globally unique project id from which to
	// collect GCP Compute Engine Instances.
	ProjectID string `json:"project_id" yaml:"project_id"`
}

CollectInstancesPayload is the payload used for collecting GCP Instances from a given GCP Project.

type CollectSubnetsPayload

type CollectSubnetsPayload struct {
	// ProjectID specifies the GCP project ID, which is associated with a
	// registered client.
	ProjectID string `json:"project_id" yaml:"project_id"`
}

CollectSubnetsPayload is the payload, which is used to collect GCP subnets.

type CollectTargetPoolsPayload added in v0.1.6

type CollectTargetPoolsPayload struct {
	// ProjectID specifies the globally unique project id from which to
	// collect resources.
	ProjectID string `json:"project_id" yaml:"project_id"`
}

CollectTargetPoolsPayload is the payload used for collecting GCP Target Pools for a given project.

type CollectVPCsPayload

type CollectVPCsPayload struct {
	// ProjectID specifies the GCP project ID, which is associated with a
	// registered client.
	ProjectID string `json:"project_id" yaml:"project_id"`
}

CollectVPCsPayload is the payload, which is used to collect GCP VPCs.

Jump to

Keyboard shortcuts

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