Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Baremetal virtual media Get API #3303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 11, 2025
Merged

Baremetal virtual media Get API #3303

merged 3 commits into from
Mar 11, 2025

Conversation

hroyrh
Copy link
Contributor

@hroyrh hroyrh commented Feb 17, 2025

Fixes #3302

@github-actions github-actions bot added the edit:baremetal This PR updates baremetal code label Feb 17, 2025
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for submitting your first PR! Be sure that we will be looking at it but keep in mind
this sometimes takes a while.
Please let the maintainers know if your PR has not got enough attention after a few days.
If any doubt, please consult our PR tutorial.

@github-actions github-actions bot added the semver:minor Backwards-compatible change label Feb 17, 2025
@coveralls
Copy link

coveralls commented Feb 17, 2025

Coverage Status

coverage: 78.686% (+0.007%) from 78.679%
when pulling 6751a7a on hroyrh:vmedia_get
into 5afeaf8 on gophercloud:main.

@Sharpz7
Copy link
Contributor

Sharpz7 commented Feb 19, 2025

This looks like a microversion change that is needed. Let me know if you want help implementing that fix

@@ -219,7 +219,7 @@ func TestNodesVirtualMedia(t *testing.T) {

client, err := clients.NewBareMetalV1Client()
th.AssertNoErr(t, err)
client.Microversion = "1.89"
client.Microversion = "1.93"
Copy link
Contributor

Choose a reason for hiding this comment

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

Although, it does look like you have updated it, so my confidence on that is low.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the issue is driver related, the test is using ipmi but the feature only supports redfish. I'm looking into fixing it.

@iurygregory
Copy link
Contributor

the tests are failing, but they are legit failures. get api will only work on redfish based.. so you can remove the change in the acceptance, I will be trying to move things to redfish in another PR and later we can update I would say.

I've manually tested this with ironic directly and things should work, I'm just wondering what we expect as the output when doing

Via curl we would get something like:

[
  {
    "media_types": [
      "Floppy",
      "USBStick"
    ],
    "inserted": false,
    "image": ""
  },
  {
    "media_types": [
      "CD",
      "DVD"
    ],
    "inserted": true,
    "image": "http://<address>/redfish/boot-12345678-aaaa-5856-bfb6-6aaaacd3dd11.iso"
  }
]

With gophercloud doing

result := nodes.GetVirtualMedia(ctx, client, myID)

returns the following:

{{[map[image: inserted:false media_types:[Floppy USBStick]] map[image:http://<address>/redfish/boot-12345678-aaaa-5856-bfb6-6aaaacd3dd11.iso inserted:true media_types:[CD DVD]]] 0 map[Content-Length:[212] Content-Type:[application/json] Date:[Fri, 28 Feb 2025 01:26:50 GMT] Openstack-Request-Id:[req-...] X-Openstack-Ironic-Api-Maximum-Version:[1.95] X-Openstack-Ironic-Api-Minimum-Version:[1.1] X-Openstack-Ironic-Api-Version:[1.93]] <nil>}}

using Result

result := nodes.GetVirtualMedia(ctx, client, myID).Result

{[map[image: inserted:false media_types:[Floppy USBStick]] map[image:http://<address>/redfish/boot-12345678-aaaa-5856-bfb6-6aaaacd3dd11.iso inserted:true media_types:[CD DVD]]] 0 map[Content-Length:[212] Content-Type:[application/json] Date:[Fri, 28 Feb 2025 01:31:18 GMT] Openstack-Request-Id:[req-34c36302-b93f-4492-89a8-c1e27f3a8cbb] X-Openstack-Ironic-Api-Maximum-Version:[1.95] X-Openstack-Ironic-Api-Minimum-Version:[1.1] X-Openstack-Ironic-Api-Version:[1.93]] <nil>}

using Err

result := nodes.GetVirtualMedia(ctx, client, myID).Err

<nil>

using Body

result := nodes.GetVirtualMedia(ctx, client, myID).Body

[map[image: inserted:false media_types:[Floppy USBStick]] map[image:http://<address>/redfish/boot-12345678-aaaa-5856-bfb6-6aaaacd3dd11.iso inserted:true media_types:[CD DVD]]]

@github-actions github-actions bot removed the semver:minor Backwards-compatible change label Mar 7, 2025
Copy link

github-actions bot commented Mar 7, 2025

Failed to assess the semver bump. See logs for details.

@github-actions github-actions bot added the semver:minor Backwards-compatible change label Mar 7, 2025
@iurygregory
Copy link
Contributor

LGTM

@iurygregory
Copy link
Contributor

@EmilienM when you have time can you check this PR? Thanks!

@mandre mandre merged commit 1031a87 into gophercloud:main Mar 11, 2025
18 checks passed
@pierreprinetti
Copy link
Member

@mandre Why was this not backported to v2?

@mandre
Copy link
Contributor

mandre commented Mar 23, 2025

@mandre Why was this not backported to v2?

It was an oversight.

@mandre mandre added the backport-v2 This PR will be backported to v2 label Mar 23, 2025
Copy link

Failed to backport PR to v2 branch. See logs for details.

@mandre
Copy link
Contributor

mandre commented Mar 23, 2025

The backport to v2 depends on #3334.

@mandre mandre added backport-v2 This PR will be backported to v2 and removed backport-v2 This PR will be backported to v2 labels Mar 23, 2025
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:baremetal This PR updates baremetal code semver:minor Backwards-compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Baremetal: add support for new virtual media GET API
6 participants