Exemplo n.º 1
0
host_patch_parser.remove_argument('absolute_name')

cname_parser = host_parser.copy()
cname_parser.remove_argument('ip4_address')
cname_parser.add_argument(
    'linked_record',
    location="json",
    help='The name of the record to which this alias will link')

cname_patch_parser = cname_parser.copy()
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')
    },
)
Exemplo n.º 2
0
# Copyright 2020 BlueCat Networks. All rights reserved.

from main_app import api
from .entity_models import entity_model

configuration_model = api.clone(
    'configurations',
    entity_model
)
Exemplo n.º 3
0
# Copyright 2020 BlueCat Networks. All rights reserved.

from flask_restplus import fields

from main_app import api
from .configuration_models import entity_model

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

view_model = api.clone('views', entity_model)

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'),
    'ipv4_address',
    {
        '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|'),
    },
)

next_ip4_address_post_model = api.clone(
    'get_next_ip',
    ip4_address_post_model
)

ip4_address_patch_model = api.model(
    'ip4_address_patch',
    {
        'mac_address': fields.String(description='MAC Address value'),
        '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',