Closed rtrox closed 8 years ago
@jrperritt I think this is ready for review, would you mind taking a look?
I should add, these features are being implemented in preparation for a PR to rack cli to allow admin functions by Rackspace admins. Thanks for looking!
Great, I'll take a look tomorrow.
Thanks for the feedback @jrperritt !
I've addressed the line comment concerns by adding the following validation:
if opts.Name == "" {
return nil, fmt.Errorf("CreateBackupOpts.Name cannot be blank.")
}
if opts.BackupType == "" {
return nil, fmt.Errorf("CreateBackupOpts.BackupType cannot be blank.")
}
if opts.Rotation < 0 {
return nil, fmt.Errorf("CreateBackupOpts.Rotation must 0 or greater.")
}
backup["name"] = opts.Name
backup["backup_type"] = opts.BackupType
backup["rotation"] = opts.Rotation
As I mentioned in my line comment, the rotation parameter can be zero according to the openstack unit-tests, but I added validation to ensure a non negative value (this is also in line with upstream validation).
I believe that means I am once more ready for review, would you mind taking another look?
LGTM. +2
This PR adds all available admin actions to the "adminactions" extension.
API Docs for these functions are available here: http://developer.openstack.org/api-ref-compute-v2.1.html#os-admin-actions-v2.1
The actions added are: