Sha256: 0c214169832e097a37c45d323f858ca3515b2ff267dc703d2b3ce281d1822ebd

Contents?: true

Size: 895 Bytes

Versions: 45

Compression:

Stored size: 895 Bytes

Contents

# OpenStack Planning Service (Tuskar) Example

require 'fog/openstack'
require 'pp'

auth_url = "https://example.net/v2.0/tokens"
username = 'admin@example.net'
password = 'secret'
tenant   = 'My Compute Tenant' # String

planning ||= ::Fog::OpenStack.new(
  :service            => :planning,
  :openstack_api_key  => password,
  :openstack_username => username,
  :openstack_auth_url => auth_url,
  :openstack_tenant   => tenant
)

pp planning

#
# Listing of Tuskar roles
#
roles = planning.roles.each do |role|
  pp role
end

#
# Listing of Tuskar plans
#
plans = planning.plans.each do |plan|
  pp plan
end

#
# Creating new Tuskar plan
#
plan = planning.plans.new({
  :name        => 'New Plan Name',
  :description => 'New Plan Description'
})
pp plan

#
# Assign role to plan
#
role_uuid = roles.first.uuid
plan.add_role(role_uuid)

#
# Output Heat templates for plan
#
pp plan.templates

Version data entries

45 entries across 43 versions & 5 rubygems

Version Path
fog-openstack-1.1.3 examples/planning/basics.rb
fog-openstack-1.1.2 examples/planning/basics.rb
fog-openstack-fork-99 examples/planning/basics.rb
fog-openstack-1.1.0 examples/planning/basics.rb
fog-openstack-1.1.0.pre examples/planning/basics.rb
fog-openstack-apibank-1.0.102 examples/planning/basics.rb
fog-openstack-1.0.11 examples/planning/basics.rb
fog-openstack-apibank-1.0.101 examples/planning/basics.rb
fog-openstack-1.0.10 examples/planning/basics.rb
fog-openstack-1.0.9 examples/planning/basics.rb
fog-openstack-0.1.31 examples/planning/basics.rb
fog-openstack-0.3.10 examples/planning/basics.rb
fog-openstack-1.0.8 examples/planning/basics.rb
fog-openstack-0.1.30 examples/planning/basics.rb
fog-openstack-1.0.7 examples/planning/basics.rb
fog-openstack-0.1.29 examples/planning/basics.rb
fog-openstack-0.3.9 examples/planning/basics.rb
fog-openstack-1.0.6 examples/planning/basics.rb
fog-openstack-0.1.28 examples/planning/basics.rb
fog-openstack-1.0.5 examples/planning/basics.rb