Documentation ¶
Index ¶
- Variables
- type BaseSize
- type CapacityProviderStrategyInput
- type Client
- func (c *Client) ContainerSize(id string) (*ContainerSize, error)
- func (c *Client) DatabaseSize(id string) (*DatabaseSize, error)
- func (c *Client) GetResource(params map[string]string, r ResourceType) error
- func (c *Client) PostResource(params map[string]string, input []byte, r ResourceType) error
- func (c *Client) PutResource(params map[string]string, input []byte, r ResourceType) error
- func (c *Client) Resources(space string) ([]*Resource, error)
- func (c *Client) S3StorageSize(id string) (*S3StorageSize, error)
- func (c *Client) ServerSize(id string) (*ServerSize, error)
- func (c *Client) Size(id string) (Size, error)
- type Container
- type ContainerCapacityProviderStrategyItem
- type ContainerDefinition
- type ContainerEfsVolumeConfiguration
- type ContainerEvent
- type ContainerHealthCheck
- type ContainerMountPoint
- type ContainerPortMapping
- type ContainerService
- type ContainerServiceUpdateInput
- type ContainerServiceWrapperUpdateInput
- type ContainerSize
- type ContainerTask
- type ContainerVolume
- type CostValue
- type DBCluster
- type DBInstance
- type DBInstanceEndpoint
- type DBScalingConfiguration
- type DatabaseInfo
- type DatabaseSize
- type Disk
- type DiskAttachment
- type Disks
- type FlexBool
- type FlexInt
- type GetSpace
- type Image
- type ImageVolume
- type ImageVolumes
- type Images
- type NameValue
- type NameValueFrom
- type Offering
- type Resource
- type ResourceType
- type S3StorageInfo
- type S3StorageSize
- type S3StorageUser
- type S3StorageUserAccessKey
- type S3StorageUsers
- type Secret
- type SecretInput
- type SecretName
- type Secrets
- type ServerInfo
- type ServerSize
- type Size
- type Snapshot
- type Snapshots
- type Space
- type SpaceCost
- type SpaceCosts
- type Spaces
Constants ¶
This section is empty.
Variables ¶
var ( BaseURL = "http://localhost:8090" DatabaseURI = "/api/v3/databases" ContainerURI = "/api/v3/containers" ResourceURI = "/api/v3/resources" SecretsURI = "/api/v3/spaces" SizeURI = "/api/v3/sizes" SpaceURI = "/api/v3/spaces" StorageURI = "/api/v3/storage" )
Functions ¶
This section is empty.
Types ¶
type BaseSize ¶
type BaseSize struct { ID *FlexInt `json:"id"` Name string `json:"name"` TypeID *FlexInt `json:"type_id"` Value string `json:"value"` Details string `json:"details"` Price string `json:"price"` }
BaseSize contains the basic size information for all sizes
func (*BaseSize) GetEndpoint ¶ added in v0.2.0
type CapacityProviderStrategyInput ¶ added in v0.4.0
type Client ¶
Client is the spinup client
func (*Client) ContainerSize ¶
func (c *Client) ContainerSize(id string) (*ContainerSize, error)
ContainerSize returns ContainerSize
func (*Client) DatabaseSize ¶ added in v0.3.0
func (c *Client) DatabaseSize(id string) (*DatabaseSize, error)
DatabaseSize returns a DatabaseSize as a Size
func (*Client) GetResource ¶
func (c *Client) GetResource(params map[string]string, r ResourceType) error
GetResource gets details about a resource and unmarshals them them into the passed ResourceType. It first gets the resource endpoint by calling r.GetEndpoint(id) which is a function on the passed ResourceType interface.
func (*Client) PostResource ¶ added in v0.4.0
PostResource creates a resource
func (*Client) PutResource ¶
PutResources updates a resource
func (*Client) S3StorageSize ¶
func (c *Client) S3StorageSize(id string) (*S3StorageSize, error)
S3StorageSize returns S3StorageSize as a Size
func (*Client) ServerSize ¶
func (c *Client) ServerSize(id string) (*ServerSize, error)
ServerSize returns a ServerSize as a Size
type Container ¶
type Container struct { ContainerArn string Cpu string ExitCode string HealthStatus string Image string LastStatus string Memory string MemoryReservation string Name string NetworkBindings []struct { BindIP string ContainerPort int64 HostPort int64 Protocol string } NetworkInterfaces []struct { AttachmentId string Ipv6Address string PrivateIpv4Address string } Reason string RuntimeId string TaskArn string }
type ContainerCapacityProviderStrategyItem ¶ added in v0.2.0
type ContainerDefinition ¶
type ContainerDefinition struct { Command []string CPU int64 DependsOn []struct { Condition string ContainerName string } DisableNetworking bool DnsSearchDomains []string DnsServers []string DockerLabels map[string]string EntryPoint []string Environment []*NameValue Essential bool HealthCheck *ContainerHealthCheck Image string Interactive bool Links []string // LinuxParameters *LinuxParameter LogConfiguration struct { LogDriver string Options map[string]string SecretOptions []*NameValueFrom } Memory int64 MemoryReservation int64 MountPoints []*ContainerMountPoint Name string PortMappings []*ContainerPortMapping Privileged bool PseudoTerminal bool ReadonlyRootFilesystem bool RepositoryCredentials struct { CredentialsParameter string } Secrets []*NameValueFrom StartTimeout int64 StopTimeout int64 Ulimits []struct { HardLimit int64 Name string SoftLimit int64 } User string VolumesFrom []struct { ReadOnly bool SourceContainer string } WorkingDirectory string }
type ContainerEfsVolumeConfiguration ¶ added in v0.2.0
type ContainerEvent ¶
type ContainerHealthCheck ¶
type ContainerMountPoint ¶
type ContainerPortMapping ¶
type ContainerService ¶
type ContainerService struct { CapacityProviderStrategy []*ContainerCapacityProviderStrategyItem ClusterArn string CreatedAt string DesiredCount int64 Events []*ContainerEvent LoadBalancers []struct { ContainerName string ContainerPort int64 LoadBalancerName string TargetGroupArn string } NetworkConfiguration struct { AwsvpcConfiguration struct { AssignPublicIp string SecurityGroups []string Subnets []string } } PendingCount int64 RoleArn string RunningCount int64 SchedulingStrategy string ServiceArn string ServiceEndpoint string ServiceName string ServiceRegistries []struct { ContainerName string ContainerPort int64 Port int64 RegistryArn string } Status string Tasks []string TaskDefinition struct { Compatibilities []string CPU string ContainerDefinitions []*ContainerDefinition Family string Memory string Revision int64 Status string TaskDefinitionArn string Volumes []*ContainerVolume } }
ContainerService is a spinup container service
func (*ContainerService) GetEndpoint ¶
func (c *ContainerService) GetEndpoint(params map[string]string) string
GetEndpoint returns the endpoint to get details about a container service
type ContainerServiceUpdateInput ¶ added in v0.4.0
type ContainerServiceUpdateInput struct { CapacityProviderStrategy []*CapacityProviderStrategyInput DesiredCount int64 PlatformVersion string }
type ContainerServiceWrapperUpdateInput ¶ added in v0.4.0
type ContainerServiceWrapperUpdateInput struct { ForceRedeploy bool `json:"force_redeploy"` Service *ContainerServiceUpdateInput `json:"service"` Size *FlexInt `json:"size_id"` }
type ContainerSize ¶
ContainerSize is the size for a container satisfying the Size interface
type ContainerTask ¶
type ContainerTask struct { Failures []string Tasks []struct { AvailabilityZone string Attachments []struct { Details []*NameValue Id string Status string Type string } CapacityProviderName string ClusterArn string Connectivity string ConnectivityAt string Containers []*Container Cpu string CreatedAt string DesiredStatus string ExecutionStoppedAt string Group string HealthStatus string InferenceAccelerators []struct { DeviceName string DeviceType string } LastStatus string LaunchType string Memory string Overrides interface{} PlatformVersion string PullStartedAt string PullStoppedAt string StartedAt string StartedBy string StopCode string StoppedAt string StoppedReason string StoppingAt string Tags []*NameValue TaskArn string TaskDefinitionArn string Version int64 } }
func (*ContainerTask) GetEndpoint ¶
func (c *ContainerTask) GetEndpoint(params map[string]string) string
GetEndpoint returns the endpoint to get details about a container service task
type ContainerVolume ¶ added in v0.2.0
type ContainerVolume struct { EfsVolumeConfiguration *ContainerEfsVolumeConfiguration `json:",omitempty"` Host *struct{} `json:",omitempty"` Name string }
type DBCluster ¶ added in v0.3.0
type DBCluster struct { AllocatedStorage int64 AutoMinorVersionUpgrade bool AvailabilityZones []string BackupRetentionPeriod int64 Capacity int64 ClusterCreateTime string DBClusterArn string DBClusterIdentifier string DbClusterResourceId string EarliestRestorableTime string Endpoint string Engine string EngineMode string EngineVersion string HostedZoneId string KmsKeyId string LatestRestorableTime string MasterUsername string MultiAZ bool PercentProgress string Port int64 PreferredBackupWindow string PreferredMaintenanceWindow string ScalingConfigurationInfo *DBScalingConfiguration Status string StorageEncrypted bool }
type DBInstance ¶ added in v0.3.0
type DBInstance struct { AllocatedStorage int64 AutoMinorVersionUpgrade bool BackupRetentionPeriod int64 CACertificateIdentifier string DBInstanceArn string DBInstanceClass string DBInstanceIdentifier string DBInstanceStatus string DBName string DbInstancePort int64 DbiResourceId string Endpoint *DBInstanceEndpoint Engine string EngineVersion string InstanceCreateTime string Iops int64 LatestRestorableTime string LicenseModel string ListenerEndpoint string MasterUsername string MultiAZ bool PreferredBackupWindow string PreferredMaintenanceWindow string PubliclyAccessible bool StorageEncrypted bool StorageType string }
type DBInstanceEndpoint ¶ added in v0.3.0
type DBScalingConfiguration ¶ added in v0.3.0
type DatabaseInfo ¶ added in v0.3.0
type DatabaseInfo struct { Endpoint string `json:",omitempty"` DBClusters []*DBCluster `json:",omitempty"` DBInstances []*DBInstance `json:",omitempty"` }
func (*DatabaseInfo) GetEndpoint ¶ added in v0.3.0
func (s *DatabaseInfo) GetEndpoint(params map[string]string) string
GetEndpoint gets the URL for server info
type DatabaseSize ¶ added in v0.3.0
type DatabaseSize struct {
*BaseSize
}
DatabaseSize is the size for a database satisfying the Size interface
type Disk ¶
type Disk struct { ID string `json:"id"` CreatedAt string `json:"created_at"` Encrypted bool `json:"encrypted"` Size int `json:"size"` VolumeType string `json:"volume_type,omitempty"` Attachments *DiskAttachment `json:"attachments,omitempty"` }
Disk is a volume
type DiskAttachment ¶
type DiskAttachment struct { AttachTime string `json:"attach_time"` DeleteOnTermination bool `json:"delete_on_termination"` Device string `json:"device,omitempty"` InstanceID string `json:"instance_id,omitempty"` State string `json:"state,omitempty"` Status string `json:"status,omitempty"` }
DiskAttachment is the details about a disk/volumes attachment to an instance
type FlexBool ¶
type FlexBool bool
FlexBool is a bool... or a stirng... or an int... or...
func (*FlexBool) UnmarshalJSON ¶
type FlexInt ¶
type FlexInt int
FlexInt is an int... or a string... or an int.... or...
func (*FlexInt) UnmarshalJSON ¶
type GetSpace ¶
type GetSpace struct {
Space *Space `json:"space"`
}
GetSpace is a space returned from a wonky endpoint
type Image ¶
type Image struct { Architecture string `json:"architecture,omitempty"` CreatedAt string `json:"created_at,omitempty"` CreatedBy string `json:"created_by,omitempty"` Description string `json:"description,omitempty"` ID string `json:"id"` Name string `json:"name,omitempty"` ServerName string `json:"server_name,omitempty"` State string `json:"state,omitempty"` Status string `json:"status,omitempty"` Volumes ImageVolumes `json:"volumes,omitempty"` Offering *Offering `json:"offering,omitempty"` }
Image is a server image
type ImageVolume ¶ added in v0.2.0
type ImageVolumes ¶ added in v0.2.0
type ImageVolumes map[string]*ImageVolume
func (*ImageVolumes) UnmarshalJSON ¶ added in v0.2.0
func (iv *ImageVolumes) UnmarshalJSON(b []byte) error
type NameValueFrom ¶
NameValueFrom is a Name/ValueFrom struct
func (*NameValueFrom) String ¶
func (nv *NameValueFrom) String() string
type Offering ¶
type Offering struct { Beta *FlexBool `json:"beta,omitempty"` CreatedAt string `json:"created_at,omitempty"` DefaultDiskSize *FlexInt `json:"default_disk_size,omitempty"` DeletedAt string `json:"deleted_at,omitempty"` Details string `json:"details,omitempty"` Flavor string `json:"flavor"` ID *FlexInt `json:"id"` Image string `json:"image,omitempty"` ImageOwner string `json:"image_owner,omitempty"` ImageSearchString string `json:"search_string,omitempty"` Logo string `json:"logo,omitempty"` MinDiskSize *FlexInt `json:"min_disk_size,omitempty"` Name string `json:"name"` NameBroker string `json:"name_broker,omitempty"` Options string `json:"options,omitempty"` ProductCode string `json:"product_code,omitempty"` Provider string `json:"provider,omitempty"` ProviderBroker string `json:"provider_name,omitempty"` Security string `json:"security,omitempty"` SecurityGroup string `json:"sgs,omitempty"` Subnet string `json:"subnet,omitempty"` Type string `json:"type"` UpdatedAt string `json:"updated_at,omitempty"` UserData string `json:"userdata,omitempty"` }
Offering is the Spinup representation of an offering (or type)
type Resource ¶
type Resource struct { Admin string `json:"admin,omitempty"` CreatedAt string `json:"created_at"` DeletedAt string `json:"deleted_at,omitempty"` TypeName string `json:"type_name"` TypeCat string `json:"type_category"` TypeFlavor string `json:"type_flavor"` ID *FlexInt `json:"id"` IP string `json:"ip,omitempty"` IsA string `json:"is_a,omitempty"` Name string `json:"name"` ServerID string `json:"server_id,omitempty"` SizeID *FlexInt `json:"size_id,omitempty"` SpaceID *FlexInt `json:"-"` SpaceName string `json:"space_name"` Space *Space `json:"-"` Status string `json:"status"` TypeID *FlexInt `json:"-"` Task string `json:"-"` Type *Offering `json:"type,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` }
Resource is a specific resource in the database, it represents an actual instance, container, s3 bucket, etc
type ResourceType ¶
ResourceType is an interface for deteriming URLs
type S3StorageInfo ¶
type S3StorageInfo struct {
Empty bool
}
S3StorageInfo is the info about a S3 storage bucket
func (*S3StorageInfo) GetEndpoint ¶
func (s *S3StorageInfo) GetEndpoint(params map[string]string) string
GetEndpoint returns the url for a storage resource
type S3StorageSize ¶
type S3StorageSize struct {
*BaseSize
}
S3StorageSize is the size for a container satisfying the Size interface
type S3StorageUser ¶
type S3StorageUser struct { Arn string `json:"Arn"` Username string `json:"UserName"` CreatedAt string `json:"CreateDate"` LastUsed string `json:"PasswordLastUsed"` AccessKeys []*S3StorageUserAccessKey `json:"AccessKeys"` }
S3StorageUser is a storage user
func (*S3StorageUser) GetEndpoint ¶
func (s *S3StorageUser) GetEndpoint(params map[string]string) string
GetEndpoint returns the URL for the details about a user of a storage resource
type S3StorageUserAccessKey ¶
type S3StorageUsers ¶
type S3StorageUsers []*S3StorageUser
S3StorageUsers is a list of storage users
func (*S3StorageUsers) GetEndpoint ¶
func (s *S3StorageUsers) GetEndpoint(params map[string]string) string
GetEndpoint returns the URL for the list of users of a storage resource
type Secret ¶
type SecretInput ¶ added in v0.4.0
type SecretName ¶
type SecretName string
type Secrets ¶
type Secrets []SecretName
type ServerInfo ¶
type ServerInfo struct { ID string `json:"id"` Name string `json:"name"` Type string `json:"type"` Image string `json:"image"` IP string `json:"ip"` Key string `json:"key,omitempty"` Subnet string `json:"subnet"` Tags []map[string]string `json:"tags,omitempty"` SecurityGroups []map[string]string `json:"sgs"` State string `json:"state"` AvailabilityZone string `json:"az"` Platform string `json:"platform,omitempty"` CreatedAt string `json:"created_at,omitempty"` CreatedBy string `json:"created_by,omitempty"` Volumes map[string]*DiskAttachment `json:"volumes,omitempty"` }
ServerInfo is the details about a server resource, filled in by fetching data from the backend APIs
func (*ServerInfo) GetEndpoint ¶
func (s *ServerInfo) GetEndpoint(params map[string]string) string
GetEndpoint gets the URL for server info
type ServerSize ¶
ServerSize is the size for a server satisfying the Size interface
type Snapshot ¶
type Snapshot struct { ID string `json:"id"` Name string `json:"name"` CreatedAt string `json:"created_at"` Encrypted bool `json:"encrypted"` Progress string `json:"progress,omitempty"` State string `json:"state,omitempty"` VolumeID string `json:"volume_id,omitempty"` }
Snapshot is a snapshot of a volume
type Space ¶
type Space struct { Id *FlexInt `json:"id"` Name string `json:"name,omitempty"` Owner string `json:"owner,omitempty"` Department string `json:"department,omitempty"` Contact string `json:"contact,omitempty"` QuestionaireID string `json:"questid,omitempty"` SecurityGroup string `json:"sg,omitempty"` Security string `json:"security,omitempty"` DataTypes []struct { Id *FlexInt Name string } `json:"data_types,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` DeletedAt string `json:"deleted_at,omitempty"` Mine bool `json:"mine,omitempty"` Resources []*Resource `json:"resources,omitempty"` Cost *SpaceCosts `json:"cost,omitempty"` }
Space holds details about a spinup space
type SpaceCost ¶
type SpaceCost struct { Estimated bool Groups []string TimePeriod struct { Start string End string } Total struct { BlendedCost *CostValue UnblendedCost *CostValue UsageQuantity *CostValue } }
SoaceCost is the cost estimate for a space
type SpaceCosts ¶ added in v0.4.0
type SpaceCosts []*SpaceCost
SpaceCosts is the list of costs for a space
func (*SpaceCosts) GetEndpoint ¶ added in v0.4.0
func (s *SpaceCosts) GetEndpoint(params map[string]string) string
GetEndpoint returns the endpoint to get cost of a space