azure

package
v0.0.0-...-e7c744b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *gorm.DB, logger logrus.FieldLogger) error

Migrate executes the table migrations for the provider.

func NewNetworkService

func NewNetworkService(resourceGroupName string, sir *secret.SecretItemResponse, logger logrus.FieldLogger) (intNetwork.Service, error)

NewNetworkService returns a new Azure network Service

func PipelineTags

func PipelineTags() map[string]*string

PipelineTags returns resource tags for Azure based on the pipeline uuid if available

Types

type ObjectStore

type ObjectStore struct {
	// contains filtered or unexported fields
}

ObjectStore stores all required parameters for container creation.

Note: calling methods on this struct is not thread safe currently.

func NewObjectStore

func NewObjectStore(
	location string,
	resourceGroup string,
	storageAccount string,
	secret *secret.SecretItemResponse,
	org *pipelineAuth.Organization,
	db *gorm.DB,
	logger logrus.FieldLogger,
	force bool,
) (*ObjectStore, error)

NewObjectStore returns a new object store instance.

func (*ObjectStore) CheckBucket

func (s *ObjectStore) CheckBucket(bucketName string) error

CheckBucket checks the status of the given Azure blob.

func (*ObjectStore) CreateBucket

func (s *ObjectStore) CreateBucket(bucketName string) error

CreateBucket creates an Azure Object Store Blob with the provided name within a generated/provided ResourceGroup and StorageAccount

func (*ObjectStore) DeleteBucket

func (s *ObjectStore) DeleteBucket(bucketName string) error

DeleteBucket deletes the Azure storage container identified by the specified name under the current resource group, storage account provided the storage container is of 'managed' type.

func (*ObjectStore) ListBuckets

func (s *ObjectStore) ListBuckets() ([]*objectstore.BucketInfo, error)

ListBuckets returns a list of Azure storage containers buckets that can be accessed with the credentials referenced by the secret field. Azure storage containers buckets that were created by a user in the current org are marked as 'managed'.

func (*ObjectStore) ListManagedBuckets

func (s *ObjectStore) ListManagedBuckets() ([]*objectstore.BucketInfo, error)

type ObjectStoreBucketModel

type ObjectStoreBucketModel struct {
	ID uint `gorm:"primary_key"`

	Organization   auth.Organization `gorm:"foreignkey:OrganizationID"`
	OrganizationID uint              `gorm:"index;not null"`

	Name           string `gorm:"unique_index:idx_azure_bucket_name"`
	ResourceGroup  string `gorm:"unique_index:idx_azure_bucket_name"`
	StorageAccount string `gorm:"unique_index:idx_azure_bucket_name"`
	Location       string

	SecretRef       string
	Status          string
	StatusMsg       string `sql:"type:text;"`
	AccessSecretRef string
}

ObjectStoreBucketModel is the schema for the DB.

func (ObjectStoreBucketModel) TableName

func (ObjectStoreBucketModel) TableName() string

TableName changes the default table name.

Directories

Path Synopsis
pke

Jump to

Keyboard shortcuts

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