fog 1.31.0 → 1.32.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +53 -0
- data/Rakefile +5 -5
- data/fog.gemspec +6 -5
- data/lib/fog/cloudstack/models/compute/network.rb +1 -0
- data/lib/fog/openstack/compute.rb +41 -98
- data/lib/fog/openstack/core.rb +257 -118
- data/lib/fog/openstack/identity.rb +4 -0
- data/lib/fog/openstack/identity_v3.rb +10 -41
- data/lib/fog/openstack/models/baremetal/chassis_collection.rb +10 -4
- data/lib/fog/openstack/models/baremetal/drivers.rb +4 -2
- data/lib/fog/openstack/models/baremetal/nodes.rb +10 -4
- data/lib/fog/openstack/models/baremetal/ports.rb +10 -4
- data/lib/fog/openstack/models/compute/addresses.rb +4 -2
- data/lib/fog/openstack/models/compute/aggregate.rb +64 -0
- data/lib/fog/openstack/models/compute/aggregates.rb +28 -0
- data/lib/fog/openstack/models/compute/flavors.rb +5 -0
- data/lib/fog/openstack/models/compute/hosts.rb +4 -2
- data/lib/fog/openstack/models/compute/images.rb +2 -0
- data/lib/fog/openstack/models/compute/key_pairs.rb +4 -2
- data/lib/fog/openstack/models/compute/security_groups.rb +4 -2
- data/lib/fog/openstack/models/compute/servers.rb +2 -0
- data/lib/fog/openstack/models/compute/services.rb +7 -4
- data/lib/fog/openstack/models/compute/snapshots.rb +15 -2
- data/lib/fog/openstack/models/compute/volumes.rb +15 -2
- data/lib/fog/openstack/models/identity_v2/ec2_credentials.rb +6 -3
- data/lib/fog/openstack/models/identity_v2/roles.rb +5 -3
- data/lib/fog/openstack/models/identity_v2/tenants.rb +5 -3
- data/lib/fog/openstack/models/identity_v2/users.rb +7 -3
- data/lib/fog/openstack/models/identity_v3/domains.rb +7 -6
- data/lib/fog/openstack/models/identity_v3/endpoints.rb +5 -4
- data/lib/fog/openstack/models/identity_v3/groups.rb +5 -3
- data/lib/fog/openstack/models/identity_v3/os_credentials.rb +5 -3
- data/lib/fog/openstack/models/identity_v3/policies.rb +5 -3
- data/lib/fog/openstack/models/identity_v3/project.rb +1 -0
- data/lib/fog/openstack/models/identity_v3/projects.rb +7 -5
- data/lib/fog/openstack/models/identity_v3/role_assignments.rb +10 -5
- data/lib/fog/openstack/models/identity_v3/roles.rb +11 -5
- data/lib/fog/openstack/models/identity_v3/services.rb +5 -3
- data/lib/fog/openstack/models/identity_v3/users.rb +4 -2
- data/lib/fog/openstack/models/image/images.rb +10 -4
- data/lib/fog/openstack/models/network/floating_ips.rb +2 -0
- data/lib/fog/openstack/models/network/lb_health_monitors.rb +2 -0
- data/lib/fog/openstack/models/network/lb_members.rb +2 -0
- data/lib/fog/openstack/models/network/lb_pools.rb +2 -0
- data/lib/fog/openstack/models/network/lb_vips.rb +2 -0
- data/lib/fog/openstack/models/network/networks.rb +2 -0
- data/lib/fog/openstack/models/network/port.rb +1 -0
- data/lib/fog/openstack/models/network/ports.rb +2 -0
- data/lib/fog/openstack/models/network/routers.rb +2 -0
- data/lib/fog/openstack/models/network/security_group_rules.rb +2 -0
- data/lib/fog/openstack/models/network/security_groups.rb +2 -0
- data/lib/fog/openstack/models/network/subnets.rb +2 -0
- data/lib/fog/openstack/models/orchestration/events.rb +10 -6
- data/lib/fog/openstack/models/orchestration/resources.rb +4 -2
- data/lib/fog/openstack/models/orchestration/stack.rb +1 -1
- data/lib/fog/openstack/models/orchestration/stacks.rb +9 -1
- data/lib/fog/openstack/models/planning/plans.rb +4 -2
- data/lib/fog/openstack/models/planning/roles.rb +5 -2
- data/lib/fog/openstack/models/storage/directories.rb +4 -2
- data/lib/fog/openstack/models/storage/files.rb +2 -0
- data/lib/fog/openstack/models/volume/volume.rb +1 -0
- data/lib/fog/openstack/models/volume/volume_types.rb +2 -0
- data/lib/fog/openstack/models/volume/volumes.rb +13 -2
- data/lib/fog/openstack/network.rb +18 -97
- data/lib/fog/openstack/orchestration.rb +2 -0
- data/lib/fog/openstack/requests/baremetal/list_chassis.rb +2 -8
- data/lib/fog/openstack/requests/baremetal/list_chassis_detailed.rb +3 -9
- data/lib/fog/openstack/requests/baremetal/list_drivers.rb +4 -3
- data/lib/fog/openstack/requests/baremetal/list_nodes.rb +3 -9
- data/lib/fog/openstack/requests/baremetal/list_nodes_detailed.rb +3 -9
- data/lib/fog/openstack/requests/baremetal/list_ports.rb +3 -9
- data/lib/fog/openstack/requests/baremetal/list_ports_detailed.rb +3 -9
- data/lib/fog/openstack/requests/compute/add_aggregate_host.rb +30 -0
- data/lib/fog/openstack/requests/compute/create_aggregate.rb +42 -0
- data/lib/fog/openstack/requests/compute/delete_aggregate.rb +28 -0
- data/lib/fog/openstack/requests/compute/get_aggregate.rb +26 -0
- data/lib/fog/openstack/requests/compute/list_aggregates.rb +36 -0
- data/lib/fog/openstack/requests/compute/list_all_addresses.rb +4 -3
- data/lib/fog/openstack/requests/compute/list_flavors.rb +6 -5
- data/lib/fog/openstack/requests/compute/list_hosts.rb +4 -3
- data/lib/fog/openstack/requests/compute/list_key_pairs.rb +4 -3
- data/lib/fog/openstack/requests/compute/list_security_groups.rb +15 -2
- data/lib/fog/openstack/requests/compute/list_snapshots.rb +18 -4
- data/lib/fog/openstack/requests/compute/list_snapshots_detail.rb +27 -0
- data/lib/fog/openstack/requests/compute/list_volumes.rb +18 -4
- data/lib/fog/openstack/requests/compute/list_volumes_detail.rb +25 -0
- data/lib/fog/openstack/requests/compute/remove_aggregate_host.rb +30 -0
- data/lib/fog/openstack/requests/compute/update_aggregate.rb +37 -0
- data/lib/fog/openstack/requests/compute/update_aggregate_metadata.rb +30 -0
- data/lib/fog/openstack/requests/identity_v2/list_ec2_credentials.rb +23 -7
- data/lib/fog/openstack/requests/identity_v2/list_roles.rb +5 -4
- data/lib/fog/openstack/requests/identity_v2/list_tenants.rb +14 -8
- data/lib/fog/openstack/requests/identity_v2/list_users.rb +16 -4
- data/lib/fog/openstack/requests/identity_v3/auth_domains.rb +2 -7
- data/lib/fog/openstack/requests/identity_v3/auth_projects.rb +6 -11
- data/lib/fog/openstack/requests/identity_v3/list_domains.rb +7 -14
- data/lib/fog/openstack/requests/identity_v3/list_endpoints.rb +7 -14
- data/lib/fog/openstack/requests/identity_v3/list_group_users.rb +5 -13
- data/lib/fog/openstack/requests/identity_v3/list_groups.rb +14 -24
- data/lib/fog/openstack/requests/identity_v3/list_os_credentials.rb +7 -12
- data/lib/fog/openstack/requests/identity_v3/list_policies.rb +7 -11
- data/lib/fog/openstack/requests/identity_v3/list_projects.rb +14 -25
- data/lib/fog/openstack/requests/identity_v3/list_role_assignments.rb +21 -17
- data/lib/fog/openstack/requests/identity_v3/list_roles.rb +7 -25
- data/lib/fog/openstack/requests/identity_v3/list_services.rb +7 -13
- data/lib/fog/openstack/requests/identity_v3/list_users.rb +7 -15
- data/lib/fog/openstack/requests/image/list_public_images.rb +4 -3
- data/lib/fog/openstack/requests/image/list_public_images_detailed.rb +9 -6
- data/lib/fog/openstack/requests/network/create_port.rb +12 -11
- data/lib/fog/openstack/requests/network/create_subnet.rb +7 -7
- data/lib/fog/openstack/requests/network/get_port.rb +1 -0
- data/lib/fog/openstack/requests/network/update_port.rb +7 -6
- data/lib/fog/openstack/requests/orchestration/list_events.rb +46 -0
- data/lib/fog/openstack/requests/orchestration/list_resource_events.rb +7 -2
- data/lib/fog/openstack/requests/orchestration/list_resource_types.rb +3 -2
- data/lib/fog/openstack/requests/orchestration/list_resources.rb +27 -4
- data/lib/fog/openstack/requests/orchestration/list_stack_data.rb +2 -2
- data/lib/fog/openstack/requests/orchestration/list_stack_data_detailed.rb +49 -0
- data/lib/fog/openstack/requests/orchestration/list_stack_events.rb +6 -2
- data/lib/fog/openstack/requests/planning/list_plans.rb +4 -3
- data/lib/fog/openstack/requests/planning/list_roles.rb +3 -9
- data/lib/fog/openstack/requests/volume/create_volume.rb +2 -1
- data/lib/fog/openstack/requests/volume/list_snapshots.rb +16 -3
- data/lib/fog/openstack/requests/volume/list_snapshots_detailed.rb +27 -0
- data/lib/fog/openstack/requests/volume/list_volume_types.rb +6 -6
- data/lib/fog/openstack/requests/volume/list_volumes.rb +20 -7
- data/lib/fog/openstack/requests/volume/list_volumes_detailed.rb +49 -0
- data/lib/fog/openstack/volume.rb +1 -0
- data/lib/fog/ovirt/models/compute/server.rb +1 -0
- data/lib/fog/ovirt/models/compute/template.rb +1 -0
- data/lib/fog/rackspace/docs/queues.md +2 -2
- data/lib/fog/rackspace/models/block_storage/snapshot.rb +5 -1
- data/lib/fog/version.rb +1 -1
- data/lib/fog/vsphere/requests/compute/vm_clone.rb +1 -1
- data/lib/tasks/changelog_task.rb +1 -0
- data/spec/fog/openstack/identity_v3/authv3_a.yml +55 -35
- data/spec/fog/openstack/identity_v3/authv3_b.yml +55 -35
- data/spec/fog/openstack/identity_v3/authv3_c.yml +159 -33
- data/spec/fog/openstack/identity_v3/authv3_project.yml +79 -35
- data/spec/fog/openstack/identity_v3/authv3_token.yml +377 -76
- data/spec/fog/openstack/identity_v3/authv3_unscoped.yml +298 -155
- data/spec/fog/openstack/identity_v3/authv3_unscoped_reauth.yml +371 -0
- data/spec/fog/openstack/identity_v3/idv3.yml +456 -41
- data/spec/fog/openstack/identity_v3/idv3_credential.yml +36 -30
- data/spec/fog/openstack/identity_v3/idv3_credential_crud.yml +223 -190
- data/spec/fog/openstack/identity_v3/idv3_domain.yml +64 -58
- data/spec/fog/openstack/identity_v3/idv3_domain_crud.yml +176 -393
- data/spec/fog/openstack/identity_v3/idv3_domain_group_roles_mutation.yml +277 -379
- data/spec/fog/openstack/identity_v3/idv3_domain_roles_mutation.yml +177 -204
- data/spec/fog/openstack/identity_v3/idv3_endpoint.yml +492 -174
- data/spec/fog/openstack/identity_v3/idv3_endpoints_crud.yml +669 -435
- data/spec/fog/openstack/identity_v3/idv3_group_crud_mutation.yml +378 -298
- data/spec/fog/openstack/identity_v3/idv3_other_region.yml +187 -0
- data/spec/fog/openstack/identity_v3/idv3_policy.yml +54 -46
- data/spec/fog/openstack/identity_v3/idv3_policy_crud.yml +137 -117
- data/spec/fog/openstack/identity_v3/idv3_project.yml +116 -86
- data/spec/fog/openstack/identity_v3/idv3_project_crud.yml +179 -387
- data/spec/fog/openstack/identity_v3/idv3_project_group_user_roles_mutation.yml +415 -556
- data/spec/fog/openstack/identity_v3/idv3_role.yml +108 -74
- data/spec/fog/openstack/identity_v3/idv3_role_crud.yml +160 -368
- data/spec/fog/openstack/identity_v3/idv3_service.yml +156 -94
- data/spec/fog/openstack/identity_v3/idv3_services_crud.yml +250 -306
- data/spec/fog/openstack/identity_v3/idv3_token.yml +195 -101
- data/spec/fog/openstack/identity_v3/idv3_user_crud.yml +276 -193
- data/spec/fog/openstack/identity_v3/idv3_users.yml +149 -219
- data/spec/fog/openstack/identity_v3_spec.rb +502 -474
- data/spec/fog/openstack/volume/volume_common_setup.yml +76 -0
- data/spec/fog/openstack/volume/volume_crud.yml +561 -0
- data/spec/fog/openstack/volume/volume_type_read.yml +120 -0
- data/spec/fog/openstack/volume_spec.rb +165 -0
- data/tests/openstack/requests/compute/aggregate_tests.rb +59 -0
- data/tests/openstack/requests/network/port_tests.rb +12 -11
- data/tests/openstack/requests/orchestration/stack_tests.rb +25 -0
- metadata +56 -14
- data/spec/fog/openstack/identity_v3/idv2_unscoped_token_v3.yml +0 -467
@@ -0,0 +1,25 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class OpenStack
|
4
|
+
class Real
|
5
|
+
def list_volumes_detail(options = {})
|
6
|
+
request(
|
7
|
+
:expects => 200,
|
8
|
+
:method => 'GET',
|
9
|
+
:path => 'os-volumes/detail',
|
10
|
+
:query => options
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Mock
|
16
|
+
def list_volumes_detail(options = {})
|
17
|
+
Excon::Response.new(
|
18
|
+
:body => { 'volumes' => self.data[:volumes].values },
|
19
|
+
:status => 200
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class OpenStack
|
4
|
+
class Real
|
5
|
+
def remove_aggregate_host(uuid, host_uuid)
|
6
|
+
data = {'remove_host' => {'host' => host_uuid}}
|
7
|
+
request(
|
8
|
+
:body => Fog::JSON.encode(data),
|
9
|
+
:expects => [200],
|
10
|
+
:method => 'POST',
|
11
|
+
:path => "os-aggregates/#{uuid}/action"
|
12
|
+
)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class Mock
|
17
|
+
def remove_aggregate_host(uuid, host_uuid)
|
18
|
+
response = Excon::Response.new
|
19
|
+
response.status = 200
|
20
|
+
response.headers = {
|
21
|
+
"Content-Type" => "text/html; charset=UTF-8",
|
22
|
+
"Content-Length" => "0",
|
23
|
+
"Date" => Date.new
|
24
|
+
}
|
25
|
+
response
|
26
|
+
end
|
27
|
+
end # mock
|
28
|
+
end # openstack
|
29
|
+
end # compute
|
30
|
+
end # fog
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class OpenStack
|
4
|
+
class Real
|
5
|
+
def update_aggregate(uuid, options = {})
|
6
|
+
vanilla_options = ['name', 'availability_zone']
|
7
|
+
|
8
|
+
data = {'aggregate' => {}}
|
9
|
+
vanilla_options.select{|o| options[o]}.each do |key|
|
10
|
+
data['aggregate'][key] = options[key]
|
11
|
+
end
|
12
|
+
|
13
|
+
request(
|
14
|
+
:body => Fog::JSON.encode(data),
|
15
|
+
:expects => [200],
|
16
|
+
:method => 'PUT',
|
17
|
+
:path => "os-aggregates/#{uuid}"
|
18
|
+
)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class Mock
|
23
|
+
def update_aggregate(uuid, options = {})
|
24
|
+
response = Excon::Response.new
|
25
|
+
response.status = 200
|
26
|
+
response.headers = {
|
27
|
+
"Content-Type" => "text/html; charset=UTF-8",
|
28
|
+
"Content-Length" => "0",
|
29
|
+
"Date" => Date.new
|
30
|
+
}
|
31
|
+
response.body = {'aggregate' => self.data[:aggregates].first}
|
32
|
+
response
|
33
|
+
end
|
34
|
+
end # mock
|
35
|
+
end # openstack
|
36
|
+
end # compute
|
37
|
+
end # fog
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class OpenStack
|
4
|
+
class Real
|
5
|
+
def update_aggregate_metadata(uuid, metadata = {})
|
6
|
+
data = {'set_metadata' => {'metadata' => metadata}}
|
7
|
+
request(
|
8
|
+
:body => Fog::JSON.encode(data),
|
9
|
+
:expects => [200],
|
10
|
+
:method => 'POST',
|
11
|
+
:path => "os-aggregates/#{uuid}/action"
|
12
|
+
)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class Mock
|
17
|
+
def update_aggregate_metadata(uuid, metadata = {})
|
18
|
+
response = Excon::Response.new
|
19
|
+
response.status = 200
|
20
|
+
response.headers = {
|
21
|
+
"Content-Type" => "text/html; charset=UTF-8",
|
22
|
+
"Content-Length" => "0",
|
23
|
+
"Date" => Date.new
|
24
|
+
}
|
25
|
+
response
|
26
|
+
end
|
27
|
+
end # mock
|
28
|
+
end # openstack
|
29
|
+
end # compute
|
30
|
+
end # fog
|
@@ -7,8 +7,8 @@ module Fog
|
|
7
7
|
# List EC2 credentials for a user. Requires administrator
|
8
8
|
# credentials.
|
9
9
|
#
|
10
|
-
# ==== Parameters
|
11
|
-
# * user_id<~String>: The id of the user to retrieve the credential
|
10
|
+
# ==== Parameters hash
|
11
|
+
# * :user_id<~String>: The id of the user to retrieve the credential
|
12
12
|
# for
|
13
13
|
#
|
14
14
|
# ==== Returns
|
@@ -20,17 +20,33 @@ module Fog
|
|
20
20
|
# * 'user_id'<~String>: The user id
|
21
21
|
# * 'tenant_id'<~String>: The tenant id
|
22
22
|
|
23
|
-
def list_ec2_credentials(
|
23
|
+
def list_ec2_credentials(options = {})
|
24
|
+
if options.is_a?(Hash)
|
25
|
+
user_id = options.delete(:user_id)
|
26
|
+
query = options
|
27
|
+
else
|
28
|
+
Fog::Logger.deprecation('Calling OpenStack[:identity].list_ec2_credentials(user_id) is deprecated, use .list_ec2_credentials(:user_id => value)')
|
29
|
+
user_id = options
|
30
|
+
query = {}
|
31
|
+
end
|
32
|
+
|
24
33
|
request(
|
25
|
-
|
26
|
-
|
27
|
-
|
34
|
+
:expects => [200, 202],
|
35
|
+
:method => 'GET',
|
36
|
+
:path => "users/#{user_id}/credentials/OS-EC2",
|
37
|
+
:query => query
|
28
38
|
)
|
29
39
|
end
|
30
40
|
end
|
31
41
|
|
32
42
|
class Mock
|
33
|
-
def list_ec2_credentials(
|
43
|
+
def list_ec2_credentials(options = {})
|
44
|
+
if options.is_a?(Hash)
|
45
|
+
user_id = options.delete(:user_id)
|
46
|
+
else
|
47
|
+
user_id = options
|
48
|
+
end
|
49
|
+
|
34
50
|
ec2_credentials = self.data[:ec2_credentials][user_id].values
|
35
51
|
|
36
52
|
response = Excon::Response.new
|
@@ -3,17 +3,18 @@ module Fog
|
|
3
3
|
class OpenStack
|
4
4
|
class V2
|
5
5
|
class Real
|
6
|
-
def list_roles
|
6
|
+
def list_roles(options = {})
|
7
7
|
request(
|
8
8
|
:expects => 200,
|
9
|
-
:method
|
10
|
-
:path
|
9
|
+
:method => 'GET',
|
10
|
+
:path => '/OS-KSADM/roles',
|
11
|
+
:query => options
|
11
12
|
)
|
12
13
|
end
|
13
14
|
end
|
14
15
|
|
15
16
|
class Mock
|
16
|
-
def list_roles
|
17
|
+
def list_roles(options = {})
|
17
18
|
if self.data[:roles].empty?
|
18
19
|
['admin', 'Member'].each do |name|
|
19
20
|
id = Fog::Mock.random_hex(32)
|
@@ -3,22 +3,28 @@ module Fog
|
|
3
3
|
class OpenStack
|
4
4
|
class V2
|
5
5
|
class Real
|
6
|
-
def list_tenants(
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
def list_tenants(options = nil, marker = nil)
|
7
|
+
if options.is_a?(Hash)
|
8
|
+
params = options
|
9
|
+
else
|
10
|
+
Fog::Logger.deprecation('Calling OpenStack[:identity].list_tenants(limit, marker) is deprecated, use'\
|
11
|
+
' .list_ec2_credentials(:limit => value, :marker => value)')
|
12
|
+
params = {}
|
13
|
+
params['limit'] = options if options
|
14
|
+
params['marker'] = marker if marker
|
15
|
+
end
|
10
16
|
|
11
17
|
request(
|
12
18
|
:expects => [200, 204],
|
13
|
-
:method
|
14
|
-
:path
|
15
|
-
:query
|
19
|
+
:method => 'GET',
|
20
|
+
:path => "tenants",
|
21
|
+
:query => params
|
16
22
|
)
|
17
23
|
end
|
18
24
|
end # class Real
|
19
25
|
|
20
26
|
class Mock
|
21
|
-
def list_tenants
|
27
|
+
def list_tenants(options = nil, marker = nil)
|
22
28
|
Excon::Response.new(
|
23
29
|
:body => {
|
24
30
|
'tenants_links' => [],
|
@@ -3,18 +3,30 @@ module Fog
|
|
3
3
|
class OpenStack
|
4
4
|
class V2
|
5
5
|
class Real
|
6
|
-
def list_users(
|
6
|
+
def list_users(options = {})
|
7
|
+
if options.is_a?(Hash)
|
8
|
+
tenant_id = options.delete(:tenant_id)
|
9
|
+
query = options
|
10
|
+
else
|
11
|
+
Fog::Logger.deprecation('Calling OpenStack[:identity].list_users(tenant_id) is deprecated, use .list_users(:tenant_id => value)')
|
12
|
+
tenant_id = options
|
13
|
+
query = {}
|
14
|
+
end
|
15
|
+
|
7
16
|
path = tenant_id ? "tenants/#{tenant_id}/users" : 'users'
|
8
17
|
request(
|
9
18
|
:expects => [200, 204],
|
10
|
-
:method
|
11
|
-
:path
|
19
|
+
:method => 'GET',
|
20
|
+
:path => path,
|
21
|
+
:query => query
|
12
22
|
)
|
13
23
|
end
|
14
24
|
end # class Real
|
15
25
|
|
16
26
|
class Mock
|
17
|
-
def list_users(
|
27
|
+
def list_users(options = {})
|
28
|
+
tenant_id = options[:tenant_id]
|
29
|
+
|
18
30
|
users = self.data[:users].values
|
19
31
|
|
20
32
|
if tenant_id
|
@@ -2,18 +2,13 @@ module Fog
|
|
2
2
|
module Identity
|
3
3
|
class OpenStack
|
4
4
|
class V3
|
5
|
-
|
6
5
|
class Real
|
7
6
|
def auth_domains(options={})
|
8
|
-
params = Hash.new
|
9
|
-
params['page'] = options.fetch(:page, 1)
|
10
|
-
params['per_page'] = options.fetch(:per_page, 30)
|
11
|
-
|
12
7
|
request(
|
13
8
|
:expects => [200],
|
14
9
|
:method => 'GET',
|
15
10
|
:path => "auth/domains",
|
16
|
-
:query =>
|
11
|
+
:query => options
|
17
12
|
)
|
18
13
|
end
|
19
14
|
end
|
@@ -26,4 +21,4 @@ module Fog
|
|
26
21
|
end
|
27
22
|
end
|
28
23
|
end
|
29
|
-
end
|
24
|
+
end
|
@@ -3,18 +3,13 @@ module Fog
|
|
3
3
|
class OpenStack
|
4
4
|
class V3
|
5
5
|
class Real
|
6
|
-
def auth_projects(options={})
|
7
|
-
params = Hash.new
|
8
|
-
params['page'] = options.fetch(:page, 1)
|
9
|
-
params['per_page'] = options.fetch(:per_page, 30)
|
10
|
-
|
6
|
+
def auth_projects(options = {})
|
11
7
|
request(
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "auth/projects",
|
11
|
+
:query => options
|
16
12
|
)
|
17
|
-
|
18
13
|
end
|
19
14
|
end
|
20
15
|
|
@@ -26,4 +21,4 @@ module Fog
|
|
26
21
|
end
|
27
22
|
end
|
28
23
|
end
|
29
|
-
end
|
24
|
+
end
|
@@ -3,29 +3,22 @@ module Fog
|
|
3
3
|
class OpenStack
|
4
4
|
class V3
|
5
5
|
class Real
|
6
|
-
def list_domains(options={})
|
7
|
-
params = Hash.new
|
8
|
-
params['name'] = options[:name] if options[:name]
|
9
|
-
params['enabled'] = options[:enabled] if options[:enabled]
|
10
|
-
|
11
|
-
params['page'] = options.fetch(:page, 1)
|
12
|
-
params['per_page'] = options.fetch(:per_page, 30)
|
13
|
-
|
6
|
+
def list_domains(options = {})
|
14
7
|
request(
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "domains",
|
11
|
+
:query => options
|
19
12
|
)
|
20
13
|
end
|
21
14
|
end
|
22
15
|
|
23
16
|
class Mock
|
24
|
-
def list_domains
|
17
|
+
def list_domains(options = {})
|
25
18
|
|
26
19
|
end
|
27
20
|
end
|
28
21
|
end
|
29
22
|
end
|
30
23
|
end
|
31
|
-
end
|
24
|
+
end
|
@@ -3,29 +3,22 @@ module Fog
|
|
3
3
|
class OpenStack
|
4
4
|
class V3
|
5
5
|
class Real
|
6
|
-
def list_endpoints(options={})
|
7
|
-
params = Hash.new
|
8
|
-
params['service_id'] = options[:service_id] if options[:service_id]
|
9
|
-
params['interface'] = options[:interface] if options[:interface]
|
10
|
-
|
11
|
-
params['page'] = options.fetch(:page, 1)
|
12
|
-
params['per_page'] = options.fetch(:per_page, 30)
|
13
|
-
|
6
|
+
def list_endpoints(options = {})
|
14
7
|
request(
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "endpoints",
|
11
|
+
:query => options
|
19
12
|
)
|
20
13
|
end
|
21
14
|
end
|
22
15
|
|
23
16
|
class Mock
|
24
|
-
def list_endpoints
|
17
|
+
def list_endpoints(options={})
|
25
18
|
|
26
19
|
end
|
27
20
|
end
|
28
21
|
end
|
29
22
|
end
|
30
23
|
end
|
31
|
-
end
|
24
|
+
end
|
@@ -4,19 +4,11 @@ module Fog
|
|
4
4
|
class V3
|
5
5
|
class Real
|
6
6
|
def list_group_users(id, options={})
|
7
|
-
params = Hash.new
|
8
|
-
params['name'] = options[:name] if options[:name]
|
9
|
-
params['domain_id'] = options[:domain_id] if options[:domain_id]
|
10
|
-
params['description'] = options[:description] if options[:description]
|
11
|
-
|
12
|
-
params['page'] = options.fetch(:page, 1)
|
13
|
-
params['per_page'] = options.fetch(:per_page, 30)
|
14
|
-
|
15
7
|
request(
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "groups/#{id}/users",
|
11
|
+
:query => options
|
20
12
|
)
|
21
13
|
end
|
22
14
|
end
|
@@ -29,4 +21,4 @@ module Fog
|
|
29
21
|
end
|
30
22
|
end
|
31
23
|
end
|
32
|
-
end
|
24
|
+
end
|
@@ -3,40 +3,30 @@ module Fog
|
|
3
3
|
class OpenStack
|
4
4
|
class V3
|
5
5
|
class Real
|
6
|
-
def list_groups(options={})
|
7
|
-
|
8
|
-
params['user_id'] = options[:user_id] if options[:user_id]
|
9
|
-
params['domain_id'] = options[:domain_id] if options[:domain_id]
|
10
|
-
params['name'] = options[:name] if options[:name]
|
11
|
-
params['enabled'] = options[:enabled] if options[:enabled]
|
6
|
+
def list_groups(options = {})
|
7
|
+
user_id = options.delete('user_id') || options.delete(:user_id)
|
12
8
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
if params['user_id'] then
|
17
|
-
request(
|
18
|
-
:expects => [200],
|
19
|
-
:method => 'GET',
|
20
|
-
:path => "users/#{params['user_id']}groups",
|
21
|
-
:query => params
|
22
|
-
)
|
9
|
+
if user_id
|
10
|
+
path = "users/#{user_id}groups"
|
23
11
|
else
|
24
|
-
|
25
|
-
:expects => [200],
|
26
|
-
:method => 'GET',
|
27
|
-
:path => "groups",
|
28
|
-
:query => params
|
29
|
-
)
|
12
|
+
path = "groups"
|
30
13
|
end
|
14
|
+
|
15
|
+
request(
|
16
|
+
:expects => [200],
|
17
|
+
:method => 'GET',
|
18
|
+
:path => path,
|
19
|
+
:query => options
|
20
|
+
)
|
31
21
|
end
|
32
22
|
end
|
33
23
|
|
34
24
|
class Mock
|
35
|
-
def list_groups
|
25
|
+
def list_groups(options = {})
|
36
26
|
|
37
27
|
end
|
38
28
|
end
|
39
29
|
end
|
40
30
|
end
|
41
31
|
end
|
42
|
-
end
|
32
|
+
end
|