fog 0.5.3 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile.lock +3 -3
- data/bin/fog +0 -5
- data/changelog.txt +88 -0
- data/fog.gemspec +3 -3
- data/lib/fog.rb +1 -2
- data/lib/fog/aws/elb.rb +2 -0
- data/lib/fog/aws/iam.rb +7 -0
- data/lib/fog/aws/parsers/iam/get_group.rb +55 -0
- data/lib/fog/aws/parsers/iam/get_user_policy.rb +27 -0
- data/lib/fog/aws/parsers/iam/update_group.rb +26 -0
- data/lib/fog/aws/parsers/iam/update_user.rb +27 -0
- data/lib/fog/aws/requests/iam/create_access_key.rb +1 -1
- data/lib/fog/aws/requests/iam/get_group.rb +44 -0
- data/lib/fog/aws/requests/iam/get_user_policy.rb +36 -0
- data/lib/fog/aws/requests/iam/update_group.rb +39 -0
- data/lib/fog/aws/requests/iam/update_signing_certificate.rb +32 -0
- data/lib/fog/aws/requests/iam/update_user.rb +39 -0
- data/lib/fog/aws/ses.rb +2 -0
- data/lib/fog/aws/simpledb.rb +2 -0
- data/lib/fog/bin.rb +3 -8
- data/lib/fog/bin/aws.rb +2 -14
- data/lib/fog/bin/bluebox.rb +6 -8
- data/lib/fog/bin/dnsimple.rb +30 -0
- data/lib/fog/bin/ecloud.rb +30 -0
- data/lib/fog/bin/go_grid.rb +1 -7
- data/lib/fog/bin/linode.rb +0 -6
- data/lib/fog/bin/local.rb +1 -7
- data/lib/fog/bin/new_servers.rb +1 -7
- data/lib/fog/bin/rackspace.rb +2 -14
- data/lib/fog/bin/slicehost.rb +2 -8
- data/lib/fog/bin/terremark.rb +0 -5
- data/lib/fog/bin/voxel.rb +30 -0
- data/lib/fog/cdn/aws.rb +2 -0
- data/lib/fog/compute.rb +6 -3
- data/lib/fog/compute/aws.rb +4 -18
- data/lib/fog/compute/ecloud.rb +1306 -0
- data/lib/fog/compute/models/aws/key_pair.rb +0 -2
- data/lib/fog/compute/models/aws/security_group.rb +4 -4
- data/lib/fog/compute/models/aws/server.rb +13 -3
- data/lib/fog/compute/models/aws/snapshot.rb +0 -2
- data/lib/fog/compute/models/aws/volume.rb +0 -2
- data/lib/fog/compute/models/bluebox/server.rb +23 -11
- data/lib/fog/compute/models/brightbox/server.rb +8 -0
- data/lib/fog/compute/models/ecloud/backup_internet_service.rb +56 -0
- data/lib/fog/compute/models/ecloud/backup_internet_services.rb +33 -0
- data/lib/fog/compute/models/ecloud/catalog.rb +28 -0
- data/lib/fog/compute/models/ecloud/catalog_item.rb +29 -0
- data/lib/fog/compute/models/ecloud/firewall_acl.rb +24 -0
- data/lib/fog/compute/models/ecloud/firewall_acls.rb +31 -0
- data/lib/fog/compute/models/ecloud/internet_service.rb +117 -0
- data/lib/fog/compute/models/ecloud/internet_services.rb +33 -0
- data/lib/fog/compute/models/ecloud/ip.rb +49 -0
- data/lib/fog/compute/models/ecloud/ips.rb +32 -0
- data/lib/fog/compute/models/ecloud/network.rb +72 -0
- data/lib/fog/compute/models/ecloud/networks.rb +33 -0
- data/lib/fog/compute/models/ecloud/node.rb +43 -0
- data/lib/fog/compute/models/ecloud/nodes.rb +31 -0
- data/lib/fog/compute/models/ecloud/public_ip.rb +22 -0
- data/lib/fog/compute/models/ecloud/public_ips.rb +36 -0
- data/lib/fog/compute/models/ecloud/server.rb +209 -0
- data/lib/fog/compute/models/ecloud/servers.rb +55 -0
- data/lib/fog/compute/models/ecloud/task.rb +21 -0
- data/lib/fog/compute/models/ecloud/tasks.rb +31 -0
- data/lib/fog/compute/models/ecloud/vdc.rb +81 -0
- data/lib/fog/compute/models/ecloud/vdcs.rb +40 -0
- data/lib/fog/compute/models/go_grid/server.rb +15 -1
- data/lib/fog/compute/models/rackspace/server.rb +16 -0
- data/lib/fog/compute/models/slicehost/server.rb +16 -0
- data/lib/fog/compute/models/voxel/image.rb +12 -0
- data/lib/fog/compute/models/voxel/images.rb +30 -0
- data/lib/fog/compute/models/voxel/server.rb +77 -0
- data/lib/fog/compute/models/voxel/servers.rb +31 -0
- data/lib/fog/compute/new_servers.rb +2 -2
- data/lib/fog/compute/parsers/voxel/basic.rb +31 -0
- data/lib/fog/compute/parsers/voxel/devices_list.rb +111 -0
- data/lib/fog/compute/parsers/voxel/images_list.rb +59 -0
- data/lib/fog/compute/parsers/voxel/voxcloud_create.rb +40 -0
- data/lib/fog/compute/parsers/voxel/voxcloud_delete.rb +31 -0
- data/lib/fog/compute/parsers/voxel/voxcloud_status.rb +42 -0
- data/lib/fog/compute/rackspace.rb +0 -16
- data/lib/fog/compute/requests/aws/associate_address.rb +2 -0
- data/lib/fog/compute/requests/aws/authorize_security_group_ingress.rb +28 -8
- data/lib/fog/compute/requests/aws/create_security_group.rb +2 -0
- data/lib/fog/compute/requests/aws/create_tags.rb +2 -0
- data/lib/fog/compute/requests/aws/delete_key_pair.rb +2 -0
- data/lib/fog/compute/requests/aws/delete_security_group.rb +2 -0
- data/lib/fog/compute/requests/aws/delete_snapshot.rb +2 -0
- data/lib/fog/compute/requests/aws/delete_tags.rb +2 -0
- data/lib/fog/compute/requests/aws/delete_volume.rb +2 -0
- data/lib/fog/compute/requests/aws/disassociate_address.rb +2 -0
- data/lib/fog/compute/requests/aws/modify_image_attributes.rb +2 -0
- data/lib/fog/compute/requests/aws/modify_snapshot_attribute.rb +2 -0
- data/lib/fog/compute/requests/aws/reboot_instances.rb +2 -0
- data/lib/fog/compute/requests/aws/release_address.rb +2 -0
- data/lib/fog/compute/requests/aws/revoke_security_group_ingress.rb +2 -0
- data/lib/fog/compute/requests/ecloud/add_backup_internet_service.rb +109 -0
- data/lib/fog/compute/requests/ecloud/add_internet_service.rb +149 -0
- data/lib/fog/compute/requests/ecloud/add_node.rb +62 -0
- data/lib/fog/compute/requests/ecloud/clone_vapp.rb +40 -0
- data/lib/fog/compute/requests/ecloud/configure_internet_service.rb +112 -0
- data/lib/fog/compute/requests/ecloud/configure_network.rb +44 -0
- data/lib/fog/compute/requests/ecloud/configure_network_ip.rb +66 -0
- data/lib/fog/compute/requests/ecloud/configure_node.rb +56 -0
- data/lib/fog/compute/requests/ecloud/configure_vapp.rb +144 -0
- data/lib/fog/compute/requests/ecloud/delete_internet_service.rb +22 -0
- data/lib/fog/compute/requests/ecloud/delete_node.rb +22 -0
- data/lib/fog/compute/requests/ecloud/delete_vapp.rb +29 -0
- data/lib/fog/compute/requests/ecloud/get_catalog.rb +44 -0
- data/lib/fog/compute/requests/ecloud/get_catalog_item.rb +47 -0
- data/lib/fog/compute/requests/ecloud/get_customization_options.rb +22 -0
- data/lib/fog/compute/requests/ecloud/get_firewall_acl.rb +11 -0
- data/lib/fog/compute/requests/ecloud/get_firewall_acls.rb +11 -0
- data/lib/fog/compute/requests/ecloud/get_internet_services.rb +82 -0
- data/lib/fog/compute/requests/ecloud/get_network.rb +44 -0
- data/lib/fog/compute/requests/ecloud/get_network_extensions.rb +33 -0
- data/lib/fog/compute/requests/ecloud/get_network_ip.rb +43 -0
- data/lib/fog/compute/requests/ecloud/get_network_ips.rb +35 -0
- data/lib/fog/compute/requests/ecloud/get_node.rb +40 -0
- data/lib/fog/compute/requests/ecloud/get_nodes.rb +41 -0
- data/lib/fog/compute/requests/ecloud/get_organization.rb +49 -0
- data/lib/fog/compute/requests/ecloud/get_public_ip.rb +34 -0
- data/lib/fog/compute/requests/ecloud/get_public_ips.rb +38 -0
- data/lib/fog/compute/requests/ecloud/get_task.rb +11 -0
- data/lib/fog/compute/requests/ecloud/get_task_list.rb +11 -0
- data/lib/fog/compute/requests/ecloud/get_vapp.rb +99 -0
- data/lib/fog/compute/requests/ecloud/get_vapp_template.rb +11 -0
- data/lib/fog/compute/requests/ecloud/get_vdc.rb +84 -0
- data/lib/fog/compute/requests/ecloud/get_versions.rb +37 -0
- data/lib/fog/compute/requests/ecloud/instantiate_vapp_template.rb +142 -0
- data/lib/fog/compute/requests/ecloud/login.rb +48 -0
- data/lib/fog/compute/requests/ecloud/power_off.rb +23 -0
- data/lib/fog/compute/requests/ecloud/power_on.rb +23 -0
- data/lib/fog/compute/requests/ecloud/power_reset.rb +11 -0
- data/lib/fog/compute/requests/ecloud/power_shutdown.rb +11 -0
- data/lib/fog/compute/requests/voxel/devices_list.rb +24 -0
- data/lib/fog/compute/requests/voxel/devices_power.rb +22 -0
- data/lib/fog/compute/requests/voxel/images_list.rb +31 -0
- data/lib/fog/compute/requests/voxel/voxcloud_create.rb +22 -0
- data/lib/fog/compute/requests/voxel/voxcloud_delete.rb +20 -0
- data/lib/fog/compute/requests/voxel/voxcloud_status.rb +29 -0
- data/lib/fog/compute/slicehost.rb +2 -0
- data/lib/fog/compute/voxel.rb +112 -0
- data/lib/fog/core.rb +1 -0
- data/lib/fog/core/credentials.rb +6 -2
- data/lib/fog/core/parser.rb +2 -0
- data/lib/fog/core/scp.rb +67 -0
- data/lib/fog/dns.rb +6 -0
- data/lib/fog/dns/aws.rb +2 -0
- data/lib/fog/dns/bluebox.rb +110 -0
- data/lib/fog/dns/dnsimple.rb +95 -0
- data/lib/fog/dns/models/bluebox/record.rb +52 -0
- data/lib/fog/dns/models/bluebox/records.rb +36 -0
- data/lib/fog/dns/models/bluebox/zone.rb +63 -0
- data/lib/fog/dns/models/bluebox/zones.rb +28 -0
- data/lib/fog/dns/models/dnsimple/record.rb +54 -0
- data/lib/fog/dns/models/dnsimple/records.rb +38 -0
- data/lib/fog/dns/models/dnsimple/zone.rb +50 -0
- data/lib/fog/dns/models/dnsimple/zones.rb +28 -0
- data/lib/fog/dns/parsers/bluebox/create_record.rb +26 -0
- data/lib/fog/dns/parsers/bluebox/create_zone.rb +26 -0
- data/lib/fog/dns/parsers/bluebox/get_record.rb +21 -0
- data/lib/fog/dns/parsers/bluebox/get_records.rb +27 -0
- data/lib/fog/{compute/parsers/terremark_ecloud/get_ip_address.rb → dns/parsers/bluebox/get_zone.rb} +6 -6
- data/lib/fog/dns/parsers/bluebox/get_zones.rb +30 -0
- data/lib/fog/dns/requests/bluebox/create_record.rb +48 -0
- data/lib/fog/dns/requests/bluebox/create_zone.rb +52 -0
- data/lib/fog/dns/requests/bluebox/delete_record.rb +31 -0
- data/lib/fog/dns/requests/bluebox/delete_zone.rb +31 -0
- data/lib/fog/dns/requests/bluebox/get_record.rb +40 -0
- data/lib/fog/dns/requests/bluebox/get_records.rb +41 -0
- data/lib/fog/dns/requests/bluebox/get_zone.rb +44 -0
- data/lib/fog/dns/requests/bluebox/get_zones.rb +43 -0
- data/lib/fog/dns/requests/bluebox/update_record.rb +34 -0
- data/lib/fog/dns/requests/bluebox/update_zone.rb +30 -0
- data/lib/fog/dns/requests/dnsimple/create_domain.rb +27 -0
- data/lib/fog/dns/requests/dnsimple/create_record.rb +48 -0
- data/lib/fog/dns/requests/dnsimple/delete_domain.rb +26 -0
- data/lib/fog/dns/requests/dnsimple/delete_record.rb +21 -0
- data/lib/fog/dns/requests/dnsimple/get_domain.rb +37 -0
- data/lib/fog/dns/requests/dnsimple/list_domains.rb +35 -0
- data/lib/fog/dns/requests/dnsimple/list_records.rb +32 -0
- data/lib/fog/dns/requests/dnsimple/update_record.rb +42 -0
- data/lib/fog/dns/slicehost.rb +2 -0
- data/lib/fog/dns/zerigo.rb +2 -0
- data/lib/fog/providers.rb +3 -1
- data/lib/fog/providers/aws.rb +0 -4
- data/lib/fog/providers/bluebox.rb +1 -8
- data/lib/fog/providers/dnsimple.rb +11 -0
- data/lib/fog/providers/ecloud.rb +11 -0
- data/lib/fog/providers/go_grid.rb +0 -8
- data/lib/fog/providers/google.rb +0 -3
- data/lib/fog/providers/linode.rb +0 -8
- data/lib/fog/providers/local.rb +0 -8
- data/lib/fog/providers/new_servers.rb +0 -11
- data/lib/fog/providers/rackspace.rb +0 -2
- data/lib/fog/providers/slicehost.rb +0 -11
- data/lib/fog/providers/voxel.rb +16 -0
- data/lib/fog/providers/zerigo.rb +0 -3
- data/lib/fog/storage/aws.rb +7 -19
- data/lib/fog/storage/google.rb +2 -2
- data/lib/fog/storage/models/aws/directory.rb +0 -3
- data/lib/fog/storage/models/aws/file.rb +0 -3
- data/lib/fog/storage/models/google/directory.rb +0 -3
- data/lib/fog/storage/models/google/file.rb +0 -3
- data/lib/fog/storage/models/local/directory.rb +0 -3
- data/lib/fog/storage/models/local/file.rb +29 -1
- data/lib/fog/storage/models/local/files.rb +8 -5
- data/lib/fog/storage/models/rackspace/directory.rb +1 -3
- data/lib/fog/storage/parsers/aws/get_bucket_website.rb +26 -0
- data/lib/fog/storage/rackspace.rb +0 -16
- data/lib/fog/storage/requests/aws/delete_bucket_website.rb +32 -0
- data/lib/fog/storage/requests/aws/get_bucket_website.rb +42 -0
- data/lib/fog/storage/requests/aws/put_bucket_website.rb +49 -0
- data/lib/fog/terremark.rb +0 -5
- data/spec/ecloud/bin_spec.rb +22 -0
- data/spec/{vcloud/terremark/ecloud → ecloud}/models/backup_internet_service_spec.rb +5 -5
- data/spec/{vcloud/terremark/ecloud → ecloud}/models/backup_internet_services_spec.rb +4 -4
- data/spec/{vcloud/terremark/ecloud → ecloud}/models/internet_service_spec.rb +5 -5
- data/spec/{vcloud/terremark/ecloud → ecloud}/models/internet_services_spec.rb +4 -4
- data/spec/{vcloud/terremark/ecloud → ecloud}/models/ip_spec.rb +5 -5
- data/spec/{vcloud/terremark/ecloud → ecloud}/models/ips_spec.rb +4 -4
- data/spec/{vcloud/terremark/ecloud → ecloud}/models/network_spec.rb +5 -5
- data/spec/{vcloud/terremark/ecloud → ecloud}/models/networks_spec.rb +4 -4
- data/spec/{vcloud/terremark/ecloud → ecloud}/models/node_spec.rb +5 -5
- data/spec/{vcloud/terremark/ecloud → ecloud}/models/nodes_spec.rb +4 -4
- data/spec/{vcloud/terremark/ecloud → ecloud}/models/public_ip_spec.rb +5 -5
- data/spec/{vcloud/terremark/ecloud → ecloud}/models/public_ips_spec.rb +4 -4
- data/spec/{vcloud/terremark/ecloud → ecloud}/models/server_spec.rb +4 -4
- data/spec/{vcloud/terremark/ecloud → ecloud}/models/vdc_spec.rb +5 -5
- data/spec/{vcloud/terremark/ecloud → ecloud}/models/vdcs_spec.rb +4 -4
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/add_backup_internet_service_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/add_internet_service_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/add_node_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/configure_internet_service_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/configure_network_ip_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/configure_node_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/configure_vapp_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/delete_internet_service_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/delete_node_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/delete_vapp_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/get_catalog_item_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/get_catalog_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/get_customization_options_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/get_internet_services_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/get_network_ip_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/get_network_ips_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/get_network_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/get_node_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/get_nodes_spec.rb +2 -2
- data/spec/{vcloud → ecloud}/requests/get_organization_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/get_public_ip_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/get_public_ips_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/get_vapp_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/get_vdc_spec.rb +2 -2
- data/spec/ecloud/requests/get_versions_spec.rb +57 -0
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/instantiate_vapp_template_spec.rb +3 -3
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/login_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/power_off_spec.rb +2 -2
- data/spec/{vcloud/terremark/ecloud → ecloud}/requests/power_on_spec.rb +2 -2
- data/spec/{vcloud → ecloud}/spec_helper.rb +14 -29
- data/spec/{vcloud → ecloud}/vcloud_spec.rb +4 -4
- data/spec/spec_helper.rb +0 -1
- data/tests/compute/helper.rb +12 -1
- data/tests/compute/models/flavors_tests.rb +2 -0
- data/tests/compute/models/server_tests.rb +28 -1
- data/tests/compute/requests/voxel/image_tests.rb +46 -0
- data/tests/compute/requests/voxel/server_tests.rb +123 -0
- data/tests/dns/helper.rb +10 -1
- data/tests/dns/models/record_tests.rb +0 -1
- data/tests/dns/requests/bluebox/dns_tests.rb +271 -0
- data/tests/dns/requests/dnsimple/dns_tests.rb +130 -0
- data/tests/helper.rb +1 -1
- data/tests/helpers/mock_helper.rb +2 -0
- data/tests/storage/models/directory_test.rb +2 -1
- metadata +244 -224
- data/lib/fog/bin/terremark_ecloud.rb +0 -28
- data/lib/fog/bin/vcloud.rb +0 -59
- data/lib/fog/compute/parsers/terremark_ecloud/get_catalog.rb +0 -36
- data/lib/fog/compute/parsers/terremark_ecloud/get_catalog_item.rb +0 -43
- data/lib/fog/compute/parsers/terremark_ecloud/get_ip_addresses.rb +0 -27
- data/lib/fog/compute/parsers/terremark_ecloud/get_network.rb +0 -59
- data/lib/fog/compute/parsers/terremark_ecloud/get_organization.rb +0 -35
- data/lib/fog/compute/parsers/terremark_ecloud/get_task.rb +0 -42
- data/lib/fog/compute/parsers/terremark_ecloud/get_task_list.rb +0 -51
- data/lib/fog/compute/parsers/terremark_ecloud/get_vdc.rb +0 -110
- data/lib/fog/compute/parsers/terremark_ecloud/get_versions.rb +0 -28
- data/lib/fog/compute/parsers/terremark_ecloud/login.rb +0 -27
- data/lib/fog/compute/requests/terremark_ecloud/get_catalog.rb +0 -19
- data/lib/fog/compute/requests/terremark_ecloud/get_catalog_item.rb +0 -19
- data/lib/fog/compute/requests/terremark_ecloud/get_ip_address.rb +0 -19
- data/lib/fog/compute/requests/terremark_ecloud/get_ip_addresses.rb +0 -19
- data/lib/fog/compute/requests/terremark_ecloud/get_network.rb +0 -19
- data/lib/fog/compute/requests/terremark_ecloud/get_organization.rb +0 -19
- data/lib/fog/compute/requests/terremark_ecloud/get_task.rb +0 -19
- data/lib/fog/compute/requests/terremark_ecloud/get_task_list.rb +0 -19
- data/lib/fog/compute/requests/terremark_ecloud/get_vdc.rb +0 -19
- data/lib/fog/compute/requests/terremark_ecloud/get_versions.rb +0 -26
- data/lib/fog/compute/requests/terremark_ecloud/login.rb +0 -29
- data/lib/fog/compute/terremark_ecloud.rb +0 -93
- data/lib/fog/providers/terremark_ecloud.rb +0 -17
- data/lib/fog/terremark/ecloud.rb +0 -73
- data/lib/fog/vcloud.rb +0 -337
- data/lib/fog/vcloud/collection.rb +0 -30
- data/lib/fog/vcloud/generators.rb +0 -33
- data/lib/fog/vcloud/mock_data_classes.rb +0 -767
- data/lib/fog/vcloud/model.rb +0 -22
- data/lib/fog/vcloud/models/vdc.rb +0 -26
- data/lib/fog/vcloud/models/vdcs.rb +0 -35
- data/lib/fog/vcloud/requests/get_network.rb +0 -47
- data/lib/fog/vcloud/requests/get_organization.rb +0 -47
- data/lib/fog/vcloud/requests/get_vdc.rb +0 -82
- data/lib/fog/vcloud/requests/get_versions.rb +0 -34
- data/lib/fog/vcloud/requests/login.rb +0 -46
- data/lib/fog/vcloud/terremark/ecloud.rb +0 -187
- data/lib/fog/vcloud/terremark/ecloud/models/backup_internet_service.rb +0 -60
- data/lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb +0 -36
- data/lib/fog/vcloud/terremark/ecloud/models/catalog.rb +0 -31
- data/lib/fog/vcloud/terremark/ecloud/models/catalog_item.rb +0 -31
- data/lib/fog/vcloud/terremark/ecloud/models/firewall_acl.rb +0 -28
- data/lib/fog/vcloud/terremark/ecloud/models/firewall_acls.rb +0 -34
- data/lib/fog/vcloud/terremark/ecloud/models/internet_service.rb +0 -121
- data/lib/fog/vcloud/terremark/ecloud/models/internet_services.rb +0 -36
- data/lib/fog/vcloud/terremark/ecloud/models/ip.rb +0 -51
- data/lib/fog/vcloud/terremark/ecloud/models/ips.rb +0 -35
- data/lib/fog/vcloud/terremark/ecloud/models/network.rb +0 -77
- data/lib/fog/vcloud/terremark/ecloud/models/networks.rb +0 -36
- data/lib/fog/vcloud/terremark/ecloud/models/node.rb +0 -47
- data/lib/fog/vcloud/terremark/ecloud/models/nodes.rb +0 -33
- data/lib/fog/vcloud/terremark/ecloud/models/public_ip.rb +0 -25
- data/lib/fog/vcloud/terremark/ecloud/models/public_ips.rb +0 -39
- data/lib/fog/vcloud/terremark/ecloud/models/server.rb +0 -211
- data/lib/fog/vcloud/terremark/ecloud/models/servers.rb +0 -57
- data/lib/fog/vcloud/terremark/ecloud/models/task.rb +0 -23
- data/lib/fog/vcloud/terremark/ecloud/models/tasks.rb +0 -33
- data/lib/fog/vcloud/terremark/ecloud/models/vdc.rb +0 -83
- data/lib/fog/vcloud/terremark/ecloud/models/vdcs.rb +0 -42
- data/lib/fog/vcloud/terremark/ecloud/requests/add_backup_internet_service.rb +0 -111
- data/lib/fog/vcloud/terremark/ecloud/requests/add_internet_service.rb +0 -152
- data/lib/fog/vcloud/terremark/ecloud/requests/add_node.rb +0 -64
- data/lib/fog/vcloud/terremark/ecloud/requests/clone_vapp.rb +0 -42
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_internet_service.rb +0 -115
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_network.rb +0 -46
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_network_ip.rb +0 -68
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_node.rb +0 -58
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_vapp.rb +0 -147
- data/lib/fog/vcloud/terremark/ecloud/requests/delete_internet_service.rb +0 -25
- data/lib/fog/vcloud/terremark/ecloud/requests/delete_node.rb +0 -24
- data/lib/fog/vcloud/terremark/ecloud/requests/delete_vapp.rb +0 -32
- data/lib/fog/vcloud/terremark/ecloud/requests/get_catalog.rb +0 -46
- data/lib/fog/vcloud/terremark/ecloud/requests/get_catalog_item.rb +0 -49
- data/lib/fog/vcloud/terremark/ecloud/requests/get_customization_options.rb +0 -24
- data/lib/fog/vcloud/terremark/ecloud/requests/get_firewall_acl.rb +0 -13
- data/lib/fog/vcloud/terremark/ecloud/requests/get_firewall_acls.rb +0 -13
- data/lib/fog/vcloud/terremark/ecloud/requests/get_internet_services.rb +0 -84
- data/lib/fog/vcloud/terremark/ecloud/requests/get_network.rb +0 -47
- data/lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb +0 -35
- data/lib/fog/vcloud/terremark/ecloud/requests/get_network_ip.rb +0 -45
- data/lib/fog/vcloud/terremark/ecloud/requests/get_network_ips.rb +0 -37
- data/lib/fog/vcloud/terremark/ecloud/requests/get_node.rb +0 -42
- data/lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb +0 -43
- data/lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb +0 -36
- data/lib/fog/vcloud/terremark/ecloud/requests/get_public_ips.rb +0 -41
- data/lib/fog/vcloud/terremark/ecloud/requests/get_task.rb +0 -13
- data/lib/fog/vcloud/terremark/ecloud/requests/get_task_list.rb +0 -14
- data/lib/fog/vcloud/terremark/ecloud/requests/get_vapp.rb +0 -101
- data/lib/fog/vcloud/terremark/ecloud/requests/get_vapp_template.rb +0 -13
- data/lib/fog/vcloud/terremark/ecloud/requests/get_vdc.rb +0 -87
- data/lib/fog/vcloud/terremark/ecloud/requests/instantiate_vapp_template.rb +0 -144
- data/lib/fog/vcloud/terremark/ecloud/requests/power_off.rb +0 -25
- data/lib/fog/vcloud/terremark/ecloud/requests/power_on.rb +0 -25
- data/lib/fog/vcloud/terremark/ecloud/requests/power_reset.rb +0 -13
- data/lib/fog/vcloud/terremark/ecloud/requests/power_shutdown.rb +0 -13
- data/lib/fog/vcloud/terremark/vcloud.rb +0 -39
- data/lib/fog/vcloud/terremark/vcloud/requests/get_vdc.rb +0 -57
- data/spec/vcloud/bin_spec.rb +0 -28
- data/spec/vcloud/models/vdc_spec.rb +0 -51
- data/spec/vcloud/models/vdcs_spec.rb +0 -1
- data/spec/vcloud/requests/get_network_spec.rb +0 -44
- data/spec/vcloud/requests/get_vdc_spec.rb +0 -62
- data/spec/vcloud/requests/get_versions_spec.rb +0 -54
- data/spec/vcloud/requests/login_spec.rb +0 -24
- data/tests/compute/requests/terremark_ecloud/catalog_tests.rb +0 -47
- data/tests/compute/requests/terremark_ecloud/helper.rb +0 -45
- data/tests/compute/requests/terremark_ecloud/network_tests.rb +0 -30
- data/tests/compute/requests/terremark_ecloud/organization_tests.rb +0 -28
- data/tests/compute/requests/terremark_ecloud/task_tests.rb +0 -39
- data/tests/compute/requests/terremark_ecloud/vdc_tests.rb +0 -60
@@ -42,7 +42,7 @@ module Fog
|
|
42
42
|
requires :name
|
43
43
|
|
44
44
|
connection.authorize_security_group_ingress(
|
45
|
-
|
45
|
+
name,
|
46
46
|
'SourceSecurityGroupName' => group,
|
47
47
|
'SourceSecurityGroupOwnerId' => owner
|
48
48
|
)
|
@@ -80,9 +80,9 @@ module Fog
|
|
80
80
|
requires :name
|
81
81
|
|
82
82
|
connection.authorize_security_group_ingress(
|
83
|
+
name,
|
83
84
|
'CidrIp' => options[:cidr_ip] || '0.0.0.0/0',
|
84
85
|
'FromPort' => range.min,
|
85
|
-
'GroupName' => name,
|
86
86
|
'ToPort' => range.max,
|
87
87
|
'IpProtocol' => options[:ip_protocol] || 'tcp'
|
88
88
|
)
|
@@ -134,7 +134,7 @@ module Fog
|
|
134
134
|
requires :name
|
135
135
|
|
136
136
|
connection.revoke_security_group_ingress(
|
137
|
-
|
137
|
+
name,
|
138
138
|
'SourceSecurityGroupName' => group,
|
139
139
|
'SourceSecurityGroupOwnerId' => owner
|
140
140
|
)
|
@@ -172,9 +172,9 @@ module Fog
|
|
172
172
|
requires :name
|
173
173
|
|
174
174
|
connection.revoke_security_group_ingress(
|
175
|
+
name,
|
175
176
|
'CidrIp' => options[:cidr_ip] || '0.0.0.0/0',
|
176
177
|
'FromPort' => range.min,
|
177
|
-
'GroupName' => name,
|
178
178
|
'ToPort' => range.max,
|
179
179
|
'IpProtocol' => options[:ip_protocol] || 'tcp'
|
180
180
|
)
|
@@ -5,6 +5,8 @@ module Fog
|
|
5
5
|
class Compute
|
6
6
|
|
7
7
|
class Server < Fog::Model
|
8
|
+
extend Fog::Deprecation
|
9
|
+
deprecate :ip_address, :public_ip_address
|
8
10
|
|
9
11
|
identity :id, :aliases => 'instanceId'
|
10
12
|
|
@@ -18,7 +20,6 @@ module Fog
|
|
18
20
|
attribute :flavor_id, :aliases => 'instanceType'
|
19
21
|
attribute :image_id, :aliases => 'imageId'
|
20
22
|
attr_accessor :instance_initiated_shutdown_behavior
|
21
|
-
attribute :ip_address, :aliases => 'ipAddress'
|
22
23
|
attribute :kernel_id, :aliases => 'kernelId'
|
23
24
|
attribute :key_name, :aliases => 'keyName'
|
24
25
|
attribute :created_at, :aliases => 'launchTime'
|
@@ -26,6 +27,7 @@ module Fog
|
|
26
27
|
attribute :product_codes, :aliases => 'productCodes'
|
27
28
|
attribute :private_dns_name, :aliases => 'privateDnsName'
|
28
29
|
attribute :private_ip_address, :aliases => 'privateIpAddress'
|
30
|
+
attribute :public_ip_address, :aliases => 'ipAddress'
|
29
31
|
attribute :ramdisk_id, :aliases => 'ramdiskId'
|
30
32
|
attribute :reason
|
31
33
|
attribute :root_device_name, :aliases => 'rootDeviceName'
|
@@ -177,11 +179,19 @@ module Fog
|
|
177
179
|
end
|
178
180
|
|
179
181
|
def ssh(commands)
|
180
|
-
requires :identity, :
|
182
|
+
requires :identity, :public_ip_address, :username
|
183
|
+
|
184
|
+
options = {}
|
185
|
+
options[:key_data] = [private_key] if private_key
|
186
|
+
Fog::SSH.new(public_ip_address, username, options).run(commands)
|
187
|
+
end
|
188
|
+
|
189
|
+
def scp(local_path, remote_path)
|
190
|
+
requires :public_ip_address, :username
|
181
191
|
|
182
192
|
options = {}
|
183
193
|
options[:key_data] = [private_key] if private_key
|
184
|
-
Fog::
|
194
|
+
Fog::SCP.new(public_ip_address, username, options).upload(local_path, remote_path)
|
185
195
|
end
|
186
196
|
|
187
197
|
def start
|
@@ -7,11 +7,6 @@ module Fog
|
|
7
7
|
class BlockInstantiationError < StandardError; end
|
8
8
|
|
9
9
|
class Server < Fog::Model
|
10
|
-
extend Fog::Deprecation
|
11
|
-
deprecate(:ssh_key, :public_key)
|
12
|
-
deprecate(:ssh_key=, :public_key=)
|
13
|
-
deprecate(:user, :username)
|
14
|
-
deprecate(:user=, :username=)
|
15
10
|
|
16
11
|
identity :id
|
17
12
|
|
@@ -50,6 +45,10 @@ module Fog
|
|
50
45
|
connection.images.get(image_id)
|
51
46
|
end
|
52
47
|
|
48
|
+
def private_ip_address
|
49
|
+
nil
|
50
|
+
end
|
51
|
+
|
53
52
|
def private_key_path
|
54
53
|
@private_key_path ||= Fog.credentials[:private_key_path]
|
55
54
|
@private_key_path &&= File.expand_path(@private_key_path)
|
@@ -59,6 +58,10 @@ module Fog
|
|
59
58
|
@private_key ||= private_key_path && File.read(private_key_path)
|
60
59
|
end
|
61
60
|
|
61
|
+
def public_ip_address
|
62
|
+
ips.first
|
63
|
+
end
|
64
|
+
|
62
65
|
def public_key_path
|
63
66
|
@public_key_path ||= Fog.credentials[:public_key_path]
|
64
67
|
@public_key_path &&= File.expand_path(@public_key_path)
|
@@ -81,13 +84,14 @@ module Fog
|
|
81
84
|
def save
|
82
85
|
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity
|
83
86
|
requires :flavor_id, :image_id
|
84
|
-
options =
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
87
|
+
options = {}
|
88
|
+
|
89
|
+
if identity.nil? # new record
|
90
|
+
raise(ArgumentError, "password or public_key is required for this operation") if !password && !public_key
|
91
|
+
options['ssh_public_key'] = public_key if @public_key
|
92
|
+
options['password'] = password if @password
|
90
93
|
end
|
94
|
+
|
91
95
|
options['username'] = username
|
92
96
|
data = connection.create_block(flavor_id, image_id, options)
|
93
97
|
merge_attributes(data.body)
|
@@ -115,6 +119,14 @@ module Fog
|
|
115
119
|
Fog::SSH.new(ips.first['address'], username, options).run(commands)
|
116
120
|
end
|
117
121
|
|
122
|
+
def scp(local_path, remote_path)
|
123
|
+
requires :ips, :username
|
124
|
+
|
125
|
+
options = {}
|
126
|
+
options[:key_data] = [private_key] if private_key
|
127
|
+
Fog::SCP.new(ips.first['address'], username, options).upload(local_path, remote_path)
|
128
|
+
end
|
129
|
+
|
118
130
|
def username
|
119
131
|
@username ||= 'deploy'
|
120
132
|
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module Fog
|
2
|
+
module Ecloud
|
3
|
+
class Compute
|
4
|
+
class BackupInternetService < Fog::Ecloud::Model
|
5
|
+
|
6
|
+
identity :href, :aliases => :Href
|
7
|
+
|
8
|
+
ignore_attributes :xmlns, :xmlns_i
|
9
|
+
|
10
|
+
attribute :name, :aliases => :Name
|
11
|
+
attribute :id, :aliases => :Id
|
12
|
+
attribute :protocol, :aliases => :Protocol
|
13
|
+
attribute :enabled, :aliases => :Enabled
|
14
|
+
attribute :description, :aliases => :Description
|
15
|
+
attribute :timeout, :aliases => :Timeout
|
16
|
+
attribute :redirect_url, :aliases => :RedirectURL
|
17
|
+
attribute :monitor, :aliases => :Monitor
|
18
|
+
|
19
|
+
def delete
|
20
|
+
requires :href
|
21
|
+
|
22
|
+
connection.delete_internet_service( href )
|
23
|
+
end
|
24
|
+
|
25
|
+
def monitor=(new_monitor = {})
|
26
|
+
if new_monitor.nil? || new_monitor.empty?
|
27
|
+
attributes[:monitor] = nil
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def save
|
32
|
+
if new_record?
|
33
|
+
result = connection.add_backup_internet_service( collection.href, _compose_service_data )
|
34
|
+
merge_attributes(result.body)
|
35
|
+
else
|
36
|
+
connection.configure_backup_internet_service( href, _compose_service_data )
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def nodes
|
41
|
+
@nodes ||= Fog::Ecloud::Compute::Nodes.new( :connection => connection, :href => href + "/nodeServices" )
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def _compose_service_data
|
47
|
+
#For some reason inject didn't work
|
48
|
+
service_data = {}
|
49
|
+
self.class.attributes.select{ |attribute| !send(attribute).nil? }.each { |attribute| service_data[attribute] = send(attribute) }
|
50
|
+
service_data
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'fog/compute/models/ecloud/backup_internet_service'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Ecloud
|
5
|
+
class Compute
|
6
|
+
class BackupInternetServices < Fog::Ecloud::Collection
|
7
|
+
|
8
|
+
model Fog::Ecloud::Compute::BackupInternetService
|
9
|
+
|
10
|
+
attribute :href, :aliases => :Href
|
11
|
+
|
12
|
+
def all
|
13
|
+
check_href! :message => "the Internet Services for the Vdc you want to enumerate"
|
14
|
+
if data = connection.get_internet_services(href).body[:InternetService].find_all {|i| i[:IsBackupService] == "true" }
|
15
|
+
load(data)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# Optimize later, no need to get_internet_services again?
|
20
|
+
def get(uri)
|
21
|
+
internet_services = connection.get_internet_services(href).body[:InternetService]
|
22
|
+
internet_services = [ internet_services ] if internet_services.is_a?(Hash)
|
23
|
+
if data = internet_services.detect { |service| service[:Href] == uri }
|
24
|
+
new(data)
|
25
|
+
end
|
26
|
+
rescue Fog::Errors::NotFound
|
27
|
+
nil
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Fog
|
2
|
+
module Ecloud
|
3
|
+
class Compute
|
4
|
+
class Catalog < Fog::Ecloud::Collection
|
5
|
+
|
6
|
+
model Fog::Ecloud::Compute::CatalogItem
|
7
|
+
|
8
|
+
attribute :href, :aliases => :Href
|
9
|
+
|
10
|
+
def all
|
11
|
+
check_href!
|
12
|
+
if data = connection.get_catalog(href).body[:CatalogItems][:CatalogItem]
|
13
|
+
load(data)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def get(uri)
|
18
|
+
if data = connection.get_catalog_item(uri)
|
19
|
+
new(data.body)
|
20
|
+
end
|
21
|
+
rescue Fog::Errors::NotFound
|
22
|
+
nil
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Fog
|
2
|
+
module Ecloud
|
3
|
+
class Compute
|
4
|
+
class CatalogItem < Fog::Ecloud::Model
|
5
|
+
|
6
|
+
identity :href, :aliases => :Href
|
7
|
+
|
8
|
+
ignore_attributes :xmlns, :xmlns_i, :xmlns_xsi, :xmlns_xsd
|
9
|
+
|
10
|
+
attribute :type
|
11
|
+
attribute :name
|
12
|
+
attribute :entity, :aliases => :Entity
|
13
|
+
attribute :link, :aliases => :Link
|
14
|
+
attribute :property, :aliases => :Property
|
15
|
+
|
16
|
+
def customization_options
|
17
|
+
load_unless_loaded!
|
18
|
+
if data = connection.get_customization_options( link[:href] ).body
|
19
|
+
data.delete_if { |key, value| [:xmlns_i, :xmlns].include?(key) }
|
20
|
+
data
|
21
|
+
else
|
22
|
+
nil
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Ecloud
|
3
|
+
class Compute
|
4
|
+
class FirewallAcl < Fog::Ecloud::Model
|
5
|
+
|
6
|
+
identity :href, :aliases => :Href
|
7
|
+
|
8
|
+
ignore_attributes :xmlns, :xmlns_i
|
9
|
+
|
10
|
+
attribute :name, :aliases => :Name
|
11
|
+
attribute :id, :aliases => :Id
|
12
|
+
attribute :protocol, :aliases => :Protocol
|
13
|
+
attribute :source, :aliases => :Source
|
14
|
+
attribute :destination, :aliases => :Destination
|
15
|
+
attribute :permission, :aliases => :Permission
|
16
|
+
attribute :port_start, :aliases => :PortStart
|
17
|
+
attribute :port_end, :aliases => :PortEnd
|
18
|
+
attribute :port_type, :aliases => :PortType
|
19
|
+
attribute :type, :aliases => :Type
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'fog/compute/models/ecloud/firewall_acl'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Ecloud
|
5
|
+
class Compute
|
6
|
+
class FirewallAcls < Fog::Ecloud::Collection
|
7
|
+
|
8
|
+
model Fog::Ecloud::Compute::FirewallAcl
|
9
|
+
|
10
|
+
attribute :href, :aliases => :Href
|
11
|
+
|
12
|
+
def all
|
13
|
+
check_href! :message => "the Firewall ACL href for the network you want to enumerate"
|
14
|
+
if data = connection.get_firewall_acls(href).body[:FirewallAcl]
|
15
|
+
data = [ data ] if data.is_a?(Hash)
|
16
|
+
load(data)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def get(uri)
|
21
|
+
if data = connection.get_firewall_acl(uri).body
|
22
|
+
new(data)
|
23
|
+
end
|
24
|
+
rescue Fog::Errors::NotFound
|
25
|
+
nil
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,117 @@
|
|
1
|
+
module Fog
|
2
|
+
module Ecloud
|
3
|
+
class Compute
|
4
|
+
class InternetService < Fog::Ecloud::Model
|
5
|
+
|
6
|
+
identity :href, :aliases => :Href
|
7
|
+
|
8
|
+
ignore_attributes :xmlns, :xmlns_i
|
9
|
+
|
10
|
+
attribute :name, :aliases => :Name
|
11
|
+
attribute :id, :aliases => :Id
|
12
|
+
attribute :protocol, :aliases => :Protocol
|
13
|
+
attribute :port, :aliases => :Port
|
14
|
+
attribute :enabled, :aliases => :Enabled
|
15
|
+
attribute :description, :aliases => :Description
|
16
|
+
attribute :public_ip, :aliases => :PublicIpAddress
|
17
|
+
attribute :timeout, :aliases => :Timeout
|
18
|
+
attribute :redirect_url, :aliases => :RedirectURL
|
19
|
+
attribute :monitor, :aliases => :Monitor
|
20
|
+
attribute :backup_service_data, :aliases => :BackupService
|
21
|
+
|
22
|
+
def delete
|
23
|
+
requires :href
|
24
|
+
|
25
|
+
connection.delete_internet_service( href )
|
26
|
+
end
|
27
|
+
|
28
|
+
def save
|
29
|
+
if new_record?
|
30
|
+
result = connection.add_internet_service( collection.href, _compose_service_data )
|
31
|
+
merge_attributes(result.body)
|
32
|
+
else
|
33
|
+
connection.configure_internet_service( href, _compose_service_data, _compose_ip_data )
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# disables monitoring for this service
|
38
|
+
def disable_monitor
|
39
|
+
if self.monitor and self.monitor[:type] == "Disabled"
|
40
|
+
raise RuntimeError.new("Monitoring already disabled")
|
41
|
+
else
|
42
|
+
self.monitor = {:type => "Disabled", :is_enabled => "true"}
|
43
|
+
self.save
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# enable default ping monitoring, use monitor= for more exotic forms (ECV & HTTP)
|
48
|
+
def enable_ping_monitor
|
49
|
+
self.monitor = nil
|
50
|
+
self.save
|
51
|
+
end
|
52
|
+
|
53
|
+
def monitor=(new_monitor = {})
|
54
|
+
if new_monitor.nil? || new_monitor.empty?
|
55
|
+
attributes[:monitor] = nil
|
56
|
+
elsif new_monitor.is_a?(Hash)
|
57
|
+
attributes[:monitor] = {}
|
58
|
+
attributes[:monitor][:type] = new_monitor[:MonitorType] || new_monitor[:type]
|
59
|
+
attributes[:monitor][:url_send_string] = new_monitor[:UrlSendString] || new_monitor[:url_send_string]
|
60
|
+
attributes[:monitor][:http_headers] = new_monitor[:HttpHeader] || new_monitor[:http_headers]
|
61
|
+
if attributes[:monitor][:http_headers]
|
62
|
+
if attributes[:monitor][:http_headers].is_a?(String)
|
63
|
+
attributes[:monitor][:http_headers] = attributes[:monitor][:http_headers].split("\n")
|
64
|
+
else
|
65
|
+
attributes[:monitor][:http_headers] = attributes[:monitor][:http_headers]
|
66
|
+
end
|
67
|
+
end
|
68
|
+
attributes[:monitor][:receive_string] = new_monitor[:ReceiveString] || new_monitor[:receive_string]
|
69
|
+
attributes[:monitor][:interval] = new_monitor[:Interval] || new_monitor[:interval]
|
70
|
+
attributes[:monitor][:response_timeout] = new_monitor[:ResponseTimeOut] || new_monitor[:response_timeout]
|
71
|
+
attributes[:monitor][:downtime] = new_monitor[:DownTime] || new_monitor[:downtime]
|
72
|
+
attributes[:monitor][:retries] = new_monitor[:Retries] || new_monitor[:retries]
|
73
|
+
attributes[:monitor][:is_enabled] = new_monitor[:IsEnabled] || new_monitor[:is_enabled]
|
74
|
+
else
|
75
|
+
raise RuntimeError.new("monitor needs to either be nil or a Hash")
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def nodes
|
80
|
+
@nodes ||= Fog::Ecloud::Compute::Nodes.new( :connection => connection, :href => href + "/nodeServices" )
|
81
|
+
end
|
82
|
+
|
83
|
+
def backup_service_uri
|
84
|
+
if backup_service_data
|
85
|
+
backup_service_data[:Href]
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def backup_service_uri=(new_value)
|
90
|
+
self.backup_service_data = {
|
91
|
+
:Href => new_value
|
92
|
+
}
|
93
|
+
end
|
94
|
+
|
95
|
+
private
|
96
|
+
|
97
|
+
def _compose_service_data
|
98
|
+
#For some reason inject didn't work
|
99
|
+
service_data = {}
|
100
|
+
self.class.attributes.select{ |attribute| attribute != :backup_service_data }.each { |attribute| service_data[attribute] = send(attribute) }
|
101
|
+
service_data[:backup_service_uri] = backup_service_uri
|
102
|
+
service_data.reject! {|k, v| v.nil? }
|
103
|
+
service_data
|
104
|
+
end
|
105
|
+
|
106
|
+
def _compose_ip_data
|
107
|
+
if public_ip.nil?
|
108
|
+
{}
|
109
|
+
else
|
110
|
+
{ :id => public_ip[:Id], :href => public_ip[:Href], :name => public_ip[:Name] }
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|