Skip to content

Commit 4ad80b3

Browse files
committed
Merge pull request #3 from PredixDev/develop
GA Release
2 parents fed40a1 + 0cf27b1 commit 4ad80b3

File tree

14 files changed

+404
-292
lines changed

14 files changed

+404
-292
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Predix Analytics Samples
22

3-
A collection of samples for use with Predix Analytics services.
3+
A collection of samples for use with [Predix Analytics](https://www.predix.io/docs/#EG3xVdLg) services.
44

55
## Sample Analytics
66

@@ -14,13 +14,13 @@ The expected JSON input data format is as follows:
1414

1515
`{"number1": 123, "number2": 456}`
1616

17-
For more information on developing analytics for use with Predix Analytics, see "Analytic Development" in the Predix Analytics Services documentation on Predix IO.
17+
For more information on developing analytics for use with Predix Analytics, see [Analytic Development](https://www.predix.io/docs/#Qd2kPYb7) on Predix IO.
1818

1919
## Sample Orchestration Workflows
2020

2121
**[Sample Orchestration Workflows](orchestrations)**
2222

23-
For more information on running orchestrations in Predix Analytics, see "Using the Analytics Runtime Service" in the Predix Analytics Services documentation on Predix IO.
23+
For more information on running orchestrations in Predix Analytics, see [Using the Analytics Runtime Service](https://www.predix.io/docs/#pM5fe0l) on Predix IO.
2424

2525
## Postman Collections
2626

demo-adder-java/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A java-based sample analytic for the Predix Analytics platform.
44

55
## Compiled binaries
6-
Refer to the Releases page for compiled binaries you can upload directly to Predix Analytics.
6+
Refer to the [Releases](https://github.com/PredixDev/predix-analytics-sample/releases) page for compiled binaries you can upload directly to Predix Analytics.
77

88
## Pre-requisites
99
To build and run this analytic, you will need to have the following:
@@ -39,4 +39,4 @@ Requests made to this generated URI will be passed to the entry point method.
3939

4040

4141

42-
For more information, see "Analytic Development" in the Predix Analytics Services documentation on Predix IO.
42+
For more information, see [Java Analytic Development](https://www.predix.io/docs#S1Wl9PHG) in the Predix Analytics Services documentation on Predix IO.

demo-adder-java/src/main/java/com/ge/predix/analytics/customdto/AdderRequest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/*
2+
* Copyright (c) 2015 - 2016 General Electric Company. All rights reserved.
3+
*
4+
* The copyright to the computer software herein is the property of
5+
* General Electric Company. The software may be used and/or copied only
6+
* with the written permission of General Electric Company or in accordance
7+
* with the terms and conditions stipulated in the agreement/contract
8+
* under which the software has been supplied.
9+
*/
10+
111
package com.ge.predix.analytics.customdto;
212

313
public class AdderRequest {

demo-adder-java/src/main/java/com/ge/predix/analytics/customdto/AdderResponse.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/*
2+
* Copyright (c) 2015 - 2016 General Electric Company. All rights reserved.
3+
*
4+
* The copyright to the computer software herein is the property of
5+
* General Electric Company. The software may be used and/or copied only
6+
* with the written permission of General Electric Company or in accordance
7+
* with the terms and conditions stipulated in the agreement/contract
8+
* under which the software has been supplied.
9+
*/
10+
111
package com.ge.predix.analytics.customdto;
212

313
public class AdderResponse {

demo-adder-java/src/main/java/com/ge/predix/analytics/demo/java/DemoAdderJavaEntryPoint.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/*
2+
* Copyright (c) 2015 - 2016 General Electric Company. All rights reserved.
3+
*
4+
* The copyright to the computer software herein is the property of
5+
* General Electric Company. The software may be used and/or copied only
6+
* with the written permission of General Electric Company or in accordance
7+
* with the terms and conditions stipulated in the agreement/contract
8+
* under which the software has been supplied.
9+
*/
10+
111
package com.ge.predix.analytics.demo.java;
212

313
import java.util.HashMap;

demo-adder-matlab/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
A Matlab-based sample analytic for Predix Analytics.
44

55
## Compiled binaries
6-
Refer to the Releases page for compiled binaries you can upload directly to Predix Analytics.
6+
Refer to the [Releases](https://github.com/PredixDev/predix-analytics-sample/releases) page for compiled binaries you can upload directly to Predix Analytics.
77

88
## Developing a Matlab-based analytic
99
1. Implement the Matlab analytic and corresponding unit tests according to your development guidelines.
1010
2. Create a config.json file as shown in the [example](demo-adder-matlab-r2011b-impl/src/main/resources/config.json) and place it in the root folder.
1111
3. Create a JAR package using either Maven build or other tools.
1212

13-
For more information, see "Analytic Development" in the Predix Analytics Services documentation on Predix IO.
13+
For more information, see [Matlab Analytic Development](https://www.predix.io/docs#zwCROx4n) in the Predix Analytics Services documentation on Predix IO.

demo-adder-matlab/demo-adder-matlab-r2011b-impl/src/main/java/com/ge/predix/insight/analytic/demo/matlab/DemoMatlabAdderEntryPoint.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/*
2+
* Copyright (c) 2015 - 2016 General Electric Company. All rights reserved.
3+
*
4+
* The copyright to the computer software herein is the property of
5+
* General Electric Company. The software may be used and/or copied only
6+
* with the written permission of General Electric Company or in accordance
7+
* with the terms and conditions stipulated in the agreement/contract
8+
* under which the software has been supplied.
9+
*/
10+
111
package com.ge.predix.insight.analytic.demo.matlab;
212

313
import java.util.HashMap;

demo-adder-py/README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A python-based sample analytic for Predix Analytics.
44

55
## Compiled binaries
6-
Refer to the Releases page for compiled binaries you can upload directly to Predix Analytics.
6+
Refer to the [Releases](https://github.com/PredixDev/predix-analytics-sample/releases) page for compiled binaries you can upload directly to Predix Analytics.
77

88
## Pre-requisites
99
To run this analytic locally, you will need to have the following:
@@ -24,16 +24,10 @@ The expected JSON input data format is as follows:
2424
The JSON output format from the analytic is as follows:
2525
`{"result":579}`
2626

27-
## Testing the analytic locally
28-
1. Download the wrapped analytic from the Analytics Catalog.
29-
2. Unzip the resultant zip file.
30-
3. Run the command `python AnalyticDeployer.py` to start up the analytic. If the analytic runs successfully, the console log displays the port number. The default port number is 5000.
31-
4. Invoke the REST API (POST http://localhost:5000/api/v1/demo-adder-py/execution) with input data as the request payload.
32-
3327
## Developing a Python-based analytic
3428
1. Implement the analytic (and test functions) according to your development guidelines. In this discussion, the top level of the analytic implementation project structure is referred to as analytic directory.
3529
2. Create a driver directory at the top level of your project structure. Place an AnalyticDriver.py file in the driver directory. The AnalyticDriver.py file must define driver and result provider functions.
3630
3. Create a config.json file in the top level of the project directory. Specify the tags, libs, conda-libs, memory, and instance values.
3731
4. Package all the analytic files and the driver directory and the config.json file into a ZIP file.
3832

39-
For more information, see "Analytic Development" in the Predix Analytics Services documentation on Predix IO.
33+
For more information, see [Python Analytic Development](https://www.predix.io/docs#alaepr9P) in the Predix Analytics Services documentation on Predix IO.

orchestrations/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ A collection of sample orchestration workflows for use with Predix Analytics.
88

99
A Catalog analytic is one that has been uploaded to the Analytic Catalog and deployed into Cloud Foundry.
1010

11-
For more information on running orchestrations in Predix Analytics, see "Using the Analytics Runtime Service" in the Predix Analytics Services documentation on Predix IO.
11+
For more information on running orchestrations in Predix Analytics, see [Using the Analytics Runtime Service](https://www.predix.io/docs/#pM5fe0l) on Predix IO.

postman/Analytic_Catalog.json.postman_collection renamed to postman/Analytics_Catalog.json.postman_collection

Lines changed: 111 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "86abc24c-69b4-d8cc-0cbc-1c6d08576734",
3-
"name": "Analytic Catalog",
3+
"name": "Analytics Catalog",
44
"description": "",
55
"order": [],
66
"folders": [
@@ -29,8 +29,17 @@
2929
"298126e1-4619-ff70-7568-28f6fe0175b2",
3030
"92a3b06e-0b9b-8f24-5ca9-2dff97105587",
3131
"e1b053ba-1403-8253-b72b-9a547a7cb3bd",
32-
"52b7b275-c307-e81a-0cd3-748572adb464",
33-
"1bdeda15-7ab0-139f-0a13-8b905aa5374b"
32+
"52b7b275-c307-e81a-0cd3-748572adb464"
33+
],
34+
"owner": 0
35+
},
36+
{
37+
"id": "95226879-2305-86e4-579a-e5484d09cef2",
38+
"name": "Taxonomy",
39+
"description": "",
40+
"order": [
41+
"fa84ee58-bebb-57ec-83e1-48de27ac27f4",
42+
"55f6397e-3fca-b49d-9b02-588c7ecda272"
3443
],
3544
"owner": 0
3645
},
@@ -47,16 +56,6 @@
4756
],
4857
"owner": 0,
4958
"collectionId": "86abc24c-69b4-d8cc-0cbc-1c6d08576734"
50-
},
51-
{
52-
"id": "95226879-2305-86e4-579a-e5484d09cef2",
53-
"name": "Taxonomy",
54-
"description": "",
55-
"order": [
56-
"fa84ee58-bebb-57ec-83e1-48de27ac27f4",
57-
"55f6397e-3fca-b49d-9b02-588c7ecda272"
58-
],
59-
"owner": 0
6059
}
6160
],
6261
"timestamp": 1426637613528,
@@ -85,26 +84,6 @@
8584
"helperAttributes": {},
8685
"folder": "927cdeb7-e4ee-af89-21d9-1189082e1c97"
8786
},
88-
{
89-
"id": "1bdeda15-7ab0-139f-0a13-8b905aa5374b",
90-
"headers": "Authorization: Bearer {{token}}\nPredix-Zone-Id: {{catalog_tenant}}\n",
91-
"url": "https://{{catalog_host}}/api/v1/catalog/analytics/8834da45-7800-4984-b9a9-cde7947a7af4/wrapped",
92-
"preRequestScript": "",
93-
"pathVariables": {},
94-
"method": "GET",
95-
"data": [],
96-
"dataMode": "params",
97-
"version": 2,
98-
"tests": "",
99-
"currentHelper": "normal",
100-
"helperAttributes": {},
101-
"time": 1443721671379,
102-
"name": "Download Wrapped Executable for Analytic",
103-
"description": "**POSTMAN DOES NOT CURRENTLY SUPPORT THIS REQUEST.** This is just for reference. In order to actually download the file, you will need to enter the full URL in your browser and make sure you send all of the headers in this request using a plugin such as ModHeaders for Chrome.",
104-
"collectionId": "86abc24c-69b4-d8cc-0cbc-1c6d08576734",
105-
"responses": [],
106-
"folder": "f27530e1-c962-618e-f66b-3ed0212b13c2"
107-
},
10887
{
10988
"id": "298126e1-4619-ff70-7568-28f6fe0175b2",
11089
"headers": "Content-Type: application/json\nAuthorization: Bearer {{token}}\nPredix-Zone-Id: {{catalog_tenant}}\n",
@@ -506,7 +485,105 @@
506485
"description": "",
507486
"collectionId": "86abc24c-69b4-d8cc-0cbc-1c6d08576734",
508487
"rawModeData": "{\n \"name\": \"aaa analytic\",\n \"version\": \"v1\",\n \"supportedLanguage\": \"Python\",\n \"taxonomyLocation\": \"\",\n \"author\": \"test\",\n \"description\": \"test\",\n \"customMetadata\": \"{\\\"assetid\\\":\\\"abc\\\"}\"\n}",
509-
"folder": "0ae85123-720a-d29e-d343-52bbe87910c0"
488+
"folder": "0ae85123-720a-d29e-d343-52bbe87910c0",
489+
"responses": [
490+
{
491+
"status": "",
492+
"responseCode": {
493+
"code": 502,
494+
"name": "Bad Gateway",
495+
"detail": "The server was acting as a gateway or proxy and received an invalid response from the upstream server."
496+
},
497+
"time": 26358,
498+
"headers": [
499+
{
500+
"name": "Content-Length",
501+
"key": "Content-Length",
502+
"value": "67",
503+
"description": "The length of the response body in octets (8-bit bytes)"
504+
},
505+
{
506+
"name": "Content-Type",
507+
"key": "Content-Type",
508+
"value": "text/plain; charset=utf-8",
509+
"description": "The mime type of this content"
510+
},
511+
{
512+
"name": "Date",
513+
"key": "Date",
514+
"value": "Thu, 17 Dec 2015 23:16:37 GMT",
515+
"description": "The date and time that the message was sent"
516+
},
517+
{
518+
"name": "X-Cf-Requestid",
519+
"key": "X-Cf-Requestid",
520+
"value": "dd72f88f-66b5-4515-7e80-f8a54051a458",
521+
"description": "Custom header"
522+
},
523+
{
524+
"name": "X-Cf-Routererror",
525+
"key": "X-Cf-Routererror",
526+
"value": "endpoint_failure",
527+
"description": "Custom header"
528+
}
529+
],
530+
"cookies": [],
531+
"mime": "",
532+
"text": "502 Bad Gateway: Registered endpoint failed to handle the request.\n",
533+
"language": "html",
534+
"rawDataType": "text",
535+
"state": {
536+
"size": "normal"
537+
},
538+
"previewType": "html",
539+
"searchResultScrolledTo": -1,
540+
"forceNoPretty": false,
541+
"write": true,
542+
"empty": false,
543+
"failed": false,
544+
"isSample": true,
545+
"scrollToResult": true,
546+
"runTests": true,
547+
"id": "2532c818-948b-0cc6-c9f2-f57f6e20554a",
548+
"name": "502 error",
549+
"request": {
550+
"url": "https://predix-analytics-catalog-release.run.aws-usw02-pr.ice.predix.io/api/v1/catalog/analytics",
551+
"headers": [
552+
{
553+
"key": "Content-Type",
554+
"value": "application/json",
555+
"name": "Content-Type",
556+
"enabled": true
557+
},
558+
{
559+
"key": "Authorization",
560+
"value": "Bearer eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI0OTJkMWExYy1jNjVlLTRmODgtODc1Mi1kZDJlZjI5ODE1ZDkiLCJzdWIiOiI4MzM1MTBiZS05NmJiLTQxYzgtOTIyMC0xMzk2ZWUxMDdhZWMiLCJzY29wZSI6WyJhbmFseXRpY3Muem9uZXMuY2IxZjVjMjktMjVlYS00YmZhLTgxNmYtNjRlOTQ4Y2M2MzQ0LnVzZXIiLCJhbmFseXRpY3Muem9uZXMuYjNlMTkzNGUtMWVhZi00MjcxLTlmZDItY2ZmZjdkNDUxZDIxLnVzZXIiXSwiY2xpZW50X2lkIjoiYWRtaW4iLCJjaWQiOiJhZG1pbiIsImF6cCI6ImFkbWluIiwiZ3JhbnRfdHlwZSI6InBhc3N3b3JkIiwidXNlcl9pZCI6IjgzMzUxMGJlLTk2YmItNDFjOC05MjIwLTEzOTZlZTEwN2FlYyIsIm9yaWdpbiI6InVhYSIsInVzZXJfbmFtZSI6ImFsbGVuLmNodUBnZS5jb20iLCJlbWFpbCI6ImFsbGVuLmNodUBnZS5jb20iLCJhdXRoX3RpbWUiOjE0NTAzOTMxODcsInJldl9zaWciOiI0YTIzOGRjZiIsImlhdCI6MTQ1MDM5MzE4NywiZXhwIjoxNDUwNDM2Mzg3LCJpc3MiOiJodHRwczovLzg3OTk1YzUzLWJiZTctNDRhOC1hZTIwLWFmMDA3OGVkZTM5NS5wcmVkaXgtdWFhLnJ1bi5hd3MtdXN3MDItcHIuaWNlLnByZWRpeC5pby9vYXV0aC90b2tlbiIsInppZCI6Ijg3OTk1YzUzLWJiZTctNDRhOC1hZTIwLWFmMDA3OGVkZTM5NSIsImF1ZCI6WyJhZG1pbiIsImFuYWx5dGljcy56b25lcy5jYjFmNWMyOS0yNWVhLTRiZmEtODE2Zi02NGU5NDhjYzYzNDQiLCJhbmFseXRpY3Muem9uZXMuYjNlMTkzNGUtMWVhZi00MjcxLTlmZDItY2ZmZjdkNDUxZDIxIl19.n-VAjTsUHsxXkz_b79RNRrpmXgPs0D8GlCqoXPh23fKilzviRyLz27lrpuQ5NDho_53Lo5R7DRb80XZM5XBjrUomT1Byp5xIZgRdJteMyfWblJZ7W_tsj6Irf4JTt9R3kYamPRjSVmMLW4BwomSpMIL6-umgUH9j7aTOR8R6StbjUkIAydvtrXWlWFgHLmWsX0cLms7lI3mOaRI2XGr-Q0EGzsXHs7fibH3NZ-BvdwRraM2dTr94RdlyuH2jAClYSHLzvJnwtuvSO1Dze8OcsfJgwqyCFQ02Hd2lTbVxRq0vk3neQxdE9jHgxPRbYSTr00yxs3o6mfu7CQasdS9pWA",
561+
"name": "Authorization",
562+
"enabled": true
563+
},
564+
{
565+
"key": "Predix-Zone-Id",
566+
"value": "cb1f5c29-25ea-4bfa-816f-64e948cc6344",
567+
"name": "Predix-Zone-Id",
568+
"enabled": true
569+
},
570+
{
571+
"key": "Cache-Control",
572+
"name": "Cache-Control",
573+
"value": "no-cache"
574+
},
575+
{
576+
"key": "Postman-Token",
577+
"name": "Postman-Token",
578+
"value": "59b1f823-49b6-b478-6fd7-0a089e357b88"
579+
}
580+
],
581+
"data": "{\n \"name\": \"matlab analytic\",\n \"version\": \"v1\",\n \"supportedLanguage\": \"Matlab\",\n \"taxonomyLocation\": \"/demo-analytics/matlab-test\",\n \"author\": \"Allen Chu\",\n \"description\": \"test matlab adder\"\n}",
582+
"method": "POST",
583+
"dataMode": "raw"
584+
}
585+
}
586+
]
510587
},
511588
{
512589
"id": "f45ac8fb-4113-5f75-142d-1399474b299e",

0 commit comments

Comments
 (0)