Class: Fog::OpenStack::Planning::Real

Inherits:
Object
  • Object
show all
Includes:
Core
Defined in:
lib/fog/openstack/planning.rb,
lib/fog/openstack/planning/requests/get_plan.rb,
lib/fog/openstack/planning/requests/list_plans.rb,
lib/fog/openstack/planning/requests/list_roles.rb,
lib/fog/openstack/planning/requests/patch_plan.rb,
lib/fog/openstack/planning/requests/create_plan.rb,
lib/fog/openstack/planning/requests/delete_plan.rb,
lib/fog/openstack/planning/requests/add_role_to_plan.rb,
lib/fog/openstack/planning/requests/get_plan_templates.rb,
lib/fog/openstack/planning/requests/remove_role_from_plan.rb

Instance Attribute Summary

Attributes included from Core

#auth_token, #auth_token_expiration, #current_tenant, #current_user, #current_user_id, #openstack_cache_ttl, #openstack_domain_id, #openstack_domain_name, #openstack_identity_api_version, #openstack_project_domain, #openstack_project_domain_id, #openstack_project_id, #openstack_user_domain, #openstack_user_domain_id, #unscoped_token

Instance Method Summary collapse

Methods included from Core

#credentials, #initialize, not_found_class, #reload

Instance Method Details

#add_role_to_plan(plan_uuid, role_uuid) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/fog/openstack/planning/requests/add_role_to_plan.rb', line 5

def add_role_to_plan(plan_uuid, role_uuid)
  request(
    :expects => [201],
    :method  => 'POST',
    :path    => "plans/#{plan_uuid}/roles",
    :body    => Fog::JSON.encode('uuid' => role_uuid)
  )
end

#create_plan(parameters) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/fog/openstack/planning/requests/create_plan.rb', line 5

def create_plan(parameters)
  request(
    :expects => [201],
    :method  => 'POST',
    :path    => "plans",
    :body    => Fog::JSON.encode(parameters)
  )
end

#default_endpoint_typeObject



98
99
100
# File 'lib/fog/openstack/planning.rb', line 98

def default_endpoint_type
  'admin'
end

#default_path_prefixObject



102
103
104
# File 'lib/fog/openstack/planning.rb', line 102

def default_path_prefix
  'v2'
end

#default_service_typeObject



106
107
108
# File 'lib/fog/openstack/planning.rb', line 106

def default_service_type
  %w[management]
end

#delete_plan(plan_uuid) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/fog/openstack/planning/requests/delete_plan.rb', line 5

def delete_plan(plan_uuid)
  request(
    :expects => [204],
    :method  => 'DELETE',
    :path    => "plans/#{plan_uuid}"
  )
end

#get_plan(plan_uuid) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/fog/openstack/planning/requests/get_plan.rb', line 5

def get_plan(plan_uuid)
  request(
    :expects => [200, 204],
    :method  => 'GET',
    :path    => "plans/#{plan_uuid}"
  )
end

#get_plan_templates(plan_uuid) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/fog/openstack/planning/requests/get_plan_templates.rb', line 5

def get_plan_templates(plan_uuid)
  request(
    :expects => [200, 204],
    :method  => 'GET',
    :path    => "plans/#{plan_uuid}/templates"
  )
end

#list_plans(options = {}) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/fog/openstack/planning/requests/list_plans.rb', line 5

def list_plans(options = {})
  request(
    :expects => [200, 204],
    :method  => 'GET',
    :path    => 'plans',
    :query   => options
  )
end

#list_roles(options = {}) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/fog/openstack/planning/requests/list_roles.rb', line 5

def list_roles(options = {})
  request(
    :expects => [200, 204],
    :method  => 'GET',
    :path    => 'roles',
    :query   => options
  )
end

#patch_plan(plan_uuid, parameters) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/fog/openstack/planning/requests/patch_plan.rb', line 5

def patch_plan(plan_uuid, parameters)
  request(
    :expects => [201],
    :method  => 'PATCH',
    :path    => "plans/#{plan_uuid}",
    :body    => Fog::JSON.encode(parameters)
  )
end

#remove_role_from_plan(plan_uuid, role_uuid) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/fog/openstack/planning/requests/remove_role_from_plan.rb', line 5

def remove_role_from_plan(plan_uuid, role_uuid)
  request(
    :expects => [200],
    :method  => 'DELETE',
    :path    => "plans/#{plan_uuid}/roles/#{role_uuid}"
  )
end