Paul Maritz!
Executive Chairman, Pivotal!
What is Cloud Foundry from a CEO’s perspective?
Google, Facebook, Twitter, Netflix, etc. have thousands of engineers working on their unique, consumer-grade platforms
Cloud Foundry encapsulates industry best practices in a platform, allowing enterprises to focus on their business domain
Cloud Foundry is transformational in two ways:
Description:
Responsibilities:
Description:
Responsibilities:
Description:
Responsibilities:
Description:
Responsibilities:
Description:
Responsibilities:
Description:
Responsibilities:
Description:
Responsibilities:
Windows Machine:
OSX
For OSX the easiest way to install virtual box is to use brew
brew cask install virtualbox \ virtualbox-extension-pack
sudo gedit /etc/bashrc
export http_proxy=http://sjc1intproxy01.crd.ge.com:8080/
export https_proxy=$http_proxy
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$http_proxy
export no_proxy="127.0.0.1,localhost,localhost.localdomain,*.ge.com"
env | grep http_proxy
wget https://www.google.com
cat index.html
<server>
<id>artifactory.external</id>
<username>your.predix.io.username</username>
<password>your.encrypted.password</password>
<!-- Obtained from
https://artifactory.predix.io -->
</server>
<proxies>
<proxy>
<id>corporate</id>
<active>true</active>
<protocol>http</protocol>
<host>sjc1intproxy01.crd.ge.com</host>
<port>8080</port>
<username>proxyuser</username>
<password>proxypass</password>
<nonProxyHosts>127.0.0.1,localhost,localhost.localdomain,*.ge.com</nonProxyHosts>
</proxy>
</proxies>
cf --help
cf help {command}
cf login -a
https://api.system.aws-usw02-pr.ice.predix.io
cf target -o {Orgname} -s
{SpaceName}
cf marketplace
cf apps
cf services
cf push -f manifest.yml
predix logs {AppName}
predix logs {AppName} --recent
predix cf delete {AppName}
predix cf env {AppName}
predix cf services
predix cf app {AppName}
predix cf target -o "Email"
predix cf create-space lab
predix cf target -s "lab"
predix cf create-space lab2
predix cf target -s "lab2"
predix cf target -s "lab"
predix cf delete-space "lab2"
predix cf target -s "lab"
mkdir nullApp && cd nullApp
touch Procfile
predix cf push nullApp -b http://github.com/ryandotsmith/null-buildpack.git --no-start --no-route -m 32m -k 64m
predix uaa target {uaaUri}
predix uaa client create {client_id} -s
{client_secret}
predix uaa client update {client_id}
{Additional properties}
predix uaa group add {groupname}
predix create-service predix-uaa Free uaa-lab -a {UAA_SECRET} -C '{"subdomain":"lab-{your initials}"}'
predix uaa client create rest-client -s "{CLIENT_SECRET}" --authorized_grant_types "client_credentials" --scope "uaa.none" --authorities "uaa.none"
https://lab-{your
initials}.predix-uaa.run.aws-usw02-pr.ice.predix.io
plus add the extension to obtain a token
{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImxlZ2FjeS10b2tlbi1rZXkiLCJ0eXAiOiJKV1QifQ.eyJqdGkiOiI5MzM3Yzc5MzE5MmE0MDcwYjA5ZmQ2MzdmZDZkMzY5MSIsInN1YiI6InJlc3RfY2xpZW50Iiwic2NvcGUiOlsidWFhLm5vbmUiXSwiY2xpZW50X2lkIjoicmVzdF9jbGllbnQiLCJjaWQiOiJyZXN0X2NsaWVudCIsImF6cCI6InJlc3RfY2xpZW50IiwiZ3JhbnRfdHlwZSI6ImNsaWVudF9jcmVkZW50aWFscyIsInJldl9zaWciOiIzMDBkYmJkOCIsImlhdCI6MTQ4MTEyODIwMSwiZXhwIjoxNDgxMTcxNDAxLCJpc3MiOiJodHRwczovL2xhYi5wcmVkaXgtdWFhLnJ1bi5hd3MtdXN3MDItcHIuaWNlLnByZWRpeC5pby9vYXV0aC90b2tlbiIsInppZCI6IjIyMTQ0NmQyLTNiNWUtNDAyYy1hNmQ1LTZhYWVjZTIyZDQzYiIsImF1ZCI6WyJyZXN0X2NsaWVudCJdfQ.h3QEK1hP5pgWWpYRoqnthKhh7_FbhKXSs_7tbEcOvqB59E46zFDC4btiBJjN7k6D1waTkuHaXiXaUxpnijwDamsHl7qfayHBkX5tDie7YQL9v4n49AJpLkA-sONDbdjr0TdbtlLYxqABInHoWEQgWEHhMBWrZDfFCiIneRWNCvwAS_d84bm2YeoodlLBG8tfo3IxxDOaB_HD0kaxeR5X54lvoahXC31m3STsxqbZSsODTggIPgphKfnQH4oSmVePDpA1LV51J0r32EhPXvXEUOSkzad3wlr365Hp7Gb36J3i-d4yfbRqLSreMmI7h2AFbBy4M5YhKHEt_DlzWnOJBw","token_type": "bearer",
"expires_in": 43199,
"scope": "uaa.none",
"jti": "9337c793192a4070b09fd637fd6d3691"
}
https://lab-{your
initials}.predix-uaa.run.aws-usw02-pr.ice.predix.io
plus add the extension to check a token
{"error":"access_denied","error_description":"Access is denied"}
{
"client_id": "rest-client",
"exp": 1481172828,
"scope": [
"uaa.none"
],
"jti": "d8fd8a1cc0714bfd97870ff50f677034",
"aud": [
"rest-client"
],
"sub": "rest-client",
"iss": "https://lab-{your initials}.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/token",
"iat": 1481129628,
"cid": "rest-client",
"grant_type": "client_credentials",
"azp": "rest-client",
"zid": "221446d2-3b5e-402c-a6d5-6aaece22d43b",
"rev_sig": "300dbbd8",
"revocable": false
}
{
"client_id": "rest-client",
"exp": 1481172828,
"scope": [
"uaa.none"
],
"jti": "d8fd8a1cc0714bfd97870ff50f677034",
"aud": [
"rest-client"
],
"sub": "rest-client",
"iss": "https://lab-{your initials}.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/token",
"iat": 1481129628,
"cid": "rest-client",
"grant_type": "client_credentials",
"azp": "rest-client",
"zid": "221446d2-3b5e-402c-a6d5-6aaece22d43b",
"rev_sig": "300dbbd8",
"revocable": false
}
predix uaa login lab-{your initials}
predix uaa client update rest-client --authorities "uaa.none uaa.resource"
predix uaa login lab-{your initials}
predix uaa client create login_client -s {SECRET} --authorized_grant_types "authorization_code" --scope "uaa.none uaa.user" --authorities "uaa.none" --redirect_uri "https://www.getpostman.com/oauth2/callback"
predix uaa user create {Pick One} --emails "{Pick One}" --given_name "{Pick One}" -p "{Pick One}"
Invalid status response: 400. Password must be at least 8 characters in length. Password must contain at least 1 special characters. Password must contain at least 2 digit characters. Password must contain at least 2 uppercase characters.
predix uaa client update login_client --autoapprove "uaa.user"
mvn clean package
predix cf push
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
</dependency>
mvn clean package
predix cf push
security:
oauth2:
client:
clientId: login_client
clientSecret: secret
accessTokenUri: https://lab-demo.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/token
userAuthorizationUri: https://lab-demo.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/authorize
tokenName: oauth_token
resource:
userInfoUri: https://lab-demo.predix-uaa.run.aws-usw02-pr.ice.predix.io/userinfo
spring:
resources:
chain:
enabled: true
logging:
level:
org:
springframework:
security: DEBUG
predix uaa client update login_client --authorized_grant_types "authorization_code" --scope "uaa.none uaa.user" --authorities "uaa.none" --redirect_uri "https://www.getpostman.com/oauth2/callback, http://security-demo-noisy-numbat.run.aws-usw02-pr.ice.predix.io/login"
predix uaa client update login_client --authorized_grant_types "authorization_code" --scope "uaa.none uaa.user openid" --authorities "uaa.none" --redirect_uri "https://www.getpostman.com/oauth2/callback, https://security-demo-noisy-numbat.run.aws-usw02-pr.ice.predix.io"
predix cf push
pip install pipenv
pipenv install --three
pipenv shell
python app.py runserver
curl http://127.0.0.1:8080/api/v1/drones
"Hello World!"
predix cf push
https://simple-predix-service-python-xxx-yyy.run.aws-usw02-pr.ice.predix.io/api/v1/drones
{
message: "The server could not verify that you are authorized to access the URL requested.
You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required."
}
---
applications:
- name: simple-predix-service
random-route: true
memory: 512M
disk_quota: 512M
instances: 1
buildpack: java-buildpack
path: target/simple-predix-service-0.0.1-SNAPSHOT.jar
services:
- uaa-lab
env:
uaaClientId: rest-client
uaaClientSecret: rest-client
SPRING_PROFILES_ACTIVE: security
Pushing from manifest to org European_Foundry_Basic / space machine as Benoit.Laurent@ge.com...
Using manifest file /Users/benoitlaurent/Git/predix-starter/simple-predix-service/manifest.yml
Getting app info...
Creating app with these attributes...
+ name: simple-predix-service
path: /Users/benoitlaurent/Git/predix-starter/simple-predix-service/target/simple-predix-service-0.0.1-SNAPSHOT.jar
+ buildpack: java-buildpack
+ disk quota: 512M
+ instances: 1
+ memory: 512M
services:
+ uaa-lab
env:
+ SPRING_PROFILES_ACTIVE
+ uaaClientId
+ uaaClientSecret
routes:
+ simple-predix-service-quiet-parrot.run.aws-usw02-pr.ice.predix.io
Creating app simple-predix-service...
Mapping routes...
Binding services...
Comparing local files to remote cache...
Packaging files to upload...
Uploading files...
1.29 MiB / 1.29 MiB [========================================================================================================================================================================] 100.00% 2s
Waiting for API to complete processing files...
Staging app and tracing logs...
-----> Downloaded app package (51M)
-----> Java Buildpack Version: v3.13 | https://github.com/cloudfoundry/java-buildpack.git#03b493f
-----> Downloading Open Jdk JRE 1.8.0_121 from https://java-buildpack.cloudfoundry.org/openjdk/trusty/x86_64/openjdk-1.8.0_121.tar.gz (0.8s)
Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.0s)
-----> Downloading Open JDK Like Memory Calculator 2.0.2_RELEASE from https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/memory-calculator-2.0.2_RELEASE.tar.gz (0.0s)
Memory Settings: -Xms317161K -XX:MetaspaceSize=64M -XX:MaxMetaspaceSize=64M -Xss228K -Xmx317161K
-----> Downloading Container Certificate Trust Store 2.1.0_RELEASE from https://java-buildpack.cloudfoundry.org/container-certificate-trust-store/container-certificate-trust-store-2.1.0_RELEASE.jar (0.0s)
Adding certificates to .java-buildpack/container_certificate_trust_store/truststore.jks (0.3s)
-----> Downloading Spring Auto Reconfiguration 1.12.0_RELEASE from https://java-buildpack.cloudfoundry.org/auto-reconfiguration/auto-reconfiguration-1.12.0_RELEASE.jar (0.0s)
-----> Uploading droplet (97M)
Waiting for app to start...
name: simple-predix-service
requested state: started
instances: 1/1
usage: 512M x 1 instances
routes: simple-predix-service-quiet-parrot.run.aws-usw02-pr.ice.predix.io
last uploaded: Tue 23 Jan 12:40:19 CET 2018
stack: cflinuxfs2
buildpack: java-buildpack
start command: CALCULATED_MEMORY=$($PWD/.java-buildpack/open_jdk_jre/bin/java-buildpack-memory-calculator-2.0.2_RELEASE -memorySizes=metaspace:64m..,stack:228k..
-memoryWeights=heap:65,metaspace:10,native:15,stack:10 -memoryInitials=heap:100%,metaspace:100% -stackThreads=300 -totMemory=$MEMORY_LIMIT) && JAVA_OPTS="-Djava.io.tmpdir=$TMPDIR
-XX:OnOutOfMemoryError=$PWD/.java-buildpack/open_jdk_jre/bin/killjava.sh $CALCULATED_MEMORY
-Djavax.net.ssl.trustStore=$PWD/.java-buildpack/container_certificate_trust_store/truststore.jks -Djavax.net.ssl.trustStorePassword=java-buildpack-trust-store-password" &&
SERVER_PORT=$PORT eval exec $PWD/.java-buildpack/open_jdk_jre/bin/java $JAVA_OPTS -cp $PWD/. org.springframework.boot.loader.JarLauncher
state since cpu memory disk details
#0 running 2018-01-23T11:41:45Z 333.4% 429.9M of 512M 178.9M of 512M
{
"tags": [
{
"name": "Compressor-2015:CompressionRatio",
"order": "desc",
"aggregations": [
{
"type": "avg",
"sampling": {
"unit": "s",
"value": "30"
}
}
]
}
],
"start": 1452112200000,
"end": 1453458896222
}
{
"start": "1y-ago",
"tags": [
{
"name": "Compressor-2015:CompressionRatio",
"order": "desc",
"groups": [
{
"name": "quality"
}
]
}
]
}
{
"tags": [
{
"name": "Compressor-2015:CompressionRatio"
}
]
}
{
"cache_time": 0,
"tags": [
{
"name": "Compressor-2015:CompressionRatio",
"order": "desc",
"limit": 2
}
],
"start": 1452112200000,
"end": 1453458896222
}
predix delete-service uaa-foundry
Really delete the service uaa-foundry?> y
Deleting service uaa-foundry in org European_Foundry_Basic / space demos-dev as Benoit.Laurent@ge.com...
FAILED
Cannot delete service instance, service keys and bindings must first be deleted
{
"staging_env_json": {},
"running_env_json": {},
"environment_json": {},
"system_env_json": {
"VCAP_SERVICES": {
"predix-uaa": [
{
"credentials": {
"issuerId": "https://demos-dev.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/token",
"subdomain": "demos-dev",
"zone": {
"http-header-value": "f082b5bf-37b6-4720-9a9b-fe06efd274d0",
"http-header-name": "X-Identity-Zone-Id"
},
"uri": "https://demos-dev.predix-uaa.run.aws-usw02-pr.ice.predix.io"
},
"syslog_drain_url": null,
"volume_mounts": [],
"label": "predix-uaa",
"provider": null,
"plan": "Tiered",
"name": "uaa-foundry",
"tags": []
}
]
}
},
"application_env_json": {
"VCAP_APPLICATION": {
"limits": {
"fds": 16384,
"mem": 1024,
"disk": 1024
},
"application_name": "cfapp-UBmZpR",
"application_uris": [],
"name": "cfapp-UBmZpR",
"space_name": "demos-dev",
"space_id": "f902086a-c66d-44f6-a1d6-1e92c4f0fef8",
"uris": [],
"users": null,
"application_id": "c9596a69-b144-4950-b726-16afa8273133",
"version": "d2579a7d-d8c0-4750-bc9f-a62059b22cdd",
"application_version": "d2579a7d-d8c0-4750-bc9f-a62059b22cdd"
}
}
}
export cftempapp_dir=`mktemp -d /tmp/cfapp-XXXXXX`
cd $cftempapp_dir
export cftempapp_name=${PWD##*/}
touch Procfile
cf push $cftempapp_name -b http://github.com/ryandotsmith/null-buildpack.git --no-start --no-route -m 32m >/dev/null
cf bs $cftempapp_name uaa-lab >/dev/null
export cftempapp_guid=`cf app uaa-lab --guid`
cf curl /v2/apps/$cftempapp_guid/env
cf delete $cftempapp_name -f >/dev/null
cd
rm -f $cftempapp_dir/Procfile
rmdir $cftempapp_dir
As you can see there some inter dependencies between services, it's important to be able to
script service configuration as much as possible
predix create-service predix-timeseries Free timeseries-lab uaa-lab -c timeseries-ingestion-client -s timeseries-ingestion-client
{
"messageId":"{MessageID}",
"body":[
{
"name":"{TagName (Required)}",
"datapoints":[
[
"{EpochInMs (Required)}",
"{Measure (Required)}",
"{Quality (Optional)}"
]
],
"attributes (Optional)":{
"{AttributeKey}":"{AttributeValue}",
"{AttributeKey2}":"{AttributeValue2}"
}
}
]
}
{
"tags": [
{
"name": "Compressor-2015:CompressionRatio",
"results": [
{
"groups": [
{
"name": "type",
"type": "number"
}
],
"values": [
[
1453338377222,
10,
1
],
[
1453338377222,
10,
1
]
],
"attributes": {
"customer": [
"Acme"
],
"host": [
"server2"
],
"valid": [
"true"
]
}
}
],
"stats": {
"rawCount": 2
}
}
]
}
try {
tenantContext = TenantContextFactory.createTenantContextFromPropertiesFile("/predix-timeseries.properties");
} catch (URISyntaxException | PredixTimeSeriesException | IOException e) {
e.printStackTrace();
}
There is several ways to create this tenant from a properties files, arguments, ... Have a look to this class for more information:
com.ge.predix.timeseries.client.TenantContextFactory
IngestionRequestBuilder ingestionBuilder = IngestionRequestBuilder
.createIngestionRequest()
.withMessageId(timestamp)
.addDataPoints(
Arrays.asList(
new DataPoint(new Date().getTime(), sensorValueAsInt, Quality.GOOD),
new DataPoint(new Date().getTime(), sensorValueAsDouble, Quality.NOT_APPLICABLE),
new DataPoint(new Date().getTime(), "Bad Value", Quality.BAD),
new DataPoint(new Date().getTime(), null, Quality.UNCERTAIN)
)
)
.addAttribute("AttributeKey", "AttributeValue")
.addAttribute("AttributeKey2", "AttributeValue2")
.build());
String json = ingestionBuilder.build().get(0);
IngestionResponse response = ClientFactory.ingestionClientForTenant(ingestionTenant).ingest(json);
String responseStr = response.getMessageId() + response.getStatusCode();
predix cf p
Once deployed you can ingest some points using postman
{
"value":{{$randomInt}},
"deviceId":"osx90r43y2",
"ip": "192.168.1.1",
"type":"mac",
"msec": {{$timestamp}}
}
Do not forget the token...
QueryBuilder builder = QueryBuilder.createQuery()
.withStartAbs(1427463525000L)
.withEndAbs(1427483525000L)
.addTags(
QueryTag.Builder.createQueryTag()
.withTagNames(Arrays.asList("ALT_SENSOR", "TEMP_SENSOR"))
.withLimit(1000)
.addAggregation(Aggregation.Builder.averageWithInterval(1, TimeUnit.HOURS))
.addFilters(FilterBuilder.getInstance()
.addMeasurementFilter(FilterBuilder.Condition.GREATER_THAN_OR_EQUALS, Arrays.asList("23.1")).build())
.addFilters(FilterBuilder.getInstance()
.withQualitiesFilter(Arrays.asList(Quality.BAD, Quality.GOOD)).build())
.build());
QueryResponse response = ClientFactory.queryClientForTenant(tenant).queryAll(builder.build());
https://simple-predix-service-xxx-yyy.run.aws-usw02-pr.ice.predix.io/api/v1/sensor?tag=ZZZZ&startDate=OOOO&endDate={{$timestamp}}000
@GetMapping(path="/sensor", produces = "application/json")
String read(@RequestParam("tag") String tag, @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate) throws IOException, PredixTimeSeriesException {
QueryBuilder builder = null;
builder = QueryBuilder.createQuery()
.withStartAbs(Long.parseLong(startDate))
.withEndAbs(Long.parseLong(endDate))
.addTags(
QueryTag.Builder.createQueryTag()
.withTagNames(Arrays.asList(tag))
.build());
QueryResponse response = null;
response = ClientFactory.queryClientForTenant(ingester.getTenantContext()).queryAll(builder.build());
Gson gson = new Gson();
return gson.toJson(response);
}
services:
- uaa-xxx
- timeseries-xxx
env:
PREDIX_APP_CLIENT_ID: rest-client
PREDIX_APP_CLIENT_SECRET: rest-client
import predix.data.timeseries
ts = predix.data.timeseries.TimeSeries()
ts.send('tag name', value)
{
"value":{{$randomInt}},
"deviceId":"osx90r43y2",
"ip": "192.168.1.1",
"type":"mac",
"sec": {{$timestamp}},
"usec": 0
}
from flask import request
from flask_restful import Resource
import predix.data.timeseries
import logging
class DHandler(Resource):
def __init__(self):
self.ts = predix.data.timeseries.TimeSeries()
def get(self):
logging.debug(request.headers)
return 'Hello World!', 200
def post(self):
logging.debug(request.headers)
logging.debug(request.json)
data = request.json
self.ts.send(data['type']+'-'+data['deviceId'], data['value'])
return 200
https://simple-predix-service-xxx-yyy.run.aws-usw02-pr.ice.predix.io/api/v1/drones?tag=ZZZZ&startDate=1422022587000&endDate={{$timestamp}}000
def get(self):
retval = self.ts.get_datapoints(tags=request.args['tag'], start=int(request.args['startDate']), end=int(request.args['endDate']))
return retval, 200
{
"access_key_id": "AKIAJTOHTWLM3R5L5OEA",
"bucket_name": "bucket-2f260863-d236-4ed2-9952-c42523804578",
"host": "s3-us-west-2.amazonaws.com",
"secret_access_key": "x4RSwDCKVQpWYdFZQgyebIgqlL80FaeEjgFMRdZ0",
"url": "https://bucket-2f260863-d236-4ed2-9952-c42523804578.s3-us-west-2.amazonaws.com"
}
---
applications:
- name: simple-predix-service-python
random-route: true
timeout: 160
memory: 256M
disk_quota: 512M
buildpack: https://github.com/cloudfoundry/python-buildpack.git
services:
- uaa-lab
- blob-lab
env:
PREDIX_APP_CLIENT_ID: timeseries-ingestion-service
PREDIX_APP_CLIENT_SECRET: timeseries-ingestion-service
class DateTimeEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, datetime):
return o.isoformat()
class DHandler(Resource):
def __init__(self):
self.bs = predix.data.blobstore.BlobStore()
def _allowed_file(self, filename):
return '.' in filename and \
filename.rsplit('.', 1)[1] in ALLOWED_EXTENSIONS
def get(self):
logging.debug(request.headers)
return json.loads(json.dumps(self.bs.list_objects()['Contents'], cls=DateTimeEncoder)), 200
def post(self):
logging.debug(request.headers)
logging.debug(request.json)
for file in dict(request.files)['files[]']:
if self._allowed_file(file.filename):
filename = secure_filename(file.filename)
path = os.path.join(current_app.config['UPLOAD_FOLDER'], filename)
file.save(path)
return self.bs.upload_file(path, file.filename), 200
else:
return file.filename + ' not ingested. File type not allowed.'
[
{ "uri": "/manufacturers/GE",
"name": "General Electric Transportation",
"year_founded": "1892" ,
"hqLatLng":{"lat": 41.881138, "lng": -87.640666 }
},
{"uri": "/manufacturers/electro-motive-diesel",
"name": "Electro-Motive Diesel",
"year_founded": "1922",
"hqLatLng": {"lat": 41.798091, "lng": -87.849247}
},
{"uri": "/manufacturers/national-railway-equipment",
"name": "National Railway Equipment",
"year_founded": "1984",
"hqLatLng": {"lat": 41.515181 , "lng":-90.411707 }
},
{"uri": "/manufacturers/cummins",
"name": "Cummins",
"year_founded": "1919",
"hqLatLng": {"lat":39.204000, "lng": -85.922910}
}
]
[
{
"uri": "/engines/v12-1",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-2",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-3",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-4",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-5",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-6",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-7",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-8",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-9",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-10",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-11",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-12",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-13",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-14",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-15",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-16",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-17",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-18",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v12-19",
"type": "7FDL",
"horsepower": "4400",
"stroke": "230",
"bore": "220",
"RPM": "2400",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-1",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-2",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-3",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-4",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-5",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-6",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-7",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-8",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-9",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-10",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-11",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-12",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-13",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-14",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-15",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-16",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-17",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-18",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-19",
"type": "7FD",
"horsepower": "4400",
"stroke": "210",
"bore": "220",
"RPM": "900",
"manufacturer": "/manufacturers/GE"
},
{
"uri": "/engines/v16-2-1",
"type": "710",
"horsepower": "4300",
"stroke": "250",
"bore": "200",
"RPM": "215",
"manufacturer": "/manufacturers/electro-motive-diesel"
},
{
"uri": "/engines/v16-2-2",
"type": "710",
"horsepower": "4300",
"stroke": "250",
"bore": "200",
"RPM": "215",
"manufacturer": "/manufacturers/electro-motive-diesel"
},
{
"uri": "/engines/v16-2-3",
"type": "710",
"horsepower": "4300",
"stroke": "250",
"bore": "200",
"RPM": "215",
"manufacturer": "/manufacturers/electro-motive-diesel"
},
{
"uri": "/engines/v16-2-4",
"type": "710",
"horsepower": "4300",
"stroke": "250",
"bore": "200",
"RPM": "215",
"manufacturer": "/manufacturers/electro-motive-diesel"
},
{
"uri": "/engines/v16-2-5",
"type": "710",
"horsepower": "4300",
"stroke": "250",
"bore": "200",
"RPM": "215",
"manufacturer": "/manufacturers/electro-motive-diesel"
},
{
"uri": "/engines/v16-2-6",
"type": "710",
"horsepower": "4300",
"stroke": "250",
"bore": "200",
"RPM": "215",
"manufacturer": "/manufacturers/electro-motive-diesel"
},
{
"uri": "/engines/v16-2-7",
"type": "710",
"horsepower": "4300",
"stroke": "250",
"bore": "200",
"RPM": "215",
"manufacturer": "/manufacturers/electro-motive-diesel"
},
{
"uri": "/engines/v16-2-8",
"type": "710",
"horsepower": "4300",
"stroke": "250",
"bore": "200",
"RPM": "215",
"manufacturer": "/manufacturers/electro-motive-diesel"
},
{
"uri": "/engines/v16-2-9",
"type": "710",
"horsepower": "4300",
"stroke": "250",
"bore": "200",
"RPM": "215",
"manufacturer": "/manufacturers/electro-motive-diesel"
},
{
"uri": "/engines/v16-2-10",
"type": "710",
"horsepower": "4300",
"stroke": "250",
"bore": "200",
"RPM": "215",
"manufacturer": "/manufacturers/electro-motive-diesel"
},
{
"uri": "/engines/v16-2-11",
"type": "710",
"horsepower": "4300",
"stroke": "250",
"bore": "200",
"RPM": "215",
"manufacturer": "/manufacturers/electro-motive-diesel"
},
{
"uri": "/engines/v16-2-12",
"type": "710",
"horsepower": "4300",
"stroke": "250",
"bore": "200",
"RPM": "215",
"manufacturer": "/manufacturers/electro-motive-diesel"
},
{
"uri": "/engines/v16-2-13",
"type": "710",
"horsepower": "4300",
"stroke": "250",
"bore": "200",
"RPM": "215",
"manufacturer": "/manufacturers/electro-motive-diesel"
},
{
"uri": "/engines/645",
"type": "7FDL",
"horsepower": "1500",
"stroke": "190",
"bore": "230",
"RPM": "900",
"manufacturer": "/manufacturers/electro-motive-diesel"
},
{
"uri": "/engines/QSK19-1",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-2",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-3",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-4",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-5",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-6",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-7",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-8",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-9",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-10",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-11",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-12",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-13",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-14",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-15",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-16",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-17",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},{
"uri": "/engines/QSK19-18",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},{
"uri": "/engines/QSK19-19",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-20",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-21",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-22",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-23",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-24",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-25",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-26",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-27",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/QSK19-28",
"type": "Diesel",
"horsepower": "2100",
"stroke": "159",
"bore": "159",
"RPM": "800",
"manufacturer": "/manufacturers/cummins"
},
{
"uri": "/engines/v20-1",
"type": "7FDL",
"horsepower": "5000",
"stroke": "230",
"bore": "230",
"RPM": "650",
"manufacturer": "/manufacturers/national-railway-equipment"
},
{
"uri": "/engines/v20-2",
"type": "7FDL",
"horsepower": "5000",
"stroke": "230",
"bore": "230",
"RPM": "650",
"manufacturer": "/manufacturers/national-railway-equipment"
},
{
"uri": "/engines/v20-3",
"type": "7FDL",
"horsepower": "5000",
"stroke": "230",
"bore": "230",
"RPM": "650",
"manufacturer": "/manufacturers/national-railway-equipment"
},
{
"uri": "/engines/v20-4",
"type": "7FDL",
"horsepower": "5000",
"stroke": "230",
"bore": "230",
"RPM": "650",
"manufacturer": "/manufacturers/national-railway-equipment"
},
{
"uri": "/engines/v20-5",
"type": "7FDL",
"horsepower": "5000",
"stroke": "230",
"bore": "230",
"RPM": "650",
"manufacturer": "/manufacturers/national-railway-equipment"
},
{
"uri": "/engines/v20-6",
"type": "7FDL",
"horsepower": "5000",
"stroke": "230",
"bore": "230",
"RPM": "650",
"manufacturer": "/manufacturers/national-railway-equipment"
},
{
"uri": "/engines/v20-7",
"type": "7FDL",
"horsepower": "5000",
"stroke": "230",
"bore": "230",
"RPM": "650",
"manufacturer": "/manufacturers/national-railway-equipment"
}
]
[
{
"uri": "/fleets/up-1",
"name": "Union Pacific Fleet 1",
"customer": "/customers/union-pacific"
},
{
"uri": "/fleets/up-2",
"name": "Union Pacific Fleet 2",
"customer": "/customers/union-pacific"
},
{
"uri": "/fleets/up-3",
"name": "Union Pacific Fleet 3",
"customer": "/customers/union-pacific"
},
{
"uri": "/fleets/up-4",
"name": "Union Pacific Fleet 4",
"customer": "/customers/union-pacific"
}
, {
"uri": "/fleets/up-5",
"name": "Union Pacific Fleet 5",
"customer": "/customers/union-pacific"
},
{
"uri": "/fleets/bnsf-1",
"name": "Burlington Northern Fleet 1",
"customer": "/customers/burlington-northern-santa-fe"
},
{
"uri": "/fleets/bnsf-2",
"name": "Burlington Northern Fleet 2",
"customer": "/customers/burlington-northern-santa-fe"
},
{
"uri": "/fleets/bnsf-3",
"name": "Burlington Northern Fleet 3",
"customer": "/customers/burlington-northern-santa-fe"
},
{
"uri": "/fleets/bnsf-4",
"name": "Burlington Northern Fleet 4",
"customer": "/customers/burlington-northern-santa-fe"
},
{
"uri": "/fleets/bnsf-5",
"name": "Burlington Northern Fleet 5",
"customer": "/customers/burlington-northern-santa-fe"
},
{
"uri": "/fleets/csx-1",
"name": "CSX Fleet 1",
"customer": "/customers/csx"
},
{
"uri": "/fleets/csx-2",
"name": "CSX Fleet 2",
"customer": "/customers/csx"
},
{
"uri": "/fleets/csx-3",
"name": "CSX Fleet 3",
"customer": "/customers/csx"
},
{
"uri": "/fleets/ns-1",
"name": "Norfolk Southern Fleet 1",
"customer": "/customers/norfolk-southern"
},
{
"uri": "/fleets/ns-2",
"name": "Norfolk Southern Fleet 2",
"customer": "/customers/norfolk-southern"
},
{
"uri": "/fleets/cn-1",
"name": "Canadian National Fleet 1",
"customer": "/customers/canadian-national"
},
{
"uri": "/fleets/cn-2",
"name": "Canadian National Fleet 2",
"customer": "/customers/canadian-national"
},
{
"uri": "/fleets/cn-3",
"name": "Canadian National Fleet 3",
"customer": "/customers/canadian-national"
},
{
"uri": "/fleets/cn-4",
"name": "Canadian National Fleet 4",
"customer": "/customers/canadian-national"
},
{
"uri": "/fleets/cn-5",
"name": "Canadian National Fleet 5",
"customer": "/customers/canadian-national"
},
{
"uri": "/fleets/cn-6",
"name": "Canadian National Fleet 6",
"customer": "/customers/canadian-national"
},
{
"uri": "/fleets/cn-7",
"name": "Canadian National Fleet 7",
"customer": "/customers/canadian-national"
},
{
"uri": "/fleets/cn-8",
"name": "Canadian National Fleet 8",
"customer": "/customers/canadian-national"
}
]
[
{
"uri": "/locomotives/1",
"type": "Diesel-electric",
"model": "ES44AC",
"serial_no": "001",
"emission_tier": "0+",
"fleet": "/fleets/up-1",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-1",
"installedOn": "01/12/2005",
"dateIso": "2005-12-01T13:15:31Z",
"hqLatLng": {
"lat": 33.914605,
"lng": -117.253374
}
},
{
"uri": "/locomotives/2",
"type": "Diesel-electric",
"model": "SD70ACe",
"serial_no": "002",
"emission_tier": "0+",
"fleet": "/fleets/up-1",
"manufacturer": "/manufacturers/electro-motive-diesel",
"engine": "/engines/v16-2-1",
"hqLatLng": {
"lat": 47.655492,
"lng": -117.427025
}
},
{
"uri": "/locomotives/3",
"type": "Diesel-electric",
"model": "ES44AC",
"serial_no": "003",
"emission_tier": "0+",
"fleet": "/fleets/up-1",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-2",
"installedOn" : "02/12/2005",
"dateIso": "2005-12-02T13:15:31Z",
"hqLatLng": {
"lat": 46.860395,
"lng": -109.473494
}
},
{
"uri": "/locomotives/4",
"type": "Diesel-electric",
"model": "AD40SPe",
"serial_no": "004",
"emission_tier": "0+",
"fleet": "/fleets/up-2",
"manufacturer": "/manufacturers/electro-motive-diesel",
"engine": "/engines/v16-2-2",
"hqLatLng": {
"lat": 45.784314,
"lng": -108.500856
}
},
{
"uri": "/locomotives/5",
"type": "Diesel-electric",
"model": "ES44AC",
"serial_no": "005",
"emission_tier": "0+",
"fleet": "/fleets/up-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-3",
"installedOn": "10/12/2005",
"dateIso": "2005-12-10T13:15:31Z",
"hqLatLng": {
"lat": 35.022757,
"lng": -83.009365
}
},
{
"uri": "/locomotives/6",
"type": "Diesel-electric",
"model": "SD70ACe",
"serial_no": "006",
"emission_tier": "0+",
"fleet": "/fleets/up-2",
"manufacturer": "/manufacturers/electro-motive-diesel",
"engine": "/engines/v16-2-3",
"installedOn": "11/12/2005",
"dateIso": "2005-12-11T13:15:31Z",
"hqLatLng": {
"lat": 33.120118,
"lng": -81.563755
}
},
{
"uri": "/locomotives/7",
"type": "Diesel-electric",
"model": "ES44AC",
"serial_no": "007",
"emission_tier": "0+",
"fleet": "/fleets/up-3",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-4",
"installedOn": "12/12/2005",
"dateIso": "2005-12-12T13:15:31Z",
"hqLatLng": {
"lat": 36.739438,
"lng": -79.66268
}
},
{
"uri": "/locomotives/8",
"type": "Diesel-electric",
"model": "GL23TCe",
"serial_no": "008",
"emission_tier": "0+",
"fleet": "/fleets/up-3",
"manufacturer": "/manufacturers/electro-motive-diesel",
"engine": "/engines/v16-2-4",
"hqLatLng": {
"lat": 41.876813,
"lng": -113.717141
}
},
{
"uri": "/locomotives/9",
"type": "Diesel-electric",
"model": "ES44AC",
"serial_no": "009",
"emission_tier": "0+",
"fleet": "/fleets/up-3",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-5",
"hqLatLng": {
"lat": 36.669408,
"lng": -115.617391
}
},
{
"uri": "/locomotives/10",
"type": "Diesel-electric",
"model": "SD70ACe",
"serial_no": "0010",
"emission_tier": "0+",
"fleet": "/fleets/up-4",
"manufacturer": "/manufacturers/electro-motive-diesel",
"engine": "/engines/v16-2-5",
"hqLatLng": {
"lat": 47.941049,
"lng": -100.126484
}
},
{
"uri": "/locomotives/11",
"type": "Diesel-electric",
"model": "ES44AC",
"serial_no": "0011",
"emission_tier": "0+",
"fleet": "/fleets/up-4",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-6",
"hqLatLng": {
"lat": 32.7086,
"lng": -108.190375
}
},
{
"uri": "/locomotives/12",
"type": "Diesel-electric",
"model": "SD70ACe",
"serial_no": "0012",
"emission_tier": "0+",
"fleet": "/fleets/up-4",
"manufacturer": "/manufacturers/electro-motive-diesel",
"engine": "/engines/v16-2-6",
"hqLatLng": {
"lat": 34.099394,
"lng": -90.261741
}
},
{
"uri": "/locomotives/13",
"type": "Diesel-electric",
"model": "GL23TCe",
"serial_no": "0013",
"emission_tier": "0+",
"fleet": "/fleets/up-5",
"manufacturer": "/manufacturers/electro-motive-diesel",
"engine": "/engines/v16-2-7",
"hqLatLng": {
"lat": 36.050366,
"lng": -91.340363
}
},
{
"uri": "/locomotives/14",
"type": "Diesel-electric",
"model": "ES44AC",
"serial_no": "0014",
"emission_tier": "0+",
"fleet": "/fleets/up-5",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-7",
"hqLatLng": {
"lat": 35.931077,
"lng": -79.643374
}
},
{
"uri": "/locomotives/15",
"type": "Diesel-electric",
"model": "SD70ACe",
"serial_no": "0015",
"emission_tier": "0+",
"fleet": "/fleets/up-5",
"manufacturer": "/manufacturers/electro-motive-diesel",
"engine": "/engines/v16-2-8",
"hqLatLng": {
"lat": 45.314087,
"lng": -90.969283
}
},
{
"uri": "/locomotives/16",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0016",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-1",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-1",
"hqLatLng": {
"lat": 47.781463,
"lng": -116.940009
}
},
{
"uri": "/locomotives/17",
"type": "",
"model": "B40-8",
"serial_no": "0017",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-1",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-8",
"hqLatLng": {
"lat": 32.863603,
"lng": -97.327141
}
},
{
"uri": "/locomotives/18",
"type": "Diesel-electric",
"model": "MP15AC",
"serial_no": "0018",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-1",
"manufacturer": "/manufacturers/electro-motive-diesel",
"engine": "/engines/645",
"hqLatLng": {
"lat": 42.090136,
"lng": -102.875767
}
},
{
"uri": "/locomotives/19",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0019",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-2",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-1",
"hqLatLng": {
"lat": 32.147267,
"lng": -83.87744
}
},
{
"uri": "/locomotives/20",
"type": "Diesel-electric",
"model": "ES44DC",
"serial_no": "0020",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-9",
"hqLatLng": {
"lat": 38.191536,
"lng": -85.472672
}
},
{
"uri": "/locomotives/21",
"type": "Diesel-electric",
"model": "SD80MAC",
"serial_no": "0021",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-2",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/v20-1",
"hqLatLng": {
"lat": 43.49188,
"lng": -122.944105
}
},
{
"uri": "/locomotives/22",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0022",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-2",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-2",
"hqLatLng": {
"lat": 45.96556,
"lng": -116.989515
}
},
{
"uri": "/locomotives/23",
"type": "Diesel-electric",
"model": "ES44DC",
"serial_no": "0023",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-10",
"hqLatLng": {
"lat": 41.788715,
"lng": -114.601854
}
},
{
"uri": "/locomotives/24",
"type": "Diesel-electric",
"model": "SD80MAC",
"serial_no": "0024",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-2",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/v20-2",
"hqLatLng": {
"lat": 38.097843,
"lng": -118.161825
}
},
{
"uri": "/locomotives/25",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0025",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-2",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-3",
"hqLatLng": {
"lat": 38.12204,
"lng": -106.260561
}
},
{
"uri": "/locomotives/26",
"type": "Diesel-electric",
"model": "ES44DC",
"serial_no": "0026",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-11",
"hqLatLng": {
"lat": 36.628722,
"lng": -103.908348
}
},
{
"uri": "/locomotives/27",
"type": "Diesel-electric",
"model": "SD80MAC",
"serial_no": "0027",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-3",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/v20-3",
"hqLatLng": {
"lat": 33.544224,
"lng": -104.506977
}
},
{
"uri": "/locomotives/28",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0028",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-3",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-4",
"hqLatLng": {
"lat": 36.87125,
"lng": -102.557858
}
},
{
"uri": "/locomotives/29",
"type": "Diesel-electric",
"model": "ES44DC",
"serial_no": "0029",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-3",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-12",
"hqLatLng": {
"lat": 34.708707,
"lng": -97.179306
}
},
{
"uri": "/locomotives/30",
"type": "Diesel-electric",
"model": "SD80MAC",
"serial_no": "0030",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-3",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/v20-4",
"hqLatLng": {
"lat": 41.103915,
"lng": -78.286601
}
},
{
"uri": "/locomotives/31",
"type": "Diesel-electric",
"model": "SD80MAC",
"serial_no": "0031",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-4",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/v20-5",
"hqLatLng": {
"lat": 31.351436,
"lng": -105.258803
}
},
{
"uri": "/locomotives/32",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0032",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-4",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-5",
"hqLatLng": {
"lat": 30.062855,
"lng": -102.111381
}
},
{
"uri": "/locomotives/33",
"type": "Diesel-electric",
"model": "ES44DC",
"serial_no": "0033",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-4",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-13",
"hqLatLng": {
"lat": 26.634179,
"lng": -98.514328
}
},
{
"uri": "/locomotives/34",
"type": "Diesel-electric",
"model": "SD80MAC",
"serial_no": "0034",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-4",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/v20-6",
"hqLatLng": {
"lat": 29.93051,
"lng": -95.969945
}
},
{
"uri": "/locomotives/35",
"type": "Diesel-electric",
"model": "ES44DC",
"serial_no": "0035",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-5",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-14",
"hqLatLng": {
"lat": 44.940593,
"lng": -110.825888
}
},
{
"uri": "/locomotives/36",
"type": "Diesel-electric",
"model": "SD80MAC",
"serial_no": "0036",
"emission_tier": "0+",
"fleet": "/fleets/bnsf-5",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/v20-7",
"hqLatLng": {
"lat": 41.307371,
"lng": -104.574386
}
},
{
"uri": "/locomotives/37",
"type": "Diesel-electric",
"model": "ES44AC",
"serial_no": "0037",
"emission_tier": "0+",
"fleet": "/fleets/csx-1",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-15",
"hqLatLng": {
"lat": 43.488604,
"lng": -116.913932
}
},
{
"uri": "/locomotives/38",
"type": "Diesel-electric",
"model": "GL23TCe",
"serial_no": "0038",
"emission_tier": "0+",
"fleet": "/fleets/csx-1",
"manufacturer": "/manufacturers/electro-motive-diesel",
"engine": "/engines/v16-2-9",
"hqLatLng": {
"lat": 40.26462,
"lng": -74.496063
}
},
{
"uri": "/locomotives/39",
"type": "Diesel-electric",
"model": "ES44AC",
"serial_no": "0039",
"emission_tier": "0+",
"fleet": "/fleets/csx-1",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-16",
"hqLatLng": {
"lat": 43.650927,
"lng": -74.570743
}
},
{
"uri": "/locomotives/40",
"type": "Diesel-electric",
"model": "SD70ACe",
"serial_no": "0040",
"emission_tier": "0+",
"fleet": "/fleets/csx-2",
"manufacturer": "/manufacturers/electro-motive-diesel",
"engine": "/engines/v16-2-10",
"hqLatLng": {
"lat": 41.394707,
"lng": -83.905661
}
},
{
"uri": "/locomotives/41",
"type": "Diesel-electric",
"model": "ES44AC",
"serial_no": "0041",
"emission_tier": "0+",
"fleet": "/fleets/csx-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-17",
"hqLatLng": {
"lat": 45.40759,
"lng": -103.471649
}
},
{
"uri": "/locomotives/42",
"type": "Diesel-electric",
"model": "SD70ACe",
"serial_no": "0042",
"emission_tier": "0+",
"fleet": "/fleets/csx-2",
"manufacturer": "/manufacturers/electro-motive-diesel",
"engine": "/engines/v16-2-11",
"hqLatLng": {
"lat": 42.284877,
"lng": -99.513644
}
},
{
"uri": "/locomotives/43",
"type": "Diesel-electric",
"model": "ES44AC",
"serial_no": "0043",
"emission_tier": "0+",
"fleet": "/fleets/csx-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-18",
"hqLatLng": {
"lat": 39.173252,
"lng": -90.552123
}
},
{
"uri": "/locomotives/44",
"type": "Diesel-electric",
"model": "SD70ACe",
"serial_no": "0044",
"emission_tier": "0+",
"fleet": "/fleets/csx-2",
"manufacturer": "/manufacturers/electro-motive-diesel",
"engine": "/engines/v16-2-12",
"hqLatLng": {
"lat": 40.775543,
"lng": -123.336355
}
},
{
"uri": "/locomotives/45",
"type": "Diesel-electric",
"model": "ES44AC",
"serial_no": "0045",
"emission_tier": "0+",
"fleet": "/fleets/csx-3",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v12-19",
"hqLatLng": {
"lat": 41.394707,
"lng": -119.079633
}
},
{
"uri": "/locomotives/46",
"type": "Diesel-electric",
"model": "GL23TCe",
"serial_no": "0046",
"emission_tier": "0+",
"fleet": "/fleets/csx-3",
"manufacturer": "/manufacturers/electro-motive-diesel",
"engine": "/engines/v16-2-13",
"hqLatLng": {
"lat": 39.921845,
"lng": -111.985095
}
},
{
"uri": "/locomotives/47",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0047",
"emission_tier": "0+",
"fleet": "/fleets/ns-1",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-2",
"hqLatLng": {
"lat": 41.674215,
"lng": -110.118111
}
},
{
"uri": "/locomotives/48",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0048",
"emission_tier": "0+",
"fleet": "/fleets/ns-1",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-3",
"hqLatLng": {
"lat": 43.829065,
"lng": -108.038521
}
},
{
"uri": "/locomotives/49",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0049",
"emission_tier": "0+",
"fleet": "/fleets/ns-1",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-4",
"hqLatLng": {
"lat": 48.730575,
"lng": -121.358846
}
},
{
"uri": "/locomotives/50",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0050",
"emission_tier": "0+",
"fleet": "/fleets/ns-1",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-5",
"hqLatLng": {
"lat": 47.988616,
"lng": -117.610012
}
},
{
"uri": "/locomotives/51",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0051",
"emission_tier": "0+",
"fleet": "/fleets/ns-1",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-6",
"hqLatLng": {
"lat": 46.141609,
"lng": -120.321935
}
},
{
"uri": "/locomotives/52",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0052",
"emission_tier": "0+",
"fleet": "/fleets/ns-1",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-7",
"hqLatLng": {
"lat": 44.629206,
"lng": -120.960034
}
},
{
"uri": "/locomotives/53",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0053",
"emission_tier": "0+",
"fleet": "/fleets/ns-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-8",
"hqLatLng": {
"lat": 48.572493,
"lng": -114.57904
}
},
{
"uri": "/locomotives/54",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0054",
"emission_tier": "0+",
"fleet": "/fleets/ns-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-9",
"hqLatLng": {
"lat": 48.677936,
"lng": -109.873057
}
},
{
"uri": "/locomotives/55",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0055",
"emission_tier": "0+",
"fleet": "/fleets/ns-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-10",
"hqLatLng": {
"lat": 48.572493,
"lng": -104.927787
}
},
{
"uri": "/locomotives/56",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0056",
"emission_tier": "0+",
"fleet": "/fleets/ns-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-11",
"hqLatLng": {
"lat": 46.746176,
"lng": -104.608737
}
},
{
"uri": "/locomotives/57",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0057",
"emission_tier": "0+",
"fleet": "/fleets/ns-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-12",
"hqLatLng": {
"lat": 41.721683,
"lng": -109.952819
}
},
{
"uri": "/locomotives/58",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0058",
"emission_tier": "0+",
"fleet": "/fleets/ns-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-13",
"hqLatLng": {
"lat": 43.771496,
"lng": -107.240897
}
},
{
"uri": "/locomotives/59",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0059",
"emission_tier": "0+",
"fleet": "/fleets/ns-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-14",
"hqLatLng": {
"lat": 43.424917,
"lng": -93.681285
}
},
{
"uri": "/locomotives/60",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0060",
"emission_tier": "0+",
"fleet": "/fleets/ns-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-15",
"hqLatLng": {
"lat": 42.018661,
"lng": -95.994395
}
},
{
"uri": "/locomotives/61",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0061",
"emission_tier": "0+",
"fleet": "/fleets/ns-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-16",
"hqLatLng": {
"lat": 33.191119,
"lng": -100.700378
}
},
{
"uri": "/locomotives/62",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0062",
"emission_tier": "0+",
"fleet": "/fleets/ns-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-17",
"hqLatLng": {
"lat": 39.481317,
"lng": -80.440722
}
},
{
"uri": "/locomotives/63",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0063",
"emission_tier": "0+",
"fleet": "/fleets/ns-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-18",
"hqLatLng": {
"lat": 42.211153,
"lng": -71.617224
}
},
{
"uri": "/locomotives/64",
"type": "Diesel-electric",
"model": "C40-8W ",
"serial_no": "0064",
"emission_tier": "0+",
"fleet": "/fleets/ns-2",
"manufacturer": "/manufacturers/GE",
"engine": "/engines/v16-19",
"hqLatLng": {
"lat": 44.171027,
"lng": -69.992906
}
},
{
"uri": "/locomotives/65",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0065",
"emission_tier": "0+",
"fleet": "/fleets/cn-1",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-6",
"hqLatLng": {
"lat": 50.750961,
"lng": -111.035917
}
},
{
"uri": "/locomotives/66",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0066",
"emission_tier": "0+",
"fleet": "/fleets/cn-1",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-7",
"hqLatLng": {
"lat": 54.165178,
"lng": -125.631473
}
},
{
"uri": "/locomotives/67",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0067",
"emission_tier": "0+",
"fleet": "/fleets/cn-1",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-8",
"hqLatLng": {
"lat": 54.517653,
"lng": -111.462679
}
},
{
"uri": "/locomotives/68",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0068",
"emission_tier": "0+",
"fleet": "/fleets/cn-1",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-9",
"hqLatLng": {
"lat": 57.466212,
"lng": -113.51957
}
},
{
"uri": "/locomotives/69",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0069",
"emission_tier": "0+",
"fleet": "/fleets/cn-2",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-10",
"hqLatLng": {
"lat": 58.648156,
"lng": -105.758545
}
},
{
"uri": "/locomotives/70",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0070",
"emission_tier": "0+",
"fleet": "/fleets/cn-2",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-11",
"hqLatLng": {
"lat": 52.479733,
"lng": -107.757597
}
},
{
"uri": "/locomotives/71",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0071",
"emission_tier": "0+",
"fleet": "/fleets/cn-2",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-12",
"hqLatLng": {
"lat": 50.259228,
"lng": -103.14772
}
},
{
"uri": "/locomotives/72",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0072",
"emission_tier": "0+",
"fleet": "/fleets/cn-2",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-13",
"hqLatLng": {
"lat": 49.939207,
"lng": -108.136696
}
},
{
"uri": "/locomotives/73",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0073",
"emission_tier": "0+",
"fleet": "/fleets/cn-2",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-14",
"hqLatLng": {
"lat": 55.252082,
"lng": -99.996572
}
},
{
"uri": "/locomotives/74",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0074",
"emission_tier": "0+",
"fleet": "/fleets/cn-2",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-15",
"hqLatLng": {
"lat": 52.213168,
"lng": -95.47359
}
},
{
"uri": "/locomotives/75",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0075",
"emission_tier": "0+",
"fleet": "/fleets/cn-3",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-16",
"hqLatLng": {
"lat": 44.264612,
"lng": -78.588661
}
},
{
"uri": "/locomotives/76",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0076",
"emission_tier": "0+",
"fleet": "/fleets/cn-3",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-17",
"hqLatLng": {
"lat": 44.088886,
"lng": -65.04682
}
},
{
"uri": "/locomotives/77",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0077",
"emission_tier": "0+",
"fleet": "/fleets/cn-3",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-18",
"hqLatLng": {
"lat": 46.513021,
"lng": -67.070163
}
},
{
"uri": "/locomotives/78",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0078",
"emission_tier": "0+",
"fleet": "/fleets/cn-3",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-19",
"hqLatLng": {
"lat": 48.387737,
"lng": -72.315866
}
},
{
"uri": "/locomotives/79",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0079",
"emission_tier": "0+",
"fleet": "/fleets/cn-3",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-20",
"hqLatLng": {
"lat": 43.12077,
"lng": -81.576942
}
},
{
"uri": "/locomotives/80",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0080",
"emission_tier": "0+",
"fleet": "/fleets/cn-4",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-21",
"hqLatLng": {
"lat": 49.281775,
"lng": -117.735624
}
},
{
"uri": "/locomotives/81",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0081",
"emission_tier": "0+",
"fleet": "/fleets/cn-4",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-22",
"hqLatLng": {
"lat": 49.267239,
"lng": -119.584813
}
},
{
"uri": "/locomotives/82",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0082",
"emission_tier": "0+",
"fleet": "/fleets/cn-4",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-23",
"hqLatLng": {
"lat": 49.209053,
"lng": -120.320033
}
},
{
"uri": "/locomotives/83",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0083",
"emission_tier": "0+",
"fleet": "/fleets/cn-4",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-25",
"hqLatLng": {
"lat": 49.179934,
"lng": -120.854738
}
},
{
"uri": "/locomotives/84",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0084",
"emission_tier": "0+",
"fleet": "/fleets/cn-4",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-26",
"hqLatLng": {
"lat": 49.296307,
"lng": -118.827314
}
},
{
"uri": "/locomotives/85",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0085",
"emission_tier": "0+",
"fleet": "/fleets/cn-4",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-27",
"hqLatLng": {
"lat": 49.640363,
"lng": -126.242998
}
},
{
"uri": "/locomotives/86",
"type": "Diesel-electric",
"model": "3GS21B",
"serial_no": "0086",
"emission_tier": "0+",
"fleet": "/fleets/cn-4",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-28",
"hqLatLng": {
"lat": 46.244201,
"lng": -73.666786
}
},
{
"uri": "/locomotives/87",
"type": "Diesel-electric",
"model": "3GS21B-87",
"serial_no": "0087",
"emission_tier": "0+",
"fleet": "/fleets/cn-4",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-26",
"hqLatLng": {
"lat": 49.296307,
"lng": -118.827314
},
"parent": "/locomotives/86",
"installedOn": "05/12/2014",
"dateIso": "2014-12-05T13:15:31Z"
},
{
"uri": "/locomotives/88",
"type": "Diesel-electric",
"model": "3GS21B-88",
"serial_no": "0085",
"emission_tier": "0+",
"fleet": "/fleets/cn-4",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-27",
"hqLatLng": {
"lat": 49.640363,
"lng": -126.242998
},
"parent": "/locomotives/87",
"dateIso": "2015-11-05T13:15:30Z"
},
{
"uri": "/locomotives/89",
"type": "Diesel-electric",
"model": "3GS21B-89",
"serial_no": "0086",
"emission_tier": "0+",
"fleet": "/fleets/cn-4",
"manufacturer": "/manufacturers/national-railway-equipment",
"engine": "/engines/QSK19-28",
"hqLatLng": {
"lat": 46.244201,
"lng": -73.666786
},
"parent": "/locomotives/88",
"installedOn": "05/12/2015",
"dateIso": "2015-12-05T13:15:31Z"
}
]
predix create-service predix-asset Free asset-lab uaa-lab -c asset-client -s asset-client
Checking if client asset-client exists on service instance uaa-lab
Client asset-client exists. The required authorities will be added to it.
Creating service instance asset-lab in org European_Foundry_Basic / space machine as Benoit.Laurent@ge.com
data: {"name":"asset-lab","space_guid":"40381acd-016a-4141-b5ee-ddf7bb6370d9","service_plan_guid":"f13446a3-c6a8-47cd-8bb3-f8c829c958ef","parameters":{"trustedIssuerIds":["https://uaa-bl.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/token"]}}
OK
Updating client asset-client on Predix UAA instance uaa-lab
OK
Getting info for service instance asset-lab
x§§§
{
"instanceId": "8fd77b47-8efe-474d-9533-b5d0273b50bc",
"scriptEngine_uri": "https://8fd77b47-8efe-474d-9533-b5d0273b50bc.predix-script-engine.run.aws-usw02-pr.ice.predix.io",
"uri": "https://predix-asset.run.aws-usw02-pr.ice.predix.io",
"zone": {
"http-header-name": "Predix-Zone-Id",
"http-header-value": "8fd77b47-8efe-474d-9533-b5d0273b50bc",
"oauth-scope": "predix-asset.zones.8fd77b47-8efe-474d-9533-b5d0273b50bc.user"
}
}
Note: Depending on the service broker implementation this info may change
Use the 'service-info' command to lookup the binding info for an app and service instance
export VCAP_SERVICES=$(cat vcap_services.txt| jq --argjson asset_cred $(p si asset-lab | tail -n 12 | head -n 10 | jq -rc '.') -c '."predix-asset"[0].credentials=$asset_cred' | jq --argjson uaa_cred $(p si uaa-lab | tail -n 12 | head -n 10 | jq -rc '.') -c '."predix-uaa"[0].credentials=$uaa_cred')
export PREDIX_APP_CLIENT_ID=asset-client
export PREDIX_APP_CLIENT_SECRET=asset-client
import predix.app
import pprint
manifest = predix.app.Manifest()
asset = manifest.get_asset()
print(asset.get_collections())
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(asset.get_collection(collection='/engines', filter='RPM=2400'))
pp.pprint(asset.get_collection(collection='/engines', filter='RPM=2400', fields='horsepower'))
pp.pprint(asset.get_collection(collection='/locomotives', filter='model=SD70ACe:fleet=/fleets/up-5'))
pp.pprint(asset.get_collection(collection='/locomotives', filter='engine=/engines/v16-2-5|fleet=/fleets/csx-1'))
{
"enableAudit": false
}
[
{
"enableAudit" : true
}
]
ass2=asset.get_collection(collection='/locomotives', filter='engine=/engines/v16-2-5')
pp.pprint(ass2)
To fetch one locomotive asset
asset.patch_collection('locomotives/10', [{'op': 'replace', 'path': '/hqLatLng/lat', 'value': '40.941049'}])
ass2 = asset.get_collection(collection='/locomotives', filter='engine=/engines/v16-2-5')
pp.pprint(ass2)
pp.pprint(asset.get_audit())
pp.pprint(asset.get_audit_changes())
cd ${HOME} && git clone https://github.com/PredixDev/predix-analytics-sample
zip -q -r ../demo-adder-py.zip .
{"number1": 123, "number2": 456}
{
"analyticId": "8330e99d-9899-44d8-8498-12a18c0999a2",
"validationRequestId": "fca0c0da-ec33-45a4-85c2-77aecfd306e9",
"status": "QUEUED",
"message": "Analytic validation request successfully queued - reference request id is fca0c0da-ec33-45a4-85c2-77aecfd306e9 for catalog entry id 8330e99d-9899-44d8-8498-12a18c0999a2",
"inputData": "{\"number1\":1,\"number2\":2}",
"result": null,
"createdTimestamp": "2018-01-26T08:39:51+00:00",
"updatedTimestamp": "2018-01-26T08:39:51+00:00"
}
{
"analyticId": "01cb012b-6aa6-4069-96a2-570c29d0b7d7",
"validationRequestId": "b685ea78-daae-420d-80ac-86ec4644de5e",
"status": "PROCESSING",
"message": "Processing analytic validation request for analytic id 01cb012b-6aa6-4069-96a2-570c29d0b7d7, request id b685ea78-daae-420d-80ac-86ec4644de5e",
"inputData": "{\"number1\":1,\"number2\":2}",
"result": null,
"createdTimestamp": "2018-01-26T08:52:00+00:00",
"updatedTimestamp": "2018-01-26T08:52:00+00:00"
}
{
"analyticId": "01cb012b-6aa6-4069-96a2-570c29d0b7d7",
"validationRequestId": "b685ea78-daae-420d-80ac-86ec4644de5e",
"status": "COMPLETED",
"message": "Analytic validation completed successfully.",
"inputData": "{\"number1\":1,\"number2\":2}",
"result": "{\"result\": 3}",
"createdTimestamp": "2018-01-26T08:52:00+00:00",
"updatedTimestamp": "2018-01-26T08:58:11+00:00"
}
Created app with guid f02af646-1911-4707-82dc-73b609fb7679
Updated app with guid f02af646-1911-4707-82dc-73b609fb7679 ({"route"=>"d71604dc-6a25-483e-8b75-aa8af61ada07", :verb=>"add", :relation=>"routes", :related_guid=>"d71604dc-6a25-483e-8b75-aa8af61ada07"})
Updated app with guid f02af646-1911-4707-82dc-73b609fb7679 ({"state"=>"STOPPED"})
Updated app with guid f02af646-1911-4707-82dc-73b609fb7679 ({"environment_json"=>"PRIVATE DATA HIDDEN"})
Updated app with guid f02af646-1911-4707-82dc-73b609fb7679 ({"environment_json"=>"PRIVATE DATA HIDDEN"})
Updated app with guid f02af646-1911-4707-82dc-73b609fb7679 ({"environment_json"=>"PRIVATE DATA HIDDEN"})
Updated app with guid f02af646-1911-4707-82dc-73b609fb7679 ({"environment_json"=>"PRIVATE DATA HIDDEN"})
Updated app with guid f02af646-1911-4707-82dc-73b609fb7679 ({"state"=>"STARTED"})
-----> Preparing Python/Miniconda Environment (3.5.2)
installing: openssl-1.0.1h-1 ...
installing: pycosat-0.6.1-py27_0 ...
installing: pyyaml-3.11-py27_0 ...
installing: readline-6.2-2 ...
installing: conda-3.7.3-py27_0 ...
Python 2.7.8 :: Continuum Analytics, Inc.
........
2018-01-26 08:59:06,356 - CFAmqpClient - INFO - Connection to RabbitMQ successfully created/revived.
2018-01-26 08:59:06,590 - CFAmqpClient - INFO - Consumers ready to consume messages
2018-01-26 08:59:09,327 - CFAmqpClient - INFO - Connection to RabbitMQ successfully created/revived.
2018-01-26 08:59:09,481 - CFAmqpClient - INFO - Consumers ready to consume messages
{
"entry-method": "analytic.demoAdder.add",
"non-conda-libs": [
"boto"
],
"conda-libs": [
"numpy",
"scipy"
]
}
__init__.py demoAdder.py
Analytic deployment request successfully queued - reference request id is 2e65f7be-e0e7-49eb-a48e-f7cfa0d98beb for catalog entry id 01cb012b-6aa6-4069-96a2-570c29d0b7d7
{
"analyticCatalogEntries": [
{
"id": "01cb012b-6aa6-4069-96a2-570c29d0b7d7",
"name": "demo-adder-py-bl",
"author": "Jack Daniels",
"description": "",
"version": "v1",
"supportedLanguage": "Python",
"customMetadata": null,
"taxonomyLocation": "/uncategorized",
"state": "PRODUCTION",
"access": "FULL",
"createdTimestamp": "2018-01-26T08:51:34+00:00",
"updatedTimestamp": "2018-01-26T09:16:30+00:00"
}
]
}
{"number1": 123, "number2": 456}