Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ARA. If not, see .
import logging
from ara import models
from ara.fields import Field
from cliff.lister import Lister
from cliff.show import ShowOne
FIELDS = (
Field('ID'),
Field('Path'),
Field('Playbook ID', 'playbook.id'),
)
class FileList(Lister):
""" Returns a list of files """
log = logging.getLogger(__name__)
def get_parser(self, prog_name):
parser = super(FileList, self).get_parser(prog_name)
g = parser.add_mutually_exclusive_group(required=True)
g.add_argument(
'--playbook', '-b',
metavar='',
help='Show files associated with a specified playbook',
)
g.add_argument(
)
SHOW_FIELDS = (
Field('ID'),
Field('Name', 'task.name'),
Field('Playbook ID', 'task.playbook.id'),
Field('Playbook Path', 'task.playbook.path'),
Field('Play ID', 'task.play.id'),
Field('Play Name', 'task.play.name'),
Field('Task ID', 'task.id'),
Field('Task Name', 'task.name'),
Field('Host', 'host.name'),
Field('Action', 'task.action'),
Field('Status', 'derived_status'),
Field('Ignore Errors'),
Field('Time Start'),
Field('Time End'),
Field('Duration'),
)
SHOW_FIELDS_LONG = SHOW_FIELDS + (
Field('Result', 'result|from_json',
template='{{ value | to_nice_json | safe }}'),
)
SHOW_FIELDS_RAW = SHOW_FIELDS + (
Field('Result', 'result | from_json'),
)
class ResultList(Lister):
""" Returns a list of results """
Field('Playbook Path', 'task.playbook.path'),
Field('Play ID', 'task.play.id'),
Field('Play Name', 'task.play.name'),
Field('Task ID', 'task.id'),
Field('Task Name', 'task.name'),
Field('Host', 'host.name'),
Field('Action', 'task.action'),
Field('Status', 'derived_status'),
Field('Ignore Errors'),
Field('Time Start'),
Field('Time End'),
Field('Duration'),
)
SHOW_FIELDS_LONG = SHOW_FIELDS + (
Field('Result', 'result|from_json',
template='{{ value | to_nice_json | safe }}'),
)
SHOW_FIELDS_RAW = SHOW_FIELDS + (
Field('Result', 'result | from_json'),
)
class ResultList(Lister):
""" Returns a list of results """
log = logging.getLogger(__name__)
def get_parser(self, prog_name):
parser = super(ResultList, self).get_parser(prog_name)
g = parser.add_mutually_exclusive_group(required=True)
Field('ID'),
Field('Path'),
Field('Time Start'),
Field('Duration'),
Field('Complete'),
Field('Ansible Version'),
)
SHOW_FIELDS = (
Field('ID'),
Field('Path'),
Field('Time Start'),
Field('Time End'),
Field('Duration'),
Field('Complete'),
Field('Ansible Version'),
Field('Parameters', 'options',
template='{{ value | to_nice_json | safe }}')
)
class PlaybookList(Lister):
""" Returns a list of playbooks """
log = logging.getLogger(__name__)
def get_parser(self, prog_name):
parser = super(PlaybookList, self).get_parser(prog_name)
parser.add_argument(
'--incomplete', '-I',
action='store_true',
help='Only show incomplete playbook runs',
)
# You should have received a copy of the GNU General Public License
# along with ARA. If not, see .
import logging
from ara import models
from ara.fields import Field
from cliff.lister import Lister
from cliff.show import ShowOne
LIST_FIELDS = (
Field('ID'),
Field('Playbook ID', 'playbook.id'),
Field('Playbook Path', 'playbook.path'),
Field('Key'),
Field('Type')
)
SHOW_FIELDS = (
Field('ID'),
Field('Playbook ID', 'playbook.id'),
Field('Playbook Path', 'playbook.path'),
Field('Key'),
Field('Value'),
Field('Type')
)
class DataList(Lister):
""" Returns a list of recorded key/value pairs """
log = logging.getLogger(__name__)
SHOW_FIELDS = (
Field('ID'),
Field('Name', 'task.name'),
Field('Playbook ID', 'task.playbook.id'),
Field('Playbook Path', 'task.playbook.path'),
Field('Play ID', 'task.play.id'),
Field('Play Name', 'task.play.name'),
Field('Task ID', 'task.id'),
Field('Task Name', 'task.name'),
Field('Host', 'host.name'),
Field('Action', 'task.action'),
Field('Status', 'derived_status'),
Field('Ignore Errors'),
Field('Time Start'),
Field('Time End'),
Field('Duration'),
)
SHOW_FIELDS_LONG = SHOW_FIELDS + (
Field('Result', 'result|from_json',
template='{{ value | to_nice_json | safe }}'),
)
SHOW_FIELDS_RAW = SHOW_FIELDS + (
Field('Result', 'result | from_json'),
)
class ResultList(Lister):
""" Returns a list of results """
log = logging.getLogger(__name__)
Field('Duration'),
)
SHOW_FIELDS = (
Field('ID'),
Field('Name', 'task.name'),
Field('Playbook ID', 'task.playbook.id'),
Field('Playbook Path', 'task.playbook.path'),
Field('Play ID', 'task.play.id'),
Field('Play Name', 'task.play.name'),
Field('Task ID', 'task.id'),
Field('Task Name', 'task.name'),
Field('Host', 'host.name'),
Field('Action', 'task.action'),
Field('Status', 'derived_status'),
Field('Ignore Errors'),
Field('Time Start'),
Field('Time End'),
Field('Duration'),
)
SHOW_FIELDS_LONG = SHOW_FIELDS + (
Field('Result', 'result|from_json',
template='{{ value | to_nice_json | safe }}'),
)
SHOW_FIELDS_RAW = SHOW_FIELDS + (
Field('Result', 'result | from_json'),
)
class ResultList(Lister):
LIST_FIELDS = (
Field('ID'),
Field('Name', 'task.name'),
Field('Host', 'host.name'),
Field('Action', 'task.action'),
Field('Status', 'derived_status'),
Field('Ignore Errors'),
Field('Time Start'),
Field('Duration'),
)
SHOW_FIELDS = (
Field('ID'),
Field('Name', 'task.name'),
Field('Playbook ID', 'task.playbook.id'),
Field('Playbook Path', 'task.playbook.path'),
Field('Play ID', 'task.play.id'),
Field('Play Name', 'task.play.name'),
Field('Task ID', 'task.id'),
Field('Task Name', 'task.name'),
Field('Host', 'host.name'),
Field('Action', 'task.action'),
Field('Status', 'derived_status'),
Field('Ignore Errors'),
Field('Time Start'),
Field('Time End'),
Field('Duration'),
)
SHOW_FIELDS_LONG = SHOW_FIELDS + (
Field('Result', 'result|from_json',
template='{{ value | to_nice_json | safe }}'),
# You should have received a copy of the GNU General Public License
# along with ARA. If not, see .
import logging
from ara import models
from ara.fields import Field
from cliff.lister import Lister
from cliff.show import ShowOne
LIST_FIELDS = (
Field('ID'),
Field('Name'),
Field('Playbook', 'playbook.path'),
Field('Time Start'),
Field('Duration'),
)
SHOW_FIELDS = (
Field('ID'),
Field('Name'),
Field('Playbook ID', 'playbook.id'),
Field('Playbook Path', 'playbook.path'),
Field('Time Start'),
Field('Time End'),
Field('Duration'),
)
class PlayList(Lister):
""" Returns a list of plays """
log = logging.getLogger(__name__)
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ARA. If not, see .
import logging
from ara import models
from ara.fields import Field
from cliff.lister import Lister
from cliff.show import ShowOne
FIELDS = (
Field('ID'),
Field('Path'),
Field('Playbook ID', 'playbook.id'),
)
class FileList(Lister):
""" Returns a list of files """
log = logging.getLogger(__name__)
def get_parser(self, prog_name):
parser = super(FileList, self).get_parser(prog_name)
g = parser.add_mutually_exclusive_group(required=True)
g.add_argument(
'--playbook', '-b',
metavar='',
help='Show files associated with a specified playbook',