Documentation ¶
Index ¶
- func ErrStatus(statusCode int, body []byte) error
- type Address
- type Allowed
- type App
- type AppCname
- type AppCnames
- type AppConfig
- type AppDeploy
- type AppDeployRequest
- type AppEnv
- type AppEnvironment
- type CanarySettings
- type Client
- func (c *Client) AssociateRoleToUser(role, email string) error
- func (c *Client) CreateApp(app *App) error
- func (c *Client) CreateAppCname(appName string, req *AppCname) error
- func (c *Client) CreateAppEnvs(appName string, req *CreateAppEnv) error
- func (c *Client) CreateCluster(req *CreateClusterRequest) error
- func (c *Client) CreateOrUpdateNetworkPolicy(app string, config *NetworkPolicy) error
- func (c *Client) CreatePermission(req *Permission) error
- func (c *Client) CreatePlan(req *Plan) error
- func (c *Client) CreatePool(req *CreatePoolRequest) error
- func (c *Client) CreatePoolConfig(pool *PoolConfig) error
- func (c *Client) CreateRole(req *Role) error
- func (c *Client) CreateTeam(req *Team) error
- func (c *Client) CreateUser(req *User) error
- func (c *Client) DeleteApp(name string) error
- func (c *Client) DeleteAppCname(appName string, req *AppCnames) error
- func (c *Client) DeleteAppEnvs(appName string, req *DeleteAppEnv) error
- func (c *Client) DeleteCluster(name string) error
- func (c *Client) DeleteNetworkPolicy(app string) error
- func (c *Client) DeletePermission(role, permission string) error
- func (c *Client) DeletePlan(name string) error
- func (c *Client) DeletePool(name string) error
- func (c *Client) DeleteRole(name string) error
- func (c *Client) DeleteTeam(name string) error
- func (c *Client) DeleteUser(email string) error
- func (c *Client) DeployApp(appName string, req *AppDeploy) error
- func (c *Client) DisassociateRoleFromUser(role, email string) error
- func (c *Client) GetApp(name string) (*App, error)
- func (c *Client) GetAppEnvs(appName string) ([]*AppEnv, error)
- func (c *Client) GetCluster(name string) (*CreateClusterRequest, error)
- func (c *Client) GetNetworkPolicy(app string) (*NetworkPolicy, error)
- func (c *Client) GetPermission(role string) (*Permission, error)
- func (c *Client) GetPlan(name string) (*Plan, error)
- func (c *Client) GetPool(name string) (*Pool, error)
- func (c *Client) GetPoolConfig(name string) (*PoolConfig, error)
- func (c *Client) GetRole(name string) (*Role, error)
- func (c *Client) GetTeam(name string) (*Team, error)
- func (c *Client) GetUser(email string) (*User, error)
- func (c *Client) ListApps() ([]*App, error)
- func (c *Client) ListPlans() ([]*Plan, error)
- func (c *Client) ListPools() ([]*Pool, error)
- func (c *Client) ListUsers() ([]*User, error)
- func (c *Client) UpdateApp(name string, app *UpdateAppRequest) error
- func (c *Client) UpdateAppCname(appName string, req *AppCname) error
- func (c *Client) UpdateCluster(req *CreateClusterRequest) error
- func (c *Client) UpdatePool(req *UpdatePoolRequest) error
- func (c *Client) UpdatePoolConfig(req *PoolConfig) error
- func (c *Client) UpdateTeam(name string, req *UpdateTeamRequest) error
- type ClusterEndpointCreate
- type ClusterResourcesCreate
- type CreateAppEnv
- type CreateClusterRequest
- type CreatePoolRequest
- type DeleteAppEnv
- type Email
- type Entrypoint
- type Framework
- type IngressControllersCreate
- type Lock
- type NetworkPeer
- type NetworkPeerSelector
- type NetworkPolicy
- type NetworkPolicyConfig
- type NetworkPolicyRule
- type NetworkPort
- type Option
- type Permission
- type Plan
- type PodAutoScaler
- type Pool
- type PoolAppQuota
- type PoolAutoScale
- type PoolConfig
- type PoolContainerPolicy
- type PoolDomainPolicy
- type PoolGeneral
- type PoolNetworkPolicy
- type PoolNode
- type PoolNodeSelector
- type PoolPlan
- type PoolPodAutoScaler
- type PoolResources
- type PoolSecurity
- type PoolServiceAccess
- type PoolSetup
- type Port
- type QueryParam
- type Registry
- type Role
- type Router
- type SelectorExpression
- type Team
- type TerraformClusterResourcesCreate
- type TerraformCreateClusterRequest
- type TerraformFramework
- type Unit
- type UpdateAppRequest
- type UpdatePoolRequest
- type UpdateTeamRequest
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Address ¶
type Address struct { Scheme string `json:"Scheme,omitempty"` Host string `json:"Host,omitempty"` Opaque string `json:"Opaque,omitempty"` User string `json:"User,omitempty"` Path string `json:"Path,omitempty"` RawPath string `json:"RawPath,omitempty"` ForceQuery bool `json:"ForceQuery"` RawQuery string `json:"RawQuery,omitempty"` Fragment string `json:"Fragment,omitempty"` RawFragment string `json:"RawFragment,omitempty"` }
type App ¶
type App struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` TeamOwner string `json:"teamowner,omitempty"` Plan *Plan `json:"plan,omitempty"` Units []*Unit `json:"units,omitempty"` IP string `json:"ip,omitempty"` Org string `json:"org,omitempty"` Entrypoints []*Entrypoint `json:"entrypoints,omitempty"` Routers []*Router `json:"routers,omitempty"` Lock *Lock `json:"lock,omitempty"` Tags []string `json:"tags,omitempty"` Platform string `json:"platform,omitempty"` Status string `json:"status,omitempty"` Error string `json:"error,omitempty"` // not shows in API response Environment AppEnvironment `json:"environment,omitempty"` }
type AppConfig ¶ added in v0.0.10
type AppConfig struct { Environment string `json:"environment"` Plan string `json:"plan"` Team string `json:"team"` Description string `json:"description"` Router string `json:"router"` Tags []string `json:"tags,omitempty"` Env []string `json:"env,omitempty"` DependencyFile []string `json:"dependencyFile,omitempty"` }
AppConfig represents the JSON body that deploy /app expects
type AppDeploy ¶
type AppDeploy struct { Image string `json:"image"` PrivateImage bool `json:"private-image,omitempty" terraform:"private_image"` RegistryUser string `json:"registry-user,omitempty" terraform:"registry_user"` RegistrySecret string `json:"registry-secret,omitempty" terraform:"registry_secret"` Environment string `json:"environment,omitempty"` Plan string `json:"plan,omitempty"` Team string `json:"team,omitempty"` Description string `json:"description,omitempty"` Router string `json:"router,omitempty"` Tags []string `json:"tags,omitempty"` Env []string `json:"env,omitempty"` DependencyFile []string `json:"dependencyFile,omitempty"` Steps int64 `json:"steps,omitempty"` StepWeight int64 `json:"step-weight,omitempty" terraform:"step_weight"` StepInterval int64 `json:"step-interval,omitempty" terraform:"step_interval"` Port int64 `json:"port,omitempty"` Protocol string `json:"protocol,omitempty"` Detach bool `json:"detach"` Message string `json:"message,omitempty"` ShipaYaml string `json:"shipaYaml,omitempty" terraform:"shipa_yaml"` Origin string `json:"origin,omitempty"` }
type AppDeployRequest ¶ added in v0.0.9
type AppDeployRequest struct { AppConfig *AppConfig `json:"appConfig,omitempty"` Image string `json:"image"` Port *Port `json:"port,omitempty"` Detach bool `json:"detach"` Message string `json:"message,omitempty"` Registry *Registry `json:"registry,omitempty"` Origin string `json:"origin,omitempty"` CanarySettings *CanarySettings `json:"canarySettings,omitempty"` ShipaYaml string `json:"shipaYaml,omitempty"` }
AppDeployRequest represents the JSON body that deploy /app expects
type AppEnvironment ¶ added in v0.0.16
type CanarySettings ¶ added in v0.0.9
type CanarySettings struct { Steps int `json:"steps,omitempty"` StepWeight int `json:"stepWeight,omitempty"` StepInterval int `json:"stepInterval,omitempty"` }
CanarySettings represents the JSON body that deploy /app expects
type Client ¶
type Client struct { HostURL string HTTPClient *http.Client Token string AdminEmail string AdminPassword string }
func (*Client) AssociateRoleToUser ¶
func (*Client) CreateAppCname ¶
func (*Client) CreateAppEnvs ¶
func (c *Client) CreateAppEnvs(appName string, req *CreateAppEnv) error
func (*Client) CreateCluster ¶
func (c *Client) CreateCluster(req *CreateClusterRequest) error
func (*Client) CreateOrUpdateNetworkPolicy ¶
func (c *Client) CreateOrUpdateNetworkPolicy(app string, config *NetworkPolicy) error
CreateOrUpdateNetworkPolicy - creates or updates network policy
func (*Client) CreatePermission ¶
func (c *Client) CreatePermission(req *Permission) error
func (*Client) CreatePlan ¶
func (*Client) CreatePool ¶
func (c *Client) CreatePool(req *CreatePoolRequest) error
func (*Client) CreatePoolConfig ¶
func (c *Client) CreatePoolConfig(pool *PoolConfig) error
func (*Client) CreateRole ¶
func (*Client) CreateTeam ¶
func (*Client) CreateUser ¶
func (*Client) DeleteAppCname ¶
func (*Client) DeleteAppEnvs ¶
func (c *Client) DeleteAppEnvs(appName string, req *DeleteAppEnv) error
func (*Client) DeleteCluster ¶
func (*Client) DeleteNetworkPolicy ¶
DeleteNetworkPolicy - deletes network policy from the given app
func (*Client) DeletePermission ¶
func (*Client) DeletePlan ¶
func (*Client) DeletePool ¶
func (*Client) DeleteRole ¶
func (*Client) DeleteTeam ¶
func (*Client) DeleteUser ¶
func (*Client) DisassociateRoleFromUser ¶
func (*Client) GetCluster ¶
func (c *Client) GetCluster(name string) (*CreateClusterRequest, error)
func (*Client) GetNetworkPolicy ¶
func (c *Client) GetNetworkPolicy(app string) (*NetworkPolicy, error)
GetNetworkPolicy - get current policy of an app
func (*Client) GetPermission ¶
func (c *Client) GetPermission(role string) (*Permission, error)
func (*Client) GetPoolConfig ¶
func (c *Client) GetPoolConfig(name string) (*PoolConfig, error)
func (*Client) UpdateAppCname ¶
func (*Client) UpdateCluster ¶
func (c *Client) UpdateCluster(req *CreateClusterRequest) error
func (*Client) UpdatePool ¶
func (c *Client) UpdatePool(req *UpdatePoolRequest) error
func (*Client) UpdatePoolConfig ¶
func (c *Client) UpdatePoolConfig(req *PoolConfig) error
func (*Client) UpdateTeam ¶
func (c *Client) UpdateTeam(name string, req *UpdateTeamRequest) error
type ClusterEndpointCreate ¶
type ClusterEndpointCreate struct { Addresses []string `json:"addresses,omitempty"` Certificate string `json:"caCert,omitempty" terraform:"ca_cert"` ClientCertificate string `json:"clientCert,omitempty" terraform:"client_cert"` ClientKey string `json:"clientKey,omitempty" terraform:"client_key"` Token string `json:"token,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` }
type ClusterResourcesCreate ¶
type ClusterResourcesCreate struct { Frameworks []*Framework `json:"frameworks,omitempty"` IngressControllers []*IngressControllersCreate `json:"ingressControllers,omitempty" terraform:"ingress_controllers"` }
type CreateAppEnv ¶
type CreateClusterRequest ¶
type CreateClusterRequest struct { Name string `json:"name"` Endpoint *ClusterEndpointCreate `json:"endpoint"` Resources *ClusterResourcesCreate `json:"resources,omitempty"` }
func NewCreateClusterRequest ¶
func NewCreateClusterRequest(from *TerraformCreateClusterRequest) *CreateClusterRequest
type CreatePoolRequest ¶
type DeleteAppEnv ¶
type Entrypoint ¶
type IngressControllersCreate ¶
type IngressControllersCreate struct { IngressIP string `json:"ingressIp,omitempty" terraform:"ingress_ip"` ServiceType string `json:"serviceType,omitempty" terraform:"service_type"` Type string `json:"type,omitempty"` HTTPPort int64 `json:"httpPort,omitempty" terraform:"http_port"` HTTPSPort int64 `json:"httpsPort,omitempty" terraform:"https_port"` ProtectedPort int64 `json:"protectedPort,omitempty" terraform:"protected_port"` Debug bool `json:"debug"` AcmeEmail string `json:"acmeEmail,omitempty" terraform:"acme_email"` AcmeServer string `json:"acmeServer,omitempty" terraform:"acme_server"` }
type NetworkPeer ¶
type NetworkPeer struct { PodSelector *NetworkPeerSelector `json:"podSelector,omitempty"` NamespaceSelector *NetworkPeerSelector `json:"namespaceSelector,omitempty"` IPBlock []string `json:"ipBlock,omitempty"` }
type NetworkPeerSelector ¶
type NetworkPeerSelector struct { MatchLabels map[string]string `json:"matchLabels,omitempty"` MatchExpressions []*SelectorExpression `json:"matchExpressions,omitempty"` }
type NetworkPolicy ¶
type NetworkPolicy struct { Ingress *NetworkPolicyConfig `json:"ingress,omitempty"` Egress *NetworkPolicyConfig `json:"egress,omitempty"` RestartApp bool `json:"restart_app"` }
type NetworkPolicyConfig ¶
type NetworkPolicyConfig struct { PolicyMode string `json:"policy_mode,omitempty"` CustomRules []*NetworkPolicyRule `json:"custom_rules,omitempty"` ShipaRules []*NetworkPolicyRule `json:"shipa_rules,omitempty"` ShipaRulesEnabled []string `json:"shipa_rules_enabled,omitempty"` }
type NetworkPolicyRule ¶
type NetworkPolicyRule struct { ID string `json:"id,omitempty"` Enabled bool `json:"enabled"` Description string `json:"description,omitempty"` Ports []*NetworkPort `json:"ports,omitempty"` Peers []*NetworkPeer `json:"peers,omitempty"` AllowedApps []string `json:"allowed_apps,omitempty"` AllowedFrameworks []string `json:"allowed_pools,omitempty" terraform:"allowed_frameworks,omitempty"` }
type NetworkPort ¶
type Permission ¶
type PodAutoScaler ¶ added in v0.0.9
type PodAutoScaler struct { MinReplicas int `json:"minReplicas,omitempty"` MaxReplicas int `json:"maxReplicas,omitempty"` TargetCPUUtilizationPercentage int `json:"targetCPUUtilizationPercentage,omitempty"` }
PodAutoScaler represents the JSON body that deploy /app expects
type PoolAppQuota ¶
type PoolAppQuota struct {
Limit string `json:"limit,omitempty"`
}
type PoolAutoScale ¶
type PoolConfig ¶
type PoolConfig struct { Name string `json:"shipaFramework" terraform:"name"` Resources *PoolResources `json:"resources,omitempty"` }
type PoolContainerPolicy ¶
type PoolContainerPolicy struct {
AllowedHosts []string `json:"allowedHosts,omitempty"`
}
type PoolDomainPolicy ¶ added in v0.0.7
type PoolDomainPolicy struct {
AllowedCnames []string `json:"allowedCnames,omitempty"`
}
type PoolGeneral ¶
type PoolGeneral struct { Setup *PoolSetup `json:"setup,omitempty"` Plan *PoolPlan `json:"plan,omitempty"` Security *PoolSecurity `json:"security,omitempty"` Access *PoolServiceAccess `json:"access,omitempty"` Services *PoolServiceAccess `json:"services,omitempty"` Router string `json:"router,omitempty"` Volumes []string `json:"volumes,omitempty"` AppQuota *PoolAppQuota `json:"appQuota,omitempty"` ContainerPolicy *PoolContainerPolicy `json:"containerPolicy,omitempty"` NetworkPolicy *PoolNetworkPolicy `json:"networkPolicy,omitempty"` DomainPolicy *PoolDomainPolicy `json:"domainPolicy,omitempty"` NodeSelector *PoolNodeSelector `json:"nodeSelector,omitempty"` PodAutoScaler *PoolPodAutoScaler `json:"podAutoScaler,omitempty"` }
type PoolNetworkPolicy ¶
type PoolNetworkPolicy struct { Ingress *NetworkPolicyConfig `json:"ingress,omitempty"` Egress *NetworkPolicyConfig `json:"egress,omitempty"` DisableAppPolicies bool `json:"disableAppPolicies"` }
type PoolNode ¶
type PoolNode struct { Drivers []string `json:"drivers,omitempty"` AutoScale *PoolAutoScale `json:"autoScale,omitempty"` }
type PoolNodeSelector ¶ added in v0.0.7
type PoolPodAutoScaler ¶ added in v0.0.7
type PoolResources ¶
type PoolResources struct { General *PoolGeneral `json:"general,omitempty"` Node *PoolNode `json:"shipaNode,omitempty"` }
type PoolSecurity ¶
type PoolServiceAccess ¶
type Port ¶ added in v0.0.9
type Port struct { Number int `json:"number,omitempty"` Protocol string `json:"protocol,omitempty"` }
Port represents the JSON body that deploy /app expects
type QueryParam ¶
type QueryParam struct { Key string Val interface{} }
type Registry ¶ added in v0.0.9
type Registry struct { User string `json:"user,omitempty"` Secret string `json:"secret,omitempty"` }
Registry represents the JSON body that deploy /app expects
type SelectorExpression ¶
type TerraformClusterResourcesCreate ¶
type TerraformClusterResourcesCreate struct { Frameworks *TerraformFramework `json:"frameworks,omitempty"` IngressControllers []*IngressControllersCreate `json:"ingressControllers,omitempty" terraform:"ingress_controllers"` }
type TerraformCreateClusterRequest ¶
type TerraformCreateClusterRequest struct { Name string `json:"name"` Endpoint *ClusterEndpointCreate `json:"endpoint"` Resources *TerraformClusterResourcesCreate `json:"resources,omitempty"` }
func NewTerraformCreateClusterRequest ¶
func NewTerraformCreateClusterRequest(from *CreateClusterRequest) *TerraformCreateClusterRequest
type TerraformFramework ¶
type TerraformFramework struct {
Name []string `json:"name,omitempty"`
}
type Unit ¶
type Unit struct { ID string `json:"ID,omitempty"` Name string `json:"Name,omitempty"` AppName string `json:"AppName,omitempty"` ProcessName string `json:"ProcessName,omitempty"` Type string `json:"Type,omitempty"` IP string `json:"IP,omitempty"` Status string `json:"Status,omitempty"` Version string `json:"Version,omitempty"` Org string `json:"Org,omitempty"` HostAddr string `json:"HostAddr,omitempty"` HostPort string `json:"HostPort,omitempty"` Address *Address `json:"Address,omitempty"` }
type UpdateAppRequest ¶
type UpdateAppRequest struct { Pool string `json:"pool,omitempty"` TeamOwner string `json:"teamowner,omitempty"` Description string `json:"description,omitempty"` Plan string `json:"plan,omitempty"` Platform string `json:"platform,omitempty"` Tags []string `json:"tags,omitempty"` }
func NewUpdateAppRequest ¶
func NewUpdateAppRequest(a *App) *UpdateAppRequest
type UpdatePoolRequest ¶
type UpdateTeamRequest ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.