Sha256: 81ea5edff82ddead28dcacb94ad3593da40780ea54f422e28206c3f3ab8fb26a

Contents?: true

Size: 612 Bytes

Versions: 11

Compression:

Stored size: 612 Bytes

Contents

module Yao::Resources
  class Project < Base
    friendly_attributes :id, :name, :description, :enabled, :parent_id, :domain_id
    alias :enabled? :enabled

    self.service        = "identity"
    self.resource_name  = "project"
    self.resources_name = "projects"
    self.admin          = true

    def domain?
      @data["is_domain"]
    end

    def servers
      @servers ||= Yao::Server.list(all_tenants: 1, project_id: id)
    end

    def ports
      @ports ||= Yao::Port.list(tenant_id: id)
    end

    class << self
      def accessible
        as_member { self.list }
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
yao-0.13.4 lib/yao/resources/project.rb
yao-0.13.3 lib/yao/resources/project.rb
yao-0.13.2 lib/yao/resources/project.rb
yao-0.13.1 lib/yao/resources/project.rb
yao-0.13.0 lib/yao/resources/project.rb
yao-0.12.0 lib/yao/resources/project.rb
yao-0.11.3 lib/yao/resources/project.rb
yao-0.11.2 lib/yao/resources/project.rb
yao-0.11.1 lib/yao/resources/project.rb
yao-0.11.0 lib/yao/resources/project.rb
yao-0.10.1 lib/yao/resources/project.rb