Merge pull request #6 from pawansingh126/master

Add yaml-editor documentation.
This commit is contained in:
hemanthnakkina 2018-11-29 21:12:43 +05:30 committed by GitHub
commit a2eedb6370
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 70 additions and 4 deletions

View File

@ -73,7 +73,7 @@ Supported Features
endpoint. endpoint.
3. YAML Editor for Intermediary YAML: Support runtime editing of missing 3. YAML Editor for Intermediary YAML: Support runtime editing of missing
site parameters site parameters, see :ref:`yaml-editor-info`
Future Work Future Work
----------- -----------

View File

@ -33,3 +33,4 @@ fed to Shipyard for site deployment / updates.
getting_started getting_started
tugboat tugboat
yaml-editor

View File

@ -1,4 +1,4 @@
..
Copyright 2018 AT&T Intellectual Property. Copyright 2018 AT&T Intellectual Property.
All Rights Reserved. All Rights Reserved.
@ -90,7 +90,7 @@ Example: Tugboat Plugin Usage
b) Excel Spec: excel_spec_upstream.yaml b) Excel Spec: excel_spec_upstream.yaml
c) Site Config: site_config.yaml c) Site Config: site_config.yaml
d) Template_dir: '../examples/templates' d) Template_dir: '../examples/templates'
c) Site name: airship-seaworthy e) Site name: airship-seaworthy
2. Spyglass CLI Command: 2. Spyglass CLI Command:
spyglass -mg -t tugboat -x SiteDesignSpec_v0.1.xlsx -e excel_spec_upstream.yaml -d site_config.yaml -s airship-seaworthy --template_dir=<relative path to '../examples/templates' spyglass -mg -t tugboat -x SiteDesignSpec_v0.1.xlsx -e excel_spec_upstream.yaml -d site_config.yaml -s airship-seaworthy --template_dir=<relative path to '../examples/templates'

View File

@ -0,0 +1,65 @@
..
Copyright 2018 AT&T Intellectual Property.
All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
.. _yaml-editor-info:
===========
Yaml Editor
===========
What is Yaml Editor?
--------------------
Yaml Editor is a spyglass utility which lets user edit their generated
intermediary file in a browser window. It is a minimal flask app which is
invoked from the parser engine in order to let user edit fields which
could not be fetched via :ref:`tugboatinfo` plugin.
Yaml Editor Utility Inputs
--------------------------
a) Yaml File: Yaml file required to be edited (This is required field)
b) Port: Port on which app shall be running
c) Host: This is only used to form URL which can be followed to open file in browser
d) String: String which is required to be updated in the file (default is '#CHANGE_ME')
Yaml Editor Utility Usage
-------------------------
With Spyglass (edit option is True by default):
::
spyglass -mg --edit_intermediary -t tugboat -x SiteDesignSpec_v0.1.xlsx -e excel_spec_upstream.yaml -d site_config.yaml -s airship-seaworthy --template_dir=<relative path to '../examples/templates'
As a stand-alone editor:
::
yaml-editor -f <yaml-file>
Help:
::
> yaml-editor --help
Usage: yaml-editor [OPTIONS]
Options:
-f, --file FILENAME Path with file name to the intermediary yaml file.
[required]
-h, --host TEXT Optional host parameter to run Flask on.
-p, --port INTEGER Optional port parameter to run Flask on.
-s, --string TEXT Text which is required to be changed on yaml file.
--help Show this message and exit.

View File

@ -105,7 +105,7 @@ def run(*args, **kwargs):
default='0.0.0.0', default='0.0.0.0',
type=click.STRING, type=click.STRING,
multiple=False, multiple=False,
help="Optional port parameter to run Flask on." help="Optional host parameter to run Flask on."
) )
@click.option( @click.option(
'--port', '--port',