fog 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +1 -1
- data/.irbrc +5 -10
- data/{README.rdoc → README.md} +66 -61
- data/Rakefile +4 -6
- data/changelog.txt +491 -0
- data/docs/about/users.markdown +1 -0
- data/fog.gemspec +4 -4
- data/lib/fog.rb +1 -1
- data/lib/fog/aws.rb +4 -0
- data/lib/fog/aws/auto_scaling.rb +3 -0
- data/lib/fog/aws/cloud_watch.rb +28 -0
- data/lib/fog/aws/compute.rb +7 -1
- data/lib/fog/aws/elasticache.rb +64 -6
- data/lib/fog/aws/models/auto_scaling/configuration.rb +3 -1
- data/lib/fog/aws/models/auto_scaling/group.rb +10 -9
- data/lib/fog/aws/models/auto_scaling/policies.rb +33 -0
- data/lib/fog/aws/models/auto_scaling/policy.rb +46 -0
- data/lib/fog/aws/models/cloud_watch/alarm.rb +50 -2
- data/lib/fog/aws/models/cloud_watch/alarms.rb +18 -1
- data/lib/fog/aws/models/compute/address.rb +2 -2
- data/lib/fog/aws/models/dns/records.rb +5 -0
- data/lib/fog/aws/models/elasticache/cluster.rb +1 -1
- data/lib/fog/aws/models/iam/users.rb +26 -4
- data/lib/fog/aws/parsers/auto_scaling/describe_policies.rb +7 -5
- data/lib/fog/aws/parsers/elb/describe_load_balancers.rb +1 -1
- data/lib/fog/aws/rds.rb +1 -1
- data/lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb +8 -0
- data/lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb +1 -2
- data/lib/fog/aws/requests/auto_scaling/delete_auto_scaling_group.rb +10 -2
- data/lib/fog/aws/requests/auto_scaling/delete_launch_configuration.rb +1 -1
- data/lib/fog/aws/requests/auto_scaling/delete_policy.rb +10 -1
- data/lib/fog/aws/requests/auto_scaling/describe_auto_scaling_instances.rb +0 -1
- data/lib/fog/aws/requests/auto_scaling/describe_policies.rb +13 -1
- data/lib/fog/aws/requests/auto_scaling/put_scaling_policy.rb +20 -1
- data/lib/fog/aws/requests/auto_scaling/update_auto_scaling_group.rb +1 -1
- data/lib/fog/aws/requests/cloud_watch/delete_alarms.rb +19 -1
- data/lib/fog/aws/requests/cloud_watch/describe_alarms.rb +20 -2
- data/lib/fog/aws/requests/cloud_watch/put_metric_alarm.rb +9 -0
- data/lib/fog/aws/requests/compute/allocate_address.rb +4 -5
- data/lib/fog/aws/requests/compute/create_dhcp_options.rb +6 -5
- data/lib/fog/aws/requests/compute/create_internet_gateway.rb +7 -6
- data/lib/fog/aws/requests/compute/create_subnet.rb +11 -10
- data/lib/fog/aws/requests/compute/create_vpc.rb +8 -7
- data/lib/fog/aws/requests/compute/delete_dhcp_options.rb +1 -0
- data/lib/fog/aws/requests/compute/delete_internet_gateway.rb +1 -0
- data/lib/fog/aws/requests/compute/delete_subnet.rb +1 -0
- data/lib/fog/aws/requests/compute/delete_vpc.rb +2 -1
- data/lib/fog/aws/requests/compute/describe_availability_zones.rb +1 -0
- data/lib/fog/aws/requests/compute/describe_dhcp_options.rb +1 -8
- data/lib/fog/aws/requests/compute/describe_instances.rb +3 -1
- data/lib/fog/aws/requests/compute/describe_internet_gateways.rb +1 -8
- data/lib/fog/aws/requests/compute/describe_subnets.rb +1 -9
- data/lib/fog/aws/requests/compute/describe_vpcs.rb +1 -8
- data/lib/fog/aws/requests/compute/release_address.rb +12 -4
- data/lib/fog/aws/requests/compute/start_instances.rb +1 -0
- data/lib/fog/aws/requests/compute/stop_instances.rb +1 -0
- data/lib/fog/aws/requests/elasticache/create_cache_cluster.rb +26 -2
- data/lib/fog/aws/requests/elasticache/delete_cache_cluster.rb +10 -1
- data/lib/fog/aws/requests/elasticache/describe_cache_clusters.rb +16 -1
- data/lib/fog/aws/requests/elasticache/modify_cache_cluster.rb +35 -3
- data/lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb +10 -2
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/rds/describe_db_instances.rb +3 -3
- data/lib/fog/aws/sqs.rb +1 -1
- data/lib/fog/aws/storage.rb +1 -1
- data/lib/fog/bin/rackspace.rb +4 -0
- data/lib/fog/cloudstack/compute.rb +25 -18
- data/lib/fog/cloudstack/models/compute/image.rb +34 -34
- data/lib/fog/cloudstack/models/compute/job.rb +14 -1
- data/lib/fog/cloudstack/models/compute/jobs.rb +1 -1
- data/lib/fog/cloudstack/models/compute/security_group.rb +50 -0
- data/lib/fog/cloudstack/models/compute/security_group_rule.rb +62 -0
- data/lib/fog/cloudstack/models/compute/security_group_rules.rb +37 -0
- data/lib/fog/cloudstack/models/compute/security_groups.rb +27 -0
- data/lib/fog/cloudstack/models/compute/server.rb +63 -39
- data/lib/fog/cloudstack/models/compute/volume.rb +3 -7
- data/lib/fog/cloudstack/models/compute/zone.rb +1 -2
- data/lib/fog/cloudstack/requests/compute/assign_virtual_machine.rb +18 -0
- data/lib/fog/cloudstack/requests/compute/authorize_security_group_egress.rb +68 -0
- data/lib/fog/cloudstack/requests/compute/authorize_security_group_ingress.rb +55 -4
- data/lib/fog/cloudstack/requests/compute/create_security_group.rb +12 -4
- data/lib/fog/cloudstack/requests/compute/create_zone.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/delete_security_group.rb +17 -0
- data/lib/fog/cloudstack/requests/compute/destroy_virtual_machine.rb +23 -1
- data/lib/fog/cloudstack/requests/compute/list_firewall_rules.rb +15 -0
- data/lib/fog/cloudstack/requests/compute/list_security_groups.rb +22 -4
- data/lib/fog/cloudstack/requests/compute/query_async_job_result.rb +15 -3
- data/lib/fog/cloudstack/requests/compute/revoke_security_group_egress.rb +42 -0
- data/lib/fog/cloudstack/requests/compute/revoke_security_group_ingress.rb +29 -3
- data/lib/fog/core.rb +1 -0
- data/lib/fog/core/attributes.rb +1 -1
- data/lib/fog/core/current_machine.rb +2 -2
- data/lib/fog/core/scp.rb +8 -0
- data/lib/fog/core/ssh.rb +8 -0
- data/lib/fog/dynect/dns.rb +14 -5
- data/lib/fog/ibm/requests/compute/create_instance.rb +1 -1
- data/lib/fog/libvirt/requests/compute/create_volume.rb +1 -1
- data/lib/fog/libvirt/requests/compute/list_volumes.rb +1 -1
- data/lib/fog/local/models/storage/file.rb +12 -1
- data/lib/fog/local/storage.rb +25 -1
- data/lib/fog/ninefold/compute.rb +1 -0
- data/lib/fog/openstack.rb +3 -1
- data/lib/fog/openstack/compute.rb +13 -2
- data/lib/fog/openstack/models/compute/servers.rb +10 -2
- data/lib/fog/openstack/requests/compute/create_flavor.rb +2 -2
- data/lib/fog/openstack/requests/compute/create_security_group.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_server.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_volume.rb +1 -1
- data/lib/fog/openstack/requests/compute/get_flavor_details.rb +7 -7
- data/lib/fog/openstack/requests/compute/get_quota.rb +1 -12
- data/lib/fog/openstack/requests/compute/get_quota_defaults.rb +1 -12
- data/lib/fog/openstack/requests/compute/get_volume_details.rb +1 -1
- data/lib/fog/openstack/requests/compute/list_flavors.rb +7 -7
- data/lib/fog/openstack/requests/compute/list_flavors_detail.rb +7 -7
- data/lib/fog/openstack/requests/compute/list_security_groups.rb +7 -7
- data/lib/fog/openstack/requests/compute/list_servers_detail.rb +4 -3
- data/lib/fog/openstack/requests/compute/list_volumes.rb +6 -8
- data/lib/fog/openstack/requests/compute/update_quota.rb +2 -15
- data/lib/fog/openstack/requests/identity/delete_role.rb +1 -1
- data/lib/fog/openstack/requests/identity/list_roles.rb +1 -1
- data/lib/fog/openstack/requests/image/create_image.rb +3 -1
- data/lib/fog/openstack/requests/image/list_public_images.rb +19 -1
- data/lib/fog/openstack/requests/image/list_public_images_detailed.rb +20 -2
- data/lib/fog/openstack/requests/image/update_image.rb +1 -1
- data/lib/fog/rackspace.rb +2 -0
- data/lib/fog/rackspace/databases.rb +121 -0
- data/lib/fog/rackspace/identity.rb +83 -0
- data/lib/fog/rackspace/load_balancers.rb +3 -0
- data/lib/fog/rackspace/models/databases/database.rb +32 -0
- data/lib/fog/rackspace/models/databases/databases.rb +31 -0
- data/lib/fog/rackspace/models/databases/flavor.rb +15 -0
- data/lib/fog/rackspace/models/databases/flavors.rb +25 -0
- data/lib/fog/rackspace/models/databases/instance.rb +104 -0
- data/lib/fog/rackspace/models/databases/instances.rb +25 -0
- data/lib/fog/rackspace/models/databases/user.rb +32 -0
- data/lib/fog/rackspace/models/databases/users.rb +31 -0
- data/lib/fog/rackspace/models/identity/credential.rb +13 -0
- data/lib/fog/rackspace/models/identity/credentials.rb +32 -0
- data/lib/fog/rackspace/models/identity/role.rb +14 -0
- data/lib/fog/rackspace/models/identity/roles.rb +32 -0
- data/lib/fog/rackspace/models/identity/tenant.rb +15 -0
- data/lib/fog/rackspace/models/identity/tenants.rb +28 -0
- data/lib/fog/rackspace/models/identity/user.rb +53 -0
- data/lib/fog/rackspace/models/identity/users.rb +36 -0
- data/lib/fog/rackspace/models/load_balancers/load_balancer.rb +17 -0
- data/lib/fog/rackspace/requests/databases/check_root_user.rb +15 -0
- data/lib/fog/rackspace/requests/databases/create_database.rb +24 -0
- data/lib/fog/rackspace/requests/databases/create_instance.rb +26 -0
- data/lib/fog/rackspace/requests/databases/create_user.rb +24 -0
- data/lib/fog/rackspace/requests/databases/delete_database.rb +15 -0
- data/lib/fog/rackspace/requests/databases/delete_instance.rb +15 -0
- data/lib/fog/rackspace/requests/databases/delete_user.rb +15 -0
- data/lib/fog/rackspace/requests/databases/enable_root_user.rb +15 -0
- data/lib/fog/rackspace/requests/databases/get_flavor.rb +15 -0
- data/lib/fog/rackspace/requests/databases/get_instance.rb +15 -0
- data/lib/fog/rackspace/requests/databases/list_databases.rb +15 -0
- data/lib/fog/rackspace/requests/databases/list_flavors.rb +15 -0
- data/lib/fog/rackspace/requests/databases/list_instances.rb +15 -0
- data/lib/fog/rackspace/requests/databases/list_users.rb +15 -0
- data/lib/fog/rackspace/requests/databases/resize_instance.rb +22 -0
- data/lib/fog/rackspace/requests/databases/resize_instance_volume.rb +24 -0
- data/lib/fog/rackspace/requests/databases/restart_instance.rb +20 -0
- data/lib/fog/rackspace/requests/identity/create_token.rb +25 -0
- data/lib/fog/rackspace/requests/identity/create_user.rb +25 -0
- data/lib/fog/rackspace/requests/identity/delete_user.rb +15 -0
- data/lib/fog/rackspace/requests/identity/get_credentials.rb +15 -0
- data/lib/fog/rackspace/requests/identity/get_user_by_id.rb +15 -0
- data/lib/fog/rackspace/requests/identity/get_user_by_name.rb +15 -0
- data/lib/fog/rackspace/requests/identity/list_credentials.rb +22 -0
- data/lib/fog/rackspace/requests/identity/list_tenants.rb +22 -0
- data/lib/fog/rackspace/requests/identity/list_user_roles.rb +22 -0
- data/lib/fog/rackspace/requests/identity/list_users.rb +22 -0
- data/lib/fog/rackspace/requests/identity/update_user.rb +24 -0
- data/lib/fog/rackspace/requests/load_balancers/get_ssl_termination.rb +15 -0
- data/lib/fog/rackspace/requests/load_balancers/remove_ssl_termination.rb +15 -0
- data/lib/fog/rackspace/requests/load_balancers/set_ssl_termination.rb +31 -0
- data/lib/fog/rackspace/storage.rb +1 -1
- data/lib/fog/vsphere/models/compute/server.rb +1 -0
- data/lib/fog/vsphere/requests/compute/vm_clone.rb +2 -2
- data/tests/aws/models/compute/address_tests.rb +2 -1
- data/tests/aws/models/compute/volume_tests.rb +1 -1
- data/tests/aws/models/dns/records_tests.rb +19 -1
- data/tests/aws/models/storage/directory_tests.rb +1 -1
- data/tests/aws/models/storage/url_tests.rb +7 -1
- data/tests/aws/requests/auto_scaling/auto_scaling_tests.rb +4 -2
- data/tests/aws/requests/compute/address_tests.rb +19 -1
- data/tests/aws/requests/elasticache/cache_cluster_tests.rb +4 -4
- data/tests/aws/requests/elb/helper.rb +13 -2
- data/tests/aws/requests/iam/access_key_tests.rb +1 -3
- data/tests/cloudstack/compute/models/security_group_rule_tests.rb +29 -0
- data/tests/cloudstack/compute/models/security_group_tests.rb +16 -0
- data/tests/cloudstack/compute/models/security_groups_tests.rb +19 -0
- data/tests/cloudstack/compute/models/server_tests.rb +18 -0
- data/tests/cloudstack/compute/models/volume_tests.rb +34 -0
- data/tests/cloudstack/compute/models/volumes_tests.rb +17 -0
- data/tests/compute/helper.rb +10 -3
- data/tests/core/current_machine_tests.rb +32 -0
- data/tests/helper.rb +1 -1
- data/tests/helpers/mock_helper.rb +3 -0
- data/tests/hp/requests/compute/address_tests.rb +2 -1
- data/tests/joyent/requests/compute/datasets_tests.rb +12 -3
- data/tests/local/models/file_tests.rb +43 -0
- data/tests/local/storage_tests.rb +40 -0
- data/tests/openstack/requests/compute/flavor_tests.rb +1 -1
- data/tests/openstack/requests/compute/server_tests.rb +3 -3
- data/tests/openstack/requests/compute/volume_tests.rb +1 -1
- data/tests/openstack/requests/identity/role_tests.rb +1 -1
- data/tests/rackspace/databases_tests.rb +26 -0
- data/tests/rackspace/models/databases/database_tests.rb +17 -0
- data/tests/rackspace/models/databases/databases_tests.rb +17 -0
- data/tests/rackspace/models/databases/flavors_tests.rb +20 -0
- data/tests/rackspace/models/databases/instance_tests.rb +43 -0
- data/tests/rackspace/models/databases/instances_tests.rb +14 -0
- data/tests/rackspace/models/databases/user_tests.rb +21 -0
- data/tests/rackspace/models/databases/users_tests.rb +21 -0
- data/tests/rackspace/models/identity/credentials_tests.rb +16 -0
- data/tests/rackspace/models/identity/roles_tests.rb +16 -0
- data/tests/rackspace/models/identity/tenants_tests.rb +21 -0
- data/tests/rackspace/models/identity/user_tests.rb +17 -0
- data/tests/rackspace/models/identity/users_tests.rb +17 -0
- data/tests/rackspace/models/load_balancers/load_balancer_tests.rb +20 -0
- data/tests/rackspace/requests/databases/database_tests.rb +36 -0
- data/tests/rackspace/requests/databases/flavor_tests.rb +16 -0
- data/tests/rackspace/requests/databases/helper.rb +84 -0
- data/tests/rackspace/requests/databases/instance_tests.rb +77 -0
- data/tests/rackspace/requests/databases/user_tests.rb +37 -0
- data/tests/rackspace/requests/identity/tenants_tests.rb +21 -0
- data/tests/rackspace/requests/identity/token_tests.rb +63 -0
- data/tests/rackspace/requests/identity/user_tests.rb +107 -0
- data/tests/rackspace/requests/load_balancers/helper.rb +70 -1
- data/tests/rackspace/requests/load_balancers/ssl_termination_tests.rb +38 -0
- data/tests/storage/models/file_tests.rb +1 -1
- metadata +129 -13
- data/spec/core/current_machine_spec.rb +0 -32
- data/spec/lib/fog/aws/parsers/sqs/receive_message_spec.rb +0 -58
- data/spec/spec_helper.rb +0 -8
@@ -0,0 +1,25 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class Identity
|
4
|
+
class Real
|
5
|
+
def create_token(username, api_key)
|
6
|
+
data = {
|
7
|
+
'auth' => {
|
8
|
+
'RAX-KSKEY:apiKeyCredentials' => {
|
9
|
+
'username' => username,
|
10
|
+
'apiKey' => api_key
|
11
|
+
}
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
request(
|
16
|
+
:body => Fog::JSON.encode(data),
|
17
|
+
:expects => [200, 203],
|
18
|
+
:method => 'POST',
|
19
|
+
:path => 'tokens'
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class Identity
|
4
|
+
class Real
|
5
|
+
def create_user(username, email, enabled, options = {})
|
6
|
+
data = {
|
7
|
+
'user' => {
|
8
|
+
'username' => username,
|
9
|
+
'email' => email,
|
10
|
+
'enabled' => enabled
|
11
|
+
}
|
12
|
+
}
|
13
|
+
data['user']['OS-KSADM:password'] = options[:password] unless options[:password].nil?
|
14
|
+
|
15
|
+
request(
|
16
|
+
:body => Fog::JSON.encode(data),
|
17
|
+
:expects => [201],
|
18
|
+
:method => 'POST',
|
19
|
+
:path => 'users'
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class Identity
|
4
|
+
class Real
|
5
|
+
def get_credentials(user_id)
|
6
|
+
request(
|
7
|
+
:expects => [200, 203],
|
8
|
+
:method => 'GET',
|
9
|
+
:path => "users/#{user_id}/OS-KSADM/credentials/RAX-KSKEY:apiKeyCredentials"
|
10
|
+
)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class Identity
|
4
|
+
class Real
|
5
|
+
def list_credentials(user_id)
|
6
|
+
response = request(
|
7
|
+
:expects => [200, 203],
|
8
|
+
:method => 'GET',
|
9
|
+
:path => "users/#{user_id}/OS-KSADM/credentials"
|
10
|
+
)
|
11
|
+
|
12
|
+
unless response.body['credentials'].is_a?(Array)
|
13
|
+
response.body['credentials'] = [response.body['credential']]
|
14
|
+
response.body.delete('credential')
|
15
|
+
end
|
16
|
+
|
17
|
+
response
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class Identity
|
4
|
+
class Real
|
5
|
+
def list_tenants()
|
6
|
+
response = request(
|
7
|
+
:expects => [200, 203],
|
8
|
+
:method => 'GET',
|
9
|
+
:path => 'tenants'
|
10
|
+
)
|
11
|
+
|
12
|
+
unless response.body['tenants'].is_a?(Array)
|
13
|
+
response.body['tenants'] = [response.body['tenant']]
|
14
|
+
response.body.delete('tenant')
|
15
|
+
end
|
16
|
+
|
17
|
+
response
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class Identity
|
4
|
+
class Real
|
5
|
+
def list_user_roles(user_id)
|
6
|
+
response = request(
|
7
|
+
:expects => [200, 203],
|
8
|
+
:method => 'GET',
|
9
|
+
:path => "users/#{user_id}/roles"
|
10
|
+
)
|
11
|
+
|
12
|
+
unless response.body['roles'].is_a?(Array)
|
13
|
+
response.body['roles'] = [response.body['role']]
|
14
|
+
response.body.delete('role')
|
15
|
+
end
|
16
|
+
|
17
|
+
response
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class Identity
|
4
|
+
class Real
|
5
|
+
def list_users()
|
6
|
+
response = request(
|
7
|
+
:expects => [200, 203],
|
8
|
+
:method => 'GET',
|
9
|
+
:path => 'users'
|
10
|
+
)
|
11
|
+
|
12
|
+
unless response.body['users'].is_a?(Array)
|
13
|
+
response.body['users'] = [response.body['user']]
|
14
|
+
response.body.delete('user')
|
15
|
+
end
|
16
|
+
|
17
|
+
response
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class Identity
|
4
|
+
class Real
|
5
|
+
def update_user(user_id, username, email, enabled, options = {})
|
6
|
+
data = {
|
7
|
+
'user' => {
|
8
|
+
'username' => username,
|
9
|
+
'email' => email,
|
10
|
+
'enabled' => enabled
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
request(
|
15
|
+
:body => Fog::JSON.encode(data),
|
16
|
+
:expects => [200, 203],
|
17
|
+
:method => 'POST',
|
18
|
+
:path => "users/#{user_id}"
|
19
|
+
)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class LoadBalancers
|
4
|
+
class Real
|
5
|
+
def get_ssl_termination(load_balancer_id)
|
6
|
+
request(
|
7
|
+
:expects => [200],
|
8
|
+
:path => "loadbalancers/#{load_balancer_id}/ssltermination",
|
9
|
+
:method => 'GET'
|
10
|
+
)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class LoadBalancers
|
4
|
+
class Real
|
5
|
+
def remove_ssl_termination(load_balancer_id)
|
6
|
+
request(
|
7
|
+
:expects => [200, 202],
|
8
|
+
:path => "loadbalancers/#{load_balancer_id}/ssltermination",
|
9
|
+
:method => 'DELETE'
|
10
|
+
)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class LoadBalancers
|
4
|
+
class Real
|
5
|
+
def set_ssl_termination(load_balancer_id, securePort, privatekey, certificate, options = {})
|
6
|
+
data = {
|
7
|
+
securePort: securePort,
|
8
|
+
privatekey: privatekey,
|
9
|
+
certificate: certificate
|
10
|
+
}
|
11
|
+
|
12
|
+
if options.has_key? :intermediate_certificate
|
13
|
+
data['intermediateCertificate'] = options[:intermediate_certificate]
|
14
|
+
end
|
15
|
+
if options.has_key? :enabled
|
16
|
+
data['enabled'] = options[:enabled]
|
17
|
+
end
|
18
|
+
if options.has_key? :secure_traffic_only
|
19
|
+
data['secureTrafficOnly'] = options[:secure_traffic_only]
|
20
|
+
end
|
21
|
+
request(
|
22
|
+
:body => Fog::JSON.encode(data),
|
23
|
+
:expects => [200, 202],
|
24
|
+
:path => "loadbalancers/#{load_balancer_id}/ssltermination",
|
25
|
+
:method => 'PUT'
|
26
|
+
)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -100,7 +100,7 @@ module Fog
|
|
100
100
|
|
101
101
|
def request(params, parse_json = true, &block)
|
102
102
|
begin
|
103
|
-
response = @connection.request(params.merge
|
103
|
+
response = @connection.request(params.merge({
|
104
104
|
:headers => {
|
105
105
|
'Content-Type' => 'application/json',
|
106
106
|
'X-Auth-Token' => @auth_token
|
@@ -22,7 +22,7 @@ module Fog
|
|
22
22
|
end
|
23
23
|
dc_name = path_elements.shift
|
24
24
|
if not self.datacenters.include? dc_name then
|
25
|
-
raise ArgumentError, "Datacenter #{dc_name} does not exist, only datacenters #{self.
|
25
|
+
raise ArgumentError, "Datacenter #{dc_name} does not exist, only datacenters #{self.datacenters.join(",")} are accessible."
|
26
26
|
end
|
27
27
|
options
|
28
28
|
end
|
@@ -166,7 +166,7 @@ module Fog
|
|
166
166
|
def vm_clone(options = {})
|
167
167
|
# Option handling
|
168
168
|
options = vm_clone_check_options(options)
|
169
|
-
notfound = lambda { raise Fog::Compute::Vsphere::NotFound, "
|
169
|
+
notfound = lambda { raise Fog::Compute::Vsphere::NotFound, "Could not find VM template" }
|
170
170
|
vm_mob_ref = list_virtual_machines['virtual_machines'].find(notfound) do |vm|
|
171
171
|
vm['name'] == options['path'].split("/")[-1]
|
172
172
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Shindo.tests("Fog::DNS[:aws] | records", ['aws', 'dns']) do
|
2
|
-
|
3
2
|
pending if Fog.mocking?
|
3
|
+
|
4
4
|
tests("zones#create").succeeds do
|
5
5
|
@zone = Fog::DNS[:aws].zones.create(:domain => generate_unique_domain)
|
6
6
|
end
|
@@ -16,6 +16,24 @@ Shindo.tests("Fog::DNS[:aws] | records", ['aws', 'dns']) do
|
|
16
16
|
collection_tests(@zone.records, params, false)
|
17
17
|
end
|
18
18
|
|
19
|
+
records = []
|
20
|
+
|
21
|
+
100.times do |i|
|
22
|
+
records << @zone.records.create(:name => "#{i}.#{@zone.domain}", :type => "A", :ttl => 3600, :value => ['1.2.3.4'])
|
23
|
+
end
|
24
|
+
|
25
|
+
tests("#all!").returns(102) do
|
26
|
+
@zone.records.all!.size
|
27
|
+
end
|
28
|
+
|
29
|
+
tests("#all!").returns(102) do
|
30
|
+
@zone.records.all!.size
|
31
|
+
end
|
32
|
+
|
33
|
+
records.each do |record|
|
34
|
+
record.destroy
|
35
|
+
end
|
36
|
+
|
19
37
|
tests("zones#destroy").succeeds do
|
20
38
|
@zone.destroy
|
21
39
|
end
|
@@ -17,7 +17,7 @@ Shindo.tests("Storage[:aws] | directory", [:aws]) do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
tests("#versioning=(false)").succeeds do
|
20
|
-
@instance.versioning = false
|
20
|
+
(@instance.versioning = false).equal? false
|
21
21
|
end
|
22
22
|
|
23
23
|
tests("#versioning=(false) sets versioning to 'Suspended'").returns('Suspended') do
|
@@ -13,8 +13,14 @@ Shindo.tests('AWS | url') do
|
|
13
13
|
|
14
14
|
@file = @storage.directories.new(key: 'fognonbucket').files.new(key: 'test.txt')
|
15
15
|
|
16
|
+
if Fog.mock?
|
17
|
+
signature = Fog::Storage::AWS.new.signature(nil)
|
18
|
+
else
|
19
|
+
signature = 'tajHIhKHAdFYsigmzybCpaq8N0Q%3D'
|
20
|
+
end
|
21
|
+
|
16
22
|
tests('#url w/ response-cache-control').returns(
|
17
|
-
|
23
|
+
"https://fognonbucket.s3.amazonaws.com/test.txt?response-cache-control=No-cache&AWSAccessKeyId=123&Signature=#{signature}&Expires=1356998400"
|
18
24
|
) do
|
19
25
|
@file.url(@expires, query: { 'response-cache-control' => 'No-cache' })
|
20
26
|
end
|
@@ -3,8 +3,6 @@ Shindo.tests('AWS::AutoScaling | auto_scaling_tests', ['aws', 'auto_scaling']) d
|
|
3
3
|
@lc_name = 'fog-test-lc'
|
4
4
|
|
5
5
|
tests('success') do
|
6
|
-
pending if Fog.mocking?
|
7
|
-
|
8
6
|
tests("#describe_adjustment_types").formats(AWS::AutoScaling::Formats::DESCRIBE_ADJUSTMENT_TYPES) do
|
9
7
|
Fog::AWS[:auto_scaling].describe_adjustment_types.body
|
10
8
|
end
|
@@ -54,15 +52,19 @@ Shindo.tests('AWS::AutoScaling | auto_scaling_tests', ['aws', 'auto_scaling']) d
|
|
54
52
|
end
|
55
53
|
|
56
54
|
tests("#describe_scaling_activities").formats(AWS::AutoScaling::Formats::DESCRIBE_SCALING_ACTIVITIES) do
|
55
|
+
pending if Fog.mocking?
|
57
56
|
Fog::AWS[:auto_scaling].describe_scaling_activities().body
|
58
57
|
end
|
59
58
|
tests("#describe_scaling_activities").formats(AWS::AutoScaling::Formats::DESCRIBE_SCALING_ACTIVITIES) do
|
59
|
+
pending if Fog.mocking?
|
60
60
|
Fog::AWS[:auto_scaling].describe_scaling_activities('ActivityIds' => '1').body
|
61
61
|
end
|
62
62
|
tests("#describe_scaling_activities").formats(AWS::AutoScaling::Formats::DESCRIBE_SCALING_ACTIVITIES) do
|
63
|
+
pending if Fog.mocking?
|
63
64
|
Fog::AWS[:auto_scaling].describe_scaling_activities('ActivityIds' => ['1', '2']).body
|
64
65
|
end
|
65
66
|
tests("#describe_scaling_activities").formats(AWS::AutoScaling::Formats::DESCRIBE_SCALING_ACTIVITIES) do
|
67
|
+
pending if Fog.mocking?
|
66
68
|
Fog::AWS[:auto_scaling].describe_scaling_activities('AutoScalingGroupName' => @asg_name).body
|
67
69
|
end
|
68
70
|
|