Visitar URL original
Add read-only Masakari Instance HA API support by zhmarvi · Pull Request #4068 · gophercloud/gophercloud · GitHub
Skip to content

Add read-only Masakari Instance HA API support - #4068

Open
zhmarvi wants to merge 5 commits into
gophercloud:mainfrom
zhmarvi:masakari-monitoring-main
Open

zhmarvi wants to merge 5 commits into
gophercloud:mainfrom
zhmarvi:masakari-monitoring-main

Conversation

@zhmarvi

@zhmarvi zhmarvi commented Oct 28, 2026

Copy link
Copy Markdown

For #3158

Add read-only support for Masakari's Instance HA v1 API so Go applications can inspect failover inventory and recovery activity through Gophercloud. This supports consumers such as OpenStack exporter without maintaining a separate HTTP implementation.
The change adds:

  • NewInstanceHAV1(ctx, provider, endpointOpts), discovering the instance-ha service through the Keystone catalog.
  • List and Get operations for failover segments and their hosts, notifications, and VM moves nested under notifications.
  • Typed results, resource filters, sorting, and marker-based pagination using the numeric IDs expected by Masakari.
  • Unit tests for service-client construction, resource reads, query serialization, pagination, and error responses.
  • A read-only acceptance test covering inventory and available recent notification and VM move records.

Segment enabled is associated with API microversion 1.2; VM moves require 1.3. Callers select the microversion through ServiceClient.Microversion. This change does not implement create, update, delete, or recovery-trigger operations.

This PR targets main and follows its context-aware client constructor. A companion v2 implementation is available for a backport if maintainers want it. This is a scoped first implementation of #3158 rather than full Masakari API coverage.

Add segment, host, notification and VM move queries with pagination and filtering. Match the context-aware client constructors on upstream main.

Validation: resource, constructor and pagination unit tests; go vet for instanceha packages; acceptance tests compile without live execution.
@github-actions github-actions Bot added the edit:openstack This PR updates common OpenStack code label Oct 28, 2026

@winiciusallan winiciusallan 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.

Hey @zhmarvi, thanks for working on this! I think this is in the right direction.

To merge with confidence, the CI runs our acceptance tests, as you can see in this example. I personally prefer to merge it with the workflow, but if you're not wiling to add it on this PR, I'm ok with it :). It would be called something like functional-instanceha.yaml.

I'm leaving a partial review and will take a look at the rest tomorrow.

@github-actions github-actions Bot added edit:actions This PR updates GitHub Actions code edit:testinfra This PR updates testing infrastructure code labels Oct 31, 2026
@zhmarvi
zhmarvi force-pushed the masakari-monitoring-main branch from a36a48c to 5ed82c2 Compare October 31, 2026 03:52
@zhmarvi

zhmarvi commented Nov 3, 2026

Copy link
Copy Markdown
Author

@winiciusallan ive also added a github workflow for intanceHA service for gophercloud, please let me know if any further questions or concerns. Thanks!

@zhmarvi
zhmarvi requested a review from winiciusallan November 4, 2026 22:58
@winiciusallan

Copy link
Copy Markdown
Contributor

@zhmarvi If I don't get into this by the end of this week, I might see this at the start of the next one. I've been busy with other stuffs, sorry. And thanks for the follow-up.

@winiciusallan winiciusallan self-assigned this Nov 5, 2026

@winiciusallan winiciusallan 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.

Hey @zhmarvi, finally I could catch this up. Thanks for addressing the comments. I left a few comments especially about the tests, and once fixed, I can trigger the workflows.

This might be merged soon!

Comment thread openstack/testing/instanceha_test.go Resolved
@zhmarvi
zhmarvi force-pushed the masakari-monitoring-main branch from 1382805 to 0fa00b2 Compare November 10, 2026 16:12
@zhmarvi

zhmarvi commented Nov 10, 2026

Copy link
Copy Markdown
Author

@winiciusallan appreciate the detailed feedback and prompt reviewing. I'll wait for your feedback and review progress :)

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 64.176% (+0.2%) from 64.023% — zhmarvi:masakari-monitoring-main into gophercloud:main

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

@winiciusallan winiciusallan 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.

Just two minor observations, then I think it'll be ready to go.

@zhmarvi
zhmarvi force-pushed the masakari-monitoring-main branch from e325a6b to bb23587 Compare November 12, 2026 05:10
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:actions This PR updates GitHub Actions code edit:openstack This PR updates common OpenStack code edit:testinfra This PR updates testing infrastructure code semver:minor Backwards-compatible change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants