Skip to content

Instantly share code, notes, and snippets.

@wchrisjohnson
Forked from elight/identity.rb
Created March 20, 2014 16:19

Revisions

  1. Evan Light renamed this gist Mar 20, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. Evan Light created this gist Mar 20, 2014.
    35 changes: 35 additions & 0 deletions rackspace.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    require "fog/openstack/rackspace/version"

    module Fog
    module Openstack
    module Rackspace
    class Identity < Fog::Service
    US_ENDPOINT = 'https://identity.api.rackspacecloud.com/v2.0'
    UK_ENDPOINT = 'https://lon.identity.api.rackspacecloud.com/v2.0'

    requires :rackspace_username, :rackspace_api_key
    recognizes :rackspace_auth_url, :rackspace_region

    model_path 'fog/rackspace/models/identity'
    model :user
    collection :users
    model :role
    collection :roles
    model :credential
    collection :credentials
    model :tenant
    collection :tenants
    model :service_catalog

    def initialize(options = {})
    options[:authenticator] ||= RackspaceAuthenticator
    @osc_identity = Fog::OpenStackCommon::Identity.new(options)
    end

    def method_missing(method, *args)
    @osc_identity.send(method, *args)
    end
    end
    end
    end
    end