-
Notifications
You must be signed in to change notification settings - Fork 898
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
Volume backup restore, delete. #15891
Volume backup restore, delete. #15891
Conversation
85a89d0
to
b525ab3
Compare
955921b
to
71cac58
Compare
Code looks good to me. |
71cac58
to
7efef31
Compare
app/models/cloud_volume_backup.rb
Outdated
|
||
acts_as_miq_taggable | ||
|
||
belongs_to :ext_management_system, :foreign_key => :ems_id, :class_name => "ExtManagementSystem" | ||
belongs_to :availability_zone | ||
belongs_to :cloud_volume | ||
has_one :cloud_tenant, :through => :cloud_volume | ||
|
||
def backup_restore_queue(userid, volumeid) |
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.
If this method is on CloudVolumeBackup
then I think just restore_queue
would be a better method, backup_restore_queue
is redundant.
app/models/cloud_volume_backup.rb
Outdated
MiqTask.generic_action_with_callback(task_opts, queue_opts) | ||
end | ||
|
||
def delete_backup |
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.
Same
@alexander-demichev just some nits on the method names but looks good overall |
774fcc3
to
45a8442
Compare
@agrare Thank you for review! Does it look better now? |
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.
Just a few more consistency changes then I'm 👍 with this
app/models/cloud_volume_backup.rb
Outdated
end | ||
|
||
def restore(volume) | ||
raw_backup_restore(volume) |
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 you change this to raw_restore
?
app/models/cloud_volume_backup.rb
Outdated
end | ||
|
||
def delete | ||
raw_delete_backup |
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.
raw_delete
app/models/cloud_volume_backup.rb
Outdated
raw_delete_backup | ||
end | ||
|
||
def raw_delete_backup |
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.
raw_delete
- :name: Restore Backup | ||
:description: Restore Backup to Volume | ||
:feature_type: control | ||
:identifier: cloud_volume_backup_restore_to_volume |
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.
How about cloud_volume_backup_restore
?
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.
@agrare identifiers should be unique and cloud_volume_backup_restore
is already there
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.
Ah okay 👍
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.
Hm is that feature used anywhere? It sounds like exactly what this does just defined on CloudVolume
but I don't see any restore methods on CloudVolume
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.
@agrare if you mean cloud_volume_backup_restore_to_volume
, then it`s used here ManageIQ/manageiq-ui-classic#2037
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.
Probably, I need a better name for this feature.
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.
@alexander-demichev actually I was wondering if cloud_volume_backup_restore
could be removed from CloudVolume
and moved here?
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.
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.
Alright maybe we can refactor this later to use this instead?
45a8442
to
f8b8535
Compare
Checked commits alexander-demicev/manageiq@6ebb1ee~...f8b8535 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.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.
I'm good with this, I think we should move usage of CloudVolume.restore(backup_id)
to this in the future
@agrare Thank you! |
Add cloud volume backup delete and restore actions.