本文整理汇总了Python中networkapi.util.json_validate.json_validate函数的典型用法代码示例。如果您正苦于以下问题:Python json_validate函数的具体用法?Python json_validate怎么用?Python json_validate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了json_validate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: put
def put(self, request, *args, **kwargs):
"""Updates list of equipments."""
data = request.DATA
json_validate(SPECS.get('equipment_put_v4')).validate(data)
response = facade_v4.update_equipment(data['equipments'], request.user)
return Response(response, status=status.HTTP_200_OK)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:8,代码来源:views.py
示例2: post
def post(self, request, *args, **kwargs):
"""Creates list of equipments."""
data = request.DATA
json_validate(SPECS.get('equipment_post')).validate(data)
response = facade.create_equipment(data['equipments'], request.user)
return Response(response, status=status.HTTP_201_CREATED)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:8,代码来源:v3.py
示例3: put
def put(self, request, *args, **kwargs):
"""Enable/Disable pool member by list of server pool."""
pools = request.DATA
json_validate(SPECS.get('pool_member_status')).validate(pools)
response = facade_pool_deploy.set_poolmember_state(
pools, request.user)
return Response(response, status=status.HTTP_200_OK)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:9,代码来源:v3.py
示例4: post
def post(self, request, *args, **kwargs):
"""Create new RouteMapEntry."""
objects = request.DATA
json_validate(SPECS.get('routemap_post')).validate(objects)
response = list()
for obj in objects['route_map_entries']:
created_obj = facade.create_route_map_entry(obj)
response.append({'id': created_obj.id})
return Response(response, status=status.HTTP_201_CREATED)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:11,代码来源:views.py
示例5: post
def post(self, request, *args, **kwargs):
"""Save Ipv6."""
ips = request.DATA
json_validate(SPECS.get('ipv6_post_v4')).validate(ips)
response = list()
for ip in ips['ips']:
ret = facade_v3.create_ipv6(ip, request.user)
response.append({'id': ret.id})
return Response(response, status=status.HTTP_201_CREATED)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:11,代码来源:views.py
示例6: post
def post(self, request, *args, **kwargs):
"""Create new Neighbor."""
objects = request.DATA
json_validate(SPECS.get('neighbor_post')).validate(objects)
response = list()
for obj in objects.get('neighbors'):
created_obj = facade.create_neighbor(obj, request.user)
response.append({'id': created_obj.id})
return Response(response, status=status.HTTP_201_CREATED)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:11,代码来源:views.py
示例7: put
def put(self, request, *args, **kwargs):
"""Edit Ipv4."""
ips = request.DATA
json_validate(SPECS.get('ipv4_put_v4')).validate(ips)
response = list()
for ip in ips['ips']:
ret = facade_v3.update_ipv4(ip, request.user)
response.append({'id': ret.id})
return Response(response, status=status.HTTP_200_OK)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:11,代码来源:views.py
示例8: post
def post(self, request, *args, **kwargs):
"""
Create new vrfs
"""
vrfs = request.DATA
json_validate(SPECS.get('vrf_post')).validate(vrfs)
response = list()
for vrf in vrfs['vrfs']:
vrf = facade.create_vrf(vrf)
response.append({'id': vrf.id})
return Response(response, status=status.HTTP_201_CREATED)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:12,代码来源:views.py
示例9: post
def post(self, request, *args, **kwargs):
"""Create new ListConfigBGP."""
objects = request.DATA
json_validate(SPECS.get('list_config_bgp_post_v4')).validate(objects)
response = list()
for obj in objects['lists_config_bgp']:
created_obj = facade.create_list_config_bgp(obj)
response.append({'id': created_obj.id})
return Response(response, status=status.HTTP_201_CREATED)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:12,代码来源:views.py
示例10: post
def post(self, request, *args, **kwargs):
"""Create new AS."""
as_s = request.DATA
json_validate(SPECS.get('as_post_v4')).validate(as_s)
response = list()
for as_ in as_s['asns']:
as_obj = facade.create_as(as_)
response.append({'id': as_obj.id})
return Response(response, status=status.HTTP_201_CREATED)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:12,代码来源:views.py
示例11: put
def put(self, request, *args, **kwargs):
"""Updates list of vlans."""
data = request.DATA
json_validate(SPECS.get('vlan_put')).validate(data)
response = list()
for vlan in data['vlans']:
vl = facade.update_vlan(vlan, request.user)
response.append({'id': vl.id})
return Response(response, status=status.HTTP_200_OK)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:13,代码来源:v3.py
示例12: post
def post(self, request, *args, **kwargs):
"""Creates list of networkv4."""
data = request.DATA
json_validate(SPECS.get('networkv4_post')).validate(data)
response = list()
for networkv4 in data['networks']:
vl = facade.create_networkipv4(networkv4, request.user)
response.append({'id': vl.id})
return Response(response, status=status.HTTP_201_CREATED)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:13,代码来源:networkv4.py
示例13: put
def put(self, request, *args, **kwargs):
"""Update NeighborV4."""
objects = request.DATA
json_validate(SPECS.get('neighbor_v4_put_v4')).validate(objects)
response = list()
for obj in objects['neighbors']:
created_obj = facade.update_neighbor_v4(obj, request.user)
response.append({
'id': created_obj.id
})
return Response(response, status=status.HTTP_200_OK)
开发者ID:pantuza,项目名称:GloboNetworkAPI,代码行数:14,代码来源:views.py
示例14: put
def put(self, request, *args, **kwargs):
envs = request.DATA
json_validate(SPECS.get('environment_vip_put')).validate(envs)
response = list()
for env in envs['environments_vip']:
ret = facade.update_environment_vip(env)
response.append({
'id': ret.id,
'msg': 'success'
})
return Response(response, status=status.HTTP_200_OK)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:14,代码来源:views.py
示例15: post
def post(self, request, *args, **kwargs):
"""
Save server pool
"""
pools = request.DATA
json_validate(SPECS.get('pool_post')).validate(pools)
verify_ports(pools)
response = list()
for pool in pools['server_pools']:
pl = facade.create_pool(pool, request.user)
response.append({'id': pl.id})
return Response(response, status=status.HTTP_201_CREATED)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:14,代码来源:v3.py
示例16: put
def put(self, request, *args, **kwargs):
"""Updates list of networkv4."""
data = request.DATA
json_validate(SPECS.get('networkv4_put')).validate(data)
response = list()
for networkv4 in data['networks']:
vl = facade.update_networkipv4(networkv4, request.user,
force=True)
response.append({'id': vl.id})
return Response(response, status=status.HTTP_200_OK)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:14,代码来源:networkv4.py
示例17: put
def put(self, request, *args, **kwargs):
"""Update RouteMap."""
objects = request.DATA
json_validate(SPECS.get('route_map_put_v4')).validate(objects)
response = list()
for obj in objects['route_maps']:
created_obj = facade.update_route_map(obj)
response.append({
'id': created_obj.id
})
return Response(response, status=status.HTTP_200_OK)
开发者ID:pantuza,项目名称:GloboNetworkAPI,代码行数:14,代码来源:views.py
示例18: patch
def patch(self, request, *args, **kwargs):
"""
Updates list of vip request in equipments
"""
vips = request.DATA
json_validate(SPECS.get('vip_request_patch')).validate(vips)
locks_list = create_lock(vips.get('vips'), LOCK_VIP)
try:
response = facade.patch_real_vip_request(
vips['vips'], request.user)
except Exception, exception:
log.error(exception)
raise api_exceptions.NetworkAPIException(exception)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:14,代码来源:v3.py
示例19: put
def put(self, request, *args, **kwargs):
"""Update AS."""
as_s = request.DATA
json_validate(SPECS.get('as_put_v4')).validate(as_s)
response = list()
for as_ in as_s['asns']:
as_obj = facade.update_as(as_)
response.append({
'id': as_obj.id
})
return Response(response, status=status.HTTP_200_OK)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:14,代码来源:views.py
示例20: put
def put(self, request, *args, **kwargs):
"""
Updates list of vip request
"""
data = request.DATA
json_validate(SPECS.get('vip_request_put')).validate(data)
locks_list = create_lock(data['vips'], LOCK_VIP)
try:
verify_ports_vip(data)
for vip in data['vips']:
facade.update_vip_request(vip, request.user)
except Exception, exception:
log.error(exception)
raise api_exceptions.NetworkAPIException(exception)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:16,代码来源:v3.py
注:本文中的networkapi.util.json_validate.json_validate函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论