Module: Deltacloud::Client

Extended by:
Methods::BackwardCompatibility::ClassMethods
Defined in:
lib/deltacloud/client/base_error.rb,
lib/deltacloud/client.rb,
lib/deltacloud/client/connection.rb,
lib/deltacloud/client/models/key.rb,
lib/deltacloud/client/methods/api.rb,
lib/deltacloud/client/methods/key.rb,
lib/deltacloud/client/models/base.rb,
lib/deltacloud/client/models/blob.rb,
lib/deltacloud/client/methods/blob.rb,
lib/deltacloud/client/models/image.rb,
lib/deltacloud/client/models/realm.rb,
lib/deltacloud/client/methods/image.rb,
lib/deltacloud/client/methods/realm.rb,
lib/deltacloud/client/models/bucket.rb,
lib/deltacloud/client/models/driver.rb,
lib/deltacloud/client/models/metric.rb,
lib/deltacloud/client/methods/bucket.rb,
lib/deltacloud/client/methods/common.rb,
lib/deltacloud/client/methods/driver.rb,
lib/deltacloud/client/methods/metric.rb,
lib/deltacloud/client/models/address.rb,
lib/deltacloud/client/methods/address.rb,
lib/deltacloud/client/models/firewall.rb,
lib/deltacloud/client/models/instance.rb,
lib/deltacloud/client/methods/firewall.rb,
lib/deltacloud/client/methods/instance.rb,
lib/deltacloud/client/helpers/xml_helper.rb,
lib/deltacloud/client/helpers/model_helper.rb,
lib/deltacloud/client/models/load_balancer.rb,
lib/deltacloud/client/methods/load_balancer.rb,
lib/deltacloud/client/models/instance_state.rb,
lib/deltacloud/client/models/storage_volume.rb,
lib/deltacloud/client/methods/instance_state.rb,
lib/deltacloud/client/methods/storage_volume.rb,
lib/deltacloud/client/helpers/property_helper.rb,
lib/deltacloud/client/models/hardware_profile.rb,
lib/deltacloud/client/models/instance_address.rb,
lib/deltacloud/client/models/storage_snapshot.rb,
lib/deltacloud/client/methods/hardware_profile.rb,
lib/deltacloud/client/methods/storage_snapshot.rb,
lib/deltacloud/client/methods/backward_compatiblity.rb

Overview

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.

Defined Under Namespace

Modules: Helpers, Methods Classes: Address, AuthenticationError, BackendError, Base, BaseError, Blob, Bucket, ClientFailure, Connection, Driver, Error, Firewall, HardwareProfile, Image, IncompatibleHardwareProfile, Instance, InstanceAddress, InstanceState, InvalidState, Key, LoadBalancer, Metric, NotFound, NotSupported, Realm, ServerError, StorageSnapshot, StorageVolume

Constant Summary collapse

VERSION =
'1.1.2'

Class Method Summary collapse

Methods included from Methods::BackwardCompatibility::ClassMethods

valid_credentials?

Class Method Details

.valid_connection?(api_url) ⇒ Boolean

Check if the connection to Deltacloud API is valid

Returns:

  • (Boolean)


60
61
62
63
64
65
66
67
68
# File 'lib/deltacloud/client.rb', line 60

def self.valid_connection?(api_url)
  begin
    Deltacloud::Client(api_url, '', '') && true
  rescue Faraday::Error::ConnectionFailed
    false
  rescue Deltacloud::Client::AuthenticationError
    false
  end
end