diff --git a/CHANGELOG.md b/CHANGELOG.md index 267e1c575..1d18a677c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Bumps `github.com/aws/aws-sdk-go` from 1.44.45 to 1.44.132 ### Changed +- SnapshotDeleteRequest use []string instead of string ([#237](https://github.com/opensearch-project/opensearch-go/pull/237)) - Workflow improvements ([#242](https://github.com/opensearch-project/opensearch-go/pull/242)) ### Deprecated @@ -40,4 +41,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Security -[Unreleased]: https://github.com/opensearch-project/opensearch-go/compare/2.1...HEAD \ No newline at end of file +[Unreleased]: https://github.com/opensearch-project/opensearch-go/compare/2.1...HEAD diff --git a/opensearchapi/api.snapshot.delete.go b/opensearchapi/api.snapshot.delete.go index 376fcdb9e..6a136e1b2 100644 --- a/opensearchapi/api.snapshot.delete.go +++ b/opensearchapi/api.snapshot.delete.go @@ -34,7 +34,7 @@ import ( ) func newSnapshotDeleteFunc(t Transport) SnapshotDelete { - return func(repository string, snapshot string, o ...func(*SnapshotDeleteRequest)) (*Response, error) { + return func(repository string, snapshot []string, o ...func(*SnapshotDeleteRequest)) (*Response, error) { var r = SnapshotDeleteRequest{Repository: repository, Snapshot: snapshot} for _, f := range o { f(&r) @@ -48,13 +48,13 @@ func newSnapshotDeleteFunc(t Transport) SnapshotDelete { // SnapshotDelete deletes a snapshot. // // -type SnapshotDelete func(repository string, snapshot string, o ...func(*SnapshotDeleteRequest)) (*Response, error) +type SnapshotDelete func(repository string, snapshot []string, o ...func(*SnapshotDeleteRequest)) (*Response, error) // SnapshotDeleteRequest configures the Snapshot Delete API request. // type SnapshotDeleteRequest struct { Repository string - Snapshot string + Snapshot []string MasterTimeout time.Duration ClusterManagerTimeout time.Duration @@ -80,13 +80,13 @@ func (r SnapshotDeleteRequest) Do(ctx context.Context, transport Transport) (*Re method = "DELETE" - path.Grow(1 + len("_snapshot") + 1 + len(r.Repository) + 1 + len(r.Snapshot)) + path.Grow(1 + len("_snapshot") + 1 + len(r.Repository) + 1 + len(strings.Join(r.Snapshot, ","))) path.WriteString("/") path.WriteString("_snapshot") path.WriteString("/") path.WriteString(r.Repository) path.WriteString("/") - path.WriteString(r.Snapshot) + path.WriteString(strings.Join(r.Snapshot, ",")) params = make(map[string]string)