Esempio n. 1
0
cname_patch_parser.add_argument('name',
                                location="json",
                                help='The name of the alias record')
cname_patch_parser.remove_argument('absolute_name')

zone_model = api.clone('zones', entity_model)

external_host_parser = host_parser.copy()
external_host_parser.remove_argument('ip4_address')
external_host_parser.remove_argument('properties')
external_host_parser.remove_argument('ttl')

external_host_model = api.model(
    'external_host_records',
    {
        'absolute_name':
        fields.String(required=True,
                      description='The FQDN of the external host record')
    },
)

host_model = api.model(
    'host_records',
    {
        'absolute_name':
        fields.String(required=True,
                      description='The FQDN of the host record'),
        'ip4_address':
        fields.String(
            description='The IPv4 addresses associated with the host record'),
        'ttl':
        fields.Integer(description='The TTL of the host record'),
Esempio n. 2
0
ip4_network_config_block_ns = api.namespace(
    'ipv4_networks',
    path='/configurations/<string:configuration>/ipv4_blocks/',
    description='IPv4 Network operations',
)

ip4_address_post_model = api.model(
    'ip4_address_post',
    {
        'mac_address':
        fields.String(description='MAC Address value'),
        'hostinfo':
        fields.String(
            description=
            'A string containing host information for the address in the following format: '
            'hostname,viewId,reverseFlag,sameAsZoneFlag'),
        'action':
        fields.String(
            description=
            'Desired IP4 address state: MAKE_STATIC / MAKE_RESERVED / MAKE_DHCP_RESERVED'
        ),
        'properties':
        fields.String(description='The properties of the IP4 Address',
                      default='attribute=value|'),
    },
)

network_patch_model = api.model(
    'ipv4_networks_patch',
    {
        'name':
        fields.String(description='The name associated with the IP4 Network.'),
)

ip4_network_block_ns = api.namespace('ipv4_networks',
                                     path='/ipv4_blocks/',
                                     description='IPv4 Network operations')
ip4_network_config_block_ns = api.namespace(
    'ipv4_networks',
    path='/configurations/<string:configuration>/ipv4_blocks/',
    description='IPv4 Network operations',
)

network_patch_model = api.model(
    'ipv4_networks_patch',
    {
        'name':
        fields.String(description='The name associated with the IP4 Network.'),
        'properties':
        fields.String(description='The properties of the host record',
                      default='attribute=value|'),
    },
)

network_patch_parser = reqparse.RequestParser()
network_patch_parser.add_argument('name',
                                  location="json",
                                  help='The name of the network')
network_patch_parser.add_argument('properties',
                                  location="json",
                                  help='The properties of the record')


@ip4_block_root_ns.route('/')
Esempio n. 4
0
entity_parser.add_argument('name',
                           location="json",
                           help='The name of the entity.')
entity_parser.add_argument(
    'properties',
    location="json",
    help=
    'The properties of the entity in the following format:key=value|key=value|',
)

entity_model = api.model(
    'Entity Parameters',
    {
        'name':
        fields.String(description='The name of the entity.'),
        'properties':
        fields.String(
            description=
            'The properties of the entity in the following format:key=value|key=value|'
        ),
    },
)

entity_return_model = api.model(
    'Entity Object',
    {
        'id':
        fields.Integer(description='ID of the entity.'),
        'name':
        fields.String(description='The name of the entity.'),
        'type':
        fields.String(description='The type of the entity.'),
# Copyright 2020 BlueCat Networks. All rights reserved.

from flask_restplus import fields

from main_app import api

deployment_option_post_model = api.model(
    'deployment_options',
    {
        'name':
        fields.String(required=True,
                      description='Name of the Deployment Option'),
        'value':
        fields.String(
            required=True,
            description=
            'Comma separated values to assign to the Deployment Option'),
        'properties':
        fields.String(
            required=False,
            description='Additional properties for the Deployment Option'),
    },
)

deployment_role_post_model = api.model(
    'deployment_roles',
    {
        'server_fqdn':
        fields.String(
            required=True,
            description=