Esempio n. 1
0
 def get_auto_allocated_topology(self, tenant_id=None):
     uri = '%s/auto-allocated-topology/%s' % (self.uri_prefix, tenant_id)
     resp, body = self.get(uri)
     self.expected_success(200, resp.status)
     body = jsonutils.loads(body)
     return service_client.ResponseBody(resp, body)
Esempio n. 2
0
 def delete_volume(self, volume_id):
     """Deletes the Specified Volume."""
     resp, body = self.delete("volumes/%s" % volume_id)
     self.expected_success(202, resp.status)
     return rest_client.ResponseBody(resp, body)
Esempio n. 3
0
 def show_trust(self, trust_id):
     """GET trust."""
     resp, body = self.get("OS-TRUST/trusts/%s" % trust_id)
     self.expected_success(200, resp.status)
     body = json.loads(body)
     return rest_client.ResponseBody(resp, body)
Esempio n. 4
0
 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)
Esempio n. 5
0
 def force_delete_volume(self, volume_id):
     """Force Delete Volume."""
     post_body = json.dumps({'os-force_delete': {}})
     resp, body = self.post('volumes/%s/action' % volume_id, post_body)
     self.expected_success(202, resp.status)
     return rest_client.ResponseBody(resp, body)
Esempio n. 6
0
 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)
Esempio n. 7
0
 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)
Esempio n. 8
0
 def get_floatingip(self, fip_id):
     uri = '%s/floatingips/%s' % (self.uri_prefix, fip_id)
     get_resp, get_resp_body = self.get(uri)
     self.expected_success(200, get_resp.status)
     body = jsonutils.loads(get_resp_body)
     return service_client.ResponseBody(get_resp, body)
Esempio n. 9
0
 def get_tags(self, resource_type, resource_id):
     uri = '%s/%s/%s/tags' % (self.uri_prefix, resource_type, resource_id)
     resp, body = self.get(uri)
     self.expected_success(200, resp.status)
     body = jsonutils.loads(body)
     return service_client.ResponseBody(resp, body)
Esempio n. 10
0
 def delete_security_group(self, security_group_id):
     uri = '%s/security-groups/%s' % (self.uri_prefix, security_group_id)
     resp, body = self.delete(uri)
     self.expected_success(204, resp.status)
     return service_client.ResponseBody(resp, body)
Esempio n. 11
0
 def get_uri_with_links(self, plural_name, uri):
     resp, body = self.get(uri)
     result = {plural_name: self.deserialize_list(body)}
     links = self.deserialize_links(body)
     self.expected_success(200, resp.status)
     return links, service_client.ResponseBody(resp, result)
Esempio n. 12
0
 def delete_flavor_service_profile(self, flavor_id, service_profile_id):
     uri = '%s/flavors/%s/service_profiles/%s' % (
         self.uri_prefix, flavor_id, service_profile_id)
     resp, body = self.delete(uri)
     self.expected_success(204, resp.status)
     return service_client.ResponseBody(resp, body)
Esempio n. 13
0
 def list_flavor_service_profiles(self, flavor_id):
     uri = '%s/flavors/%s/service_profiles' % (self.uri_prefix, flavor_id)
     resp, body = self.get(uri)
     self.expected_success(200, resp.status)
     body = jsonutils.loads(body)
     return service_client.ResponseBody(resp, body)
Esempio n. 14
0
 def delete_auto_allocated_topology(self, tenant_id=None):
     uri = '%s/auto-allocated-topology/%s' % (self.uri_prefix, tenant_id)
     resp, body = self.delete(uri)
     self.expected_success(204, resp.status)
     return service_client.ResponseBody(resp, body)
Esempio n. 15
0
 def delete_endpoint(self, endpoint_id):
     """Delete endpoint."""
     resp_header, resp_body = self.delete('endpoints/%s' % endpoint_id)
     self.expected_success(204, resp_header.status)
     return rest_client.ResponseBody(resp_header, resp_body)
Esempio n. 16
0
 def _list(**filters):
     uri = self.build_uri(plural_name, **filters)
     resp, body = self.get(uri)
     result = {plural_name: self.deserialize_list(body)}
     self.expected_success(200, resp.status)
     return service_client.ResponseBody(resp, result)
Esempio n. 17
0
 def show_endpoint(self, endpoint_id):
     """Get endpoint."""
     resp_header, resp_body = self.get('endpoints/%s' % endpoint_id)
     self.expected_success(200, resp_header.status)
     resp_body = json.loads(resp_body)
     return rest_client.ResponseBody(resp_header, resp_body)
Esempio n. 18
0
 def show_user(self, user_id):
     """GET a user."""
     resp, body = self.get("users/%s" % user_id)
     self.expected_success(200, resp.status)
     body = json.loads(body)
     return rest_client.ResponseBody(resp, body)
Esempio n. 19
0
 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)
Esempio n. 20
0
 def delete_user(self, user_id):
     """Deletes a User."""
     resp, body = self.delete("users/%s" % user_id)
     self.expected_success(204, resp.status)
     return rest_client.ResponseBody(resp, body)
Esempio n. 21
0
 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))
Esempio n. 22
0
 def list_user_groups(self, user_id):
     """Lists groups which a user belongs to."""
     resp, body = self.get('users/%s/groups' % user_id)
     self.expected_success(200, resp.status)
     body = json.loads(body)
     return rest_client.ResponseBody(resp, body)
Esempio n. 23
0
 def delete_volume_transfer(self, transfer_id):
     """Delete a volume transfer."""
     resp, body = self.delete("os-volume-transfer/%s" % transfer_id)
     self.expected_success(202, resp.status)
     return rest_client.ResponseBody(resp, body)
Esempio n. 24
0
 def list_user_projects(self, user_id):
     """Lists the projects on which a user has roles assigned."""
     resp, body = self.get('users/%s/projects' % user_id)
     self.expected_success(200, resp.status)
     body = json.loads(body)
     return rest_client.ResponseBody(resp, body)
Esempio n. 25
0
 def delete_volume_metadata_item(self, volume_id, id):
     """Delete metadata item for the volume."""
     url = "volumes/%s/metadata/%s" % (volume_id, id)
     resp, body = self.delete(url)
     self.expected_success(200, resp.status)
     return rest_client.ResponseBody(resp, body)
Esempio n. 26
0
 def force_delete_volume(self, volume_id):
     """Force Delete Volume."""
     post_body = json.dumps({'os-force_delete': {}})
     resp, body = self.post('volumes/%s/action' % volume_id, post_body)
     self.validate_response(schema.force_delete_volume, resp, body)
     return rest_client.ResponseBody(resp, body)
Esempio n. 27
0
 def delete_trust(self, trust_id):
     """Deletes a trust."""
     resp, body = self.delete("OS-TRUST/trusts/%s" % trust_id)
     self.expected_success(204, resp.status)
     return rest_client.ResponseBody(resp, body)
Esempio n. 28
0
 def delete_volume_metadata_item(self, volume_id, id):
     """Delete metadata item for the volume."""
     url = "volumes/%s/metadata/%s" % (volume_id, id)
     resp, body = self.delete(url)
     self.validate_response(schema.delete_volume_metadata_item, resp, body)
     return rest_client.ResponseBody(resp, body)
Esempio n. 29
0
 def list_trust_roles(self, trust_id):
     """GET roles delegated by a trust."""
     resp, body = self.get("OS-TRUST/trusts/%s/roles" % trust_id)
     self.expected_success(200, resp.status)
     body = json.loads(body)
     return rest_client.ResponseBody(resp, body)
Esempio n. 30
0
 def get_subports(self, trunk_id):
     uri = '%s/trunks/%s/%s' % (self.uri_prefix, trunk_id, 'get_subports')
     resp, body = self.get(uri)
     self.expected_success(200, resp.status)
     body = jsonutils.loads(body)
     return service_client.ResponseBody(resp, body)