ansibleapp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2017 License: Apache-2.0 Imports: 16 Imported by: 20

Documentation

Index

Constants

View Source
const AppsPath = "/ansibleapps"

Variables

View Source
var AnsibleAppSpecLabel = "com.redhat.ansibleapp.spec"
View Source
var DockerSocket = "unix:///var/run/docker.sock"
View Source
var HardcodedClusterConfig = ClusterConfig{

	Target:   "10.1.2.2:8443",
	User:     "admin",
	Password: "admin",
}
View Source
var ListImagesScript = "get_images_for_org.sh"

Functions

func Deprovision

func Deprovision(instance *ServiceInstance, log *logging.Logger) error

func DumpJSON

func DumpJSON(obj interface{}) (string, error)

func LoadJSON

func LoadJSON(payload string, obj interface{}) error

func LoadYAML

func LoadYAML(payload string, obj interface{}) error

func Provision

func Provision(
	spec *Spec, parameters *Parameters,
	clusterConfig ClusterConfig, log *logging.Logger,
) error

TODO: Figure out the right way to allow ansibleapp to log It's passed in here, but that's a hard coupling point to github.com/op/go-logging, which is used all over the broker Maybe ansibleapp defines its own interface and accepts that optionally Little looser, but still not great

Types

type Client

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

func NewClient

func NewClient(log *logging.Logger) (*Client, error)

func (*Client) PullImage

func (c *Client) PullImage(imageName string) error

func (*Client) RunImage

func (c *Client) RunImage(
	action string,
	clusterConfig ClusterConfig,
	spec *Spec,
	p *Parameters,
) ([]byte, error)

type ClusterConfig

type ClusterConfig struct {
	Target   string
	User     string
	Password string
}

type DevRegistry

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

func (*DevRegistry) Init

func (r *DevRegistry) Init(config RegistryConfig, log *logging.Logger) error

func (*DevRegistry) LoadSpecs

func (r *DevRegistry) LoadSpecs() ([]*Spec, error)

type DockerHubRegistry

type DockerHubRegistry struct {
	ScriptsDir string
	// contains filtered or unexported fields
}

func (*DockerHubRegistry) Init

func (r *DockerHubRegistry) Init(config RegistryConfig, log *logging.Logger) error

func (*DockerHubRegistry) LoadSpecs

func (r *DockerHubRegistry) LoadSpecs() ([]*Spec, error)

type ImageData

type ImageData struct {
	Name         string
	Tag          string
	Labels       map[string]string
	Layers       []string
	IsAnsibleApp bool
	Error        error
}

type ParameterDescriptor

type ParameterDescriptor struct {
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Type        string      `json:"type"`
	Required    bool        `json:"required"`
	Default     interface{} `json:"default"`
}

type Parameters

type Parameters map[string]interface{}

type RHCCRegistry

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

func (*RHCCRegistry) Init

func (r *RHCCRegistry) Init(config RegistryConfig, log *logging.Logger) error

func (*RHCCRegistry) LoadSpecs

func (r *RHCCRegistry) LoadSpecs() ([]*Spec, error)

type Registry

type Registry interface {
	Init(RegistryConfig, *logging.Logger) error
	LoadSpecs() ([]*Spec, error)
}

func NewRegistry

func NewRegistry(config RegistryConfig, log *logging.Logger) (Registry, error)

type RegistryConfig

type RegistryConfig struct {
	Name string
	Url  string
	User string
	Pass string
	Org  string // Target org to load ansibleapps from
}

type ServiceInstance

type ServiceInstance struct {
	Id         uuid.UUID   `json:"id"`
	Spec       *Spec       `json:"spec"`
	Parameters *Parameters `json:"parameters"`
}

type Spec

type Spec struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Bindable    bool   `json:"bindable"`
	Description string `json:"description"`

	// required, optional, unsupported
	Async      string                 `json:"async"`
	Parameters []*ParameterDescriptor `json:"parameters"`
}

type SpecManifest

type SpecManifest map[string]*Spec

func NewSpecManifest

func NewSpecManifest(specs []*Spec) SpecManifest

Jump to

Keyboard shortcuts

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