Пример #1
0
def getCloudwatchMetrics(conn, fields=None):
  """Get Cloudwatch metrics

  :param conn: SQLAlchemy connection object
  :type conn: sqlalchemy.engine.base.Connection
  :param fields: Sequence of columns to be returned by underlying query
  :returns: Result of querying database for cloudwatch metrics
  :rtype: sqlalchemy.engine.ResultProxy
  """
  where = (schema.metric.c.datasource == "cloudwatch")

  return _getMetrics(conn, fields=fields, where=where)
Пример #2
0
def getCloudwatchMetrics(conn, fields=None):
    """Get Cloudwatch metrics

  :param conn: SQLAlchemy connection object
  :type conn: sqlalchemy.engine.base.Connection
  :param fields: Sequence of columns to be returned by underlying query
  :returns: Result of querying database for cloudwatch metrics
  :rtype: sqlalchemy.engine.ResultProxy
  """
    where = (schema.metric.c.datasource == "cloudwatch")

    return _getMetrics(conn, fields=fields, where=where)
Пример #3
0
def getCloudwatchMetricsForNameAndServer(conn, name, server, fields=None):
  """Get Cloudwatch metrics given name and server

  :param conn: SQLAlchemy connection object
  :type conn: sqlalchemy.engine.base.Connection
  :param name: metric name
  :param server: metric server
  :param fields: Sequence of columns to be returned by underlying query
  :returns: Sequence of matching cloudwatch metric rows
  :rtype: Sequence of sqlalchemy.engine.RowProxy
  """
  where = ((schema.metric.c.datasource == "cloudwatch") &
           (schema.metric.c.server == server) &
           (schema.metric.c.name == name))

  return _getMetrics(conn, fields=fields, where=where).fetchall()
Пример #4
0
def getCloudwatchMetricsForNameAndServer(conn, name, server, fields=None):
    """Get Cloudwatch metrics given name and server

  :param conn: SQLAlchemy connection object
  :type conn: sqlalchemy.engine.base.Connection
  :param name: metric name
  :param server: metric server
  :param fields: Sequence of columns to be returned by underlying query
  :returns: Sequence of matching cloudwatch metric rows
  :rtype: Sequence of sqlalchemy.engine.RowProxy
  """
    where = ((schema.metric.c.datasource == "cloudwatch") &
             (schema.metric.c.server == server) &
             (schema.metric.c.name == name))

    return _getMetrics(conn, fields=fields, where=where).fetchall()