MCPcopy Index your code
hub / github.com/StackStorm/st2 / Shell

Class Shell

st2client/st2client/shell.py:171–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169
170
171class Shell(BaseCLIApp):
172 LOG = LOGGER
173
174 SKIP_AUTH_CLASSES = [
175 TokenCreateCommand.__name__,
176 LoginCommand.__name__,
177 ]
178
179 def __init__(self):
180 # Set up of endpoints is delayed until program is run.
181 self.client = None
182
183 # Set up the main parser.
184 self.parser = argparse.ArgumentParser(description=CLI_DESCRIPTION)
185
186 # Set up general program options.
187 self.parser.add_argument(
188 "--version",
189 action="version",
190 version="%(prog)s {version}, on Python {python_major}.{python_minor}.{python_patch}".format(
191 version=get_stackstorm_version(),
192 python_major=sys.version_info.major,
193 python_minor=sys.version_info.minor,
194 python_patch=sys.version_info.micro,
195 ),
196 )
197
198 self.parser.add_argument(
199 "--url",
200 action="store",
201 dest="base_url",
202 default=None,
203 help="Base URL for the API servers. Assumes all servers use the "
204 "same base URL and default ports are used. Get ST2_BASE_URL "
205 "from the environment variables by default.",
206 )
207
208 self.parser.add_argument(
209 "--auth-url",
210 action="store",
211 dest="auth_url",
212 default=None,
213 help="URL for the authentication service. Get ST2_AUTH_URL "
214 "from the environment variables by default.",
215 )
216
217 self.parser.add_argument(
218 "--api-url",
219 action="store",
220 dest="api_url",
221 default=None,
222 help="URL for the API server. Get ST2_API_URL "
223 "from the environment variables by default.",
224 )
225
226 self.parser.add_argument(
227 "--stream-url",
228 action="store",

Calls

no outgoing calls