models

package
v4.2.0-rc2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The following operation types are used as part of the OSB process.
	// The types correspond to asynchronous provision/deprovision/update calls
	// and will exist on a ServiceInstanceDetails with an operation ID that can be
	// used to look up the state of an operation.
	ProvisionOperationType   = "provision"
	DeprovisionOperationType = "deprovision"
	UpdateOperationType      = "update"
	ClearOperationType       = ""
)
View Source
const BigqueryName = "google-bigquery"
View Source
const BigtableName = "google-bigtable"
View Source
const CloudsqlMySQLName = "google-cloudsql-mysql"
View Source
const CloudsqlPostgresName = "google-cloudsql-postgres"
View Source
const DatastoreName = "google-datastore"
View Source
const MlName = "google-ml-apis"
View Source
const PubsubName = "google-pubsub"
View Source
const SpannerName = "google-spanner"
View Source
const StackdriverDebuggerName = "google-stackdriver-debugger"
View Source
const StackdriverProfilerName = "google-stackdriver-profiler"
View Source
const StackdriverTraceName = "google-stackdriver-trace"
View Source
const StorageName = "google-storage"

Variables

View Source
var CustomUserAgent = "cf-gcp-service-broker-test " + utils.Version

This custom user agent string is added to provision calls so that Google can track the aggregated use of this tool We can better advocate for devoting resources to supporting cloud foundry and this service broker if we can show good usage statistics for it, so if you feel the need to fork this repo, please leave this string in place!

Functions

func ProductionizeUserAgent

func ProductionizeUserAgent()

Types

type CloudOperation

type CloudOperation CloudOperationV1

CloudOperation holds information about the status of Google Cloud long-running operations.

type CloudOperationV1

type CloudOperationV1 struct {
	gorm.Model

	Name          string
	Status        string
	OperationType string
	ErrorMessage  string `gorm:"type:text"`
	InsertTime    string
	StartTime     string
	TargetId      string
	TargetLink    string

	ServiceId         string
	ServiceInstanceId string
}

CloudOperationV1 holds information about the status of Google Cloud long-running operations. As-of version 4.1.0, this table is no longer necessary.

func (CloudOperationV1) TableName

func (CloudOperationV1) TableName() string

TableName returns a consistent table name (`cloud_operations`) for gorm so multiple structs from different versions of the database all operate on the same table.

type Migration

type Migration MigrationV1

Migration represents the mgirations table. It holds a monotonically increasing number that gets incremented with every database schema revision.

type MigrationV1

type MigrationV1 struct {
	gorm.Model

	MigrationId int `gorm:"type:int(10)"`
}

MigrationV1 represents the mgirations table. It holds a monotonically increasing number that gets incremented with every database schema revision.

func (MigrationV1) TableName

func (MigrationV1) TableName() string

TableName returns a consistent table name (`migrations`) for gorm so multiple structs from different versions of the database all operate on the same table.

type PlanDetailsV1

type PlanDetailsV1 struct {
	ID        string `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time

	ServiceId string
	Name      string
	Features  string `sql:"type:text"`
}

PlanDetailsV1 is a table that was deprecated in favor of using Environment variables. It only remains for ORM migrations and the ability for existing users to export their plans.

func (PlanDetailsV1) TableName

func (PlanDetailsV1) TableName() string

TableName returns a consistent table name (`plan_details`) for gorm so multiple structs from different versions of the database all operate on the same table.

type ProvisionRequestDetails

type ProvisionRequestDetails ProvisionRequestDetailsV1

ProvisionRequestDetails holds user-defined properties passed to a call to provision a service.

type ProvisionRequestDetailsV1

type ProvisionRequestDetailsV1 struct {
	gorm.Model

	ServiceInstanceId string
	// is a json.Marshal of models.ProvisionDetails
	RequestDetails string
}

ProvisionRequestDetailsV1 holds user-defined properties passed to a call to provision a service.

func (ProvisionRequestDetailsV1) TableName

func (ProvisionRequestDetailsV1) TableName() string

TableName returns a consistent table name (`provision_request_details`) for gorm so multiple structs from different versions of the database all operate on the same table.

type ServiceBindingCredentials

type ServiceBindingCredentials ServiceBindingCredentialsV1

ServiceBindingCredentials holds credentials returned to the users after binding to a service.

type ServiceBindingCredentialsV1

type ServiceBindingCredentialsV1 struct {
	gorm.Model

	OtherDetails string `gorm:"type:text"`

	ServiceId         string
	ServiceInstanceId string
	BindingId         string
}

ServiceBindingCredentialsV1 holds credentials returned to the users after binding to a service.

func (ServiceBindingCredentialsV1) TableName

func (ServiceBindingCredentialsV1) TableName() string

TableName returns a consistent table name (`service_binding_credentials`) for gorm so multiple structs from different versions of the database all operate on the same table.

type ServiceInstanceDetails

type ServiceInstanceDetails ServiceInstanceDetailsV2

ServiceInstanceDetails holds information about provisioned services.

func (ServiceInstanceDetails) GetOtherDetails

func (si ServiceInstanceDetails) GetOtherDetails(v interface{}) error

GetOtherDetails returns an unmarshalls the OtherDetails field into the given struct. An empty OtherDetails field does not get unmarshalled and does not error.

func (*ServiceInstanceDetails) SetOtherDetails

func (si *ServiceInstanceDetails) SetOtherDetails(toSet interface{}) error

SetOtherDetails marshals the value passed in into a JSON string and sets OtherDetails to it if marshalling was successful.

type ServiceInstanceDetailsV1

type ServiceInstanceDetailsV1 struct {
	ID        string `gorm:"primary_key;type:varchar(255);not null"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time

	Name         string
	Location     string
	Url          string
	OtherDetails string `gorm:"type:text"`

	ServiceId        string
	PlanId           string
	SpaceGuid        string
	OrganizationGuid string
}

ServiceInstanceDetailsV1 holds information about provisioned services.

func (ServiceInstanceDetailsV1) TableName

func (ServiceInstanceDetailsV1) TableName() string

TableName returns a consistent table name (`service_instance_details`) for gorm so multiple structs from different versions of the database all operate on the same table.

type ServiceInstanceDetailsV2

type ServiceInstanceDetailsV2 struct {
	ID        string `gorm:"primary_key;type:varchar(255);not null"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time

	Name         string
	Location     string
	Url          string
	OtherDetails string `gorm:"type:text"`

	ServiceId        string
	PlanId           string
	SpaceGuid        string
	OrganizationGuid string

	// OperationType holds a string corresponding to what kind of operation
	// OperationId is referencing. The object is "locked" for editing if
	// an operation is pending.
	OperationType string

	// OperationId holds a string referencing an operation specific to a broker.
	// Operations in GCP all have a unique ID.
	// The OperationId will be cleared after a successful operation.
	// This string MAY be sent to users and MUST NOT leak confidential information.
	OperationId string `gorm:"type:varchar(1024)"`
}

ServiceInstanceDetailsV2 holds information about provisioned services.

func (ServiceInstanceDetailsV2) TableName

func (ServiceInstanceDetailsV2) TableName() string

TableName returns a consistent table name (`service_instance_details`) for gorm so multiple structs from different versions of the database all operate on the same table.

type TerraformDeployment

type TerraformDeployment TerraformDeploymentV1

TerraformDeployment holds Terraform state and plan information for resources that use that execution system.

type TerraformDeploymentV1

type TerraformDeploymentV1 struct {
	ID        string `gorm:"primary_key",sql:"type:varchar(1024)"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time

	// Workspace contains a JSON serialized version of the Terraform workspace.
	Workspace string `sql:"type:text"`

	// LastOperationType describes the last operation being performed on the resource.
	LastOperationType string

	// LastOperationState holds one of the following strings "in progress", "succeeded", "failed".
	// These mirror the OSB API.
	LastOperationState string

	// LastOperationMessage is a description that can be passed back to the user.
	LastOperationMessage string
}

TerraformDeploymentV1 describes the state of a Terraform resource deployment.

func (TerraformDeploymentV1) TableName

func (TerraformDeploymentV1) TableName() string

TableName returns a consistent table name (`tf_deployment`) for gorm so multiple structs from different versions of the database all operate on the same table.

Jump to

Keyboard shortcuts

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