Wrong description of "attach volume" API

Bug #1530738 reported by Ken'ichi Ohmichi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-api-site
Fix Released
Medium
Sripriya

Bug Description

Current api-site explains "attach volume" API like

  URL: /v2.1/​{tenant_id}​/servers/​{server_id}​/action
  METHOD: POST
  BODY: {
    "attach": {
        "volume_id": "15e59938-07d5-11e1-90e3-e3dffe0c5983",
        [..]
    }
  }

but technically, the API is

  URL: /v2.1/​{tenant_id}​/servers/​{server_id}​/os-volume_attachments
  BODY: {
     "volumeAttachment": {
        "volumeId": "15e59938-07d5-11e1-90e3-e3dffe0c5983",
        "device": "/dev/sda2"
     }
  }

like Tempest tests:

tempest/api/compute/volumes/test_attach_volume.py
 84 self.attachment = self.servers_client.attach_volume(
 85 self.server['id'],
 86 volumeId=self.volume['id'],
 87 device='/dev/%s' % self.device)['volumeAttachment']

tempest_lib/services/compute/servers_client.py
 306 def attach_volume(self, server_id, **kwargs):
 307 """Attaches a volume to a server instance."""
 308 post_body = json.dumps({'volumeAttachment': kwargs})
 309 resp, body = self.post('servers/%s/os-volume_attachments' % server_id,
 310 post_body)
 311 body = json.loads(body)
 312 self.validate_response(schema.attach_volume, resp, body)
 313 return rest_client.ResponseBody(resp, body)

Revision history for this message
Anne Gentle (annegentle) wrote :

Thanks for investigating the Tempest tests.

Changed in openstack-api-site:
status: New → Confirmed
importance: Undecided → Medium
Sripriya (sseetha)
Changed in openstack-api-site:
assignee: nobody → Sripriya (sseetha)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to api-site (master)

Fix proposed to branch: master
Review: https://review.openstack.org/283938

Changed in openstack-api-site:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to api-site (master)

Reviewed: https://review.openstack.org/283938
Committed: https://git.openstack.org/cgit/openstack/api-site/commit/?id=9d58a2df274b24597f96c61cc1feb574072e54f2
Submitter: Jenkins
Branch: master

commit 9d58a2df274b24597f96c61cc1feb574072e54f2
Author: Sripriya <email address hidden>
Date: Tue Feb 23 20:42:42 2016 -0800

    Remove redundant attach volume API

    Compute API reference was referring to a wrong volume-attach API
    in server actions section. The volume attach is done through a
    dedicated os-volume_attachments API which is already captured
    in the Compute API reference

    Change-Id: Ie7b85c390733983abab2f2facd50fe2b3de14113
    Closes-Bug: #1530738

Changed in openstack-api-site:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.