This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=========================================================== | |
file_upload.py | |
Script to upload files to AgXchange(tm). | |
=========================================================== | |
PREREQUISITES | |
============= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VirtualBox VM Install | |
===================== | |
Prerequisites: | |
- VirtualBox installed | |
- Ubuntu ISO image downloaded: ubuntu-14.04.1-server-amd64.iso | |
-- for 64bit architecture AMD/Intel processors | |
- Thingworx packages downloaded | |
Create new VM in VirtualBox, select ISO and use these (or other) settings: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_user_events(nr_list, start_time): | |
dq = DatastoreQueryBuilder(datastore=DataStore.DS_EVENTS, profile=DataStore.DS_PROFILE.EVENTS) | |
where_list = [] | |
for nr in user_nr_list: | |
nr_condition_and = [] | |
if nr.origin: | |
nr_condition_and.append(qb.eq(qb.EA_ORIGIN, nr.origin) | |
if nr.origin_type: | |
nr_condition_and.append(qb.eq(qb.EA_ORIGIN_TYPE, nr.origin_type) | |
if nr.event_type: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyon.datastore.datastore import DataStore | |
from pyon.datastore.datastore_query import DatastoreQueryBuilder, DQ | |
from pyon.public import get_ion_ts_millis | |
dqb = DatastoreQueryBuilder(datastore=DataStore.DS_EVENTS, profile=DataStore.DS_PROFILE.EVENTS) | |
filter_origins = dqb.in_(DQ.EA_ORIGIN, "7b1c97e40b7345b5b31a6d3208a39040", "234d1d999adc490f90b1406c14a9591a") | |
filter_types = dqb.in_(DQ.ATT_TYPE, "ResourceLifecycleEvent", "ResourceModifiedEvent") | |
filter_mindate = dqb.gte(DQ.RA_TS_CREATED, str(get_ion_ts_millis()-1000*60*60)) # 1 hour back in this case | |
where = dqb.and_(filter_origins, filter_types, filter_mindate) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Holds information about the definition of a custom attribute, e.g. for instrument models | |
CustomAttribute: | |
# Name of the attribute | |
name: "" | |
# Type of the attribute. | |
# Codelist: str, int, float, bool, list, dict | |
type: "" | |
# Description for the attribute | |
description: "" | |
# Default value for the attribute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Sample supervisor config file. | |
[unix_http_server] | |
file=/tmp/supervisor.sock ; (the path to the socket file) | |
;chmod=0700 ; sockef file mode (default 0700) | |
;chown=nobody:nogroup ; socket file uid:gid owner | |
;username=user ; (default is no username (open server)) | |
;password=123 ; (default is no password (open server)) | |
[inet_http_server] ; inet (TCP) server disabled by default |