def update_service(self, service_id, name=None, type_=None, description=None, requestslib_kwargs=None): """ @summary: Updates a service given the provided parameters Maps to /services @param service_id: The ID of an existing service. @type service_id: String @param name: The name for the service @type name: String @param description: The description of the service @type description: String @param type_: The type of the service @type type_: String @return: response @rtype: Response """ url = '{0}/{1}/services/{2}'.format(self.base_url, _admin_extensions, service_id) service_request_object = Service(id_=service_id, name=name, type_=type_, description=description) response = self.request('PUT', url, response_entity_type=Service, request_entity=service_request_object, requestslib_kwargs=requestslib_kwargs) return response
def setup_class(cls): cls.name = "keystone-test" cls.type = "identity-test" cls.description = "Keystone Identity Service Test" cls.admin_ext = "OS-KSADM" cls.service_dict = { "name": cls.name, "type": cls.type, "description": cls.description } cls.expected_service = Service(name=cls.name, type_=cls.type, description=cls.description) cls.json_dict = json.dumps( {"{0}:service".format(cls.admin_ext): cls.service_dict}) cls.expected_services = Services(services=[cls.expected_service]) cls.service_dict_list = [cls.service_dict] cls.services_json_dict = json.dumps( {"{0}:services".format(cls.admin_ext): cls.service_dict_list})