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

document usage #35

Open
abellotti opened this issue Sep 9, 2016 · 2 comments
Open

document usage #35

abellotti opened this issue Sep 9, 2016 · 2 comments

Comments

@abellotti
Copy link
Member

once the dust settles and we have a good percentage of the API working, the main README should be updated and possibly another file with more examples.

@b-long
Copy link

b-long commented Jun 19, 2017

@abellotti @Fryguy I'd like to help out with this issue.

I've used the REST interface to provision and delete all types of VMs in Ruby, but now I want to develop better control & understanding using the Ruby API. Here's the sort of thing I've managed to do so far:

miq_client = ManageIQ::API::Client.new(
  url: @auth_config.url,
  user: @auth_config.user,
  password: @auth_config.password
)

result_set = miq_client.vms.where(name: 'my-vm*')
@logger.info("Number of instances created by me: #{result_set.count}")
@logger.debug('Instances created by me')
result_set.each do |vm|
  @logger.debug("VM: #{vm}")
end

I don't have a deep ruby background, so excuse my ignorance. Could you tell me for starters how I can find other data or collections that are accessible?

Can I manipulate ManageIQ::API::Client::Collection::Users or inspect objects like ManageIQ::Providers::Amazon::CloudManager::Vm?

@b-long
Copy link

b-long commented Jun 23, 2017

Assume I'm starting from scratch, what is the current method to get the collection of type ManageIQ::Providers::Amazon::CloudManager::Vm ? Sorry if my rails / Ruby vocabulary is incorrect.

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

4 participants