Sha256: 81794ccfb8bbf1d28452e766bd55440ac1eab527a42aecbae312339fbb152d88

Contents?: true

Size: 1.31 KB

Versions: 1

Compression:

Stored size: 1.31 KB

Contents

module Fog
  module Resources
    class AzureRM
      class Real
        def list_resource_groups
          begin
            promise = @rmc.resource_groups.list
            result = promise.value!
            result.body.next_link = ''
            Azure::ARM::Resources::Models::ResourceGroupListResult.serialize_object(result.body)['value']
          rescue  MsRestAzure::AzureOperationError => e
            msg = "Exception listing Resource Groups. #{e.body['error']['message']}"
            raise msg
          end
        end
      end

      class Mock
        def list_resource_groups
          [
            {
              "location"=>"westus",
              "id"=>"/subscriptions/########-####-####-####-############/resourceGroups/Fog_test_rg",
              "name"=>"Fog_test_rg",
              "properties"=>
                {
                  "provisioningState"=>"Succeeded"
                }
            },
            {
              "location"=>"westus",
              "id"=>"/subscriptions/########-####-####-####-############/resourceGroups/Fog_test_rg1",
              "name"=>"Fog_test_rg1",
              "properties"=>
                {
                  "provisioningState"=>"Succeeded"
                }
            }
          ]
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.2 lib/fog/azurerm/requests/resources/list_resource_groups.rb