当前位置: 首页>>代码示例>>Python>>正文


Python settings.SPECS类代码示例

本文整理汇总了Python中networkapi.settings.SPECS的典型用法代码示例。如果您正苦于以下问题:Python SPECS类的具体用法?Python SPECS怎么用?Python SPECS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SPECS类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 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

示例5: 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

示例6: 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

示例7: 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

示例8: post

    def post(self, request, *args, **kwargs):
        """Create new environment."""

        envs = request.DATA
        json_validate(SPECS.get('environment_post')).validate(envs)
        response = list()
        for env in envs['environments']:

            env_obj = facade.create_environment(env)
            response.append({'id': env_obj.id})

        return Response(response, status=status.HTTP_201_CREATED)
开发者ID:globocom,项目名称:GloboNetworkAPI,代码行数:12,代码来源:views.py

示例9: get

    def get(self, request, *args, **kwargs):
        """Enable/Disable pool member by list"""

        try:
            way = kwargs['way']
            with open(SPECS.get(way)) as data_file:
                data = json.load(data_file)

            return Response(data)
        except Exception, exception:
            log.error(exception)
            raise Exception('Spec not exists')
开发者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: 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

示例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):
        """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

示例14: put

    def put(self, request, *args, **kwargs):
        """
        Update vrfs
        """
        vrfs = request.DATA
        json_validate(SPECS.get('vrf_put')).validate(vrfs)
        response = list()
        for vrf in vrfs['vrfs']:
            vrf = facade.update_vrf(vrf)
            response.append({
                'id': vrf.id
            })

        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


注:本文中的networkapi.settings.SPECS类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。