/**
 * Add properties that help map to cassandra
 * complex types
 */
ConfigurationValue.meta = {
  name: 'ConfigurationValue',
  cname: 'configuration_value',
  columnFamily: 'configuration_values',
  prefix: 'cv',
  dataPrefix: null,
  parents: []
};

ConfigurationValue.fields = {
  'value': null
};

ConfigurationValue.operationalVersion = 0;
base.inheritBase(ConfigurationValue, __filename);

ConfigurationValue.prototype.getKeyWithoutPrefix = function() {
  return this.getKey().replace(new RegExp('^' + ConfigurationValue.prefix()), '');
};

ConfigurationValue.prototype.getUrlPath = function() {
  return sprintf('/configuration/%s', this.getKeyWithoutPrefix());
};

exports.ConfigurationValue = ConfigurationValue;
Пример #2
0
};

/**
 * Add properties that help map to cassandra
 * complex types
 */
Account.meta = {
  name: 'Account',
  cname: 'account',
  columnFamily: 'accounts',
  prefix: 'ac',
  dataPrefix: null,
  parents: []
};

/**
 * Fields on the Account
 */
Account.fields = {
  'metadata': {'default_value': {}},
  'status': {'default_value': 'active'},

  // account object limits
  'limits': {'default_value': { 'service': 200, 'configuration_value': 1000 }}
};

Account.operationalVersion = 4;
base.inheritBase(Account, __filename);

exports.Account = Account;