Documentation ¶
Index ¶
- Constants
- Variables
- func BuildElasticsearchTopology(params BuildElasticsearchTopologyParams) ([]*models.ElasticsearchClusterTopologyElement, error)
- func CancelPlan(params CancelPlanParams) (*models.DeploymentResourceCrudResponse, error)
- func DeleteStateless(params DeleteStatelessParams) error
- func LatestStackVersion(params LatestStackVersionParams) (string, error)
- func New(params NewParams) (*models.DeploymentCreateRequest, error)
- func NewApm(params NewStateless) (*models.ApmPayload, error)
- func NewAppSearch(params NewStateless) (*models.AppSearchPayload, error)
- func NewElasticsearch(params NewElasticsearchParams) (*models.ElasticsearchPayload, error)
- func NewKibana(params NewStateless) (*models.KibanaPayload, error)
- func ParseElasticsearchInput(params ParseElasticsearchInputParams) (*models.ElasticsearchPayload, error)
- func Restore(params RestoreParams) error
- func Shutdown(params ShutdownParams) error
- func Start(params StartParams) (models.DeploymentResourceCommandResponse, error)
- func StartAllOrSpecified(params StartInstancesParams) (models.DeploymentResourceCommandResponse, error)
- func StartInstances(params StartInstancesParams) (models.DeploymentResourceCommandResponse, error)
- func StartInstancesMaintenanceMode(params StartInstancesParams) (models.DeploymentResourceCommandResponse, error)
- func StartMaintenanceMode(params StartParams) (models.DeploymentResourceCommandResponse, error)
- func StartMaintenanceModeAllOrSpecified(params StartInstancesParams) (models.DeploymentResourceCommandResponse, error)
- func Stop(params StopParams) (models.DeploymentResourceCommandResponse, error)
- func StopAllOrSpecified(params StopInstancesParams) (models.DeploymentResourceCommandResponse, error)
- func StopInstances(params StopInstancesParams) (models.DeploymentResourceCommandResponse, error)
- func StopInstancesMaintenanceMode(params StopInstancesParams) (models.DeploymentResourceCommandResponse, error)
- func StopMaintenanceMode(params StopParams) (models.DeploymentResourceCommandResponse, error)
- func StopMaintenanceModeAllOrSpecified(params StopInstancesParams) (models.DeploymentResourceCommandResponse, error)
- func UpgradeStateless(params deployment.ResourceParams) (*models.DeploymentResourceUpgradeResponse, error)
- type BuildElasticsearchTopologyParams
- type CancelPlanParams
- type DeleteStatelessParams
- type ElasticsearchTopologyElement
- type GetDeploymentInfoParams
- type GetDeploymentInfoResponse
- type InstanceParams
- type LatestStackVersionParams
- type NewElasticsearchParams
- type NewParams
- type NewStateless
- type ParseElasticsearchInputParams
- type RestoreParams
- type ShutdownParams
- type StartInstancesParams
- type StartParams
- type StopInstancesParams
- type StopParams
Constants ¶
const ( // DefaultTemplateID is used when there's no template ID specified in // the request. DefaultTemplateID = "default" // DefaultDataSize defines the default node size for data nodes when not // specified. DefaultDataSize = 4096 // DefaultDataZoneCount defines the default number of zones a deployment // spans. DefaultDataZoneCount = 1 // DefaultElasticsearchRefID is used when the RefID is not specified. DefaultElasticsearchRefID = "main-elasticsearch" )
const ( // DataNode identifies the node type which stores data. DataNode = "data" // MasterNode identifies the node type which is master elegible. MasterNode = "master" // MLNode identifies the node type performing the Machine Learning. MLNode = "ml" )
const (
// DefaultApmRefID is used when the RefID is not specified.
DefaultApmRefID = "main-apm"
)
const (
// DefaultAppSearchRefID is used when the RefID is not specified.
DefaultAppSearchRefID = "main-appsearch"
)
const (
// DefaultKibanaRefID is used when the RefID is not specified.
DefaultKibanaRefID = "main-kibana"
)
Variables ¶
var ( // DefaultTopology will be used when no topology is specified. DefaultTopology = []ElasticsearchTopologyElement{ DefaultTopologyElement, } // DefaultTopologyElement defines the element used in DefaultTopology DefaultTopologyElement = ElasticsearchTopologyElement{ Name: DataNode, Size: DefaultDataSize, ZoneCount: DefaultDataZoneCount, } )
Functions ¶
func BuildElasticsearchTopology ¶
func BuildElasticsearchTopology(params BuildElasticsearchTopologyParams) ([]*models.ElasticsearchClusterTopologyElement, error)
BuildElasticsearchTopology receives an ElasticsearchCluster topology from the deployment template definition and what the user has specified through a simplified version of the deployment topology, iterating over the template topology and triying to match the types that the user can specify: ["ml", "data", "master"], with their instance configuration ID. the matchNodeType function takes care of the matching. Once the NodeType has beeen matched, any overrides coming from the user- specified topology settings are set, overriding the default deployment template defined defaults.
func CancelPlan ¶
func CancelPlan(params CancelPlanParams) (*models.DeploymentResourceCrudResponse, error)
CancelPlan cancels a deployment resource plan.
func DeleteStateless ¶
func DeleteStateless(params DeleteStatelessParams) error
DeleteStateless deletes a stateless deployment resource like APM, Kibana and App Search.
func LatestStackVersion ¶
func LatestStackVersion(params LatestStackVersionParams) (string, error)
LatestStackVersion obtains the latest stack version from the API given an empty version from the parameters, if the passed version is not empty, then it will be returned.
func New ¶
func New(params NewParams) (*models.DeploymentCreateRequest, error)
New creates the payload for a deployment
func NewApm ¶
func NewApm(params NewStateless) (*models.ApmPayload, error)
NewApm creates a *models.ApmPayload from the parameters. It relies on a simplified single dimension memory size and zone count to construct the Apm's topology.
func NewAppSearch ¶
func NewAppSearch(params NewStateless) (*models.AppSearchPayload, error)
NewAppSearch creates a *models.AppSearchPayload from the parameters. It relies on a simplified single dimension memory size and zone count to construct the AppSearch's topology.
func NewElasticsearch ¶
func NewElasticsearch(params NewElasticsearchParams) (*models.ElasticsearchPayload, error)
NewElasticsearch creates a *models.ElasticsearchPayload from the parameters. It relies on a simplified definition of the full API ElasticsearchPayload. See BuildElasticsearchTopology for more information on how the construction of ElasticsearchPayload works.
func NewKibana ¶
func NewKibana(params NewStateless) (*models.KibanaPayload, error)
NewKibana creates a *models.KibanaPayload from the parameters. It relies on a simplified single dimension memory size and zone count to construct the Kibana's topology.
func ParseElasticsearchInput ¶
func ParseElasticsearchInput(params ParseElasticsearchInputParams) (*models.ElasticsearchPayload, error)
ParseElasticsearchInput handles all the parameters as optional, providing a nicer API when it's used. The bulk of what it does is:
- If a Payload is already specifide, it returns it.
- Tries to create an []ElasticsearchTopologyElement from a raw []string.
- If the previous step returns an empty slice, it uses a default slice which might override the values when Size or ZoneCount are set in the params.
- Auto-discovers the latest Stack version if Version is not specified.
When all of those steps are done, it finally calls NewElasticsearch building the resulting ElasticsearchPayload.
func Restore ¶
func Restore(params RestoreParams) error
Restore upgrades a stateless deployment resource like APM, Kibana and App Search.
func Shutdown ¶
func Shutdown(params ShutdownParams) error
Shutdown stops all the running instances for the specified resource kind ref ID on a Deployment. If no refID is specified, it tries to autodiscover it.
func Start ¶
func Start(params StartParams) (models.DeploymentResourceCommandResponse, error)
Start starts all instances belonging to a deployment resource kind.
func StartAllOrSpecified ¶
func StartAllOrSpecified(params StartInstancesParams) (models.DeploymentResourceCommandResponse, error)
StartAllOrSpecified starts all or defined instances belonging to a deployment resource.
func StartInstances ¶
func StartInstances(params StartInstancesParams) (models.DeploymentResourceCommandResponse, error)
StartInstances starts defined instances belonging to a deployment resource.
func StartInstancesMaintenanceMode ¶
func StartInstancesMaintenanceMode(params StartInstancesParams) (models.DeploymentResourceCommandResponse, error)
StartInstancesMaintenanceMode starts maintenance mode of defined instances belonging to a deployment resource.
func StartMaintenanceMode ¶
func StartMaintenanceMode(params StartParams) (models.DeploymentResourceCommandResponse, error)
StartMaintenanceMode starts maintenance mode of all instances belonging to a deployment resource kind.
func StartMaintenanceModeAllOrSpecified ¶
func StartMaintenanceModeAllOrSpecified(params StartInstancesParams) (models.DeploymentResourceCommandResponse, error)
StartMaintenanceModeAllOrSpecified starts all or defined instances belonging to a deployment resource.
func Stop ¶
func Stop(params StopParams) (models.DeploymentResourceCommandResponse, error)
Stop stops all instances belonging to a deployment resource kind.
func StopAllOrSpecified ¶
func StopAllOrSpecified(params StopInstancesParams) (models.DeploymentResourceCommandResponse, error)
StopAllOrSpecified stops all or defined instances belonging to a deployment resource.
func StopInstances ¶
func StopInstances(params StopInstancesParams) (models.DeploymentResourceCommandResponse, error)
StopInstances stops defined instances belonging to a deployment resource.
func StopInstancesMaintenanceMode ¶
func StopInstancesMaintenanceMode(params StopInstancesParams) (models.DeploymentResourceCommandResponse, error)
StopInstancesMaintenanceMode stops maintenance mode of defined instances belonging to a deployment resource.
func StopMaintenanceMode ¶
func StopMaintenanceMode(params StopParams) (models.DeploymentResourceCommandResponse, error)
StopMaintenanceMode stops maintenance mode of all instances belonging to a deployment resource kind.
func StopMaintenanceModeAllOrSpecified ¶
func StopMaintenanceModeAllOrSpecified(params StopInstancesParams) (models.DeploymentResourceCommandResponse, error)
StopMaintenanceModeAllOrSpecified stops all or defined instances belonging to a deployment resource.
func UpgradeStateless ¶
func UpgradeStateless(params deployment.ResourceParams) (*models.DeploymentResourceUpgradeResponse, error)
UpgradeStateless upgrades a stateless deployment resource like APM, Kibana and App Search.
Types ¶
type BuildElasticsearchTopologyParams ¶
type BuildElasticsearchTopologyParams struct { // Deployment Template ID from which the ClusterTopology comes from. TemplateID string // API-obtained slice of the Elasticsearch Deployment topology. ClusterTopology []*models.ElasticsearchClusterTopologyElement // User specified desired topology from which a new topology will be built. Topology []ElasticsearchTopologyElement }
BuildElasticsearchTopologyParams is consumed by BuildElasticsearchTopology.
type CancelPlanParams ¶
type CancelPlanParams struct { deployment.ResourceParams ForceDelete bool }
CancelPlanParams is consumed by CancelPlan
type DeleteStatelessParams ¶
type DeleteStatelessParams struct {
deployment.ResourceParams
}
DeleteStatelessParams is consumed by Delete
func (*DeleteStatelessParams) Validate ¶
func (params *DeleteStatelessParams) Validate() error
Validate ensures the parameters are usable by the consuming function.
type ElasticsearchTopologyElement ¶
type ElasticsearchTopologyElement struct { // Name can be one of "data", "master" or "ml". Name string `json:"name"` // Number of zones to span the cluster on. ZoneCount int32 `json:"zone_count,omitempty"` // Memory size of the cluster node. Size int32 `json:"size"` }
ElasticsearchTopologyElement is a single cluster topology element, meaning a number of instances (controlled by ZoneCount) for a single NodeType.
func NewElasticsearchTopology ¶
func NewElasticsearchTopology(topology []string) ([]ElasticsearchTopologyElement, error)
NewElasticsearchTopology creates a []ElasticsearchTopologyElement from a slice of raw strings which are then unmarshaled into the desired slice type. If any of the topology elements is not usable, an error is returned.
func NewElasticsearchTopologyElement ¶
func NewElasticsearchTopologyElement(size, zoneCount int32) ElasticsearchTopologyElement
NewElasticsearchTopologyElement creates a new topology element given a zone count and node size. Using DefaultTopologyElement as the blueprint.
func (*ElasticsearchTopologyElement) Validate ¶
func (element *ElasticsearchTopologyElement) Validate() error
Validate ensures the parameters are usable by the consuming function.
type GetDeploymentInfoParams ¶
GetDeploymentInfoParams is consumed by GetDeploymentInfo.
func (GetDeploymentInfoParams) Validate ¶
func (params GetDeploymentInfoParams) Validate() error
Validate ensures the parameters are usable by the consuming function.
type GetDeploymentInfoResponse ¶
type GetDeploymentInfoResponse struct { // RefID is the ElasticsearchRefID. RefID string // Deployment template which the Elasticsearch resource is using. DeploymentTemplate string }
GetDeploymentInfoResponse is returned by GetDeploymentInfo.
func GetDeploymentInfo ¶
func GetDeploymentInfo(params GetDeploymentInfoParams) (GetDeploymentInfoResponse, error)
GetDeploymentInfo obtains the Deployment's elasticsearch relevant info and packs it into GetDeploymentInfoResponse. It is convenient for actions which need to auto-discover information of their deployment.
type InstanceParams ¶
InstanceParams holds the common instance fields for a resource
type LatestStackVersionParams ¶
type LatestStackVersionParams struct { *api.API // When specified, the consuming function will return that version. Version string // If spceified, it's the io.Writer where info messages are written to. Writer io.Writer }
LatestStackVersionParams is consumed by LatestStackVersion.
func (LatestStackVersionParams) Validate ¶
func (params LatestStackVersionParams) Validate() error
Validate ensures the parameters are usable by the consuming function.
type NewElasticsearchParams ¶
type NewElasticsearchParams struct { *api.API // Optional region name. Defaults to Region string // Optional name. If not specified it defaults to the autogeneratd ID. Name string // Optional RefID for the deployment resource. RefID string // Required: Version is the Elasticsearch Version. Version string Plugins []string // Required Deployment Template ID. TemplateID string // Topology settings Topology []ElasticsearchTopologyElement }
NewElasticsearchParams is consumed by NewElasticsearch.
func (*NewElasticsearchParams) Validate ¶
func (params *NewElasticsearchParams) Validate() error
Validate ensures the parameters are usable by the consuming function.
type NewParams ¶
type NewParams struct { *api.API Name string Version string DeploymentTemplateID string Region string ApmEnable bool AppsearchEnable bool Writer io.Writer Plugins []string TopologyElements []string ElasticsearchInstance InstanceParams KibanaInstance InstanceParams ApmInstance InstanceParams AppsearchInstance InstanceParams }
NewParams is consumed by New()
type NewStateless ¶
type NewStateless struct { *api.API // Optional DeploymentID. DeploymentID string // Required region name. Region string // Optional ElasticsearchRefID. ElasticsearchRefID string // Optional name. If not specified it defaults to the autogenerated ID. Name string // Optional RefID for the stateless deployment resource. RefID string // Optional: Version is the stateless resource Version. If not set it'll // automatically be set to the Elasticsearch RefID version. Version string // Stateless deployment resource size. Size int32 ZoneCount int32 // Optional Deployment Template ID. TemplateID string }
NewStateless is consumed by NewKibana.
func (*NewStateless) Validate ¶
func (params *NewStateless) Validate() error
Validate ensures the parameters are usable by the consuming function.
type ParseElasticsearchInputParams ¶
type ParseElasticsearchInputParams struct { NewElasticsearchParams Payload *models.ElasticsearchPayload TopologyElements []string Size, ZoneCount int32 Writer io.Writer }
ParseElasticsearchInputParams is consumed by ParseElasticsearchInput.
type RestoreParams ¶
type RestoreParams struct { deployment.ResourceParams // Optional RestoreSnapshot bool }
RestoreParams is consumed by Restore
type ShutdownParams ¶
type ShutdownParams struct { deployment.ResourceParams // Optional Values // Skips taking a snapshot before shutting down the deployment resource. SkipSnapshot bool // Hides the resource. Hidden resources are not listed by default. Hide bool }
ShutdownParams is consumed by Shutdown.
type StartInstancesParams ¶
type StartInstancesParams struct { StartParams IgnoreMissing *bool InstanceIDs []string }
StartInstancesParams is consumed by StartInstances.
func (*StartInstancesParams) Validate ¶
func (params *StartInstancesParams) Validate() error
Validate ensures the parameters are usable by StartInstances.
type StartParams ¶
type StartParams struct { deployment.ResourceParams All bool }
StartParams is consumed by start.
type StopInstancesParams ¶
type StopInstancesParams struct { StopParams IgnoreMissing *bool InstanceIDs []string }
StopInstancesParams is consumed by StopInstances.
func (*StopInstancesParams) Validate ¶
func (params *StopInstancesParams) Validate() error
Validate ensures the parameters are usable by StopInstances.
type StopParams ¶
type StopParams struct { deployment.ResourceParams All bool }
StopParams is consumed by Stop.
Source Files ¶
- apm.go
- appsearch.go
- cancel_plan.go
- delete_stateless.go
- deployment_info.go
- elasticsearch.go
- elasticsearch_parser.go
- elasticsearch_topology.go
- kibana.go
- new_deployment.go
- new_stateless.go
- restore.go
- shutdown.go
- stack_latest.go
- start.go
- start_maintenance.go
- stop.go
- stop_maintenance.go
- upgrade_stateless.go