#
# 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.

import pecan

import wsmeext.pecan as wsme_pecan

from solum.api.controllers.camp.datamodel import camp_v1_1_endpoint as model

from solum.common import exception


description_string = "Solum CAMP v1.1 API platform_endpoint resource."


class Controller(object):
    """camp_v1_1_endpoint controller"""

    @exception.wrap_wsme_controller_exception
    @wsme_pecan.wsexpose(model.CAMP_V1_1_Endpoint)
    def index(self):
        return model.CAMP_V1_1_Endpoint(uri=pecan.request.host_url +
                                         '/camp/camp_v1_1_endpoint/',
                                        name='Solum_CAMP_V1_1_endpoint',
                                        type='platform_endpoint',
                                        description=description_string,
                                        platform_uri=pecan.request.host_url +
                                         '/camp/v1_1/platform/',
                                        specification_version='CAMP 1.1',
                                       implementation_version='Solum CAMP 1.1',
                                        auth_scheme='KEYSTONE-2.0')
