Module: Fog

Defined in:
lib/fog/local/models/directory.rb,
lib/fog.rb,
lib/fog/aws.rb,
lib/fog/bin.rb,
lib/fog/ssh.rb,
lib/fog/hmac.rb,
lib/fog/local.rb,
lib/fog/model.rb,
lib/fog/aws/s3.rb,
lib/fog/errors.rb,
lib/fog/parser.rb,
lib/fog/parser.rb,
lib/fog/vcloud.rb,
lib/fog/aws/ec2.rb,
lib/fog/aws/elb.rb,
lib/fog/bluebox.rb,
lib/fog/service.rb,
lib/fog/rackspace.rb,
lib/fog/slicehost.rb,
lib/fog/terremark.rb,
lib/fog/attributes.rb,
lib/fog/collection.rb,
lib/fog/connection.rb,
lib/fog/credentials.rb,
lib/fog/deprecation.rb,
lib/fog/new_servers.rb,
lib/fog/aws/simpledb.rb,
lib/fog/vcloud/model.rb,
lib/fog/rackspace/files.rb,
lib/fog/terremark/ecloud.rb,
lib/fog/terremark/parser.rb,
lib/fog/terremark/shared.rb,
lib/fog/terremark/vcloud.rb,
lib/fog/vcloud/extension.rb,
lib/fog/local/models/file.rb,
lib/fog/rackspace/servers.rb,
lib/fog/vcloud/collection.rb,
lib/fog/vcloud/generators.rb,
lib/fog/vcloud/models/vdc.rb,
lib/fog/aws/models/s3/file.rb,
lib/fog/local/models/files.rb,
lib/fog/vcloud/models/vdcs.rb,
lib/fog/aws/models/s3/files.rb,
lib/fog/aws/models/ec2/image.rb,
lib/fog/bluebox/models/image.rb,
lib/fog/aws/models/ec2/flavor.rb,
lib/fog/aws/models/ec2/images.rb,
lib/fog/aws/models/ec2/server.rb,
lib/fog/aws/models/ec2/volume.rb,
lib/fog/aws/parsers/ec2/basic.rb,
lib/fog/bluebox/models/flavor.rb,
lib/fog/bluebox/models/images.rb,
lib/fog/bluebox/models/server.rb,
lib/fog/vcloud/requests/login.rb,
lib/fog/aws/models/ec2/address.rb,
lib/fog/aws/models/ec2/flavors.rb,
lib/fog/aws/models/ec2/servers.rb,
lib/fog/aws/models/ec2/volumes.rb,
lib/fog/bluebox/models/flavors.rb,
lib/fog/bluebox/models/servers.rb,
lib/fog/slicehost/models/image.rb,
lib/fog/aws/models/ec2/key_pair.rb,
lib/fog/aws/models/ec2/snapshot.rb,
lib/fog/aws/models/s3/directory.rb,
lib/fog/slicehost/models/flavor.rb,
lib/fog/slicehost/models/images.rb,
lib/fog/slicehost/models/server.rb,
lib/fog/vcloud/requests/get_vdc.rb,
lib/fog/vcloud/terremark/ecloud.rb,
lib/fog/vcloud/terremark/vcloud.rb,
lib/fog/aws/models/ec2/addresses.rb,
lib/fog/aws/models/ec2/key_pairs.rb,
lib/fog/aws/models/ec2/snapshots.rb,
lib/fog/local/models/directories.rb,
lib/fog/slicehost/models/flavors.rb,
lib/fog/slicehost/models/servers.rb,
lib/fog/aws/models/s3/directories.rb,
lib/fog/aws/parsers/s3/get_bucket.rb,
lib/fog/aws/parsers/s3/copy_object.rb,
lib/fog/aws/parsers/s3/get_service.rb,
lib/fog/aws/parsers/simpledb/basic.rb,
lib/fog/aws/requests/s3/get_bucket.rb,
lib/fog/aws/requests/s3/get_object.rb,
lib/fog/aws/requests/s3/put_bucket.rb,
lib/fog/aws/requests/s3/put_object.rb,
lib/fog/bluebox/requests/get_block.rb,
lib/fog/aws/parsers/simpledb/select.rb,
lib/fog/aws/requests/s3/copy_object.rb,
lib/fog/aws/requests/s3/get_service.rb,
lib/fog/aws/requests/s3/head_object.rb,
lib/fog/bluebox/requests/get_blocks.rb,
lib/fog/rackspace/models/files/file.rb,
lib/fog/slicehost/parsers/get_image.rb,
lib/fog/slicehost/parsers/get_slice.rb,
lib/fog/terremark/models/shared/vdc.rb,
lib/fog/vcloud/requests/get_network.rb,
lib/fog/aws/requests/simpledb/select.rb,
lib/fog/bluebox/requests/get_product.rb,
lib/fog/rackspace/models/files/files.rb,
lib/fog/slicehost/parsers/get_flavor.rb,
lib/fog/slicehost/parsers/get_images.rb,
lib/fog/slicehost/parsers/get_slices.rb,
lib/fog/slicehost/requests/get_image.rb,
lib/fog/slicehost/requests/get_slice.rb,
lib/fog/terremark/models/shared/task.rb,
lib/fog/terremark/models/shared/vdcs.rb,
lib/fog/vcloud/requests/get_versions.rb,
lib/fog/aws/models/ec2/security_group.rb,
lib/fog/aws/parsers/ec2/attach_volume.rb,
lib/fog/aws/parsers/ec2/create_volume.rb,
lib/fog/aws/parsers/ec2/detach_volume.rb,
lib/fog/aws/parsers/ec2/run_instances.rb,
lib/fog/aws/requests/s3/delete_bucket.rb,
lib/fog/aws/requests/s3/delete_object.rb,
lib/fog/bluebox/requests/create_block.rb,
lib/fog/bluebox/requests/get_products.rb,
lib/fog/bluebox/requests/get_template.rb,
lib/fog/bluebox/requests/reboot_block.rb,
lib/fog/slicehost/parsers/get_backups.rb,
lib/fog/slicehost/parsers/get_flavors.rb,
lib/fog/slicehost/requests/get_flavor.rb,
lib/fog/slicehost/requests/get_images.rb,
lib/fog/slicehost/requests/get_slices.rb,
lib/fog/terremark/models/shared/tasks.rb,
lib/fog/terremark/parsers/shared/task.rb,
lib/fog/terremark/parsers/shared/vapp.rb,
lib/fog/aws/models/ec2/security_groups.rb,
lib/fog/aws/requests/ec2/attach_volume.rb,
lib/fog/aws/requests/ec2/create_volume.rb,
lib/fog/aws/requests/ec2/delete_volume.rb,
lib/fog/aws/requests/ec2/detach_volume.rb,
lib/fog/aws/requests/ec2/run_instances.rb,
lib/fog/aws/requests/s3/get_bucket_acl.rb,
lib/fog/aws/requests/s3/get_object_acl.rb,
lib/fog/aws/requests/s3/get_object_url.rb,
lib/fog/aws/requests/s3/put_bucket_acl.rb,
lib/fog/aws/requests/s3/put_object_url.rb,
lib/fog/bluebox/requests/destroy_block.rb,
lib/fog/bluebox/requests/get_templates.rb,
lib/fog/rackspace/models/servers/image.rb,
lib/fog/slicehost/parsers/create_slice.rb,
lib/fog/slicehost/requests/get_backups.rb,
lib/fog/slicehost/requests/get_flavors.rb,
lib/fog/terremark/models/shared/server.rb,
lib/fog/aws/parsers/ec2/create_key_pair.rb,
lib/fog/aws/parsers/ec2/create_snapshot.rb,
lib/fog/aws/parsers/ec2/describe_images.rb,
lib/fog/new_servers/requests/add_server.rb,
lib/fog/new_servers/requests/get_server.rb,
lib/fog/new_servers/requests/list_plans.rb,
lib/fog/rackspace/models/servers/flavor.rb,
lib/fog/rackspace/models/servers/images.rb,
lib/fog/rackspace/models/servers/server.rb,
lib/fog/slicehost/requests/create_slice.rb,
lib/fog/slicehost/requests/delete_slice.rb,
lib/fog/slicehost/requests/reboot_slice.rb,
lib/fog/terremark/models/shared/address.rb,
lib/fog/terremark/models/shared/network.rb,
lib/fog/terremark/models/shared/servers.rb,
lib/fog/aws/parsers/ec2/allocate_address.rb,
lib/fog/aws/parsers/ec2/describe_regions.rb,
lib/fog/aws/parsers/ec2/describe_volumes.rb,
lib/fog/aws/requests/ec2/create_key_pair.rb,
lib/fog/aws/requests/ec2/create_snapshot.rb,
lib/fog/aws/requests/ec2/delete_key_pair.rb,
lib/fog/aws/requests/ec2/delete_snapshot.rb,
lib/fog/aws/requests/ec2/describe_images.rb,
lib/fog/aws/requests/ec2/release_address.rb,
lib/fog/new_servers/requests/list_images.rb,
lib/fog/rackspace/models/files/directory.rb,
lib/fog/rackspace/models/servers/flavors.rb,
lib/fog/rackspace/models/servers/servers.rb,
lib/fog/terremark/models/shared/networks.rb,
lib/fog/terremark/parsers/shared/get_vdc.rb,
lib/fog/terremark/parsers/shared/network.rb,
lib/fog/vcloud/requests/get_organization.rb,
lib/fog/aws/parsers/s3/get_bucket_logging.rb,
lib/fog/aws/parsers/simpledb/list_domains.rb,
lib/fog/aws/requests/ec2/allocate_address.rb,
lib/fog/aws/requests/ec2/describe_regions.rb,
lib/fog/aws/requests/ec2/describe_volumes.rb,
lib/fog/aws/requests/ec2/reboot_instances.rb,
lib/fog/new_servers/requests/list_servers.rb,
lib/fog/terremark/models/shared/addresses.rb,
lib/fog/terremark/requests/shared/get_vdc.rb,
lib/fog/vcloud/terremark/ecloud/models/ip.rb,
lib/fog/aws/parsers/ec2/describe_addresses.rb,
lib/fog/aws/parsers/ec2/describe_instances.rb,
lib/fog/aws/parsers/ec2/describe_key_pairs.rb,
lib/fog/aws/parsers/ec2/describe_snapshots.rb,
lib/fog/aws/parsers/ec2/get_console_output.rb,
lib/fog/aws/parsers/s3/access_control_list.rb,
lib/fog/aws/parsers/s3/get_bucket_location.rb,
lib/fog/aws/parsers/s3/get_request_payment.rb,
lib/fog/aws/requests/ec2/associate_address.rb,
lib/fog/aws/requests/s3/get_bucket_logging.rb,
lib/fog/aws/requests/s3/get_object_torrent.rb,
lib/fog/aws/requests/s3/put_bucket_logging.rb,
lib/fog/aws/requests/simpledb/list_domains.rb,
lib/fog/new_servers/requests/cancel_server.rb,
lib/fog/new_servers/requests/reboot_server.rb,
lib/fog/rackspace/models/files/directories.rb,
lib/fog/terremark/parsers/shared/public_ip.rb,
lib/fog/terremark/requests/shared/get_task.rb,
lib/fog/terremark/requests/shared/get_vapp.rb,
lib/fog/terremark/requests/shared/power_on.rb,
lib/fog/vcloud/terremark/ecloud/models/ips.rb,
lib/fog/vcloud/terremark/ecloud/models/vdc.rb,
lib/fog/aws/parsers/ec2/terminate_instances.rb,
lib/fog/aws/parsers/simpledb/get_attributes.rb,
lib/fog/aws/requests/ec2/describe_addresses.rb,
lib/fog/aws/requests/ec2/describe_instances.rb,
lib/fog/aws/requests/ec2/describe_key_pairs.rb,
lib/fog/aws/requests/ec2/describe_snapshots.rb,
lib/fog/aws/requests/ec2/get_console_output.rb,
lib/fog/aws/requests/s3/get_bucket_location.rb,
lib/fog/aws/requests/s3/get_request_payment.rb,
lib/fog/aws/requests/s3/put_request_payment.rb,
lib/fog/aws/requests/simpledb/create_domain.rb,
lib/fog/aws/requests/simpledb/delete_domain.rb,
lib/fog/rackspace/requests/files/get_object.rb,
lib/fog/rackspace/requests/files/put_object.rb,
lib/fog/terremark/requests/shared/power_off.rb,
lib/fog/vcloud/terremark/ecloud/models/node.rb,
lib/fog/vcloud/terremark/ecloud/models/task.rb,
lib/fog/vcloud/terremark/ecloud/models/vdcs.rb,
lib/fog/aws/parsers/elb/create_load_balancer.rb,
lib/fog/aws/parsers/elb/delete_load_balancer.rb,
lib/fog/aws/parsers/s3/get_bucket_versioning.rb,
lib/fog/aws/parsers/simpledb/domain_metadata.rb,
lib/fog/aws/requests/ec2/terminate_instances.rb,
lib/fog/aws/requests/simpledb/get_attributes.rb,
lib/fog/aws/requests/simpledb/put_attributes.rb,
lib/fog/rackspace/requests/files/head_object.rb,
lib/fog/terremark/parsers/shared/get_catalog.rb,
lib/fog/vcloud/terremark/ecloud/models/nodes.rb,
lib/fog/vcloud/terremark/ecloud/models/tasks.rb,
lib/fog/aws/requests/ec2/disassociate_address.rb,
lib/fog/aws/requests/elb/create_load_balancer.rb,
lib/fog/aws/requests/elb/delete_load_balancer.rb,
lib/fog/aws/requests/s3/get_bucket_versioning.rb,
lib/fog/aws/requests/s3/put_bucket_versioning.rb,
lib/fog/aws/requests/simpledb/domain_metadata.rb,
lib/fog/terremark/parsers/shared/node_service.rb,
lib/fog/terremark/requests/shared/delete_vapp.rb,
lib/fog/terremark/requests/shared/deploy_vapp.rb,
lib/fog/terremark/requests/shared/get_catalog.rb,
lib/fog/terremark/requests/shared/get_network.rb,
lib/fog/terremark/requests/shared/power_reset.rb,
lib/fog/vcloud/terremark/ecloud/models/server.rb,
lib/fog/aws/requests/ec2/create_security_group.rb,
lib/fog/aws/requests/ec2/delete_security_group.rb,
lib/fog/rackspace/requests/files/delete_object.rb,
lib/fog/rackspace/requests/files/get_container.rb,
lib/fog/rackspace/requests/files/put_container.rb,
lib/fog/rackspace/requests/servers/list_images.rb,
lib/fog/vcloud/terremark/ecloud/models/catalog.rb,
lib/fog/vcloud/terremark/ecloud/models/network.rb,
lib/fog/vcloud/terremark/ecloud/models/servers.rb,
lib/fog/aws/parsers/elb/describe_load_balancers.rb,
lib/fog/aws/requests/simpledb/delete_attributes.rb,
lib/fog/rackspace/requests/files/get_containers.rb,
lib/fog/rackspace/requests/files/head_container.rb,
lib/fog/rackspace/requests/servers/create_image.rb,
lib/fog/rackspace/requests/servers/delete_image.rb,
lib/fog/rackspace/requests/servers/list_flavors.rb,
lib/fog/rackspace/requests/servers/list_servers.rb,
lib/fog/terremark/parsers/shared/get_public_ips.rb,
lib/fog/terremark/parsers/shared/get_tasks_list.rb,
lib/fog/terremark/requests/shared/get_public_ip.rb,
lib/fog/vcloud/terremark/ecloud/models/networks.rb,
lib/fog/aws/parsers/ec2/describe_security_groups.rb,
lib/fog/aws/parsers/elb/describe_instance_health.rb,
lib/fog/aws/requests/ec2/modify_image_attributes.rb,
lib/fog/aws/requests/elb/describe_load_balancers.rb,
lib/fog/rackspace/requests/files/head_containers.rb,
lib/fog/rackspace/requests/servers/create_server.rb,
lib/fog/rackspace/requests/servers/delete_server.rb,
lib/fog/rackspace/requests/servers/reboot_server.rb,
lib/fog/rackspace/requests/servers/update_server.rb,
lib/fog/terremark/parsers/shared/get_network_ips.rb,
lib/fog/terremark/requests/shared/get_public_ips.rb,
lib/fog/terremark/requests/shared/get_tasks_list.rb,
lib/fog/terremark/requests/shared/power_shutdown.rb,
lib/fog/vcloud/terremark/ecloud/models/public_ip.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_vdc.rb,
lib/fog/vcloud/terremark/vcloud/requests/get_vdc.rb,
lib/fog/aws/parsers/s3/get_bucket_object_versions.rb,
lib/fog/aws/requests/ec2/describe_security_groups.rb,
lib/fog/aws/requests/elb/describe_instance_health.rb,
lib/fog/rackspace/requests/files/delete_container.rb,
lib/fog/rackspace/requests/servers/list_addresses.rb,
lib/fog/terremark/parsers/shared/get_catalog_item.rb,
lib/fog/terremark/parsers/shared/get_organization.rb,
lib/fog/terremark/parsers/shared/internet_service.rb,
lib/fog/terremark/requests/shared/get_network_ips.rb,
lib/fog/vcloud/terremark/ecloud/models/public_ips.rb,
lib/fog/vcloud/terremark/ecloud/requests/add_node.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_node.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_task.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_vapp.rb,
lib/fog/vcloud/terremark/ecloud/requests/power_on.rb,
lib/fog/aws/requests/s3/get_bucket_object_versions.rb,
lib/fog/aws/requests/simpledb/batch_put_attributes.rb,
lib/fog/terremark/parsers/shared/get_node_services.rb,
lib/fog/terremark/parsers/shared/get_organizations.rb,
lib/fog/terremark/parsers/shared/get_vapp_template.rb,
lib/fog/terremark/requests/shared/add_node_service.rb,
lib/fog/terremark/requests/shared/delete_public_ip.rb,
lib/fog/terremark/requests/shared/get_catalog_item.rb,
lib/fog/terremark/requests/shared/get_organization.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb,
lib/fog/vcloud/terremark/ecloud/requests/power_off.rb,
lib/fog/aws/parsers/ec2/describe_availability_zones.rb,
lib/fog/aws/parsers/ec2/describe_reserved_instances.rb,
lib/fog/terremark/requests/shared/get_node_services.rb,
lib/fog/terremark/requests/shared/get_organizations.rb,
lib/fog/terremark/requests/shared/get_vapp_template.rb,
lib/fog/vcloud/terremark/ecloud/models/catalog_item.rb,
lib/fog/vcloud/terremark/ecloud/models/firewall_acl.rb,
lib/fog/vcloud/terremark/ecloud/requests/clone_vapp.rb,
lib/fog/aws/requests/ec2/describe_availability_zones.rb,
lib/fog/aws/requests/ec2/describe_reserved_instances.rb,
lib/fog/rackspace/requests/servers/get_image_details.rb,
lib/fog/vcloud/terremark/ecloud/models/firewall_acls.rb,
lib/fog/vcloud/terremark/ecloud/requests/delete_node.rb,
lib/fog/vcloud/terremark/ecloud/requests/delete_vapp.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_catalog.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_network.rb,
lib/fog/vcloud/terremark/ecloud/requests/power_reset.rb,
lib/fog/rackspace/requests/servers/get_flavor_details.rb,
lib/fog/rackspace/requests/servers/get_server_details.rb,
lib/fog/rackspace/requests/servers/list_images_detail.rb,
lib/fog/terremark/requests/shared/delete_node_service.rb,
lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb,
lib/fog/rackspace/requests/servers/list_flavors_detail.rb,
lib/fog/rackspace/requests/servers/list_servers_detail.rb,
lib/fog/terremark/parsers/shared/get_internet_services.rb,
lib/fog/terremark/requests/shared/add_internet_service.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_task_list.rb,
lib/fog/terremark/requests/shared/get_internet_services.rb,
lib/fog/vcloud/terremark/ecloud/models/internet_service.rb,
lib/fog/vcloud/terremark/ecloud/requests/configure_node.rb,
lib/fog/vcloud/terremark/ecloud/requests/configure_vapp.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_network_ip.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_public_ips.rb,
lib/fog/vcloud/terremark/ecloud/requests/power_shutdown.rb,
lib/fog/rackspace/requests/servers/list_public_addresses.rb,
lib/fog/vcloud/terremark/ecloud/models/internet_services.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_network_ips.rb,
lib/fog/aws/requests/ec2/authorize_security_group_ingress.rb,
lib/fog/rackspace/requests/servers/list_private_addresses.rb,
lib/fog/terremark/requests/shared/create_internet_service.rb,
lib/fog/terremark/requests/shared/delete_internet_service.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_catalog_item.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_firewall_acl.rb,
lib/fog/terremark/parsers/shared/instantiate_vapp_template.rb,
lib/fog/vcloud/terremark/ecloud/requests/configure_network.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_firewall_acls.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_vapp_template.rb,
lib/fog/terremark/requests/shared/instantiate_vapp_template.rb,
lib/fog/aws/parsers/elb/register_instances_with_load_balancer.rb,
lib/fog/vcloud/terremark/ecloud/requests/add_internet_service.rb,
lib/fog/vcloud/terremark/ecloud/requests/configure_network_ip.rb,
lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_internet_services.rb,
lib/fog/aws/parsers/elb/deregister_instances_from_load_balancer.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb,
lib/fog/aws/requests/elb/deregister_instances_from_load_balancer.rb,
lib/fog/vcloud/terremark/ecloud/requests/delete_internet_service.rb,
lib/fog/vcloud/terremark/ecloud/requests/get_customization_options.rb,
lib/fog/vcloud/terremark/ecloud/requests/instantiate_vapp_template.rb,
lib/fog/aws/parsers/elb/enable_availability_zones_for_load_balancer.rb,
lib/fog/vcloud/terremark/ecloud/requests/configure_internet_service.rb,
lib/fog/aws/parsers/elb/disable_availability_zones_for_load_balancer.rb,
lib/fog/aws/requests/elb/enable_availability_zones_for_load_balancer.rb,
lib/fog/aws/requests/elb/disable_availability_zones_for_load_balancer.rb

Overview

AFAICT - This is basically undocumented - 6/18/2010 - freeformz

Defined Under Namespace

Modules: AWS, Attributes, Bluebox, Deprecation, Errors, Local, Mock, NewServers, Parsers, Rackspace, SSH, Service, Slicehost, Terremark, Vcloud Classes: Collection, Connection, HMAC, Model, ToHashDocument

Constant Summary collapse

VERSION =
'0.2.11'

Class Method Summary collapse

Class Method Details

.config_pathObject



14
15
16
# File 'lib/fog/credentials.rb', line 14

def config_path
  ENV["FOG_RC"] || '~/.fog'
end

.credentialObject



10
11
12
# File 'lib/fog/credentials.rb', line 10

def credential
  @credential || :default
end

.credential=(new_credential) ⇒ Object



5
6
7
8
# File 'lib/fog/credentials.rb', line 5

def credential=(new_credential)
  @credential = new_credential
  @credentials = nil
end

.credentialsObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/fog/credentials.rb', line 18

def credentials
  @credentials ||= begin
    path = File.expand_path(config_path)
    credentials = if File.exists?(path)
      File.open(path) do |file|
        YAML.load(file.read)
      end
    else
      nil
    end
    unless credentials && credentials[credential]
      print("\n  To run as '#{credential}', add the following to #{config_path}\n")
      yml = <<-YML

:#{credential}:
  :aws_access_key_id:     INTENTIONALLY_LEFT_BLANK
  :aws_secret_access_key: INTENTIONALLY_LEFT_BLANK
  :bluebox_api_key:       INTENTIONALLY_LEFT_BLANK
  :bluebox_customer_id:   INTENTIONALLY_LEFT_BLANK
  :local_root:            INTENTIONALLY_LEFT_BLANK
  :new_servers_password:  INTENTIONALLY_LEFT_BLANK
  :new_servers_username:  INTENTIONALLY_LEFT_BLANK
  :public_key_path:       INTENTIONALLY_LEFT_BLANK
  :private_key_path:      INTENTIONALLY_LEFT_BLANK
  :rackspace_api_key:     INTENTIONALLY_LEFT_BLANK
  :rackspace_username:    INTENTIONALLY_LEFT_BLANK
  :slicehost_password:    INTENTIONALLY_LEFT_BLANK
  :terremark_username:    INTENTIONALLY_LEFT_BLANK
  :terremark_password:    INTENTIONALLY_LEFT_BLANK
YML
      print(yml)
      raise(ArgumentError.new("Missing Credentials"))
    end
    credentials[credential]
  end
end

.directoriesObject



25
26
27
28
29
30
31
32
33
# File 'lib/fog/bin.rb', line 25

def directories
  directories = {}
  services.each do |service|
    if service.respond_to?(:directories)
      directories[service] = service.directories
    end
  end
  directories
end

.flavorsObject



35
36
37
38
39
40
41
42
43
# File 'lib/fog/bin.rb', line 35

def flavors
  flavors = {}
  services.each do |service|
    if service.respond_to?(:flavors)
      flavors[service] = service.flavors
    end
  end
  flavors
end

.imagesObject



45
46
47
48
49
50
51
52
53
# File 'lib/fog/bin.rb', line 45

def images
  images = {}
  services.each do |service|
    if service.respond_to?(:images)
      images[service] = service.images
    end
  end
  images
end

.mock!Object



62
63
64
# File 'lib/fog.rb', line 62

def self.mock!
  @mocking = true
end

.mocking?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/fog.rb', line 66

def self.mocking?
  !!@mocking
end

.serversObject



55
56
57
58
59
60
61
62
63
# File 'lib/fog/bin.rb', line 55

def servers
  servers = {}
  services.each do |service|
    if service.respond_to?(:servers)
      servers[service] = service.servers
    end
  end
  servers
end

.servicesObject



15
16
17
18
19
20
21
22
23
# File 'lib/fog/bin.rb', line 15

def services
  services = []
  [::AWS, ::Local, ::NewServers, ::Rackspace, ::Slicehost, ::Terremark, ::Vcloud, ::Bluebox].each do |service|
    if service.initialized?
      services << service
    end
  end
  services
end

.wait_for(timeout = 600, &block) ⇒ Object



70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/fog.rb', line 70

def self.wait_for(timeout = 600, &block)
  duration = 0
  start = Time.now
  until yield || duration > timeout
    sleep(1)
    duration = Time.now - start
  end
  if duration > timeout
    false
  else
    { :duration => duration }
  end
end