-
Notifications
You must be signed in to change notification settings - Fork 355
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
DB models and API changes for host mapping #606
DB models and API changes for host mapping #606
Conversation
Codecov Report
@@ Coverage Diff @@
## host_mapping #606 +/- ##
================================================
- Coverage 72.13% 69.40% -2.74%
================================================
Files 141 144 +3
Lines 12211 13795 +1584
Branches 1446 1653 +207
================================================
+ Hits 8809 9575 +766
- Misses 2909 3688 +779
- Partials 493 532 +39
|
@NajmudheenCT @wisererik @kumarashit @joseph-v @AmitRoushan , pls help to review |
delfin/db/api.py
Outdated
@@ -841,3 +841,491 @@ def failed_task_delete_by_storage(context, storage_id): | |||
does not exist. | |||
""" | |||
return IMPL.failed_task_delete_by_storage(context, storage_id) | |||
|
|||
|
|||
def storage_initiators_create(context, values): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use just initiators
instead of storage_initiators
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
return IMPL.storage_hosts_delete(context, values) | ||
|
||
|
||
def storage_hosts_get(context, storage_host_id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
storage_hosts -> hosts ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This need not change
delfin/db/sqlalchemy/models.py
Outdated
name = Column(String(255)) | ||
description = Column(String(255)) | ||
os_type = Column(String(255)) | ||
storage_host_initiators = Column(Text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may not require as we keep host relation in initiator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Pls help to review @wisererik @kumarashit @joseph-v @AmitRoushan @ThisIsClark |
e848aeb
to
ee96751
Compare
ee96751
to
cdf299b
Compare
delfin/exception.py
Outdated
@@ -170,6 +170,42 @@ class VolumeNotFound(NotFound): | |||
msg_fmt = _("Volume {0} could not be found.") | |||
|
|||
|
|||
class StorageHostInitiatorNotFound(NotFound): | |||
msg_fmt = _("Storage host initiator{0} could not be found.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initiator{0}
should be initiator {0}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Updated for the comments |
a0f7e35
to
8551547
Compare
delfin/exception.py
Outdated
|
||
|
||
class VolumeGroupNotFound(NotFound): | ||
msg_fmt = _("Port group {0} could not be found.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msg_fmt
is same as PortGroupNotFound
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
8551547
to
e9b570d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
delfin/db/api.py
Outdated
host_grp_host_relation_id) | ||
|
||
|
||
def storage_host_grp_host_relations_get_all(context, marker=None, limit=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets use table name as suffix for all operations storage_host_grp_host_rels_get_all ? applicable for all group relation related APS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
e9b570d
to
f63c741
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
delfin/db/sqlalchemy/models.py
Outdated
native_storage_host_id = Column(String(255)) | ||
storage_host_initiators = Column(Text) | ||
volumes = Column(Text) | ||
ports = Column(Text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confused about the below defintion, can you explain it
storage_host_initiators = Column(Text)
volumes = Column(Text)
ports = Column(Text)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d428879
to
80b2563
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What this PR does / why we need it:
This PR adds DB APIs and models for host mapping models
Feature Design doc for reference:
RequirementsDesignSpec_HostMapping.docx
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #Special notes for your reviewer:
UT scripts to be added to this PR
Currently fake values are random values without any relation just to verify db operations
Test report
DB Tables
DB Table Entries
Release note: