summaryrefslogtreecommitdiff
path: root/tempest_lib/services/compute
diff options
context:
space:
mode:
Diffstat (limited to 'tempest_lib/services/compute')
-rw-r--r--tempest_lib/services/compute/__init__.py0
-rw-r--r--tempest_lib/services/compute/agents_client.py63
-rw-r--r--tempest_lib/services/compute/aggregates_client.py116
-rw-r--r--tempest_lib/services/compute/availability_zone_client.py35
-rw-r--r--tempest_lib/services/compute/baremetal_nodes_client.py42
-rw-r--r--tempest_lib/services/compute/certificates_client.py37
-rw-r--r--tempest_lib/services/compute/extensions_client.py34
-rw-r--r--tempest_lib/services/compute/fixed_ips_client.py40
-rw-r--r--tempest_lib/services/compute/flavors_client.py176
-rw-r--r--tempest_lib/services/compute/floating_ip_pools_client.py34
-rw-r--r--tempest_lib/services/compute/floating_ips_bulk_client.py50
-rw-r--r--tempest_lib/services/compute/floating_ips_client.py103
-rw-r--r--tempest_lib/services/compute/hosts_client.py85
-rw-r--r--tempest_lib/services/compute/hypervisor_client.py70
-rw-r--r--tempest_lib/services/compute/images_client.py142
-rw-r--r--tempest_lib/services/compute/instance_usage_audit_log_client.py38
-rw-r--r--tempest_lib/services/compute/interfaces_client.py55
-rw-r--r--tempest_lib/services/compute/keypairs_client.py51
-rw-r--r--tempest_lib/services/compute/limits_client.py28
-rw-r--r--tempest_lib/services/compute/migrations_client.py38
-rw-r--r--tempest_lib/services/compute/networks_client.py33
-rw-r--r--tempest_lib/services/compute/quota_classes_client.py48
-rw-r--r--tempest_lib/services/compute/quotas_client.py68
-rw-r--r--tempest_lib/services/compute/security_group_default_rules_client.py64
-rw-r--r--tempest_lib/services/compute/security_group_rules_client.py43
-rw-r--r--tempest_lib/services/compute/security_groups_client.py89
-rw-r--r--tempest_lib/services/compute/server_groups_client.py56
-rw-r--r--tempest_lib/services/compute/servers_client.py570
-rw-r--r--tempest_lib/services/compute/services_client.py58
-rw-r--r--tempest_lib/services/compute/snapshots_client.py76
-rw-r--r--tempest_lib/services/compute/tenant_networks_client.py34
-rw-r--r--tempest_lib/services/compute/tenant_usages_client.py43
-rw-r--r--tempest_lib/services/compute/versions_client.py55
-rw-r--r--tempest_lib/services/compute/volumes_client.py76
34 files changed, 0 insertions, 2550 deletions
diff --git a/tempest_lib/services/compute/__init__.py b/tempest_lib/services/compute/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest_lib/services/compute/__init__.py
+++ /dev/null
diff --git a/tempest_lib/services/compute/agents_client.py b/tempest_lib/services/compute/agents_client.py
deleted file mode 100644
index a2b80c5..0000000
--- a/tempest_lib/services/compute/agents_client.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright 2014 NEC Corporation. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-from six.moves.urllib import parse as urllib
-
-from tempest_lib.api_schema.response.compute.v2_1 import agents as schema
-from tempest_lib.common import rest_client
-
-
-class AgentsClient(rest_client.RestClient):
- """Tests Agents API"""
-
- def list_agents(self, **params):
- """List all agent builds."""
- url = 'os-agents'
- if params:
- url += '?%s' % urllib.urlencode(params)
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_agents, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def create_agent(self, **kwargs):
- """Create an agent build.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#agentbuild
- """
- post_body = json.dumps({'agent': kwargs})
- resp, body = self.post('os-agents', post_body)
- body = json.loads(body)
- self.validate_response(schema.create_agent, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_agent(self, agent_id):
- """Delete an existing agent build."""
- resp, body = self.delete("os-agents/%s" % agent_id)
- self.validate_response(schema.delete_agent, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def update_agent(self, agent_id, **kwargs):
- """Update an agent build.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#updatebuild
- """
- put_body = json.dumps({'para': kwargs})
- resp, body = self.put('os-agents/%s' % agent_id, put_body)
- body = json.loads(body)
- self.validate_response(schema.update_agent, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/aggregates_client.py b/tempest_lib/services/compute/aggregates_client.py
deleted file mode 100644
index a90c338..0000000
--- a/tempest_lib/services/compute/aggregates_client.py
+++ /dev/null
@@ -1,116 +0,0 @@
-# Copyright 2013 NEC Corporation.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import aggregates as schema
-from tempest_lib.common import rest_client
-from tempest_lib import exceptions as lib_exc
-
-
-class AggregatesClient(rest_client.RestClient):
-
- def list_aggregates(self):
- """Get aggregate list."""
- resp, body = self.get("os-aggregates")
- body = json.loads(body)
- self.validate_response(schema.list_aggregates, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_aggregate(self, aggregate_id):
- """Get details of the given aggregate."""
- resp, body = self.get("os-aggregates/%s" % aggregate_id)
- body = json.loads(body)
- self.validate_response(schema.get_aggregate, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def create_aggregate(self, **kwargs):
- """Create a new aggregate.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createaggregate
- """
- post_body = json.dumps({'aggregate': kwargs})
- resp, body = self.post('os-aggregates', post_body)
-
- body = json.loads(body)
- self.validate_response(schema.create_aggregate, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def update_aggregate(self, aggregate_id, **kwargs):
- """Update an aggregate.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#updateaggregate
- """
- put_body = json.dumps({'aggregate': kwargs})
- resp, body = self.put('os-aggregates/%s' % aggregate_id, put_body)
-
- body = json.loads(body)
- self.validate_response(schema.update_aggregate, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_aggregate(self, aggregate_id):
- """Delete the given aggregate."""
- resp, body = self.delete("os-aggregates/%s" % aggregate_id)
- self.validate_response(schema.delete_aggregate, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def is_resource_deleted(self, id):
- try:
- self.show_aggregate(id)
- except lib_exc.NotFound:
- return True
- return False
-
- @property
- def resource_type(self):
- """Return the primary type of resource this client works with."""
- return 'aggregate'
-
- def add_host(self, aggregate_id, **kwargs):
- """Add a host to the given aggregate.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#addhost
- """
- post_body = json.dumps({'add_host': kwargs})
- resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
- post_body)
- body = json.loads(body)
- self.validate_response(schema.aggregate_add_remove_host, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def remove_host(self, aggregate_id, **kwargs):
- """Remove a host from the given aggregate.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#removehost
- """
- post_body = json.dumps({'remove_host': kwargs})
- resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
- post_body)
- body = json.loads(body)
- self.validate_response(schema.aggregate_add_remove_host, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def set_metadata(self, aggregate_id, **kwargs):
- """Replace the aggregate's existing metadata with new metadata."""
- post_body = json.dumps({'set_metadata': kwargs})
- resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
- post_body)
- body = json.loads(body)
- self.validate_response(schema.aggregate_set_metadata, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/availability_zone_client.py b/tempest_lib/services/compute/availability_zone_client.py
deleted file mode 100644
index f03b8ba..0000000
--- a/tempest_lib/services/compute/availability_zone_client.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2013 NEC Corporation.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import availability_zone \
- as schema
-from tempest_lib.common import rest_client
-
-
-class AvailabilityZoneClient(rest_client.RestClient):
-
- def list_availability_zones(self, detail=False):
- url = 'os-availability-zone'
- schema_list = schema.list_availability_zone_list
- if detail:
- url += '/detail'
- schema_list = schema.list_availability_zone_list_detail
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema_list, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/baremetal_nodes_client.py b/tempest_lib/services/compute/baremetal_nodes_client.py
deleted file mode 100644
index b0c1849..0000000
--- a/tempest_lib/services/compute/baremetal_nodes_client.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 2015 NEC Corporation. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-from six.moves.urllib import parse as urllib
-
-from tempest_lib.api_schema.response.compute.v2_1 import baremetal_nodes \
- as schema
-from tempest_lib.common import rest_client
-
-
-class BaremetalNodesClient(rest_client.RestClient):
- """Tests Baremetal API"""
-
- def list_baremetal_nodes(self, **params):
- """List all baremetal nodes."""
- url = 'os-baremetal-nodes'
- if params:
- url += '?%s' % urllib.urlencode(params)
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_baremetal_nodes, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_baremetal_node(self, baremetal_node_id):
- """Return the details of a single baremetal node."""
- url = 'os-baremetal-nodes/%s' % baremetal_node_id
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.get_baremetal_node, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/certificates_client.py b/tempest_lib/services/compute/certificates_client.py
deleted file mode 100644
index 546e53c..0000000
--- a/tempest_lib/services/compute/certificates_client.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright 2013 IBM Corp
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import certificates as schema
-from tempest_lib.common import rest_client
-
-
-class CertificatesClient(rest_client.RestClient):
-
- def show_certificate(self, certificate_id):
- url = "os-certificates/%s" % certificate_id
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.get_certificate, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def create_certificate(self):
- """Create a certificate."""
- url = "os-certificates"
- resp, body = self.post(url, None)
- body = json.loads(body)
- self.validate_response(schema.create_certificate, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/extensions_client.py b/tempest_lib/services/compute/extensions_client.py
deleted file mode 100644
index 4a3435f..0000000
--- a/tempest_lib/services/compute/extensions_client.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import extensions as schema
-from tempest_lib.common import rest_client
-
-
-class ExtensionsClient(rest_client.RestClient):
-
- def list_extensions(self):
- url = 'extensions'
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_extensions, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_extension(self, extension_alias):
- resp, body = self.get('extensions/%s' % extension_alias)
- body = json.loads(body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/fixed_ips_client.py b/tempest_lib/services/compute/fixed_ips_client.py
deleted file mode 100644
index 1b4afb7..0000000
--- a/tempest_lib/services/compute/fixed_ips_client.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2013 IBM Corp
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import fixed_ips as schema
-from tempest_lib.common import rest_client
-
-
-class FixedIPsClient(rest_client.RestClient):
-
- def show_fixed_ip(self, fixed_ip):
- url = "os-fixed-ips/%s" % fixed_ip
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.get_fixed_ip, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def reserve_fixed_ip(self, fixed_ip, **kwargs):
- """Reserve/Unreserve a fixed IP.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#reserveIP
- """
- url = "os-fixed-ips/%s/action" % fixed_ip
- resp, body = self.post(url, json.dumps(kwargs))
- self.validate_response(schema.reserve_unreserve_fixed_ip, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/flavors_client.py b/tempest_lib/services/compute/flavors_client.py
deleted file mode 100644
index 7e8eda6..0000000
--- a/tempest_lib/services/compute/flavors_client.py
+++ /dev/null
@@ -1,176 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-from six.moves.urllib import parse as urllib
-
-from tempest_lib.api_schema.response.compute.v2_1 import flavors as schema
-from tempest_lib.api_schema.response.compute.v2_1 import flavors_access \
- as schema_access
-from tempest_lib.api_schema.response.compute.v2_1 import flavors_extra_specs \
- as schema_extra_specs
-from tempest_lib.common import rest_client
-
-
-class FlavorsClient(rest_client.RestClient):
-
- def list_flavors(self, detail=False, **params):
- url = 'flavors'
- _schema = schema.list_flavors
-
- if detail:
- url += '/detail'
- _schema = schema.list_flavors_details
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(_schema, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_flavor(self, flavor_id):
- resp, body = self.get("flavors/%s" % flavor_id)
- body = json.loads(body)
- self.validate_response(schema.create_get_flavor_details, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def create_flavor(self, **kwargs):
- """Create a new flavor or instance type.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#create-flavors
- """
- if kwargs.get('ephemeral'):
- kwargs['OS-FLV-EXT-DATA:ephemeral'] = kwargs.pop('ephemeral')
- if kwargs.get('is_public'):
- kwargs['os-flavor-access:is_public'] = kwargs.pop('is_public')
-
- post_body = json.dumps({'flavor': kwargs})
- resp, body = self.post('flavors', post_body)
-
- body = json.loads(body)
- self.validate_response(schema.create_get_flavor_details, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_flavor(self, flavor_id):
- """Delete the given flavor."""
- resp, body = self.delete("flavors/{0}".format(flavor_id))
- self.validate_response(schema.delete_flavor, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def is_resource_deleted(self, id):
- # Did not use show_flavor(id) for verification as it gives
- # 200 ok even for deleted id. LP #981263
- # we can remove the loop here and use get by ID when bug gets sortedout
- flavors = self.list_flavors(detail=True)['flavors']
- for flavor in flavors:
- if flavor['id'] == id:
- return False
- return True
-
- @property
- def resource_type(self):
- """Return the primary type of resource this client works with."""
- return 'flavor'
-
- def set_flavor_extra_spec(self, flavor_id, **kwargs):
- """Set extra Specs to the mentioned flavor.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#updateFlavorExtraSpec
- """
- post_body = json.dumps({'extra_specs': kwargs})
- resp, body = self.post('flavors/%s/os-extra_specs' % flavor_id,
- post_body)
- body = json.loads(body)
- self.validate_response(schema_extra_specs.set_get_flavor_extra_specs,
- resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def list_flavor_extra_specs(self, flavor_id):
- """Get extra Specs details of the mentioned flavor."""
- resp, body = self.get('flavors/%s/os-extra_specs' % flavor_id)
- body = json.loads(body)
- self.validate_response(schema_extra_specs.set_get_flavor_extra_specs,
- resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_flavor_extra_spec(self, flavor_id, key):
- """Get extra Specs key-value of the mentioned flavor and key."""
- resp, body = self.get('flavors/%s/os-extra_specs/%s' % (flavor_id,
- key))
- body = json.loads(body)
- self.validate_response(
- schema_extra_specs.set_get_flavor_extra_specs_key,
- resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def update_flavor_extra_spec(self, flavor_id, key, **kwargs):
- """Update specified extra Specs of the mentioned flavor and key.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#updateflavorspec
- """
- resp, body = self.put('flavors/%s/os-extra_specs/%s' %
- (flavor_id, key), json.dumps(kwargs))
- body = json.loads(body)
- self.validate_response(
- schema_extra_specs.set_get_flavor_extra_specs_key,
- resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def unset_flavor_extra_spec(self, flavor_id, key):
- """Unset extra Specs from the mentioned flavor."""
- resp, body = self.delete('flavors/%s/os-extra_specs/%s' %
- (flavor_id, key))
- self.validate_response(schema.unset_flavor_extra_specs, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def list_flavor_access(self, flavor_id):
- """Get flavor access information given the flavor id."""
- resp, body = self.get('flavors/%s/os-flavor-access' % flavor_id)
- body = json.loads(body)
- self.validate_response(schema_access.add_remove_list_flavor_access,
- resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def add_flavor_access(self, flavor_id, tenant_id):
- """Add flavor access for the specified tenant."""
- post_body = {
- 'addTenantAccess': {
- 'tenant': tenant_id
- }
- }
- post_body = json.dumps(post_body)
- resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
- body = json.loads(body)
- self.validate_response(schema_access.add_remove_list_flavor_access,
- resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def remove_flavor_access(self, flavor_id, tenant_id):
- """Remove flavor access from the specified tenant."""
- post_body = {
- 'removeTenantAccess': {
- 'tenant': tenant_id
- }
- }
- post_body = json.dumps(post_body)
- resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
- body = json.loads(body)
- self.validate_response(schema_access.add_remove_list_flavor_access,
- resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/floating_ip_pools_client.py b/tempest_lib/services/compute/floating_ip_pools_client.py
deleted file mode 100644
index b95e761..0000000
--- a/tempest_lib/services/compute/floating_ip_pools_client.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-from six.moves.urllib import parse as urllib
-
-from tempest_lib.api_schema.response.compute.v2_1 import floating_ips as schema
-from tempest_lib.common import rest_client
-
-
-class FloatingIPPoolsClient(rest_client.RestClient):
-
- def list_floating_ip_pools(self, params=None):
- """Gets all floating IP Pools list."""
- url = 'os-floating-ip-pools'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_floating_ip_pools, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/floating_ips_bulk_client.py b/tempest_lib/services/compute/floating_ips_bulk_client.py
deleted file mode 100644
index c7ec840..0000000
--- a/tempest_lib/services/compute/floating_ips_bulk_client.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import floating_ips as schema
-from tempest_lib.common import rest_client
-
-
-class FloatingIPsBulkClient(rest_client.RestClient):
-
- def create_floating_ips_bulk(self, ip_range, pool, interface):
- """Allocate floating IPs in bulk."""
- post_body = {
- 'ip_range': ip_range,
- 'pool': pool,
- 'interface': interface
- }
- post_body = json.dumps({'floating_ips_bulk_create': post_body})
- resp, body = self.post('os-floating-ips-bulk', post_body)
- body = json.loads(body)
- self.validate_response(schema.create_floating_ips_bulk, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def list_floating_ips_bulk(self):
- """Gets all floating IPs in bulk."""
- resp, body = self.get('os-floating-ips-bulk')
- body = json.loads(body)
- self.validate_response(schema.list_floating_ips_bulk, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_floating_ips_bulk(self, ip_range):
- """Deletes the provided floating IPs in bulk."""
- post_body = json.dumps({'ip_range': ip_range})
- resp, body = self.put('os-floating-ips-bulk/delete', post_body)
- body = json.loads(body)
- self.validate_response(schema.delete_floating_ips_bulk, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/floating_ips_client.py b/tempest_lib/services/compute/floating_ips_client.py
deleted file mode 100644
index 6abf921..0000000
--- a/tempest_lib/services/compute/floating_ips_client.py
+++ /dev/null
@@ -1,103 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-from six.moves.urllib import parse as urllib
-
-from tempest_lib.api_schema.response.compute.v2_1 import floating_ips as schema
-from tempest_lib.common import rest_client
-from tempest_lib import exceptions as lib_exc
-
-
-class FloatingIPsClient(rest_client.RestClient):
-
- def list_floating_ips(self, **params):
- """Returns a list of all floating IPs filtered by any parameters."""
- url = 'os-floating-ips'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_floating_ips, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_floating_ip(self, floating_ip_id):
- """Get the details of a floating IP."""
- url = "os-floating-ips/%s" % floating_ip_id
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.create_get_floating_ip, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def create_floating_ip(self, **kwargs):
- """Allocate a floating IP to the project.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createFloatingIP
- """
- url = 'os-floating-ips'
- post_body = json.dumps(kwargs)
- resp, body = self.post(url, post_body)
- body = json.loads(body)
- self.validate_response(schema.create_get_floating_ip, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_floating_ip(self, floating_ip_id):
- """Deletes the provided floating IP from the project."""
- url = "os-floating-ips/%s" % floating_ip_id
- resp, body = self.delete(url)
- self.validate_response(schema.add_remove_floating_ip, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def associate_floating_ip_to_server(self, floating_ip, server_id):
- """Associate the provided floating IP to a specific server."""
- url = "servers/%s/action" % server_id
- post_body = {
- 'addFloatingIp': {
- 'address': floating_ip,
- }
- }
-
- post_body = json.dumps(post_body)
- resp, body = self.post(url, post_body)
- self.validate_response(schema.add_remove_floating_ip, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def disassociate_floating_ip_from_server(self, floating_ip, server_id):
- """Disassociate the provided floating IP from a specific server."""
- url = "servers/%s/action" % server_id
- post_body = {
- 'removeFloatingIp': {
- 'address': floating_ip,
- }
- }
-
- post_body = json.dumps(post_body)
- resp, body = self.post(url, post_body)
- self.validate_response(schema.add_remove_floating_ip, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def is_resource_deleted(self, id):
- try:
- self.show_floating_ip(id)
- except lib_exc.NotFound:
- return True
- return False
-
- @property
- def resource_type(self):
- """Returns the primary type of resource this client works with."""
- return 'floating_ip'
diff --git a/tempest_lib/services/compute/hosts_client.py b/tempest_lib/services/compute/hosts_client.py
deleted file mode 100644
index ecc5d14..0000000
--- a/tempest_lib/services/compute/hosts_client.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright 2013 IBM Corp.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-from six.moves.urllib import parse as urllib
-
-from tempest_lib.api_schema.response.compute.v2_1 import hosts as schema
-from tempest_lib.common import rest_client
-
-
-class HostsClient(rest_client.RestClient):
-
- def list_hosts(self, **params):
- """List all hosts."""
-
- url = 'os-hosts'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_hosts, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_host(self, hostname):
- """Show detail information for the host."""
-
- resp, body = self.get("os-hosts/%s" % hostname)
- body = json.loads(body)
- self.validate_response(schema.get_host_detail, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def update_host(self, hostname, **kwargs):
- """Update a host.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#enablehost
- """
-
- request_body = {
- 'status': None,
- 'maintenance_mode': None,
- }
- request_body.update(**kwargs)
- request_body = json.dumps(request_body)
-
- resp, body = self.put("os-hosts/%s" % hostname, request_body)
- body = json.loads(body)
- self.validate_response(schema.update_host, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def startup_host(self, hostname):
- """Startup a host."""
-
- resp, body = self.get("os-hosts/%s/startup" % hostname)
- body = json.loads(body)
- self.validate_response(schema.startup_host, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def shutdown_host(self, hostname):
- """Shutdown a host."""
-
- resp, body = self.get("os-hosts/%s/shutdown" % hostname)
- body = json.loads(body)
- self.validate_response(schema.shutdown_host, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def reboot_host(self, hostname):
- """Reboot a host."""
-
- resp, body = self.get("os-hosts/%s/reboot" % hostname)
- body = json.loads(body)
- self.validate_response(schema.reboot_host, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/hypervisor_client.py b/tempest_lib/services/compute/hypervisor_client.py
deleted file mode 100644
index 4276a5c..0000000
--- a/tempest_lib/services/compute/hypervisor_client.py
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 2013 IBM Corporation.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import hypervisors as schema
-from tempest_lib.common import rest_client
-
-
-class HypervisorClient(rest_client.RestClient):
-
- def list_hypervisors(self, detail=False):
- """List hypervisors information."""
- url = 'os-hypervisors'
- _schema = schema.list_search_hypervisors
- if detail:
- url += '/detail'
- _schema = schema.list_hypervisors_detail
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(_schema, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_hypervisor(self, hypervisor_id):
- """Display the details of the specified hypervisor."""
- resp, body = self.get('os-hypervisors/%s' % hypervisor_id)
- body = json.loads(body)
- self.validate_response(schema.get_hypervisor, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def list_servers_on_hypervisor(self, hypervisor_name):
- """List instances belonging to the specified hypervisor."""
- resp, body = self.get('os-hypervisors/%s/servers' % hypervisor_name)
- body = json.loads(body)
- self.validate_response(schema.get_hypervisors_servers, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_hypervisor_statistics(self):
- """Get hypervisor statistics over all compute nodes."""
- resp, body = self.get('os-hypervisors/statistics')
- body = json.loads(body)
- self.validate_response(schema.get_hypervisor_statistics, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_hypervisor_uptime(self, hypervisor_id):
- """Display the uptime of the specified hypervisor."""
- resp, body = self.get('os-hypervisors/%s/uptime' % hypervisor_id)
- body = json.loads(body)
- self.validate_response(schema.get_hypervisor_uptime, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def search_hypervisor(self, hypervisor_name):
- """Search specified hypervisor."""
- resp, body = self.get('os-hypervisors/%s/search' % hypervisor_name)
- body = json.loads(body)
- self.validate_response(schema.list_search_hypervisors, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/images_client.py b/tempest_lib/services/compute/images_client.py
deleted file mode 100644
index a35da4d..0000000
--- a/tempest_lib/services/compute/images_client.py
+++ /dev/null
@@ -1,142 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-from six.moves.urllib import parse as urllib
-
-from tempest_lib.api_schema.response.compute.v2_1 import images as schema
-from tempest_lib.common import rest_client
-from tempest_lib import exceptions as lib_exc
-
-
-class ImagesClient(rest_client.RestClient):
-
- def create_image(self, server_id, **kwargs):
- """Create an image of the original server.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createImage
- """
-
- post_body = {'createImage': kwargs}
- post_body = json.dumps(post_body)
- resp, body = self.post('servers/%s/action' % server_id,
- post_body)
- self.validate_response(schema.create_image, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def list_images(self, detail=False, **params):
- """Return a list of all images filtered by any parameter.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#listImages
- """
- url = 'images'
- _schema = schema.list_images
- if detail:
- url += '/detail'
- _schema = schema.list_images_details
-
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(_schema, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_image(self, image_id):
- """Return the details of a single image."""
- resp, body = self.get("images/%s" % image_id)
- self.expected_success(200, resp.status)
- body = json.loads(body)
- self.validate_response(schema.get_image, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_image(self, image_id):
- """Delete the provided image."""
- resp, body = self.delete("images/%s" % image_id)
- self.validate_response(schema.delete, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def list_image_metadata(self, image_id):
- """List all metadata items for an image."""
- resp, body = self.get("images/%s/metadata" % image_id)
- body = json.loads(body)
- self.validate_response(schema.image_metadata, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def set_image_metadata(self, image_id, meta):
- """Set the metadata for an image.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createImageMetadata
- """
- post_body = json.dumps({'metadata': meta})
- resp, body = self.put('images/%s/metadata' % image_id, post_body)
- body = json.loads(body)
- self.validate_response(schema.image_metadata, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def update_image_metadata(self, image_id, meta):
- """Update the metadata for an image.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#updateImageMetadata
- """
- post_body = json.dumps({'metadata': meta})
- resp, body = self.post('images/%s/metadata' % image_id, post_body)
- body = json.loads(body)
- self.validate_response(schema.image_metadata, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_image_metadata_item(self, image_id, key):
- """Return the value for a specific image metadata key."""
- resp, body = self.get("images/%s/metadata/%s" % (image_id, key))
- body = json.loads(body)
- self.validate_response(schema.image_meta_item, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def set_image_metadata_item(self, image_id, key, meta):
- """Set the value for a specific image metadata key.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#setImageMetadataItem
- """
- post_body = json.dumps({'meta': meta})
- resp, body = self.put('images/%s/metadata/%s' % (image_id, key),
- post_body)
- body = json.loads(body)
- self.validate_response(schema.image_meta_item, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_image_metadata_item(self, image_id, key):
- """Delete a single image metadata key/value pair."""
- resp, body = self.delete("images/%s/metadata/%s" %
- (image_id, key))
- self.validate_response(schema.delete, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def is_resource_deleted(self, id):
- try:
- self.show_image(id)
- except lib_exc.NotFound:
- return True
- return False
-
- @property
- def resource_type(self):
- """Return the primary type of resource this client works with."""
- return 'image'
diff --git a/tempest_lib/services/compute/instance_usage_audit_log_client.py b/tempest_lib/services/compute/instance_usage_audit_log_client.py
deleted file mode 100644
index 1b4c61d..0000000
--- a/tempest_lib/services/compute/instance_usage_audit_log_client.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2013 IBM Corporation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import \
- instance_usage_audit_logs as schema
-from tempest_lib.common import rest_client
-
-
-class InstanceUsagesAuditLogClient(rest_client.RestClient):
-
- def list_instance_usage_audit_logs(self):
- url = 'os-instance_usage_audit_log'
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_instance_usage_audit_log,
- resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_instance_usage_audit_log(self, time_before):
- url = 'os-instance_usage_audit_log/%s' % time_before
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.get_instance_usage_audit_log, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/interfaces_client.py b/tempest_lib/services/compute/interfaces_client.py
deleted file mode 100644
index 799e27c..0000000
--- a/tempest_lib/services/compute/interfaces_client.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 2013 IBM Corp.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import interfaces as schema
-from tempest_lib.common import rest_client
-
-
-class InterfacesClient(rest_client.RestClient):
-
- def list_interfaces(self, server_id):
- resp, body = self.get('servers/%s/os-interface' % server_id)
- body = json.loads(body)
- self.validate_response(schema.list_interfaces, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def create_interface(self, server_id, **kwargs):
- """Create an interface.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createAttachInterface
- """
- post_body = {'interfaceAttachment': kwargs}
- post_body = json.dumps(post_body)
- resp, body = self.post('servers/%s/os-interface' % server_id,
- body=post_body)
- body = json.loads(body)
- self.validate_response(schema.get_create_interfaces, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_interface(self, server_id, port_id):
- resp, body = self.get('servers/%s/os-interface/%s' % (server_id,
- port_id))
- body = json.loads(body)
- self.validate_response(schema.get_create_interfaces, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_interface(self, server_id, port_id):
- resp, body = self.delete('servers/%s/os-interface/%s' % (server_id,
- port_id))
- self.validate_response(schema.delete_interface, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/keypairs_client.py b/tempest_lib/services/compute/keypairs_client.py
deleted file mode 100644
index 6663da6..0000000
--- a/tempest_lib/services/compute/keypairs_client.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import keypairs as schema
-from tempest_lib.common import rest_client
-
-
-class KeyPairsClient(rest_client.RestClient):
-
- def list_keypairs(self):
- resp, body = self.get("os-keypairs")
- body = json.loads(body)
- self.validate_response(schema.list_keypairs, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_keypair(self, keypair_name):
- resp, body = self.get("os-keypairs/%s" % keypair_name)
- body = json.loads(body)
- self.validate_response(schema.get_keypair, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def create_keypair(self, **kwargs):
- """Create a keypair.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createKeypair
- """
- post_body = json.dumps({'keypair': kwargs})
- resp, body = self.post("os-keypairs", body=post_body)
- body = json.loads(body)
- self.validate_response(schema.create_keypair, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_keypair(self, keypair_name):
- resp, body = self.delete("os-keypairs/%s" % keypair_name)
- self.validate_response(schema.delete_keypair, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/limits_client.py b/tempest_lib/services/compute/limits_client.py
deleted file mode 100644
index c056a7f..0000000
--- a/tempest_lib/services/compute/limits_client.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import limits as schema
-from tempest_lib.common import rest_client
-
-
-class LimitsClient(rest_client.RestClient):
-
- def show_limits(self):
- resp, body = self.get("limits")
- body = json.loads(body)
- self.validate_response(schema.get_limit, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/migrations_client.py b/tempest_lib/services/compute/migrations_client.py
deleted file mode 100644
index a92d7c1..0000000
--- a/tempest_lib/services/compute/migrations_client.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2014 NEC Corporation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-from six.moves.urllib import parse as urllib
-
-from tempest_lib.api_schema.response.compute.v2_1 import migrations as schema
-from tempest_lib.common import rest_client
-
-
-class MigrationsClient(rest_client.RestClient):
-
- def list_migrations(self, **params):
- """List all migrations.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#returnmigrations
- """
-
- url = 'os-migrations'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_migrations, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/networks_client.py b/tempest_lib/services/compute/networks_client.py
deleted file mode 100644
index 7e6f3f0..0000000
--- a/tempest_lib/services/compute/networks_client.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.common import rest_client
-
-
-class NetworksClient(rest_client.RestClient):
-
- def list_networks(self):
- resp, body = self.get("os-networks")
- body = json.loads(body)
- self.expected_success(200, resp.status)
- return rest_client.ResponseBody(resp, body)
-
- def show_network(self, network_id):
- resp, body = self.get("os-networks/%s" % network_id)
- body = json.loads(body)
- self.expected_success(200, resp.status)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/quota_classes_client.py b/tempest_lib/services/compute/quota_classes_client.py
deleted file mode 100644
index 12f79be..0000000
--- a/tempest_lib/services/compute/quota_classes_client.py
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 2012 NTT Data
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1\
- import quota_classes as classes_schema
-from tempest_lib.common import rest_client
-
-
-class QuotaClassesClient(rest_client.RestClient):
-
- def show_quota_class_set(self, quota_class_id):
- """List the quota class set for a quota class."""
-
- url = 'os-quota-class-sets/%s' % quota_class_id
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(classes_schema.get_quota_class_set, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def update_quota_class_set(self, quota_class_id, **kwargs):
- """Update the quota class's limits for one or more resources.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#updatequota
- """
- post_body = json.dumps({'quota_class_set': kwargs})
-
- resp, body = self.put('os-quota-class-sets/%s' % quota_class_id,
- post_body)
-
- body = json.loads(body)
- self.validate_response(classes_schema.update_quota_class_set,
- resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/quotas_client.py b/tempest_lib/services/compute/quotas_client.py
deleted file mode 100644
index 470010e..0000000
--- a/tempest_lib/services/compute/quotas_client.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright 2012 NTT Data
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import quotas as schema
-from tempest_lib.common import rest_client
-
-
-class QuotasClient(rest_client.RestClient):
-
- def show_quota_set(self, tenant_id, user_id=None):
- """List the quota set for a tenant."""
-
- url = 'os-quota-sets/%s' % tenant_id
- if user_id:
- url += '?user_id=%s' % user_id
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.get_quota_set, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_default_quota_set(self, tenant_id):
- """List the default quota set for a tenant."""
-
- url = 'os-quota-sets/%s/defaults' % tenant_id
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.get_quota_set, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def update_quota_set(self, tenant_id, user_id=None, **kwargs):
- """Updates the tenant's quota limits for one or more resources.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#updatesquotatenant
- """
-
- post_body = json.dumps({'quota_set': kwargs})
-
- if user_id:
- resp, body = self.put('os-quota-sets/%s?user_id=%s' %
- (tenant_id, user_id), post_body)
- else:
- resp, body = self.put('os-quota-sets/%s' % tenant_id,
- post_body)
-
- body = json.loads(body)
- self.validate_response(schema.update_quota_set, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_quota_set(self, tenant_id):
- """Delete the tenant's quota set."""
- resp, body = self.delete('os-quota-sets/%s' % tenant_id)
- self.validate_response(schema.delete_quota, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/security_group_default_rules_client.py b/tempest_lib/services/compute/security_group_default_rules_client.py
deleted file mode 100644
index 74a99b3..0000000
--- a/tempest_lib/services/compute/security_group_default_rules_client.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 2014 NEC Corporation.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import \
- security_group_default_rule as schema
-from tempest_lib.common import rest_client
-
-
-class SecurityGroupDefaultRulesClient(rest_client.RestClient):
-
- def create_security_default_group_rule(self, **kwargs):
- """Create security group default rule.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html
- #createSecGroupDefaultRule
- """
- post_body = json.dumps({'security_group_default_rule': kwargs})
- url = 'os-security-group-default-rules'
- resp, body = self.post(url, post_body)
- body = json.loads(body)
- self.validate_response(schema.create_get_security_group_default_rule,
- resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_security_group_default_rule(self,
- security_group_default_rule_id):
- """Delete the provided Security Group default rule."""
- resp, body = self.delete('os-security-group-default-rules/%s' % (
- security_group_default_rule_id))
- self.validate_response(schema.delete_security_group_default_rule,
- resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def list_security_group_default_rules(self):
- """List all Security Group default rules."""
- resp, body = self.get('os-security-group-default-rules')
- body = json.loads(body)
- self.validate_response(schema.list_security_group_default_rules,
- resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_security_group_default_rule(self, security_group_default_rule_id):
- """Return the details of provided Security Group default rule."""
- resp, body = self.get('os-security-group-default-rules/%s' %
- security_group_default_rule_id)
- body = json.loads(body)
- self.validate_response(schema.create_get_security_group_default_rule,
- resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/security_group_rules_client.py b/tempest_lib/services/compute/security_group_rules_client.py
deleted file mode 100644
index 0972284..0000000
--- a/tempest_lib/services/compute/security_group_rules_client.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import \
- security_groups as schema
-from tempest_lib.common import rest_client
-
-
-class SecurityGroupRulesClient(rest_client.RestClient):
-
- def create_security_group_rule(self, **kwargs):
- """Create a new security group rule.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createSecGroupRule
- """
- post_body = json.dumps({'security_group_rule': kwargs})
- url = 'os-security-group-rules'
- resp, body = self.post(url, post_body)
- body = json.loads(body)
- self.validate_response(schema.create_security_group_rule, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_security_group_rule(self, group_rule_id):
- """Deletes the provided Security Group rule."""
- resp, body = self.delete('os-security-group-rules/%s' %
- group_rule_id)
- self.validate_response(schema.delete_security_group_rule, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/security_groups_client.py b/tempest_lib/services/compute/security_groups_client.py
deleted file mode 100644
index 98394eb..0000000
--- a/tempest_lib/services/compute/security_groups_client.py
+++ /dev/null
@@ -1,89 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-from six.moves.urllib import parse as urllib
-
-from tempest_lib.api_schema.response.compute.v2_1 import \
- security_groups as schema
-from tempest_lib.common import rest_client
-from tempest_lib import exceptions as lib_exc
-
-
-class SecurityGroupsClient(rest_client.RestClient):
-
- def list_security_groups(self, **params):
- """List all security groups for a user."""
-
- url = 'os-security-groups'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_security_groups, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_security_group(self, security_group_id):
- """Get the details of a Security Group."""
- url = "os-security-groups/%s" % security_group_id
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.get_security_group, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def create_security_group(self, **kwargs):
- """Create a new security group.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createSecGroup
- """
- post_body = json.dumps({'security_group': kwargs})
- resp, body = self.post('os-security-groups', post_body)
- body = json.loads(body)
- self.validate_response(schema.get_security_group, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def update_security_group(self, security_group_id, **kwargs):
- """Update a security group.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#updateSecGroup
- """
- post_body = json.dumps({'security_group': kwargs})
- resp, body = self.put('os-security-groups/%s' % security_group_id,
- post_body)
- body = json.loads(body)
- self.validate_response(schema.update_security_group, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_security_group(self, security_group_id):
- """Delete the provided Security Group."""
- resp, body = self.delete(
- 'os-security-groups/%s' % security_group_id)
- self.validate_response(schema.delete_security_group, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def is_resource_deleted(self, id):
- try:
- self.show_security_group(id)
- except lib_exc.NotFound:
- return True
- return False
-
- @property
- def resource_type(self):
- """Return the primary type of resource this client works with."""
- return 'security_group'
diff --git a/tempest_lib/services/compute/server_groups_client.py b/tempest_lib/services/compute/server_groups_client.py
deleted file mode 100644
index 2cbce7e..0000000
--- a/tempest_lib/services/compute/server_groups_client.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# Copyright 2013 Hewlett-Packard Development Company, L.P.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import servers as schema
-from tempest_lib.common import rest_client
-
-
-class ServerGroupsClient(rest_client.RestClient):
-
- def create_server_group(self, **kwargs):
- """Create the server group.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createServerGroup
- """
- post_body = json.dumps({'server_group': kwargs})
- resp, body = self.post('os-server-groups', post_body)
-
- body = json.loads(body)
- self.validate_response(schema.create_show_server_group, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_server_group(self, server_group_id):
- """Delete the given server-group."""
- resp, body = self.delete("os-server-groups/%s" % server_group_id)
- self.validate_response(schema.delete_server_group, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def list_server_groups(self):
- """List the server-groups."""
- resp, body = self.get("os-server-groups")
- body = json.loads(body)
- self.validate_response(schema.list_server_groups, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_server_group(self, server_group_id):
- """Get the details of given server_group."""
- resp, body = self.get("os-server-groups/%s" % server_group_id)
- body = json.loads(body)
- self.validate_response(schema.create_show_server_group, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/servers_client.py b/tempest_lib/services/compute/servers_client.py
deleted file mode 100644
index cdb992b..0000000
--- a/tempest_lib/services/compute/servers_client.py
+++ /dev/null
@@ -1,570 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# Copyright 2013 Hewlett-Packard Development Company, L.P.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-import copy
-
-from oslo_serialization import jsonutils as json
-from six.moves.urllib import parse as urllib
-
-from tempest_lib.api_schema.response.compute.v2_1 import servers as schema
-from tempest_lib.common import rest_client
-
-
-class ServersClient(rest_client.RestClient):
-
- def __init__(self, auth_provider, service, region,
- enable_instance_password=True, **kwargs):
- super(ServersClient, self).__init__(
- auth_provider, service, region, **kwargs)
- self.enable_instance_password = enable_instance_password
-
- def create_server(self, **kwargs):
- """Create server.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createServer
-
- Most parameters except the following are passed to the API without
- any changes.
- :param disk_config: The name is changed to OS-DCF:diskConfig
- :param scheduler_hints: The name is changed to os:scheduler_hints and
- the parameter is set in the same level as the parameter 'server'.
- """
- body = copy.deepcopy(kwargs)
- if body.get('disk_config'):
- body['OS-DCF:diskConfig'] = body.pop('disk_config')
-
- hints = None
- if body.get('scheduler_hints'):
- hints = {'os:scheduler_hints': body.pop('scheduler_hints')}
-
- post_body = {'server': body}
-
- if hints:
- post_body = dict(post_body.items() + hints.items())
-
- post_body = json.dumps(post_body)
- resp, body = self.post('servers', post_body)
-
- body = json.loads(body)
- # NOTE(maurosr): this deals with the case of multiple server create
- # with return reservation id set True
- if 'reservation_id' in body:
- return rest_client.ResponseBody(resp, body)
- if self.enable_instance_password:
- create_schema = schema.create_server_with_admin_pass
- else:
- create_schema = schema.create_server
- self.validate_response(create_schema, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def update_server(self, server_id, **kwargs):
- """Update server.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#updateServer
-
- Most parameters except the following are passed to the API without
- any changes.
- :param disk_config: The name is changed to OS-DCF:diskConfig
- """
- if kwargs.get('disk_config'):
- kwargs['OS-DCF:diskConfig'] = kwargs.pop('disk_config')
-
- post_body = json.dumps({'server': kwargs})
- resp, body = self.put("servers/%s" % server_id, post_body)
- body = json.loads(body)
- self.validate_response(schema.update_server, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_server(self, server_id):
- """Get server details."""
- resp, body = self.get("servers/%s" % server_id)
- body = json.loads(body)
- self.validate_response(schema.get_server, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_server(self, server_id):
- """Delete server."""
- resp, body = self.delete("servers/%s" % server_id)
- self.validate_response(schema.delete_server, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def list_servers(self, detail=False, **params):
- """List servers.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#listServers
- and http://developer.openstack.org/
- api-ref-compute-v2.1.html#listDetailServers
- """
-
- url = 'servers'
- _schema = schema.list_servers
-
- if detail:
- url += '/detail'
- _schema = schema.list_servers_detail
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(_schema, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def list_addresses(self, server_id):
- """Lists all addresses for a server."""
- resp, body = self.get("servers/%s/ips" % server_id)
- body = json.loads(body)
- self.validate_response(schema.list_addresses, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def list_addresses_by_network(self, server_id, network_id):
- """Lists all addresses of a specific network type for a server."""
- resp, body = self.get("servers/%s/ips/%s" %
- (server_id, network_id))
- body = json.loads(body)
- self.validate_response(schema.list_addresses_by_network, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def action(self, server_id, action_name,
- schema=schema.server_actions_common_schema,
- **kwargs):
- post_body = json.dumps({action_name: kwargs})
- resp, body = self.post('servers/%s/action' % server_id,
- post_body)
- if body:
- body = json.loads(body)
- self.validate_response(schema, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def create_backup(self, server_id, **kwargs):
- """Backup a server instance.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createBackup
- """
- return self.action(server_id, "createBackup", **kwargs)
-
- def change_password(self, server_id, **kwargs):
- """Change the root password for the server.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#changePassword
- """
- return self.action(server_id, 'changePassword', **kwargs)
-
- def show_password(self, server_id):
- resp, body = self.get("servers/%s/os-server-password" %
- server_id)
- body = json.loads(body)
- self.validate_response(schema.show_password, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_password(self, server_id):
- """Removes the encrypted server password from the metadata server
-
- Note that this does not actually change the instance server
- password.
- """
- resp, body = self.delete("servers/%s/os-server-password" %
- server_id)
- self.validate_response(schema.server_actions_delete_password,
- resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def reboot_server(self, server_id, **kwargs):
- """Reboot a server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#reboot
- """
- return self.action(server_id, 'reboot', **kwargs)
-
- def rebuild_server(self, server_id, image_ref, **kwargs):
- """Rebuild a server with a new image.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#rebuild
-
- Most parameters except the following are passed to the API without
- any changes.
- :param disk_config: The name is changed to OS-DCF:diskConfig
- """
- kwargs['imageRef'] = image_ref
- if 'disk_config' in kwargs:
- kwargs['OS-DCF:diskConfig'] = kwargs.pop('disk_config')
- if self.enable_instance_password:
- rebuild_schema = schema.rebuild_server_with_admin_pass
- else:
- rebuild_schema = schema.rebuild_server
- return self.action(server_id, 'rebuild',
- rebuild_schema, **kwargs)
-
- def resize_server(self, server_id, flavor_ref, **kwargs):
- """Change the flavor of a server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#resize
-
- Most parameters except the following are passed to the API without
- any changes.
- :param disk_config: The name is changed to OS-DCF:diskConfig
- """
- kwargs['flavorRef'] = flavor_ref
- if 'disk_config' in kwargs:
- kwargs['OS-DCF:diskConfig'] = kwargs.pop('disk_config')
- return self.action(server_id, 'resize', **kwargs)
-
- def confirm_resize_server(self, server_id, **kwargs):
- """Confirm the flavor change for a server.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#confirmResize
- """
- return self.action(server_id, 'confirmResize',
- schema.server_actions_confirm_resize,
- **kwargs)
-
- def revert_resize_server(self, server_id, **kwargs):
- """Revert a server back to its original flavor.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#revertResize
- """
- return self.action(server_id, 'revertResize', **kwargs)
-
- def list_server_metadata(self, server_id):
- resp, body = self.get("servers/%s/metadata" % server_id)
- body = json.loads(body)
- self.validate_response(schema.list_server_metadata, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def set_server_metadata(self, server_id, meta, no_metadata_field=False):
- if no_metadata_field:
- post_body = ""
- else:
- post_body = json.dumps({'metadata': meta})
- resp, body = self.put('servers/%s/metadata' % server_id,
- post_body)
- body = json.loads(body)
- self.validate_response(schema.set_server_metadata, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def update_server_metadata(self, server_id, meta):
- post_body = json.dumps({'metadata': meta})
- resp, body = self.post('servers/%s/metadata' % server_id,
- post_body)
- body = json.loads(body)
- self.validate_response(schema.update_server_metadata,
- resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_server_metadata_item(self, server_id, key):
- resp, body = self.get("servers/%s/metadata/%s" % (server_id, key))
- body = json.loads(body)
- self.validate_response(schema.set_show_server_metadata_item,
- resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def set_server_metadata_item(self, server_id, key, meta):
- post_body = json.dumps({'meta': meta})
- resp, body = self.put('servers/%s/metadata/%s' % (server_id, key),
- post_body)
- body = json.loads(body)
- self.validate_response(schema.set_show_server_metadata_item,
- resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_server_metadata_item(self, server_id, key):
- resp, body = self.delete("servers/%s/metadata/%s" %
- (server_id, key))
- self.validate_response(schema.delete_server_metadata_item,
- resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def stop_server(self, server_id, **kwargs):
- return self.action(server_id, 'os-stop', **kwargs)
-
- def start_server(self, server_id, **kwargs):
- return self.action(server_id, 'os-start', **kwargs)
-
- def attach_volume(self, server_id, **kwargs):
- """Attaches a volume to a server instance."""
- post_body = json.dumps({'volumeAttachment': kwargs})
- resp, body = self.post('servers/%s/os-volume_attachments' % server_id,
- post_body)
- body = json.loads(body)
- self.validate_response(schema.attach_volume, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def update_attached_volume(self, server_id, attachment_id, **kwargs):
- """Swaps a volume attached to an instance for another volume"""
- post_body = json.dumps({'volumeAttachment': kwargs})
- resp, body = self.put('servers/%s/os-volume_attachments/%s' %
- (server_id, attachment_id),
- post_body)
- self.validate_response(schema.update_attached_volume, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def detach_volume(self, server_id, volume_id): # noqa
- """Detaches a volume from a server instance."""
- resp, body = self.delete('servers/%s/os-volume_attachments/%s' %
- (server_id, volume_id))
- self.validate_response(schema.detach_volume, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_volume_attachment(self, server_id, volume_id):
- """Return details about the given volume attachment."""
- resp, body = self.get('servers/%s/os-volume_attachments/%s' % (
- server_id, volume_id))
- body = json.loads(body)
- self.validate_response(schema.show_volume_attachment, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def list_volume_attachments(self, server_id):
- """Returns the list of volume attachments for a given instance."""
- resp, body = self.get('servers/%s/os-volume_attachments' % (
- server_id))
- body = json.loads(body)
- self.validate_response(schema.list_volume_attachments, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def add_security_group(self, server_id, **kwargs):
- """Add a security group to the server.
-
- Available params: TODO
- """
- # TODO(oomichi): The api-site doesn't contain this API description.
- # So the above should be changed to the api-site link after
- # adding the description on the api-site.
- # LP: https://bugs.launchpad.net/openstack-api-site/+bug/1524199
- return self.action(server_id, 'addSecurityGroup', **kwargs)
-
- def remove_security_group(self, server_id, **kwargs):
- """Remove a security group from the server.
-
- Available params: TODO
- """
- # TODO(oomichi): The api-site doesn't contain this API description.
- # So the above should be changed to the api-site link after
- # adding the description on the api-site.
- # LP: https://bugs.launchpad.net/openstack-api-site/+bug/1524199
- return self.action(server_id, 'removeSecurityGroup', **kwargs)
-
- def live_migrate_server(self, server_id, **kwargs):
- """This should be called with administrator privileges.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#migrateLive
- """
- return self.action(server_id, 'os-migrateLive', **kwargs)
-
- def migrate_server(self, server_id, **kwargs):
- """Migrate a server to a new host.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#migrate
- """
- return self.action(server_id, 'migrate', **kwargs)
-
- def lock_server(self, server_id, **kwargs):
- """Lock the given server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#lock
- """
- return self.action(server_id, 'lock', **kwargs)
-
- def unlock_server(self, server_id, **kwargs):
- """UNlock the given server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#unlock
- """
- return self.action(server_id, 'unlock', **kwargs)
-
- def suspend_server(self, server_id, **kwargs):
- """Suspend the provided server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#suspend
- """
- return self.action(server_id, 'suspend', **kwargs)
-
- def resume_server(self, server_id, **kwargs):
- """Un-suspend the provided server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#resume
- """
- return self.action(server_id, 'resume', **kwargs)
-
- def pause_server(self, server_id, **kwargs):
- """Pause the provided server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#pause
- """
- return self.action(server_id, 'pause', **kwargs)
-
- def unpause_server(self, server_id, **kwargs):
- """Un-pause the provided server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#unpause
- """
- return self.action(server_id, 'unpause', **kwargs)
-
- def reset_state(self, server_id, **kwargs):
- """Reset the state of a server to active/error.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#resetState
- """
- return self.action(server_id, 'os-resetState', **kwargs)
-
- def shelve_server(self, server_id, **kwargs):
- """Shelve the provided server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#shelve
- """
- return self.action(server_id, 'shelve', **kwargs)
-
- def unshelve_server(self, server_id, **kwargs):
- """Un-shelve the provided server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#unshelve
- """
- return self.action(server_id, 'unshelve', **kwargs)
-
- def shelve_offload_server(self, server_id, **kwargs):
- """Shelve-offload the provided server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#shelveOffload
- """
- return self.action(server_id, 'shelveOffload', **kwargs)
-
- def get_console_output(self, server_id, **kwargs):
- """Get console output.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#getConsoleOutput
- """
- return self.action(server_id, 'os-getConsoleOutput',
- schema.get_console_output, **kwargs)
-
- def list_virtual_interfaces(self, server_id):
- """List the virtual interfaces used in an instance."""
- resp, body = self.get('/'.join(['servers', server_id,
- 'os-virtual-interfaces']))
- body = json.loads(body)
- self.validate_response(schema.list_virtual_interfaces, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def rescue_server(self, server_id, **kwargs):
- """Rescue the provided server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#rescue
- """
- return self.action(server_id, 'rescue', schema.rescue_server, **kwargs)
-
- def unrescue_server(self, server_id):
- """Unrescue the provided server."""
- return self.action(server_id, 'unrescue')
-
- def show_server_diagnostics(self, server_id):
- """Get the usage data for a server."""
- resp, body = self.get("servers/%s/diagnostics" % server_id)
- return rest_client.ResponseBody(resp, json.loads(body))
-
- def list_instance_actions(self, server_id):
- """List the provided server action."""
- resp, body = self.get("servers/%s/os-instance-actions" %
- server_id)
- body = json.loads(body)
- self.validate_response(schema.list_instance_actions, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_instance_action(self, server_id, request_id):
- """Returns the action details of the provided server."""
- resp, body = self.get("servers/%s/os-instance-actions/%s" %
- (server_id, request_id))
- body = json.loads(body)
- self.validate_response(schema.show_instance_action, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def force_delete_server(self, server_id, **kwargs):
- """Force delete a server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#forceDelete
- """
- return self.action(server_id, 'forceDelete', **kwargs)
-
- def restore_soft_deleted_server(self, server_id, **kwargs):
- """Restore a soft-deleted server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#restore
- """
- return self.action(server_id, 'restore', **kwargs)
-
- def reset_network(self, server_id, **kwargs):
- """Reset the Network of a server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#resetNetwork
- """
- return self.action(server_id, 'resetNetwork', **kwargs)
-
- def inject_network_info(self, server_id, **kwargs):
- """Inject the Network Info into server.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#injectNetworkInfo
- """
- return self.action(server_id, 'injectNetworkInfo', **kwargs)
-
- def get_vnc_console(self, server_id, **kwargs):
- """Get URL of VNC console.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#getVNCConsole
- """
- return self.action(server_id, "os-getVNCConsole",
- schema.get_vnc_console, **kwargs)
-
- def add_fixed_ip(self, server_id, **kwargs):
- """Add a fixed IP to server instance.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#addFixedIp
- """
- return self.action(server_id, 'addFixedIp', **kwargs)
-
- def remove_fixed_ip(self, server_id, **kwargs):
- """Remove input fixed IP from input server instance.
-
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#removeFixedIp
- """
- return self.action(server_id, 'removeFixedIp', **kwargs)
diff --git a/tempest_lib/services/compute/services_client.py b/tempest_lib/services/compute/services_client.py
deleted file mode 100644
index 7adc1d0..0000000
--- a/tempest_lib/services/compute/services_client.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 2013 NEC Corporation
-# Copyright 2013 IBM Corp.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-from six.moves.urllib import parse as urllib
-
-from tempest_lib.api_schema.response.compute.v2_1 import services as schema
-from tempest_lib.common import rest_client
-
-
-class ServicesClient(rest_client.RestClient):
-
- def list_services(self, **params):
- url = 'os-services'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_services, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def enable_service(self, **kwargs):
- """Enable service on a host.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#enableScheduling
- """
- post_body = json.dumps(kwargs)
- resp, body = self.put('os-services/enable', post_body)
- body = json.loads(body)
- self.validate_response(schema.enable_disable_service, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def disable_service(self, **kwargs):
- """Disable service on a host.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#disableScheduling
- """
- post_body = json.dumps(kwargs)
- resp, body = self.put('os-services/disable', post_body)
- body = json.loads(body)
- self.validate_response(schema.enable_disable_service, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/snapshots_client.py b/tempest_lib/services/compute/snapshots_client.py
deleted file mode 100644
index 9b65cdc..0000000
--- a/tempest_lib/services/compute/snapshots_client.py
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright 2015 Fujitsu(fnst) Corporation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-from six.moves.urllib import parse as urllib
-
-from tempest_lib.api_schema.response.compute.v2_1 import snapshots as schema
-from tempest_lib.common import rest_client
-from tempest_lib import exceptions as lib_exc
-
-
-class SnapshotsClient(rest_client.RestClient):
-
- def create_snapshot(self, volume_id, **kwargs):
- """Create a snapshot.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createSnapshot
- """
- post_body = {
- 'volume_id': volume_id
- }
- post_body.update(kwargs)
- post_body = json.dumps({'snapshot': post_body})
- resp, body = self.post('os-snapshots', post_body)
- body = json.loads(body)
- self.validate_response(schema.create_get_snapshot, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_snapshot(self, snapshot_id):
- url = "os-snapshots/%s" % snapshot_id
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.create_get_snapshot, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def list_snapshots(self, detail=False, params=None):
- url = 'os-snapshots'
-
- if detail:
- url += '/detail'
- if params:
- url += '?%s' % urllib.urlencode(params)
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_snapshots, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_snapshot(self, snapshot_id):
- resp, body = self.delete("os-snapshots/%s" % snapshot_id)
- self.validate_response(schema.delete_snapshot, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def is_resource_deleted(self, id):
- try:
- self.show_snapshot(id)
- except lib_exc.NotFound:
- return True
- return False
-
- @property
- def resource_type(self):
- """Return the primary type of resource this client works with."""
- return 'snapshot'
diff --git a/tempest_lib/services/compute/tenant_networks_client.py b/tempest_lib/services/compute/tenant_networks_client.py
deleted file mode 100644
index e1ebfea..0000000
--- a/tempest_lib/services/compute/tenant_networks_client.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 2015 NEC Corporation. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest_lib.api_schema.response.compute.v2_1 import tenant_networks
-from tempest_lib.common import rest_client
-
-
-class TenantNetworksClient(rest_client.RestClient):
-
- def list_tenant_networks(self):
- resp, body = self.get("os-tenant-networks")
- body = json.loads(body)
- self.validate_response(tenant_networks.list_tenant_networks, resp,
- body)
- return rest_client.ResponseBody(resp, body)
-
- def show_tenant_network(self, network_id):
- resp, body = self.get("os-tenant-networks/%s" % network_id)
- body = json.loads(body)
- self.validate_response(tenant_networks.get_tenant_network, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/tenant_usages_client.py b/tempest_lib/services/compute/tenant_usages_client.py
deleted file mode 100644
index 70df4d0..0000000
--- a/tempest_lib/services/compute/tenant_usages_client.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright 2013 NEC Corporation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-from six.moves.urllib import parse as urllib
-
-from tempest_lib.api_schema.response.compute.v2_1 import tenant_usages
-from tempest_lib.common import rest_client
-
-
-class TenantUsagesClient(rest_client.RestClient):
-
- def list_tenant_usages(self, **params):
- url = 'os-simple-tenant-usage'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(tenant_usages.list_tenant_usage, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_tenant_usage(self, tenant_id, **params):
- url = 'os-simple-tenant-usage/%s' % tenant_id
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(tenant_usages.get_tenant_usage, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/versions_client.py b/tempest_lib/services/compute/versions_client.py
deleted file mode 100644
index 4b7273d..0000000
--- a/tempest_lib/services/compute/versions_client.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-from six.moves import urllib
-
-from tempest_lib.api_schema.response.compute.v2_1 import versions as schema
-from tempest_lib.common import rest_client
-
-
-class VersionsClient(rest_client.RestClient):
-
- def _get_base_version_url(self):
- # NOTE: The URL which is gotten from keystone's catalog contains
- # API version and project-id like "v2/{project-id}", but we need
- # to access the URL which doesn't contain them for getting API
- # versions. For that, here should use raw_request() instead of
- # get().
- endpoint = self.base_url
- url = urllib.parse.urlparse(endpoint)
- return '%s://%s/' % (url.scheme, url.netloc)
-
- def list_versions(self):
- version_url = self._get_base_version_url()
- resp, body = self.raw_request(version_url, 'GET')
- body = json.loads(body)
- self.validate_response(schema.list_versions, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def get_version_by_url(self, version_url):
- """Get the version document by url.
-
- This gets the version document for a url, useful in testing
- the contents of things like /v2/ or /v2.1/ in Nova. That
- controller needs authenticated access, so we have to get
- ourselves a token before making the request.
-
- """
- # we need a token for this request
- resp, body = self.raw_request(version_url, 'GET',
- {'X-Auth-Token': self.token})
- body = json.loads(body)
- self.validate_response(schema.get_one_version, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest_lib/services/compute/volumes_client.py b/tempest_lib/services/compute/volumes_client.py
deleted file mode 100644
index 0d767ef..0000000
--- a/tempest_lib/services/compute/volumes_client.py
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-from six.moves.urllib import parse as urllib
-
-from tempest_lib.api_schema.response.compute.v2_1 import volumes as schema
-from tempest_lib.common import rest_client
-from tempest_lib import exceptions as lib_exc
-
-
-class VolumesClient(rest_client.RestClient):
-
- def list_volumes(self, detail=False, **params):
- """List all the volumes created."""
- url = 'os-volumes'
-
- if detail:
- url += '/detail'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_volumes, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def show_volume(self, volume_id):
- """Return the details of a single volume."""
- url = "os-volumes/%s" % volume_id
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.create_get_volume, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def create_volume(self, **kwargs):
- """Create a new Volume.
-
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createVolume
- """
- post_body = json.dumps({'volume': kwargs})
- resp, body = self.post('os-volumes', post_body)
- body = json.loads(body)
- self.validate_response(schema.create_get_volume, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_volume(self, volume_id):
- """Delete the Specified Volume."""
- resp, body = self.delete("os-volumes/%s" % volume_id)
- self.validate_response(schema.delete_volume, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def is_resource_deleted(self, id):
- try:
- self.show_volume(id)
- except lib_exc.NotFound:
- return True
- return False
-
- @property
- def resource_type(self):
- """Return the primary type of resource this client works with."""
- return 'volume'