export default (function (_ref) {
  var projectId = _ref.projectId;
  return {
    autoQuery: false,
    selection: false,
    paging: false,
    transport: {
      read: function read(_ref2) {
        var data = _ref2.data;

        var _ref3 = data || {},
            clusterId = _ref3.clusterId;

        return {
          url: "/devops/v1/projects/".concat(projectId, "/clusters/").concat(clusterId, "/node_names"),
          method: 'get',
          transformResponse: function transformResponse(response) {
            try {
              var res = JSON.parse(response);

              if (res && res.failed) {
                return data;
              } else {
                return res.map(function (item) {
                  return {
                    value: item
                  };
                });
              }
            } catch (e) {
              return response;
            }
          }
        };
      }
    }
  };
});