def create_service(resource_root, name, service_type,
                   cluster_name="default"):
    """Create a service

    :param resource_root: The root Resource object.
    :param name: Service name
    :param service_type: Service type
    :param cluster_name: Cluster name
    :return: An ApiService object
    """
    apiservice = ApiService(resource_root, name, service_type)
    return types.call(resource_root.post, SERVICES_PATH % (cluster_name,),
                      ApiService, True, data=[apiservice])[0]
dataset/ETHPy150Open openstack/sahara/sahara/plugins/cdh/client/services.py/create_service/original