Skip to content
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

Datastores : Get datastore in maintenance mode #113

Open
kairel opened this issue Sep 22, 2017 · 1 comment
Open

Datastores : Get datastore in maintenance mode #113

kairel opened this issue Sep 22, 2017 · 1 comment

Comments

@kairel
Copy link

kairel commented Sep 22, 2017

Hi,

i try to check datastores that are in maintenance mode , but no field in datastore is present.
I've add it in list_datastores

def datastore_attributes datastore, datacenter
          {
            :id          => managed_obj_id(datastore),
            :name        => datastore.name,
            :accessible  => datastore.summary.accessible,
            :type        => datastore.summary.type,
            :freespace   => datastore.summary.freeSpace,
            :capacity    => datastore.summary.capacity,
            :uncommitted => datastore.summary.uncommitted,
            :datacenter  => datacenter,
            :maintenance_mode => datastore.summary.maintenanceMode,
          }
end

I don't know if it's the best way for implement it ?

Michael

@derekmwright
Copy link
Contributor

So, I'm not sure at the "fog" level if there is standardization across provider types to present specific attributes. If there isn't and each provider can implement whatever attributes they want, then I'd vote to do something similar but maybe just call the attribute maintenance and return a boolean. This would also be handy for host models as well. This would allow for the idiomatic method of is_maintenance? to be easily implemented and make sense in context of the attribute name.

Another options is to consider a details hash that can return arbitrary data to keep the top level attributes list smaller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants