Sha256: c0be987d3707437d3c87cab48630a53a86a230a5517705bfb7559daa5c8aae64

Contents?: true

Size: 1.12 KB

Versions: 19

Compression:

Stored size: 1.12 KB

Contents

#
# Author:: Chef Partner Engineering (<partnereng@chef.io>)
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

module Vra
  class Resources
    attr_reader :client

    def initialize(client)
      @client = client
    end

    def all_resources
      resources = []

      items = client.http_get_paginated_array!('/catalog-service/api/consumer/resources')
      items.each do |item|
        resources << Vra::Resource.new(client, data: item)
      end

      resources
    end

    def by_id(id)
      Vra::Resource.new(client, id: id)
    end
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
vmware-vra-2.0.0 lib/vra/resources.rb
vmware-vra-2.0.0.pre2 lib/vra/resources.rb
vmware-vra-2.0.0.pre1 lib/vra/resources.rb
vmware-vra-1.7.0 lib/vra/resources.rb
vmware-vra-1.6.1 lib/vra/resources.rb
vmware-vra-1.6.0 lib/vra/resources.rb
vmware-vra-1.5.4 lib/vra/resources.rb
vmware-vra-1.5.3 lib/vra/resources.rb
vra-restapi-1.5.2 lib/vra-restapi/resources.rb
vmware-vra-1.5.2 lib/vra/resources.rb
vmware-vra-1.5.1 lib/vra/resources.rb
vmware-vra-1.5.0 lib/vra/resources.rb
vmware-vra-1.4.0 lib/vra/resources.rb
vmware-vra-1.3.0 lib/vra/resources.rb
vmware-vra-1.2.0 lib/vra/resources.rb
vmware-vra-1.1.0 lib/vra/resources.rb
vmware-vra-1.0.0 lib/vra/resources.rb
vmware-vra-1.0.0.rc2 lib/vra/resources.rb
vmware-vra-1.0.0.rc1 lib/vra/resources.rb