code: def create_role(resource_root,
                  service_name,
                  role_type,
                  role_name,
                  host_id,
                  cluster_name="default"):
    
    apirole = ApiRole(resource_root, role_name, role_type,
                      ApiHostRef(resource_root, host_id))
    return call(resource_root.post,
        _get_roles_path(cluster_name, service_name),
        ApiRole, True, data=[apirole])[0]
docs: Create a role
    @param resource_root: The root Resource object.
    @param service_name: Service name
    @param role_type: Role type
    @param role_name: Role name
    @param cluster_name: Cluster name
    @return: An ApiRole object