예제 #1
0
api = Api(app,
          version='1.0',
          title='Config service API',
          description='API for QWC Config service',
          default_label='Config query operations',
          doc='/api/')
# disable verbose 404 error message
app.config['ERROR_404_HELP'] = False

# create config service
config_service = ConfigService(app.logger)

# Api models
last_update_response = create_model(api, 'LastUpdate', [[
    'permissions_updated_at',
    fields.String(required=True,
                  description='Timestamp of last permissions update',
                  example='2018-07-09 12:00:00')
]])

cache_project_settings_response = create_model(api, 'CacheProjectSettings', [[
    'cached_settings',
    fields.Raw(
        required=True,
        description='List of service names for which settings were cached',
        example=['name1', 'name2'])
]])

resource_permissions_response = create_model(
    api, 'Resource permissions',
    [[
        'resource_type',
예제 #2
0
    doc='/api/',
)
# disable verbose 404 error message
app.config['ERROR_404_HELP'] = False

# Setup the Flask-JWT-Extended extension
jwt = jwt_manager(app, api)

# create data service
data_service = DataService(app.logger)

# Api models
geojson_crs_properties = create_model(api, 'CRS Properties', [
    [
        'name',
        fields.String(required=True,
                      description='OGC CRS URN',
                      example='urn:ogc:def:crs:EPSG::3857')
    ],
])

geojson_crs = create_model(
    api, 'CRS', [[
        'type',
        fields.String(required=True, description='CRS type', example='name')
    ],
                 [
                     'properties',
                     fields.Nested(geojson_crs_properties,
                                   required=True,
                                   description='CRS properties')
                 ]])