-
Notifications
You must be signed in to change notification settings - Fork 129
Description
elastic-package is using a legacy arrays-based format when creating package policies (around here).
According to the documentation, this format is deprecated and a new format based on objects should be used.
We should check since what version this new format exists, in case we need to support both formats for old versions.
Update: elastic-package is actually using both formats, there is a type kibana.PackageDataStream that uses the arrays format, while the kibana.PackagePolicy uses the object format. They have equivalent methods that at the end use the same /package_policies endpoints. See for example:
elastic-package/internal/kibana/policies.go
Line 242 in e84244e
func (c *Client) AddPackageDataStreamToPolicy(ctx context.Context, r PackageDataStream) error { elastic-package/internal/kibana/policies.go
Line 287 in e84244e
func (c *Client) CreatePackagePolicy(ctx context.Context, p PackagePolicy) (*PackagePolicy, error) {
kibana.PackageDataStream type and related helpers should be removed in favor of kibana.PackagePolicy.