# Path: raxcli/apps/monitoring/utils.py
# class MonitoringEntityCommand(MonitoringCommand):
#     def get_parser(self, prog_name):
#         parser = super(MonitoringEntityCommand, self).\
#             get_parser(prog_name=prog_name)
#         parser.add_argument('--entity-id', dest='entity_id', required=True)
#         return parser
# 
# def get_client(parsed_args):
#     config = get_config()
#     driver = get_driver(Provider.RACKSPACE)
# 
#     username = config['username']
#     api_key = config['api_key']
#     if parsed_args.username:
#         username = parsed_args.username
#     if parsed_args.api_key:
#         api_key = parsed_args.api_key
# 
#     api_url = parsed_args.api_url
#     auth_url = parsed_args.auth_url
# 
#     if not username:
#         raise ValueError('Missing required argument: username')
# 
#     if not api_key:
#         raise ValueError('Missing required argument: api-key')
# 
#     options = {}
# 
#     if api_url is not None:
#         options['ex_force_base_url'] = api_url
# 
#     if auth_url is not None:
#         options['ex_force_auth_url'] = auth_url
# 
#     return driver(username, api_key, **options)
# 
# Path: raxcli/apps/monitoring/resources.py
# class Check(Model):
#     """
#     Check resource.
#     """
#     id = Attribute()
#     label = Attribute()
#     type = Attribute()
#     entity_id = Attribute(view_list=False)
#     monitoring_zones = Attribute(view_list=False)
#     period = Attribute(view_list=False)
#     timeout = Attribute(view_list=False)
#     target_alias = Attribute(view_list=False)
#     target_resolver = Attribute(view_list=False)
#     disabled = Attribute(view_list=False)
#     details = Attribute(view_list=False)


import logging
from cliff.show import ShowOne
from raxcli.apps.monitoring.utils import (MonitoringEntityCommand,
                                          get_client)
from raxcli.apps.monitoring.resources import Check
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.





class ShowCommand(MonitoringEntityCommand, ShowOne):
    """
    Show the details of a check.
    """
    log = logging.getLogger(__name__)

    def get_parser(self, prog_name):
        parser = super(ShowCommand, self).get_parser(prog_name=prog_name)
        parser.add_argument('--id', dest='check_id', required=True)
        return parser

    def take_action(self, parsed_args):
        client = get_client(parsed_args)

# Path: raxcli/apps/monitoring/utils.py
# class MonitoringEntityCommand(MonitoringCommand):
#     def get_parser(self, prog_name):
#         parser = super(MonitoringEntityCommand, self).\
#             get_parser(prog_name=prog_name)
#         parser.add_argument('--entity-id', dest='entity_id', required=True)
#         return parser
# 
# def get_client(parsed_args):
#     config = get_config()
#     driver = get_driver(Provider.RACKSPACE)
# 
#     username = config['username']
#     api_key = config['api_key']
#     if parsed_args.username:
#         username = parsed_args.username
#     if parsed_args.api_key:
#         api_key = parsed_args.api_key
# 
#     api_url = parsed_args.api_url
#     auth_url = parsed_args.auth_url
# 
#     if not username:
#         raise ValueError('Missing required argument: username')
# 
#     if not api_key:
#         raise ValueError('Missing required argument: api-key')
# 
#     options = {}
# 
#     if api_url is not None:
#         options['ex_force_base_url'] = api_url
# 
#     if auth_url is not None:
#         options['ex_force_auth_url'] = auth_url
# 
#     return driver(username, api_key, **options)
# 
# Path: raxcli/apps/monitoring/resources.py
# class Check(Model):
#     """
#     Check resource.
#     """
#     id = Attribute()
#     label = Attribute()
#     type = Attribute()
#     entity_id = Attribute(view_list=False)
#     monitoring_zones = Attribute(view_list=False)
#     period = Attribute(view_list=False)
#     timeout = Attribute(view_list=False)
#     target_alias = Attribute(view_list=False)
#     target_resolver = Attribute(view_list=False)
#     disabled = Attribute(view_list=False)
#     details = Attribute(view_list=False)


# Path: raxcli/apps/monitoring/commands/checks/show.py
import logging
from cliff.show import ShowOne
from raxcli.apps.monitoring.utils import (MonitoringEntityCommand,
                                          get_client)
from raxcli.apps.monitoring.resources import Check

# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.





class ShowCommand(MonitoringEntityCommand, ShowOne):
    """
    Show the details of a check.
    """
    log = logging.getLogger(__name__)

    def get_parser(self, prog_name):
        parser = super(ShowCommand, self).get_parser(prog_name=prog_name)
        parser.add_argument('--id', dest='check_id', required=True)
        return parser

    def take_action(self, parsed_args):
        client = get_client(parsed_args)

        check = Check(client.get_check(parsed_args.entity_id,