Skip to content

Add CREATE support in V3 volume types#654

Merged
jtopjian merged 2 commits intogophercloud:masterfrom
TommyLike:feature/volume_type_create
Dec 19, 2017
Merged

Add CREATE support in V3 volume types#654
jtopjian merged 2 commits intogophercloud:masterfrom
TommyLike:feature/volume_type_create

Conversation

@TommyLike
Copy link
Copy Markdown
Contributor

@TommyLike TommyLike commented Dec 6, 2017

Add Create support for volume type in volume V3.

For #649

Document:
Volume type create V3

Code:
Volume type create V3

Model:
Link

@coveralls
Copy link
Copy Markdown

coveralls commented Dec 6, 2017

Coverage Status

Coverage decreased (-0.03%) to 72.727% when pulling cfddd65 on TommyLike:feature/volume_type_create into 955c2f5 on gophercloud:master.

@TommyLike TommyLike force-pushed the feature/volume_type_create branch from cfddd65 to dba49d3 Compare December 6, 2017 02:04
@coveralls
Copy link
Copy Markdown

coveralls commented Dec 6, 2017

Coverage Status

Coverage increased (+0.04%) to 72.798% when pulling dba49d3 on TommyLike:feature/volume_type_create into 955c2f5 on gophercloud:master.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Dec 6, 2017

@dklyle
Copy link
Copy Markdown
Contributor

dklyle commented Dec 13, 2017

@TommyLike, thanks for splitting this up into the individual CRUD components. Could you also link to the source code of the API as well. API docs are not always complete or accurate. I have found from experience that there are aspects of the API implementation that can be overlooked by just relying on the public documentation. I would like to review these PRs but more complete code linking would help tremendously. Thank you. From a first run through, the code looks to be in good shape.

@jtopjian
Copy link
Copy Markdown
Contributor

@TommyLike I agree with @dklyle here. I just merged #657 so this PR will also need rebased to account for the changes.

I suggest not rebasing the Update and Delete PRs yet. Let's work on these one at a time.

Get/List is usually the biggest PR in a CRUD set, so the rest of these should be more small and easier :)

@TommyLike TommyLike force-pushed the feature/volume_type_create branch from dba49d3 to 0826245 Compare December 14, 2017 02:12
@coveralls
Copy link
Copy Markdown

coveralls commented Dec 14, 2017

Coverage Status

Coverage increased (+0.01%) to 72.805% when pulling 0826245 on TommyLike:feature/volume_type_create into f85e7c0 on gophercloud:master.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Dec 14, 2017

@TommyLike TommyLike force-pushed the feature/volume_type_create branch from 0826245 to ed90ba5 Compare December 14, 2017 02:38
@coveralls
Copy link
Copy Markdown

coveralls commented Dec 14, 2017

Coverage Status

Coverage increased (+0.01%) to 72.805% when pulling ed90ba5 on TommyLike:feature/volume_type_create into 92fb632 on gophercloud:master.

@TommyLike TommyLike force-pushed the feature/volume_type_create branch from ed90ba5 to 5f0568f Compare December 14, 2017 02:42
@coveralls
Copy link
Copy Markdown

coveralls commented Dec 14, 2017

Coverage Status

Coverage increased (+0.01%) to 72.805% when pulling 5f0568f on TommyLike:feature/volume_type_create into 92fb632 on gophercloud:master.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Dec 14, 2017

@TommyLike
Copy link
Copy Markdown
Contributor Author

TommyLike commented Dec 15, 2017

@jtopjian done!

@jtopjian
Copy link
Copy Markdown
Contributor

@dklyle Would you like to do a review of this?

@dklyle
Copy link
Copy Markdown
Contributor

dklyle commented Dec 15, 2017

@jtopjian yes, working on it now.

Copy link
Copy Markdown
Contributor

@dklyle dklyle left a comment

Choose a reason for hiding this comment

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

This looks very good. There is one missing option to create that should be added before merging this.

I also wonder about acceptance tests for this functionality. I looked and noticed there are no blockstorage/v3 acceptance tests yet. I'm unsure if there is a technical limitation as to why those are not there. I'm sure @jtopjian would know the answer. If not, it would be nice to start building those out as well.

Description string `json:"description,omitempty"`
// the ID of the existing volume snapshot
PublicAccess bool `json:"os-volume-type-access:is_public"`
}
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.

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.

Looking a little further, following the trail down. It looks like the extra specs get stored in a separate table as part of the process https://github.com/openstack/cinder/blob/master/cinder/db/sqlalchemy/api.py#L3474 with the model being https://github.com/openstack/cinder/blob/master/cinder/db/sqlalchemy/models.py#L478

But it just comes through this API as a dict of key:value pairs.

@jtopjian
Copy link
Copy Markdown
Contributor

jtopjian commented Dec 16, 2017

also wonder about acceptance tests for this functionality. I looked and noticed there are no blockstorage/v3 acceptance tests yet. I'm unsure if there is a technical limitation as to why those are not there. I'm sure @jtopjian would know the answer. If not, it would be nice to start building those out as well.

There's no limitation. I've been lenient with acceptance tests but I think we should start requiring them for feature additions like this. There's a bit of a learning curve to getting an environment up and running and such, but there's enough documentation now to start enforcing it. Fixing a bug or small single-field patches might be ok to let slide.

I have a test for Volume Type get/list which I'll commit now so this PR can add to it. @TommyLike once #675 is merged, can you rebase with master to add a TestVolumeTypesCRUD test which only implements "create"? Update and Delete can be added with those respective PRs. Look at the existing v2 acceptance test for common patterns.

Technically all other v2 acceptance tests can be copied to v3 as well at some point.

edit: If you need to set up an environment for acceptance testing, see the documentation here.

Add Create/Delete/List/Update/Get support for volume
type in volume V3.
@TommyLike
Copy link
Copy Markdown
Contributor Author

@jtopjian @dklyle does it matter if we only create the resource in the test and not delete it?

@jtopjian
Copy link
Copy Markdown
Contributor

@TommyLike Yep, that's totally fine. For now, the test will create the type but not delete it. When you work on the Delete PR, you can modify the acceptance test to perform the delete. :)

Add create API in V3's volume type resource
@TommyLike TommyLike force-pushed the feature/volume_type_create branch from 5f0568f to db19781 Compare December 19, 2017 01:55
@coveralls
Copy link
Copy Markdown

coveralls commented Dec 19, 2017

Coverage Status

Coverage increased (+0.01%) to 72.805% when pulling db19781 on TommyLike:feature/volume_type_create into caa74f7 on gophercloud:master.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Dec 19, 2017

@TommyLike
Copy link
Copy Markdown
Contributor Author

@jtopjian @dklyle done!

Copy link
Copy Markdown
Contributor

@dklyle dklyle left a comment

Choose a reason for hiding this comment

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

Thanks @TommyLike, this looks good now.

@jtopjian
Copy link
Copy Markdown
Contributor

All looks good. @TommyLike thank you for your work on this. @dklyle thank you for reviewing.

@jtopjian jtopjian merged commit 22c7abc into gophercloud:master Dec 19, 2017
cardoe pushed a commit to cardoe/gophercloud that referenced this pull request Aug 27, 2020
…hanged (gophercloud#654)

* Manila: recreate share resource, when the region is changed

* Manila: recreate share access resource, when the region is changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants