-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathec.sh
157 lines (157 loc) · 5.19 KB
/
ec.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#!/bin/bash
#
# The following Gateway, Server and Client commands
# are provided to be used as templates for basic
# use cases. Further down you will find a reference
# guide for all the flags found within the commands.
# While these are written with Linux/Mac agents in mind,
# these commands require very little adjustments
# to be 'copy/paste' ready for a Windows environment.
# Windows specific variation coming soon.
#
#
#
# -----------------------------------------------------
# Gateway Agent
# -----------------------------------------------------
#
# ./ecagent_linux_sys -mod gateway -gpt ${PORT} \
# -zon <EC Service GUID> -sst <EC Service URI ending in predix.io> \
# -tkn <admin token>
# -hst <gatewayappname.domain part of sst uri>
#
#
# -----------------------------------------------------
# Server Agent
# -----------------------------------------------------
#
#./ecagent_linux_sys -mod server -aid <agent ID> \
#-grp <agent group> \
#-cid <UAA client ID> -csc <UAA client secret> -dur 3000 \
#-oa2 https://<Predix UAA Instance URI>/oauth/token \
#-hst wss://<gateway URI>/agent \
#-zon <EC Service GUID> -sst <EC Service URI ending in predix.io> \
#-rht 127.0.0.1 -rpt 5432 -hca 8080 -dbg
#
#
# -----------------------------------------------------
# Client Agent
# -----------------------------------------------------
#
#./ecagent_linux_sys -mod client \
#-aid <agent id> -tid <target/server ID> \
#-grp <agent group> \
#-cid <UAA client ID> -csc <UAA client secret> -dur 3000 \
#-oa2 https://<Predix UAA Instance URI>/oauth/token \
#-hst wss://<gateway URI>/agent \
#-lpt <an available port>
#-pxy <proxy url, only if running from corporate network>
#
# -----------------------------------------------------
# Flag Usage Guide
# -----------------------------------------------------
# -flag arg
# Description: of flag and arg, if any.
#
# (also available by running `ecagent_*_sys -h`)
# -----------------------------------------------------
#
# -aid string
# Agent ID: Six character, alphanumeric value generated by the Service,
# used by the Gateway to identify and vaidate the agent
#
# -bkl string
# Black List: Specify comma-separated IPs to be blocked in IPv4/IPv6 format.
# E.g. 10.20.30.5, 2002:4559:1FE2::4559:1FE2
#
# -cid string
# (UAA) Client ID: The name of the UAA Client configured for EC agents to
# auto-refresh the OAuth2 token.
#
# -crt string
# Cert: Specify the relative path of a digital certificate to operate the EC agent.
# (.pfx, .cer, .p7s, .der, .pem, .crt)
#
# -csc string
# (UAA) Client Secret: The 'secret' of the UAA Client configured for EC agents to
# auto-refresh the OAuth2 token.
#
# -dbg
# Debug: Enables a debug logging mode, which produces additional log output for any EC agent.
#
# -dur int
# Duration: How frequently, in seconds, the EC Client or Server will refresh the token.
#
# -gen
# Generate a certificate request for the usage validation purpose.
#
# -grp string
# Group: The 'group' that the provided -aid/-tid values belong to.
# Custom groups can be viewed at the Service's Swagger APIs.
#
# -hca string
# Health Check: Specify an available port to enable a health check.
# The api is available at <agent_uri>/health.
#
# -hst string
# Host: The EC Gateway's URI.
# E.g. wss://my-gateway.the-cloud.com/agent; ws://localhost:8080/agent
#
# -inf
# The Product Information.
#
# -lpt string
# Listening Port: An available port for the agent to listen on when
# running in Client or Gateway mode.
#
# -mod string
# Mode: The desired operational mode for the EC agent, "client", "server", or "gateway".
#
# -oa2 string
# UAA Token Endpoint: E.g. https://my-uaa-instance.predix.io/oauth/token
#
# -plg *** MUST BE FINAL FLAG WHEN USED ***
# Plugins: Enables plugins. This requires the plugins.yml file presented in the agent path.
#
# -pxy string
# Proxy: Specify a local proxy service, passwords/data can not be passed.
# E.g. http://hello.world.com:8080
#
# -rht string
# Resource Host: The 'address' where the EC Server agent can access the desired data/resource.
# E.g. <someip>, <somedomain>.
#
# -rpt string
# Resource Port: The port made available by the resource. E.g. 1521, 5432, 8989, 38989
#
# -sgn
# Sign: Start a CA Cert-Signing process.
#
# -shc
# Secure Health Check: Specify an available port to enable a health check.
# The api is available at <agent_uri>/health, and requires basic authentication.
#
# -sst string
# Service URI: The EC agents will use this value to make API calls, found in service keys or VCAPs.
# E.g. https://7497fbcb-cde5-48ae-aa96-6095371a0e54.run.something.predix.io
#
# -tid string
# Target ID: The agent ID of the EC Server the EC Client should connect to.
#
# -tkn string
# Token: Generated by the Service upon subscription, this encoded value can be found in either a service key
# or VCAP, and is the basic auth for the Service APIs.
#
# -ver
# Output version information
#
# -vfy
# Verify the legitimacy of a digital certificate.
#
# -wtl string
# White List: Specify comma-separated IPs to be white-listed in CIDR format.
# E.g. 89.24.9.0/24, 7.6.0.0/16 (default "0.0.0.0/0,::/0")
#
# -zon string
# Zone: GUID of the EC Service. This value can be found in the service key, vcaps, or by running:
# $ cf service SERVICE_NAME --guid