Module: Nucleus::Adapters::V1::OpenshiftV2::Regions

Included in:
Nucleus::Adapters::V1::OpenshiftV2
Defined in:
lib/nucleus/adapters/v1/openshift_v2/regions.rb

Instance Method Summary collapse

Instance Method Details

#region(region_name) ⇒ Object

See Also:



16
17
18
19
20
21
# File 'lib/nucleus/adapters/v1/openshift_v2/regions.rb', line 16

def region(region_name)
  region = convert_region(region_name)
  fail Errors::AdapterResourceNotFoundError,
       "Region '#{region_name}' does not exist at the endpoint" if region.nil?
  region
end

#regionsObject

See Also:



7
8
9
10
11
12
13
# File 'lib/nucleus/adapters/v1/openshift_v2/regions.rb', line 7

def regions
  response = get('/regions').body[:data]
  response.each { |region| to_nucleus_region(region) }
  # filter all non-available regions

  response.delete_if { |region| region[:allow_selection] == false }
  response
end