mirror of
https://github.com/inspec/inspec
synced 2024-12-25 04:23:15 +00:00
9c9bb27540
Signed-off-by: Russell Seymour <russell.seymour@turtlesystems.co.uk>
23 lines
502 B
Ruby
23 lines
502 B
Ruby
|
|
require 'azure_mgmt_resources'
|
|
|
|
class ResourceGroups
|
|
attr_reader :client
|
|
|
|
def initialize(azure)
|
|
@client = Azure::ARM::Resources::ResourceManagementClient.new(azure.connection)
|
|
client.subscription_id = azure.subscription_id
|
|
end
|
|
|
|
def exists(name)
|
|
client.resource_groups.check_existence(name)
|
|
end
|
|
|
|
def get(name)
|
|
client.resource_groups.get(name) if exists(name)
|
|
end
|
|
|
|
def get_resources(name)
|
|
client.resource_groups.list_resources_as_lazy(name) if exists(name)
|
|
end
|
|
end
|