@

Home 

OpenStack Study: routers.py

OpenStack Index

**** CubicPower OpenStack Study ****

def append_v3_routers(mapper, routers):

    regions_controller = controllers.RegionV3()

    routers.append(router.Router(regions_controller,

                                 'regions', 'region'))

    # Need to add an additional route to support PUT /regions/{region_id}

    mapper.connect(

        '/regions/{region_id}',

        controller=regions_controller,

        action='create_region_with_id',

        conditions=dict(method=['PUT']))

    routers.append(router.Router(controllers.ServiceV3(),

                                 'services', 'service'))

    routers.append(router.Router(controllers.EndpointV3(),

                                 'endpoints', 'endpoint'))