Documentation
¶
Index ¶
- type AlterComputePoolOptions
- type AlterComputePoolStateOptions
- type AlterListingOptions
- type AlterServiceOptions
- type ApplicationPackageManifest
- type ApplicationPackageVersion
- type ApplicationPackageVersions
- type Client
- type ComputePool
- type ComputePoolDetails
- type ComputePoolInstance
- type ComputePoolStateAction
- type ComputePools
- type Connection
- type ConnectionManager
- type CreateComputePoolOptions
- type CreateImageRepositoryOptions
- type CreateListingOptions
- type CreateServiceOptions
- type DropComputePoolOptions
- type DropImageRepositoryOptions
- type DropListingOptions
- type DropSecretsOptions
- type DropServiceOptions
- type DropSnapshotOptions
- type Endpoint
- type Endpoints
- type Files
- type Image
- type ImageRepositories
- type ImageRepository
- type Listing
- type ListingDetails
- type ListingManifest
- type Listings
- type ManifestContainer
- type ManifestEndpoint
- type ManifestServiceRole
- type ManifestVolume
- type PutFileOptions
- type ReleaseDirective
- type ReleaseDirectives
- type Secret
- type Secrets
- type Service
- type ServiceContainer
- type ServiceContainers
- type ServiceDetails
- type ServiceInstance
- type ServiceInstances
- type ServiceManifest
- type Services
- type ShowImageRepositoryOptions
- type ShowSecretsOptions
- type ShowServiceOptions
- type ShowSnapshotOptions
- type Snapshot
- type Snapshots
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlterComputePoolOptions ¶
type AlterComputePoolStateOptions ¶
type AlterComputePoolStateOptions struct { IfExists bool StateAction ComputePoolStateAction }
type AlterListingOptions ¶
type AlterListingOptions struct { ListingManifest *ListingManifest IfExists bool Publish bool Review bool }
type AlterServiceOptions ¶
type AlterServiceOptions struct { IfExists bool MinInstances *int MaxInstances *int QueryWarehouse *sdk.AccountObjectIdentifier AutoResume *bool ExternalAccessIntegration []sdk.AccountObjectIdentifier Comment *string }
type ApplicationPackageManifest ¶
type ApplicationPackageManifest struct { }
type ApplicationPackageVersion ¶
type ApplicationPackageVersion struct { Version string `db:"version"` Patch int `db:"patch"` Label string `db:"label"` Comment sql.NullString `db:"comment"` CreatedOn sql.NullTime `db:"created_on"` DroppedOn sql.NullTime `db:"dropped_on"` LogLevel string `db:"log_level"` TraceLevel string `db:"trace_level"` State string `db:"state"` ReviewStatus string `db:"review_status"` }
type ApplicationPackageVersions ¶
type ApplicationPackageVersions interface {
Show(ctx context.Context, id sdk.AccountObjectIdentifier) ([]ApplicationPackageVersion, error)
}
type Client ¶
type Client struct { SDKClient *sdk.Client // Modeled after the SDKClient we create the missing interfaces Listings Listings ImageRepositories ImageRepositories ComputePools ComputePools Services Services ServiceInstances ServiceInstances ServiceContainers ServiceContainers Endpoints Endpoints Snapshots Snapshots Secrets Secrets Files Files ReleaseDirectives ReleaseDirectives ApplicationPackageVersions ApplicationPackageVersions }
type ComputePool ¶
type ComputePool struct { Name string `db:"name"` State string `db:"state"` MinNodes int `db:"min_nodes"` MaxNodes int `db:"max_nodes"` InstanceFamily string `db:"instance_family"` NumServices int `db:"num_services"` NumJobs int `db:"num_jobs"` AutoSuspendSecs int `db:"auto_suspend_secs"` AutoResume bool `db:"auto_resume"` ActiveNodes int `db:"active_nodes"` IdleNodes int `db:"idle_nodes"` CreatedOn sql.NullTime `db:"created_on"` ResumedOn sql.NullTime `db:"resumed_on"` UpdatedOn sql.NullTime `db:"updated_on"` Owner string `db:"owner"` Comment sql.NullString `db:"comment"` IsExclusive bool `db:"is_exclusive"` Application sql.NullString `db:"application"` }
type ComputePoolDetails ¶
type ComputePoolDetails struct { Name string `db:"name"` State string `db:"state"` MinNodes int `db:"min_nodes"` MaxNodes int `db:"max_nodes"` InstanceFamily string `db:"instance_family"` NumServices int `db:"num_services"` NumJobs int `db:"num_jobs"` AutoSuspendSecs int `db:"auto_suspend_secs"` AutoResume bool `db:"auto_resume"` ActiveNodes int `db:"active_nodes"` IdleNodes int `db:"idle_nodes"` CreatedOn sql.NullTime `db:"created_on"` ResumedOn sql.NullTime `db:"resumed_on"` UpdatedOn sql.NullTime `db:"updated_on"` Owner string `db:"owner"` Comment string `db:"comment"` IsExclusive bool `db:"is_exclusive"` Application sql.NullString `db:"application"` }
type ComputePoolInstance ¶
type ComputePoolInstance string
const ( CPU_X64_XS ComputePoolInstance = "CPU_X64_XS" CPU_X64_S ComputePoolInstance = "CPU_X64_S" CPU_X64_M ComputePoolInstance = "CPU_X64_M" CPU_X64_L ComputePoolInstance = "CPU_X64_L" HIGHMEM_X64_S ComputePoolInstance = "HIGHMEM_X64_S" HIGHMEM_X64_M ComputePoolInstance = "HIGHMEM_X64_M" HIGHMEM_X64_L ComputePoolInstance = "HIGHMEM_X64_L" )
type ComputePoolStateAction ¶
type ComputePoolStateAction string
const ( ComputePoolStateActionSuspend ComputePoolStateAction = "SUSPEND" ComputePoolStateActionResume ComputePoolStateAction = "RESUME" ComputePoolStateActionStopAll ComputePoolStateAction = "STOP ALL" )
type ComputePools ¶
type ComputePools interface { Create(ctx context.Context, id sdk.AccountObjectIdentifier, opts *CreateComputePoolOptions) error Show(ctx context.Context) ([]ComputePool, error) Drop(ctx context.Context, id sdk.AccountObjectIdentifier, opts *DropComputePoolOptions) error Describe(ctx context.Context, id sdk.AccountObjectIdentifier) (*ComputePoolDetails, error) Alter(ctx context.Context, id sdk.AccountObjectIdentifier, opts *AlterComputePoolOptions) error AlterState(ctx context.Context, id sdk.AccountObjectIdentifier, opts *AlterComputePoolStateOptions) error }
type Connection ¶
type ConnectionManager ¶
type ConnectionManager struct {
// contains filtered or unexported fields
}
func NewConnectionManager ¶
func NewConnectionManager() (*ConnectionManager, error)
func (*ConnectionManager) AvailableClients ¶
func (cm *ConnectionManager) AvailableClients() map[string]*sf.Config
func (*ConnectionManager) GetClient ¶
func (cm *ConnectionManager) GetClient() *Client
func (*ConnectionManager) SetClient ¶
func (cm *ConnectionManager) SetClient(name string) error
type CreateComputePoolOptions ¶
type CreateComputePoolOptions struct { IfNotExists bool Application *sdk.AccountObjectIdentifier MinNodes int MaxNodes int InstanceFamily ComputePoolInstance AutoResume *bool InitiallySuspended *bool AutoSuspendSecs *int Comment *string }
type CreateImageRepositoryOptions ¶
type CreateImageRepositoryOptions struct {
IfNotExists bool
}
type CreateListingOptions ¶
type CreateListingOptions struct { ListingManifest *ListingManifest IfNotExists bool ApplicationPackage string Publish bool Review bool }
type CreateServiceOptions ¶
type CreateServiceOptions struct { IfNotExists bool ComputePool sdk.AccountObjectIdentifier ServiceManifest *ServiceManifest ExternalAccessIntegrations []sdk.AccountObjectIdentifier AutoResume bool MinInstances int MaxInstances int QueryWarehouse sdk.AccountObjectIdentifier Comment string }
type DropComputePoolOptions ¶
type DropComputePoolOptions struct {
IfExists bool
}
type DropImageRepositoryOptions ¶
type DropImageRepositoryOptions struct {
IfExists bool
}
type DropListingOptions ¶
type DropListingOptions struct {
IfExists bool
}
type DropSecretsOptions ¶
type DropSecretsOptions struct { IfExists bool Secret *sdk.SchemaObjectIdentifier }
type DropServiceOptions ¶
type DropServiceOptions struct {
IfExists bool
}
type DropSnapshotOptions ¶
type DropSnapshotOptions struct { IfExists bool Snapshot *sdk.SchemaObjectIdentifier }
type Files ¶
type Files interface {
Put(ctx context.Context, id sdk.SchemaObjectIdentifier, opts *PutFileOptions) error
}
type ImageRepositories ¶
type ImageRepositories interface { Create(ctx context.Context, id sdk.SchemaObjectIdentifier, opts *CreateImageRepositoryOptions) error Show(ctx context.Context, opts *ShowImageRepositoryOptions) ([]ImageRepository, error) ShowImages(ctx context.Context, id sdk.SchemaObjectIdentifier) ([]Image, error) Drop(ctx context.Context, id sdk.SchemaObjectIdentifier, opts *DropImageRepositoryOptions) error }
type ImageRepository ¶
type ImageRepository struct { CreatedOn sql.NullTime `db:"created_on"` Name string `db:"name"` DatabaseName string `db:"database_name"` SchemaName string `db:"schema_name"` RepositoryURL string `db:"repository_url"` Owner string `db:"owner"` OwnerRoleType string `db:"owner_role_type"` Comment string `db:"comment"` }
type Listing ¶
type Listing struct { GlobalName string `db:"global_name"` Name string `db:"name"` Title string `db:"title"` Subtitle sql.NullString `db:"subtitle"` Profile string `db:"profile"` CreatedOn sql.NullTime `db:"created_on"` UpdatedOn sql.NullTime `db:"updated_on"` PublishedOn sql.NullTime `db:"published_on"` State string `db:"state"` ReviewState sql.NullString `db:"review_state"` Comment sql.NullString `db:"comment"` Owner string `db:"owner"` OwnerRoleType string `db:"owner_role_type"` Regions sql.NullString `db:"regions"` TargetAccounts string `db:"target_accounts"` IsMonetized bool `db:"is_monetized"` IsApplication bool `db:"is_application"` IsTargeted bool `db:"is_targeted"` IsLimitedTrial bool `db:"is_limited_trial"` IsByRequest bool `db:"is_by_request"` RejectedOn sql.NullTime `db:"rejected_on"` DetailedTargetAccounts sql.NullString `db:"detailed_target_accounts"` }
type ListingDetails ¶
type ListingDetails struct { GlobalName string `db:"global_name"` Name string `db:"name"` Owner string `db:"owner"` OwnerRoleType string `db:"owner_role_type"` CreatedOn sql.NullTime `db:"created_on"` UpdatedOn sql.NullTime `db:"updated_on"` PublishedOn sql.NullTime `db:"published_on"` Title string `db:"title"` Subtitle sql.NullString `db:"subtitle"` Description sql.NullString `db:"description"` ListingTerms sql.NullString `db:"listing_terms"` State string `db:"state"` ApplicationPackage string `db:"application_package"` BusinessNeeds sql.NullString `db:"business_needs"` UsageExamples sql.NullString `db:"usage_examples"` DataAttributes sql.NullString `db:"data_attributes"` Categories sql.NullString `db:"categories"` Resources sql.NullString `db:"resources"` Profile sql.NullString `db:"profile"` CustomizedContactInfo sql.NullString `db:"customized_contact_info"` DataDictionary sql.NullString `db:"data_dictionary"` DataPreview sql.NullString `db:"data_preview"` Comment sql.NullString `db:"comment"` Revisions string `db:"revisions"` TargetAccounts sql.NullString `db:"target_accounts"` Regions sql.NullString `db:"regions"` RefreshSchedule sql.NullString `db:"refresh_schedule"` RefreshType sql.NullString `db:"refresh_type"` ReviewState sql.NullString `db:"review_state"` RejectionReason sql.NullString `db:"rejection_reason"` UnpublishedByAdminReason sql.NullString `db:"unpublished_by_admin_reason"` IsMonetized bool `db:"is_monetized"` IsApplication bool `db:"is_application"` IsTargeted bool `db:"is_targeted"` IsLimitedTrial bool `db:"is_limited_trial"` IsByRequest bool `db:"is_by_request"` LimitedTrialPlan sql.NullString `db:"limited_trial_plan"` RetiredOn sql.NullTime `db:"retired_on"` ScheduledDropTime sql.NullTime `db:"scheduled_drop_time"` ManifestYAML string `db:"manifest_yaml"` }
type ListingManifest ¶
type ListingManifest struct { Title string `json:"title" yaml:"title"` Subtitle string `json:"subtitle" yaml:"subtitle"` Description string `json:"description" yaml:"description"` Profile string `json:"profile" yaml:"profile"` ListingTerms *struct { Type string `json:"type" yaml:"type"` Link string `json:"link,omitempty" yaml:"link,omitempty"` } `json:"listing_terms,omitempty" yaml:"listing_terms,omitempty"` Targets *struct { Accounts []string `json:"accounts,omitempty" yaml:"accounts,omitempty"` Regions []string `json:"regions,omitempty" yaml:"regions,omitempty"` } `json:"targets,omitempty" yaml:"targets,omitempty"` AutoFulfillment *struct { RefreshSchedule string `json:"refresh_schedule,omitempty" yaml:"refresh_schedule,omitempty"` RefreshType string `json:"refresh_type,omitempty" yaml:"refresh_type,omitempty"` } `json:"auto_fulfillment,omitempty" yaml:"auto_fulfillment,omitempty"` BusinessNeeds []struct { Name string `json:"name" yaml:"name"` Description string `json:"description" yaml:"description"` Type string `json:"type,omitempty" yaml:"type,omitempty"` } `json:"business_needs,omitempty" yaml:"business_needs,omitempty"` Categories []string `json:"categories,omitempty" yaml:"categories,omitempty"` // DataAttributes // DataDictionary // UsageExamples Resources *struct { Documentation string `json:"documentation,omitempty" yaml:"documentation,omitempty"` Media string `json:"media,omitempty" yaml:"media,omitempty"` } `json:"resources,omitempty" yaml:"resources,omitempty"` }
https://other-docs.snowflake.com/en/progaccess/listing-manifest-reference
type Listings ¶
type Listings interface { Create(ctx context.Context, id string, opts *CreateListingOptions) error Alter(ctx context.Context, id string, opts *AlterListingOptions) error Show(ctx context.Context) ([]Listing, error) Describe(ctx context.Context, id string) (*ListingDetails, error) Drop(ctx context.Context, id string, opts *DropListingOptions) error }
type ManifestContainer ¶
type ManifestContainer struct { Name string `json:"name"` Image string `json:"image"` Command []string `json:"command"` Args []string `json:"args"` Env []string `json:"env"` ReadinessProbe struct { Port int `json:"port"` Path string `json:"path"` } `json:"readinessProbe"` VolumeMounts []struct { Name string `json:"name"` MountPath string `json:"mountPath"` } Resources struct { Requests struct { Memory string `json:"memory"` CPU string `json:"cpu"` NvidiaComGpu int `json:"nvidia.com/gpu"` } `json:"requests"` Limits struct { Memory string `json:"memory"` CPU string `json:"cpu"` NvidiaComGpu int `json:"nvidia.com/gpu"` } `json:"limits"` } `json:"resources"` Secrets []struct { SnowflakeSecret string `json:"snowflake_secret"` SecretKeyRef string `json:"secretKeyRef"` EnvVarName string `json:"envVarName"` DirectoryPath string `json:"directoryPath"` } `json:"secrets"` }
type ManifestEndpoint ¶
type ManifestServiceRole ¶
type ManifestVolume ¶
type PutFileOptions ¶
type ReleaseDirective ¶
type ReleaseDirective struct { Name string `db:"name"` TargetType sql.NullString `db:"target_type"` TargetName sql.NullString `db:"target_name"` CreatedOn sql.NullTime `db:"created_on"` Version string `db:"version"` Patch int `db:"patch"` ModifiedOn sql.NullTime `db:"modified_on"` ActiveRegions string `db:"active_regions"` PendingRegions sql.NullString `db:"pending_regions"` ReleaseStatus string `db:"release_status"` DeployedOn sql.NullTime `db:"deployed_on"` }
type ReleaseDirectives ¶
type ReleaseDirectives interface {
Show(ctx context.Context, id sdk.AccountObjectIdentifier) ([]ReleaseDirective, error)
}
type Secret ¶
type Secret struct { CreatedOn string `db:"created_on"` Name string `db:"name"` SchemaName string `db:"schema_name"` DatabaseName string `db:"database_name"` Owner string `db:"owner"` Comment sql.NullString `db:"comment"` SecretType string `db:"secret_type"` OAuthScopes sql.NullString `db:"oauth_scopes"` OwnerRoleType string `db:"owner_role_type"` }
type Secrets ¶
type Secrets interface { Show(ctx context.Context, opts *ShowSecretsOptions) ([]Secret, error) Drop(ctx context.Context, opts *DropSecretsOptions) error }
type Service ¶
type Service struct { Name string `db:"name"` Status string `db:"status"` DatabaseName string `db:"database_name"` SchemaName string `db:"schema_name"` Owner string `db:"owner"` ComputePool string `db:"compute_pool"` DNSName string `db:"dns_name"` MinInstances int `db:"min_instances"` MaxInstances int `db:"max_instances"` AutoResume bool `db:"auto_resume"` ExternalAccessIntegration string `db:"external_access_integration"` CreatedOn sql.NullTime `db:"created_on"` UpdatedOn sql.NullTime `db:"updated_on"` ResumedOn sql.NullTime `db:"resumed_on"` Comment sql.NullString `db:"comment"` OwnerRoleType string `db:"owner_role_type"` QueryWarehouse sql.NullString `db:"query_warehouse"` IsJob bool `db:"is_job"` }
type ServiceContainer ¶
type ServiceContainer struct { DatabaseName string `db:"database_name"` SchemaName string `db:"schema_name"` ServiceName string `db:"service_name"` InstanceId int `db:"instance_id"` ContainerName string `db:"container_name"` Status string `db:"status"` Message string `db:"message"` ImageName string `db:"image_name"` ImageDigest string `db:"image_digest"` RestartCount int `db:"restart_count"` StartTime string `db:"start_time"` }
type ServiceContainers ¶
type ServiceContainers interface {
Show(ctx context.Context, id *sdk.SchemaObjectIdentifier) ([]ServiceContainer, error)
}
type ServiceDetails ¶
type ServiceDetails struct { Name string `db:"name"` DatabaseName string `db:"database_name"` SchemaName string `db:"schema_name"` Owner string `db:"owner"` ComputePool string `db:"compute_pool"` DNSName string `db:"dns_name"` MinInstances int `db:"min_instances"` MaxInstances int `db:"max_instances"` AutoResume bool `db:"auto_resume"` ExternalAccessIntegration string `db:"external_access_integration"` CreatedOn sql.NullTime `db:"created_on"` UpdatedOn sql.NullTime `db:"updated_on"` ResumedOn sql.NullTime `db:"resumed_on"` Comment string `db:"comment"` OwnerRoleType string `db:"owner_role_type"` QueryWarehouse string `db:"query_warehouse"` IsJob bool `db:"is_job"` }
type ServiceInstance ¶
type ServiceInstance struct { DatabaseName string `db:"database_name"` SchemaName string `db:"schema_name"` ServiceName string `db:"service_name"` InstanceId int `db:"instance_id"` Status string `db:"status"` SpecDigest string `db:"spec_digest"` CreationTime string `db:"creation_time"` StartTime string `db:"start_time"` }
type ServiceInstances ¶
type ServiceInstances interface {
Show(ctx context.Context, id *sdk.SchemaObjectIdentifier) ([]ServiceInstance, error)
}
type ServiceManifest ¶
type ServiceManifest struct { Spec struct { Containers []*ManifestContainer `json:"containers"` Endpoints []*ManifestEndpoint `json:"endpoints"` Volumes []*ManifestVolume `json:"volumes"` LogExporters struct { EventTableConfig struct { LogLevel string `json:"logLevel"` } `json:"eventTableConfig"` } ServiceRoles []*ManifestServiceRole `json:"serviceRoles"` } `json:"spec"` }
type Services ¶
type Services interface { Create(ctx context.Context, id sdk.SchemaObjectIdentifier, opts *CreateServiceOptions) error Show(ctx context.Context, opts *ShowServiceOptions) ([]Service, error) Drop(ctx context.Context, id sdk.SchemaObjectIdentifier, opts *DropServiceOptions) error Describe(ctx context.Context, id sdk.SchemaObjectIdentifier) (*ServiceDetails, error) Alter(ctx context.Context, id sdk.SchemaObjectIdentifier, opts *AlterServiceOptions) error }
type ShowImageRepositoryOptions ¶
type ShowImageRepositoryOptions struct { Database *sdk.AccountObjectIdentifier Schema *sdk.DatabaseObjectIdentifier }
type ShowSecretsOptions ¶
type ShowSecretsOptions struct { Database *sdk.AccountObjectIdentifier Schema *sdk.DatabaseObjectIdentifier Application *sdk.AccountObjectIdentifier ApplicationPackage *sdk.AccountObjectIdentifier }
type ShowServiceOptions ¶
type ShowServiceOptions struct { ComputePool *sdk.AccountObjectIdentifier Database *sdk.AccountObjectIdentifier Schema *sdk.DatabaseObjectIdentifier }
type ShowSnapshotOptions ¶
type ShowSnapshotOptions struct { Database *sdk.AccountObjectIdentifier Schema *sdk.DatabaseObjectIdentifier }
type Snapshot ¶
type Snapshot struct { Name string `db:"name"` State string `db:"state"` DatabaseName string `db:"database_name"` SchemaName string `db:"schema_name"` ServiceName string `db:"service_name"` VolumeName string `db:"volume_name"` Instance int `db:"instance"` Size string `db:"size"` Comment sql.NullString `db:"comment"` Owner string `db:"owner"` OwnerRoleType string `db:"owner_role_type"` CreatedOn string `db:"created_on"` UpdatedOn string `db:"updated_on"` }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.