deltacloud-core 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/config/drivers/aruba.yaml +3 -3
- data/deltacloud-core.gemspec +2 -2
- data/lib/cimi/collections/address_templates.rb +1 -2
- data/lib/cimi/collections/addresses.rb +1 -2
- data/lib/cimi/collections/base.rb +1 -1
- data/lib/cimi/collections/credentials.rb +2 -3
- data/lib/cimi/collections/forwarding_group_templates.rb +1 -2
- data/lib/cimi/collections/forwarding_groups.rb +1 -2
- data/lib/cimi/collections/machine_configurations.rb +1 -2
- data/lib/cimi/collections/machine_images.rb +1 -2
- data/lib/cimi/collections/machines.rb +9 -9
- data/lib/cimi/collections/network_configurations.rb +1 -2
- data/lib/cimi/collections/network_port_configurations.rb +1 -2
- data/lib/cimi/collections/network_port_templates.rb +1 -2
- data/lib/cimi/collections/network_ports.rb +1 -2
- data/lib/cimi/collections/network_templates.rb +1 -2
- data/lib/cimi/collections/networks.rb +2 -3
- data/lib/cimi/collections/volume_configurations.rb +1 -2
- data/lib/cimi/collections/volume_images.rb +1 -2
- data/lib/cimi/collections/volumes.rb +3 -4
- data/lib/cimi/helpers/cimi_helper.rb +7 -2
- data/lib/cimi/models.rb +6 -10
- data/lib/cimi/models/base.rb +48 -35
- data/lib/cimi/models/cloud_entry_point.rb +22 -1
- data/lib/cimi/models/collection.rb +42 -5
- data/lib/cimi/models/credential.rb +1 -1
- data/lib/cimi/models/disk.rb +39 -10
- data/lib/cimi/models/machine.rb +39 -22
- data/lib/cimi/models/machine_configuration.rb +4 -5
- data/lib/cimi/models/machine_image.rb +1 -1
- data/lib/cimi/models/machine_volume.rb +1 -1
- data/lib/cimi/models/network.rb +6 -3
- data/lib/cimi/models/network_port.rb +13 -2
- data/lib/cimi/models/schema.rb +66 -5
- data/lib/cimi/models/volume.rb +17 -16
- data/lib/cimi/models/volume_configuration.rb +7 -10
- data/lib/cimi/models/volume_image.rb +1 -1
- data/lib/deltacloud/collections/base.rb +1 -1
- data/lib/deltacloud/collections/firewalls.rb +2 -2
- data/lib/deltacloud/collections/load_balancers.rb +8 -2
- data/lib/deltacloud/core_ext.rb +1 -0
- data/lib/deltacloud/core_ext/base.rb +30 -0
- data/lib/deltacloud/drivers.rb +1 -1
- data/lib/deltacloud/drivers/base_driver.rb +1 -1
- data/lib/deltacloud/drivers/condor/condor_driver.rb +1 -1
- data/lib/deltacloud/drivers/exceptions.rb +24 -14
- data/lib/deltacloud/drivers/features.rb +3 -3
- data/lib/deltacloud/drivers/fgcp/fgcp_driver.rb +163 -92
- data/lib/deltacloud/drivers/mock/data/images/img1.yml +1 -0
- data/lib/deltacloud/drivers/mock/data/images/img2.yml +1 -0
- data/lib/deltacloud/drivers/mock/data/images/img3.yml +1 -0
- data/lib/deltacloud/drivers/mock/mock_client.rb +4 -4
- data/lib/deltacloud/drivers/mock/mock_driver.rb +16 -16
- data/lib/deltacloud/drivers/openstack/openstack_driver.rb +25 -9
- data/lib/deltacloud/drivers/rhevm/rhevm_driver.rb +2 -1
- data/lib/deltacloud/drivers/terremark/terremark_driver.rb +1 -1
- data/lib/deltacloud/drivers/vsphere/vsphere_driver.rb +2 -0
- data/lib/deltacloud/helpers/deltacloud_helper.rb +29 -8
- data/lib/deltacloud/models/image.rb +1 -0
- data/lib/deltacloud/models/instance_profile.rb +4 -0
- data/lib/deltacloud/version.rb +1 -1
- data/lib/ec2/query_parser.rb +1 -1
- data/lib/sinatra/rack_accept.rb +5 -1
- data/lib/sinatra/rack_logger.rb +9 -2
- data/tests/cimi/collections/machine_images_test.rb +23 -6
- data/tests/cimi/collections/machines_test.rb +39 -0
- data/tests/cimi/model/collection_spec.rb +109 -0
- data/tests/cimi/{spec/cimi/model → model}/credential_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/machine_configuration_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/machine_image_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/machine_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/machine_template_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/schema_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/volume_configuration_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/volume_image_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/volume_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/volume_template_spec.rb +1 -1
- data/tests/cimi/{spec/spec_helper.rb → spec_helper.rb} +7 -4
- data/tests/drivers/base/exceptions_test.rb +8 -8
- data/tests/drivers/ec2/buckets_test.rb +1 -1
- data/tests/drivers/ec2/images_test.rb +1 -1
- data/tests/drivers/ec2/instance_test.rb +1 -1
- data/tests/drivers/ec2/keys_test.rb +2 -2
- data/tests/drivers/ec2/realms_test.rb +1 -1
- data/tests/drivers/ec2/storage_snapshots_test.rb +1 -1
- data/tests/drivers/gogrid/hardware_profiles_test.rb +1 -1
- data/tests/drivers/gogrid/images_test.rb +1 -1
- data/tests/drivers/gogrid/instances_test.rb +1 -1
- data/tests/drivers/gogrid/realms_test.rb +1 -1
- data/tests/drivers/mock/images_test.rb +7 -2
- data/tests/drivers/mock/instances_test.rb +1 -1
- data/tests/drivers/mock/keys_test.rb +2 -2
- data/tests/drivers/mock/realms_test.rb +1 -1
- data/tests/drivers/mock/storage_snapshots_test.rb +1 -1
- data/tests/drivers/mock/storage_volumes_test.rb +1 -1
- data/tests/drivers/openstack/hardware_profiles_test.rb +3 -3
- data/tests/drivers/openstack/images_test.rb +1 -1
- data/tests/drivers/openstack/instances_test.rb +1 -1
- data/tests/drivers/openstack/keys_test.rb +2 -2
- data/tests/drivers/openstack/realms_test.rb +1 -1
- data/tests/drivers/rhevm/common.rb +3 -3
- data/tests/drivers/rhevm/images_test.rb +13 -13
- data/tests/drivers/rhevm/instance_test.rb +22 -22
- data/tests/drivers/rhevm/provider_test.rb +3 -3
- data/tests/drivers/rhevm/realms_test.rb +7 -7
- data/tests/test_helper.rb +0 -5
- data/views/api/show.xml.haml +6 -3
- data/views/errors/401.html.haml +0 -16
- data/views/errors/404.html.haml +2 -3
- data/views/errors/500.html.haml +6 -5
- data/views/images/show.html.haml +5 -1
- data/views/images/show.xml.haml +8 -3
- data/views/instances/new.html.haml +1 -1
- data/views/instances/show.xml.haml +1 -1
- data/views/load_balancers/show.html.haml +1 -1
- metadata +761 -778
- data/lib/cimi/models/disk_collection.rb +0 -37
- data/lib/cimi/models/machine_volume_collection.rb +0 -34
- data/lib/cimi/models/network_port_collection.rb +0 -51
- data/lib/cimi/models/network_port_configuration_collection.rb +0 -35
- data/lib/cimi/models/network_port_template_collection.rb +0 -37
@@ -1,37 +0,0 @@
|
|
1
|
-
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
-
# contributor license agreements. See the NOTICE file distributed with
|
3
|
-
# this work for additional information regarding copyright ownership. The
|
4
|
-
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
5
|
-
# "License"); you may not use this file except in compliance with the
|
6
|
-
# License. You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
12
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
13
|
-
# License for the specific language governing permissions and limitations
|
14
|
-
# under the License.
|
15
|
-
class CIMI::Model::DiskCollection < CIMI::Model::Base
|
16
|
-
text :count
|
17
|
-
|
18
|
-
#add disks array:
|
19
|
-
self << CIMI::Model::Disk
|
20
|
-
|
21
|
-
array :operations do
|
22
|
-
scalar :rel, :href
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.default(instance_id, context)
|
26
|
-
instance = context.driver.instance(context.credentials, :id=>instance_id)
|
27
|
-
machine_conf = CIMI::Model::MachineConfiguration.find(instance.instance_profile.name, context)
|
28
|
-
disks = CIMI::Model::Disk.find(instance, machine_conf, context, :all)
|
29
|
-
self.new(
|
30
|
-
:id => context.machine_url(instance_id)+"/disks",
|
31
|
-
:description => "DiskCollection for Machine #{instance_id}",
|
32
|
-
:created => instance.launch_time,
|
33
|
-
:count => disks.size,
|
34
|
-
:disks => disks
|
35
|
-
)
|
36
|
-
end
|
37
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
-
# contributor license agreements. See the NOTICE file distributed with
|
3
|
-
# this work for additional information regarding copyright ownership. The
|
4
|
-
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
5
|
-
# "License"); you may not use this file except in compliance with the
|
6
|
-
# License. You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
12
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
13
|
-
# License for the specific language governing permissions and limitations
|
14
|
-
# under the License.
|
15
|
-
class CIMI::Model::MachineVolumeCollection < CIMI::Model::Base
|
16
|
-
|
17
|
-
text :count
|
18
|
-
|
19
|
-
self << CIMI::Model::MachineVolume
|
20
|
-
|
21
|
-
array :operations do
|
22
|
-
scalar :rel, :href
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.default(instance_id, context)
|
26
|
-
volumes = CIMI::Model::MachineVolume.find(instance_id, context)
|
27
|
-
self.new(
|
28
|
-
:id => context.machine_url(instance_id)+"/volumes",
|
29
|
-
:description => "MachineVolumeCollection for Machine #{instance_id}",
|
30
|
-
:count => volumes.size,
|
31
|
-
:machine_volumes => volumes
|
32
|
-
)
|
33
|
-
end
|
34
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
-
# contributor license agreements. See the NOTICE file distributed with
|
3
|
-
# this work for additional information regarding copyright ownership. The
|
4
|
-
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
5
|
-
# "License"); you may not use this file except in compliance with the
|
6
|
-
# License. You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
12
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
13
|
-
# License for the specific language governing permissions and limitations
|
14
|
-
# under the License.
|
15
|
-
|
16
|
-
class CIMI::Model::NetworkPortCollection < CIMI::Model::Base
|
17
|
-
|
18
|
-
act_as_root_entity :network_port
|
19
|
-
|
20
|
-
text :count
|
21
|
-
|
22
|
-
#add member array:
|
23
|
-
self << CIMI::Model::NetworkPort
|
24
|
-
|
25
|
-
def self.default(context)
|
26
|
-
network_ports = CIMI::Model::NetworkPort.all(context)
|
27
|
-
self.new(
|
28
|
-
:id => context.network_ports_url,
|
29
|
-
:name => 'default',
|
30
|
-
:created => Time.now,
|
31
|
-
:description => "#{context.driver.name.capitalize} NetworkPortCollection",
|
32
|
-
:count => network_ports.size,
|
33
|
-
:network_ports => network_ports
|
34
|
-
)
|
35
|
-
end
|
36
|
-
|
37
|
-
def self.for_network(network_id, context)
|
38
|
-
net_url = context.network_url(network_id)
|
39
|
-
network_ports = CIMI::Model::NetworkPort.all(context)
|
40
|
-
ports_collection = network_ports.inject([]){|res, current| res << current if current.network.href == net_url ; res}
|
41
|
-
self.new(
|
42
|
-
:id => net_url+"/network_ports",
|
43
|
-
:name => 'default',
|
44
|
-
:created => Time.now,
|
45
|
-
:description => "#{context.driver.name.capitalize} NetworkPortCollection",
|
46
|
-
:count => ports_collection.size,
|
47
|
-
:network_ports => ports_collection
|
48
|
-
)
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
-
# contributor license agreements. See the NOTICE file distributed with
|
3
|
-
# this work for additional information regarding copyright ownership. The
|
4
|
-
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
5
|
-
# "License"); you may not use this file except in compliance with the
|
6
|
-
# License. You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
12
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
13
|
-
# License for the specific language governing permissions and limitations
|
14
|
-
# under the License.
|
15
|
-
class CIMI::Model::NetworkPortConfigurationCollection < CIMI::Model::Base
|
16
|
-
|
17
|
-
act_as_root_entity :network_port_configuration
|
18
|
-
|
19
|
-
text :count
|
20
|
-
|
21
|
-
self << CIMI::Model::NetworkPortConfiguration
|
22
|
-
|
23
|
-
def self.default(context)
|
24
|
-
network_port_configurations = CIMI::Model::NetworkPortConfiguration.all(context)
|
25
|
-
self.new(
|
26
|
-
:id => context.network_port_configurations_url,
|
27
|
-
:name => 'default',
|
28
|
-
:created => Time.now,
|
29
|
-
:description => "#{context.driver.name.capitalize} NetworkPortConfigurationCollection",
|
30
|
-
:count => network_port_configurations.size,
|
31
|
-
:network_port_configurations => network_port_configurations
|
32
|
-
)
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
-
# contributor license agreements. See the NOTICE file distributed with
|
3
|
-
# this work for additional information regarding copyright ownership. The
|
4
|
-
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
5
|
-
# "License"); you may not use this file except in compliance with the
|
6
|
-
# License. You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
12
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
13
|
-
# License for the specific language governing permissions and limitations
|
14
|
-
# under the License.
|
15
|
-
|
16
|
-
class CIMI::Model::NetworkPortTemplateCollection < CIMI::Model::Base
|
17
|
-
|
18
|
-
CIMI::Model.register_as_root_entity! "NetworkPortTemplates"
|
19
|
-
|
20
|
-
text :count
|
21
|
-
|
22
|
-
#add array of network_port_templates:
|
23
|
-
self << CIMI::Model::NetworkPortTemplate
|
24
|
-
|
25
|
-
def self.default(context)
|
26
|
-
network_port_templates = CIMI::Model::NetworkPortTemplate.all(context)
|
27
|
-
self.new(
|
28
|
-
:id => context.network_port_templates_url,
|
29
|
-
:name => 'default',
|
30
|
-
:created => Time.now,
|
31
|
-
:description => "#{context.driver.name.capitalize} NetworkPortTemplateCollection",
|
32
|
-
:count => network_port_templates.size,
|
33
|
-
:network_port_templates => network_port_templates
|
34
|
-
)
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|