deploymentapi

package
v1.2.30 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package deploymentapi contains curated functions which iteract with the deployments API, exposing an API which its usage is preferred over the direct client calls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

Create performs a Create using the specified Request against the API. Also overrides the passed request with the PayloadOverrides set in the wrapping CreateParams.

func Delete

Delete removes the specified deployment ID from the platform.

func Get

Get returns info about a deployment.

func GetApm

func GetApm(params GetParams) (*models.ApmResourceInfo, error)

GetApm returns info about an apm resource belonging to a given deployment.

func GetAppSearch

func GetAppSearch(params GetParams) (*models.AppSearchResourceInfo, error)

GetAppSearch returns info about an appsearch resource belonging to a given deployment.

func GetElasticsearch

func GetElasticsearch(params GetParams) (*models.ElasticsearchResourceInfo, error)

GetElasticsearch returns info about an elasticsearch resource belonging to a given deployment.

func GetElasticsearchID

func GetElasticsearchID(params GetParams) (string, error)

GetElasticsearchID returns the deployment's elasticsearch resource ID

func GetEnterpriseSearch

func GetEnterpriseSearch(params GetParams) (*models.EnterpriseSearchResourceInfo, error)

GetEnterpriseSearch returns info about an Enterprise Search resource belonging to a given deployment.

func GetKibana

func GetKibana(params GetParams) (*models.KibanaResourceInfo, error)

GetKibana returns info about an kibana resource belonging to a given deployment.

func GetResource

func GetResource(params GetResourceParams) (interface{}, error)

GetResource is a high level function which either returns the top level deployment information when no params.Kind is specified, or it returns a specific deployment resource information by RefID. If no RefID is defined, It will perform an additional API call to obtain the top level

func List

List returns the platform deployments

func NewUpdateRequest

NewUpdateRequest generates a DeploymentUpdateRequest from a GetResponse.

func OverrideCreateOrUpdateRequest

func OverrideCreateOrUpdateRequest(req interface{}, overrides *PayloadOverrides) error

OverrideCreateOrUpdateRequest sets a series of overrides to either the Create or Update deployment request. See PayloadOverrides to understand which how each field of that struct affects the behavior of this function.

func PopulateRefID

func PopulateRefID(params PopulateRefIDParams) error

PopulateRefID takes in a the necessary parameters to discover a RefID from a resource kind, and populates the value in the params.RefID field in the form of a *string.

func RequestID

func RequestID(s string) string

RequestID creates a 64-character string when an empty s tring is provided, or returns the provided string. It is aimed to be used as a helper when creating a deployment to always provide a request ID.

func Restore

Restore restores a deployment which has been previously shut down.

func Resync

func Resync(params ResyncParams) error

Resync forces indexer to immediately resynchronize the search index and cache for a given deployment.

func ResyncAll

ResyncAll asynchronously resynchronizes the search index for all deployments.

Search performs a search using the specified Request against the API.

func Shutdown

Shutdown shuts down a deployment and all of its associated resources. To shutdown individual deployment resources use the kind specific APIs.

func Update

Update receives an update payload with an optional region override in case the region isn't specified in the update request payload. Additionally if Request.PruneOrphans is false then any omitted resources aren't shutdown. The opposite behavior can be expected when the flag is true since the update request is treated as the single source of truth and the complete desired deployment definition.

Types

type CreateParams

type CreateParams struct {
	*api.API

	// Request from which to create the deployment, by combining this with
	// the Overrides fields, certain fields can be overridden centrally through
	// that struct.
	//
	// Additionally, a Request can be generated with depresourceapi.NewPayload().
	// For more information on that struct, please refer to its godoc.
	Request *models.DeploymentCreateRequest

	// Optional request_id to be sent in the Create which acts as an idempotency
	// token.
	RequestID string

	// PayloadOverrides are used as a definition of values which want to
	// be overridden within the resources themselves.
	Overrides *PayloadOverrides
}

CreateParams is consumed by Create.

func (CreateParams) Validate

func (params CreateParams) Validate() error

Validate ensures the parameters are usable by Create.

type DeleteParams

type DeleteParams struct {
	*api.API
	DeploymentID string
}

DeleteParams is consumed by Delete.

func (DeleteParams) Validate

func (params DeleteParams) Validate() error

Validate ensures the parameters are usable by Delete.

type GetParams

type GetParams struct {
	// Required API instance.
	*api.API

	// Required Deployment identifier.
	DeploymentID string

	// Optional parameters
	deputil.QueryParams

	// Optionally convert the legacy plans to the current deployment format.
	ConvertLegacyPlans bool

	// RefID, when specified, skips auto-discovering the deployment resource
	// RefID and instead uses the one that's passed.
	RefID string
}

GetParams is consumed by get resource functions

func (GetParams) Validate

func (params GetParams) Validate() error

Validate ensures that the parameters are usable by the consuming function.

type GetResourceParams

type GetResourceParams struct {
	GetParams

	Kind string
}

GetResourceParams is consumed by GetResource.

type ListParams

type ListParams struct {
	*api.API
}

ListParams is consumed by List.

func (ListParams) Validate

func (params ListParams) Validate() error

Validate ensures the parameters are usable.

type PayloadOverrides

type PayloadOverrides struct {
	// If set, it will override the deployment name.
	Name string

	// If set, it will override the region when not present in the
	// DeploymentCreateRequest.
	// Note this behavior is different from the rest of overrides
	// since this field tends to be populated by the global region
	// field which is implicit (by config) rather than explicit by flag.
	Region string

	// If set, it'll override all versions to match this one.
	Version string

	// ElasticsearchRefID used for the applications.
	ElasticsearchRefID string

	// OverrideRefIDs when set, it'll override all the application's ref_id.
	OverrideRefIDs bool

	// Slice of built-in enabled plugins.
	ElasticcsearchBuiltinPlugins []string
}

PayloadOverrides represent the override settings to

type PopulateRefIDParams

type PopulateRefIDParams struct {
	*api.API

	DeploymentID string
	Kind         string

	// RefID string pointer where the value is persisted.
	RefID *string
}

PopulateRefIDParams is consumed by PopulateRefID.

type RestoreParams

type RestoreParams struct {
	*api.API
	DeploymentID string

	RestoreSnapshot bool
}

RestoreParams is consumed by Restore.

func (RestoreParams) Validate

func (params RestoreParams) Validate() error

Validate ensures the parameters are usable by Restore.

type ResyncAllParams

type ResyncAllParams struct {
	*api.API
}

ResyncAllParams is consumed by ResyncAll

func (ResyncAllParams) Validate

func (params ResyncAllParams) Validate() error

Validate ensures the parameters are usable by the consuming function.

type ResyncParams

type ResyncParams struct {
	*api.API
	ID string
}

ResyncParams is consumed by Resync

func (ResyncParams) Validate

func (params ResyncParams) Validate() error

Validate ensures the parameters are usable by the consuming function.

type SearchParams

type SearchParams struct {
	*api.API

	Request *models.SearchRequest
}

SearchParams is consumed by Search.

func (SearchParams) Validate

func (params SearchParams) Validate() error

Validate ensures the parameters are usable by Shutdown.

type ShutdownParams

type ShutdownParams struct {
	*api.API
	DeploymentID string

	SkipSnapshot bool
}

ShutdownParams is consumed by Shutdown.

func (ShutdownParams) Validate

func (params ShutdownParams) Validate() error

Validate ensures the parameters are usable by Shutdown.

type UpdateParams

type UpdateParams struct {
	*api.API

	DeploymentID string
	Request      *models.DeploymentUpdateRequest

	// Optional values
	SkipSnapshot      bool
	HidePrunedOrphans bool

	// PayloadOverrides are used as a definition of values which want to
	// be overridden within the resources themselves.
	Overrides PayloadOverrides
}

UpdateParams is consumed by Update.

func (UpdateParams) Validate

func (params UpdateParams) Validate() error

Validate ensures the parameters are usable by Update.

Directories

Path Synopsis
Package depresourceapi contains curated functions which iteract with the deployment resources API, exposing an API which its usage is preferred over the direct client calls.
Package depresourceapi contains curated functions which iteract with the deployment resources API, exposing an API which its usage is preferred over the direct client calls.
Package noteapi contains curated functions which iteract with the deployment notes API, exposing an API which its usage is preferred over the direct client calls.
Package noteapi contains curated functions which iteract with the deployment notes API, exposing an API which its usage is preferred over the direct client calls.

Jump to

Keyboard shortcuts

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