Visitar URL original
openstack/db: add Trove datastore version APIs by stias · Pull Request #3812 · gophercloud/gophercloud · GitHub
Skip to content

openstack/db: add Trove datastore version APIs - #3812

Open
stias wants to merge 1 commit into
gophercloud:mainfrom
stias:feature/trove-db-datastore-versions
Open

stias wants to merge 1 commit into
gophercloud:mainfrom
stias:feature/trove-db-datastore-versions

Conversation

@stias

@stias stias commented Jun 20, 2026

Copy link
Copy Markdown

For #3809

Split out from #3767.

Links to the line numbers/files in the OpenStack source code that support the
code in this PR:

@github-actions github-actions Bot added the edit:db This PR updates db code label Jun 20, 2026
// PackageList represents packages associated with a datastore version.
type PackageList []string

// UnmarshalJSON supports Trove responses that may return packages as either a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not package return only a list? I'm assuming from these lines

https://github.com/openstack/trove/blob/stable/2026.1/trove/extensions/mgmt/datastores/views.py#L32-L33

@github-actions github-actions Bot added semver:minor Backwards-compatible change backport-v2 This PR will be backported to v2 labels Jun 29, 2026

@mandre mandre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in this particular case, having acceptance test is a must because, IIUC, we're expecting a body when trove doesn't return one. We need to verify against a live environment and prove it works.

Image string `json:"image,omitempty" or:"ImageTags"`
// Image tags used to find the latest matching image. Either Image or
// ImageTags must be provided.
ImageTags []string `json:"image_tags,omitempty"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also add or:"Image" ?


// CreateVersionResult represents the result of creating a version.
type CreateVersionResult struct {
gophercloud.Result

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the API doesn't return a body, this should be gophercloud.ErrResult


// UpdateVersionResult represents the result of updating a version.
type UpdateVersionResult struct {
gophercloud.Result

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

r.Err = err
return
}
resp, err := client.Post(ctx, createVersionURL(client), &b, &r.Body, &gophercloud.RequestOpts{OkCodes: []int{202}})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r.Err = err
return
}
resp, err := client.Patch(ctx, mgmtVersionURL(client, versionID), &b, &r.Body, &gophercloud.RequestOpts{OkCodes: []int{202}})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return s.Version, err
}

// Extract retrieves a single Version struct from a create result.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If trove doesn't return a body, the two methods below become dead code.

Links []gophercloud.Link
Name string
Active bool
Datastore string

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we're using the same type for the return of both /v1.0/{project_id}/datastores/{datastore}/versions/{version} and /v1.0/{project_id}/mgmt/datastore-versions/{datastore_version_id}, but they populate different fields?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v2 This PR will be backported to v2 edit:db This PR updates db code semver:minor Backwards-compatible change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants