module Deltacloud

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Constants

API_VERSION

Public Class Methods

[](frontend=:deltacloud) click to toggle source
# File lib/deltacloud_rack.rb, line 34
def self.[](frontend=:deltacloud)
  config[frontend.to_sym]
end
collection_names() click to toggle source
# File lib/deltacloud/collections.rb, line 21
def self.collection_names
  @collections.map { |c| c.collection_name }
end
collections() click to toggle source
# File lib/deltacloud/collections.rb, line 25
def self.collections
  @collections ||= []
end
config() click to toggle source
# File lib/deltacloud_rack.rb, line 24
def self.config
  @config ||= {}
end
configure(frontend=:deltacloud, &block) click to toggle source
# File lib/deltacloud_rack.rb, line 28
def self.configure(frontend=:deltacloud, &block)
  frontend = frontend.to_sym
  config[frontend] ||= Server.new(frontend, &block)
  self
end
default_frontend(frontend=nil) click to toggle source
# File lib/deltacloud_rack.rb, line 53
def self.default_frontend(frontend=nil)
  @default_frontend = frontend unless frontend.nil?
  raise "Could not determine default API frontend" if @default_frontend.nil? and !config[:deltacloud]
  @default_frontend || config[:deltacloud]
end
drivers() click to toggle source
# File lib/deltacloud/api.rb, line 71
def self.drivers
  Drivers.driver_config
end
enabled_frontends() click to toggle source
# File lib/deltacloud_rack.rb, line 45
def self.enabled_frontends
  @config.keys.select { |k| frontend_required?(k) }.map { |f| Deltacloud[f] }
end
frontend_required?(frontend) click to toggle source
# File lib/deltacloud_rack.rb, line 49
def self.frontend_required?(frontend)
  true unless Deltacloud[frontend].klass.kind_of? String
end
new(driver_name, opts={}, &block) click to toggle source
# File lib/deltacloud/api.rb, line 127
def self.new(driver_name, opts={}, &block)
  Library.new(driver_name, opts, &block)
end
require_frontend!(frontend=:deltacloud) click to toggle source
# File lib/deltacloud_rack.rb, line 38
def self.require_frontend!(frontend=:deltacloud)
  frontend = frontend.to_sym
  return false if frontend_required?(frontend)
  require_relative File.join(frontend.to_s, 'server.rb')
  Deltacloud[frontend].klass eval('::'+Deltacloud[frontend].klass)
end