Пример #1
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.

import logging

from cliff.lister import Lister
from cliff.show import ShowOne
from ara import models
from ara.fields import Field

LIST_FIELDS = (
    Field('ID'),
    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('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'),
Пример #2
0
#       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.

import logging

from cliff.lister import Lister
from cliff.show import ShowOne
from ara import models
from ara.fields import Field

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__)

    def get_parser(self, prog_name):
        parser = super(DataList, self).get_parser(prog_name)
        g = parser.add_mutually_exclusive_group(required=True)
Пример #3
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.

import logging
import six

from ara import models
from ara.fields import Field
from cliff.lister import Lister
from cliff.show import ShowOne
from oslo_serialization import jsonutils

LIST_FIELDS = (Field('ID'), Field('Name'), Field('Playbook ID', 'playbook.id'),
               Field('Latest facts', 'facts.timestamp'))

SHOW_FIELDS = (Field('ID'), Field('Name'), Field('Playbook ID', 'playbook.id'),
               Field('Playbook Path',
                     'playbook.path'), Field('Latest facts',
                                             'facts.timestamp'))


class HostList(Lister):
    """ Returns a list of hosts """
    log = logging.getLogger(__name__)

    def get_parser(self, prog_name):
        parser = super(HostList, self).get_parser(prog_name)
        g = parser.add_mutually_exclusive_group(required=True)
Пример #4
0
#  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 <http://www.gnu.org/licenses/>.

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',
Пример #5
0
#   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.

import logging

from ara import models
from ara.models import db
from ara.fields import Field
from cliff.lister import Lister
from cliff.show import ShowOne
from cliff.command import Command

LIST_FIELDS = (
    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 }}'))

Пример #6
0
#   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.

import logging

from cliff.lister import Lister
from cliff.show import ShowOne
from cliff.command import Command
from ara import models
from ara.models import db
from ara.fields import Field

LIST_FIELDS = (
    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'),
Пример #7
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.

import logging

from ara import models
from ara.fields import Field
from cliff.lister import Lister
from cliff.show import ShowOne

COMMON_FIELDS = (
    Field('Changed'),
    Field('Failed'),
    Field('Ok'),
    Field('Skipped'),
    Field('Unreachable'),
)

LIST_FIELDS = (
    Field('ID'),
    Field('Host', 'host.name'),
    Field('Playbook', 'playbook.path'),
) + COMMON_FIELDS

SHOW_FIELDS = (
    Field('ID'),
    Field('Host', 'host.name'),
Пример #8
0
#  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 <http://www.gnu.org/licenses/>.

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'),
)
Пример #9
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.
#

import logging

from cliff.lister import Lister
from cliff.show import ShowOne
from ara import models
from ara.fields import Field

LIST_FIELDS = (
    Field('ID'),
    Field('Name'),
    Field('Path'),
    Field('Line', 'lineno'),
    Field('Action'),
    Field('Time Start'),
    Field('Duration'),
)

SHOW_FIELDS = (
    Field('ID'),
    Field('Name'),
    Field('Playbook ID', 'playbook.id'),
    Field('Playbook Path', 'playbook.path'),
    Field('Play ID', 'play.id'),
    Field('Play Name', 'play.name'),
Пример #10
0
#  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 <http://www.gnu.org/licenses/>.

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('Path'),
    Field('Line', 'lineno'),
    Field('Action'),
    Field('Time Start'),
    Field('Duration'),
)

SHOW_FIELDS = (
    Field('ID'),
    Field('Name'),
    Field('Playbook ID', 'playbook.id'),
    Field('Playbook Path', 'playbook.path'),
    Field('Play ID', 'play.id'),
    Field('Play Name', 'play.name'),
Пример #11
0
#   WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#   License for the specific language governing permissions and limitations
#   under the License.
#

import json
import logging
import six

from cliff.lister import Lister
from cliff.show import ShowOne
from ara import models
from ara.fields import Field

LIST_FIELDS = (
    Field('ID'),
    Field('Name'),
    Field('Playbook ID', 'playbook.id'),
    Field('Latest facts', 'facts.timestamp')
)

SHOW_FIELDS = (
    Field('ID'),
    Field('Name'),
    Field('Playbook ID', 'playbook.id'),
    Field('Playbook Path', 'playbook.path'),
    Field('Latest facts', 'facts.timestamp')
)


class HostList(Lister):