Esempio n. 1
0
def queryAgentHistory(groupIds=None,
                      agentIds=None,
                      startDate=None,
                      endDate=None,
                      limit=100):
    """Returns a list of the most recent agent events.

    Args:
        groupIds (list[str]): A list of groups to restrict the results
            to. If not specified, all groups will be included. Optional.
        agentIds (list[str]): A list of agent names to restrict the
            results to. If not specified, all agents will be allowed.
            Optional.
        startDate (datetime): The starting time for history events. If
            null, defaults to 8 hours previous to now. Optional.
        endDate (datetime): The ending time for the query range. If
            null, defaults to "now". Optional.
        limit (int): The limit of results to return. Defaults to 100. A
            value of 0 means "no limit". Optional.

    Returns:
        Dataset: A dataset with columns id, agent_name, agent_role,
            event_time, event_category, event_type, event_source,
            event_level, event_level_int, and message, where each row is
            a new agent event.
    """
    endDate = system.date.now() if endDate is None else endDate
    startDate = (system.date.addHours(endDate, -8)
                 if startDate is None else startDate)
    print(groupIds, agentIds, startDate, endDate, limit)
    return Dataset()
Esempio n. 2
0
def getReportNamesAsDataset(project="project", includeReportName=True):
    """Gets a data of all reports for a project.

    This dataset is particularly suited for display in a Tree View
    component.

    Args:
        project (str): The name of the project where the reports are
            located. Optional in client scope.
        includeReportName (bool): When set to False, the end of Path
            does not include the report name. Default is True. Optional.

    Returns:
        Dataset: A dataset of report paths and names for the project.
            Returns an empty dataset if the project has no reports.

    Raises:
        IllegalArgumentException: Thrown when any of the following
            occurs: If the project name is omitted in the Gateway scope,
            project does not exist.
    """
    if project is None:
        raise IllegalArgumentException()

    print(project, includeReportName)
    return Dataset()
Esempio n. 3
0
def listDevices():
    """Returns a dataset of information about each configured device.
    Each row represents a single device.

    Returns:
        Dataset: A dataset, where each row represents a device. Contains
            4 columns Name, Enabled, State, and Driver.
    """
    return Dataset()
Esempio n. 4
0
def getAccountsDataset():
    """Return a list of Twilio accounts that have been configured in the
    Gateway as a single-column Dataset.

    Returns:
        Dataset: A list of configured Twilio accounts as a single-column
            Dataset.
    """
    return Dataset()
Esempio n. 5
0
def getConnections():
    """Returns a dataset of information about each configured database
    connection. Each row represents a single connection.

    Returns:
        Dataset: A dataset, where each row represents a database
            connection.
    """
    return Dataset()
Esempio n. 6
0
def getToolProgramDataset():
    """Returns a Dataset containing information about all stored process
    programs.

    Returns:
         Dataset: A Dataset containing information about all stored
            process programs. Includes the following columns in order:
            ppid, editDate, bodyFormat.
    """
    return Dataset()
Esempio n. 7
0
    def getResultSet(self):
        """Returns a dataset that is the resulting data of the stored
        procedure, if any.

        Returns:
            Dataset: The dataset that is the resulting data of the
                stored procedure, if any.
        """
        print(self)
        return Dataset()
Esempio n. 8
0
def queryAuditLog(
    auditProfileName,
    startDate=None,
    endDate=None,
    actorFilter=None,
    actionFilter=None,
    targetFilter=None,
    valueFilter=None,
    systemFilter=None,
    contextFilter=None,
):
    """Queries an audit profile for audit history.

    Returns the results as a dataset.

    Args:
        auditProfileName (str): The name of the audit profile to pull
            the history from.
        startDate (Date): The earliest audit event to return. If
            omitted, the current time - 8 hours will be used. Optional.
        endDate (Date): The latest audit event to return. If
            omitted, the current time will be used. Optional.
        actorFilter (str): A filter string used to restrict the results
            by actor. Optional.
        actionFilter (str): A filter string used to restrict the results
            by action. Optional.
        targetFilter (str): A filter string used to restrict the results
            by target. Optional.
        valueFilter (str): A filter string used to restrict the results
            by value. Optional.
        systemFilter (str): A filter string used to restrict the results
            by system. Optional.
        contextFilter (int): A bitmask used to restrict the results by
            context. 0x01 = Gateway, 0x02 = Designer, 0x04 = Client.
            Optional.

    Returns:
        Dataset: A dataset with the audit events from the specified
            profile that match the filter arguments.
    """
    endDate = system.date.now() if endDate is None else endDate
    startDate = (system.date.addHours(endDate, -8)
                 if startDate is None else startDate)
    print(
        auditProfileName,
        startDate,
        endDate,
        actorFilter,
        actionFilter,
        targetFilter,
        valueFilter,
        systemFilter,
        contextFilter,
    )
    return Dataset()
Esempio n. 9
0
def toDataSet(secsObject):
    """Converts a SECS message data structure, as returned by the
    system.secsgem.getResponse function, into a dataset and returns it.

    Args:
        secsObject (object): A Python object, such as Sequence or a
            Dictionary, representing a SECS message to convert to a
            dataset.

    Returns:
         Dataset: A Dataset representing a SECS message.
    """
    print secsObject
    return Dataset()
Esempio n. 10
0
def getConnectionInfo(name):
    """Returns a dataset of information about a single database
    connection, as specified by the name argument.

    Args:
        name (str): The name of the database connection to find
            information about.

    Returns:
        Dataset: A dataset containing information about the named
            database connection, or an empty dataset if the connection
            wasn't found.
    """
    print name
    return Dataset()
Esempio n. 11
0
def getPhoneNumbersDataset(accountName):
    """Return a list of outgoing phone numbers for a Twilio account as a
    single-column Dataset. Note that these numbers are supplied by
    Twilio, and are not defined on a user in Ignition.

    Args:
        accountName (str): The Twilio account to retrieve phone numbers
            for.

    Returns:
        Dataset: A list of phone numbers for the given Twilio account as
            a single-column Dataset.
    """
    print accountName
    return Dataset()
Esempio n. 12
0
def getConnectionInfo(name=""):
    """Returns a dataset of information about a database connection.

    Args:
        name (str): The name of the database connection to find
            information about, or the project's default connection if
            omitted. Optional.

    Returns:
        Dataset: A dataset containing information about the named
            database connection or about the current project's default
            database connection, or an empty dataset if the connection
            wasn't found.
    """
    print(name)
    return Dataset()
Esempio n. 13
0
def getRunningCharts(charPath=None):
    """Retrieves information about running charts. Can search all
    running charts, or be filtered charts at a specific path. This
    function will return charts that are in a Paused state.

    Args:
        charPath (str): The path to a chart to filter on: i.e.,
            "folder/chartName". If specified, only charts at the path
            will be included in the returned dataset. If omitted, the
            function will return data for all active charts.

    Returns:
        Dataset: A dataset with information on the active chart.
    """
    print charPath
    return Dataset()
Esempio n. 14
0
def toTreeDataSet(dataset):
    """Changes an existing dataset, as returned by the
    system.secsgem.toDataSet function, to make it usable for the Tree
    View component.

    Args:
        dataset (Dataset): A DataSet containing a SECS message. Note
            that this parameter cannot take a JSON message, so the
            object returned by system.secsgem.getResponse must first be
            processed by system.secsgem.toDataSet.

    Returns:
        Dataset: A Dataset containing a SECS message that can be used in
            the Tree View component.
    """
    print dataset
    return Dataset()
Esempio n. 15
0
def getReportNamesAsDataset(project='project'):
    """Gets a data of all reports for a project. This dataset is
    particularly suited for display in a Tree View component.

    Args:
        project (str):  The name of the project where the reports are
            located. Optional in client scope.

    Returns:
        Dataset: A dataset of report paths and names for the project.
            Returns an empty dataset if the project has no reports.

    Raises:
        IllegalArgumentException: Thrown when any of the following
            occurs: If the project name is omitted in the Gateway scope,
            project does not exist.
    """
    if project is None:
        raise IllegalArgumentException()
    else:
        return Dataset()
Esempio n. 16
0
def queryAgentStatus(groupIds=None, agentIds=None, isConnected=True):
    """Returns the current state of the matching agents.

    Args:
        groupIds (list[str]): A list of groups to restrict the results
            to. If not specified, all groups will be included.
        agentIds (list[str]): A list of agent names to restrict the
            results to. If not specified, all agents will be allowed.
        isConnected (bool): If True, only returns agents that are
            currently connected. If False, only agents that are
            considered down will be returned, and if not specified, all
            agents will be returned.

    Returns:
        Dataset: A dataset with columns AgentName, NodeRole, AgentGroup,
            LastCommunication, IsConnected, IsRunning, RunningState,
            RunningStateInt, LicenseKey, and Version, where each row is
            a new agent.
    """
    print(groupIds, agentIds, isConnected)
    return Dataset()