Merge "Add attribute type for neutron resources"

This commit is contained in:
Jenkins 2015-06-03 01:09:08 +00:00 committed by Gerrit Code Review
commit df0d908bfc
11 changed files with 167 additions and 83 deletions

View File

@ -340,47 +340,61 @@ class FirewallRule(neutron.NeutronResource):
attributes_schema = { attributes_schema = {
NAME_ATTR: attributes.Schema( NAME_ATTR: attributes.Schema(
_('Name for the firewall rule.') _('Name for the firewall rule.'),
type=attributes.Schema.STRING
), ),
DESCRIPTION_ATTR: attributes.Schema( DESCRIPTION_ATTR: attributes.Schema(
_('Description of the firewall rule.') _('Description of the firewall rule.'),
type=attributes.Schema.STRING
), ),
FIREWALL_POLICY_ID: attributes.Schema( FIREWALL_POLICY_ID: attributes.Schema(
_('Unique identifier of the firewall policy to which this ' _('Unique identifier of the firewall policy to which this '
'firewall rule belongs.') 'firewall rule belongs.'),
type=attributes.Schema.STRING
), ),
SHARED_ATTR: attributes.Schema( SHARED_ATTR: attributes.Schema(
_('Shared status of this firewall rule.') _('Shared status of this firewall rule.'),
type=attributes.Schema.STRING
), ),
PROTOCOL_ATTR: attributes.Schema( PROTOCOL_ATTR: attributes.Schema(
_('Protocol value for this firewall rule.') _('Protocol value for this firewall rule.'),
type=attributes.Schema.STRING
), ),
IP_VERSION_ATTR: attributes.Schema( IP_VERSION_ATTR: attributes.Schema(
_('Ip_version for this firewall rule.') _('Ip_version for this firewall rule.'),
type=attributes.Schema.STRING
), ),
SOURCE_IP_ADDRESS_ATTR: attributes.Schema( SOURCE_IP_ADDRESS_ATTR: attributes.Schema(
_('Source ip_address for this firewall rule.') _('Source ip_address for this firewall rule.'),
type=attributes.Schema.STRING
), ),
DESTINATION_IP_ADDRESS_ATTR: attributes.Schema( DESTINATION_IP_ADDRESS_ATTR: attributes.Schema(
_('Destination ip_address for this firewall rule.') _('Destination ip_address for this firewall rule.'),
type=attributes.Schema.STRING
), ),
SOURCE_PORT_ATTR: attributes.Schema( SOURCE_PORT_ATTR: attributes.Schema(
_('Source port range for this firewall rule.') _('Source port range for this firewall rule.'),
type=attributes.Schema.STRING
), ),
DESTINATION_PORT_ATTR: attributes.Schema( DESTINATION_PORT_ATTR: attributes.Schema(
_('Destination port range for this firewall rule.') _('Destination port range for this firewall rule.'),
type=attributes.Schema.STRING
), ),
ACTION_ATTR: attributes.Schema( ACTION_ATTR: attributes.Schema(
_('Allow or deny action for this firewall rule.') _('Allow or deny action for this firewall rule.'),
type=attributes.Schema.STRING
), ),
ENABLED_ATTR: attributes.Schema( ENABLED_ATTR: attributes.Schema(
_('Indicates whether this firewall rule is enabled or not.') _('Indicates whether this firewall rule is enabled or not.'),
type=attributes.Schema.STRING
), ),
POSITION: attributes.Schema( POSITION: attributes.Schema(
_('Position of the rule within the firewall policy.') _('Position of the rule within the firewall policy.'),
type=attributes.Schema.STRING
), ),
TENANT_ID: attributes.Schema( TENANT_ID: attributes.Schema(
_('Id of the tenant owning the firewall.') _('Id of the tenant owning the firewall.'),
type=attributes.Schema.STRING
), ),
} }

View File

@ -98,25 +98,32 @@ class FloatingIP(neutron.NeutronResource):
attributes_schema = { attributes_schema = {
ROUTER_ID: attributes.Schema( ROUTER_ID: attributes.Schema(
_('ID of the router used as gateway, set when associated with a ' _('ID of the router used as gateway, set when associated with a '
'port.') 'port.'),
type=attributes.Schema.STRING
), ),
TENANT_ID: attributes.Schema( TENANT_ID: attributes.Schema(
_('The tenant owning this floating IP.') _('The tenant owning this floating IP.'),
type=attributes.Schema.STRING
), ),
FLOATING_NETWORK_ID_ATTR: attributes.Schema( FLOATING_NETWORK_ID_ATTR: attributes.Schema(
_('ID of the network in which this IP is allocated.') _('ID of the network in which this IP is allocated.'),
type=attributes.Schema.STRING
), ),
FIXED_IP_ADDRESS_ATTR: attributes.Schema( FIXED_IP_ADDRESS_ATTR: attributes.Schema(
_('IP address of the associated port, if specified.') _('IP address of the associated port, if specified.'),
type=attributes.Schema.STRING
), ),
FLOATING_IP_ADDRESS_ATTR: attributes.Schema( FLOATING_IP_ADDRESS_ATTR: attributes.Schema(
_('The allocated address of this IP.') _('The allocated address of this IP.'),
type=attributes.Schema.STRING
), ),
PORT_ID_ATTR: attributes.Schema( PORT_ID_ATTR: attributes.Schema(
_('ID of the port associated with this IP.') _('ID of the port associated with this IP.'),
type=attributes.Schema.STRING
), ),
SHOW: attributes.Schema( SHOW: attributes.Schema(
_('All attributes.') _('All attributes.'),
type=attributes.Schema.MAP
), ),
} }

View File

@ -104,39 +104,50 @@ class HealthMonitor(neutron.NeutronResource):
attributes_schema = { attributes_schema = {
ADMIN_STATE_UP_ATTR: attributes.Schema( ADMIN_STATE_UP_ATTR: attributes.Schema(
_('The administrative state of this health monitor.') _('The administrative state of this health monitor.'),
type=attributes.Schema.STRING
), ),
DELAY_ATTR: attributes.Schema( DELAY_ATTR: attributes.Schema(
_('The minimum time in seconds between regular connections ' _('The minimum time in seconds between regular connections '
'of the member.') 'of the member.'),
type=attributes.Schema.STRING
), ),
EXPECTED_CODES_ATTR: attributes.Schema( EXPECTED_CODES_ATTR: attributes.Schema(
_('The list of HTTP status codes expected in response ' _('The list of HTTP status codes expected in response '
'from the member to declare it healthy.') 'from the member to declare it healthy.'),
type=attributes.Schema.LIST
), ),
HTTP_METHOD_ATTR: attributes.Schema( HTTP_METHOD_ATTR: attributes.Schema(
_('The HTTP method used for requests by the monitor of type HTTP.') _('The HTTP method used for requests by the monitor of '
'type HTTP.'),
type=attributes.Schema.STRING
), ),
MAX_RETRIES_ATTR: attributes.Schema( MAX_RETRIES_ATTR: attributes.Schema(
_('Number of permissible connection failures before changing ' _('Number of permissible connection failures before changing '
'the member status to INACTIVE.') 'the member status to INACTIVE.'),
type=attributes.Schema.STRING
), ),
TIMEOUT_ATTR: attributes.Schema( TIMEOUT_ATTR: attributes.Schema(
_('Maximum number of seconds for a monitor to wait for a ' _('Maximum number of seconds for a monitor to wait for a '
'connection to be established before it times out.') 'connection to be established before it times out.'),
type=attributes.Schema.STRING
), ),
TYPE_ATTR: attributes.Schema( TYPE_ATTR: attributes.Schema(
_('One of predefined health monitor types.') _('One of predefined health monitor types.'),
type=attributes.Schema.STRING
), ),
URL_PATH_ATTR: attributes.Schema( URL_PATH_ATTR: attributes.Schema(
_('The HTTP path used in the HTTP request used by the monitor ' _('The HTTP path used in the HTTP request used by the monitor '
'to test a member health.') 'to test a member health.'),
type=attributes.Schema.STRING
), ),
TENANT_ID: attributes.Schema( TENANT_ID: attributes.Schema(
_('Tenant owning the health monitor.') _('Tenant owning the health monitor.'),
type=attributes.Schema.STRING
), ),
SHOW: attributes.Schema( SHOW: attributes.Schema(
_('All attributes.') _('All attributes.'),
type=attributes.Schema.MAP
), ),
} }

View File

@ -58,13 +58,16 @@ class MeteringLabel(neutron.NeutronResource):
attributes_schema = { attributes_schema = {
NAME_ATTR: attributes.Schema( NAME_ATTR: attributes.Schema(
_('Name of the metering label.') _('Name of the metering label.'),
type=attributes.Schema.STRING
), ),
DESCRIPTION_ATTR: attributes.Schema( DESCRIPTION_ATTR: attributes.Schema(
_('Description of the metering label.') _('Description of the metering label.'),
type=attributes.Schema.STRING
), ),
SHARED_ATTR: attributes.Schema( SHARED_ATTR: attributes.Schema(
_('Shared status of the metering label.') _('Shared status of the metering label.'),
type=attributes.Schema.STRING
), ),
} }

View File

@ -79,22 +79,28 @@ class Net(neutron.NeutronResource):
attributes_schema = { attributes_schema = {
STATUS: attributes.Schema( STATUS: attributes.Schema(
_("The status of the network.") _("The status of the network."),
type=attributes.Schema.STRING
), ),
NAME_ATTR: attributes.Schema( NAME_ATTR: attributes.Schema(
_("The name of the network.") _("The name of the network."),
type=attributes.Schema.STRING
), ),
SUBNETS: attributes.Schema( SUBNETS: attributes.Schema(
_("Subnets of this network.") _("Subnets of this network."),
type=attributes.Schema.LIST
), ),
ADMIN_STATE_UP_ATTR: attributes.Schema( ADMIN_STATE_UP_ATTR: attributes.Schema(
_("The administrative status of the network.") _("The administrative status of the network."),
type=attributes.Schema.STRING
), ),
TENANT_ID_ATTR: attributes.Schema( TENANT_ID_ATTR: attributes.Schema(
_("The tenant owning this network.") _("The tenant owning this network."),
type=attributes.Schema.STRING
), ),
SHOW: attributes.Schema( SHOW: attributes.Schema(
_("All attributes.") _("All attributes."),
type=attributes.Schema.MAP
), ),
} }

View File

@ -138,10 +138,12 @@ class NetworkGateway(neutron.NeutronResource):
attributes_schema = { attributes_schema = {
DEFAULT: attributes.Schema( DEFAULT: attributes.Schema(
_("A boolean value of default flag.") _("A boolean value of default flag."),
type=attributes.Schema.STRING
), ),
SHOW: attributes.Schema( SHOW: attributes.Schema(
_("All attributes.") _("All attributes."),
type=attributes.Schema.MAP
), ),
} }

View File

@ -221,44 +221,57 @@ class Port(neutron.NeutronResource):
attributes_schema = { attributes_schema = {
ADMIN_STATE_UP_ATTR: attributes.Schema( ADMIN_STATE_UP_ATTR: attributes.Schema(
_("The administrative state of this port.") _("The administrative state of this port."),
type=attributes.Schema.STRING
), ),
DEVICE_ID_ATTR: attributes.Schema( DEVICE_ID_ATTR: attributes.Schema(
_("Unique identifier for the device.") _("Unique identifier for the device."),
type=attributes.Schema.STRING
), ),
DEVICE_OWNER: attributes.Schema( DEVICE_OWNER: attributes.Schema(
_("Name of the network owning the port.") _("Name of the network owning the port."),
type=attributes.Schema.STRING
), ),
FIXED_IPS_ATTR: attributes.Schema( FIXED_IPS_ATTR: attributes.Schema(
_("Fixed IP addresses.") _("Fixed IP addresses."),
type=attributes.Schema.LIST
), ),
MAC_ADDRESS_ATTR: attributes.Schema( MAC_ADDRESS_ATTR: attributes.Schema(
_("MAC address of the port.") _("MAC address of the port."),
type=attributes.Schema.STRING
), ),
NAME_ATTR: attributes.Schema( NAME_ATTR: attributes.Schema(
_("Friendly name of the port.") _("Friendly name of the port."),
type=attributes.Schema.STRING
), ),
NETWORK_ID_ATTR: attributes.Schema( NETWORK_ID_ATTR: attributes.Schema(
_("Unique identifier for the network owning the port.") _("Unique identifier for the network owning the port."),
type=attributes.Schema.STRING
), ),
SECURITY_GROUPS_ATTR: attributes.Schema( SECURITY_GROUPS_ATTR: attributes.Schema(
_("A list of security groups for the port.") _("A list of security groups for the port."),
type=attributes.Schema.LIST
), ),
STATUS: attributes.Schema( STATUS: attributes.Schema(
_("The status of the port.") _("The status of the port."),
type=attributes.Schema.STRING
), ),
TENANT_ID: attributes.Schema( TENANT_ID: attributes.Schema(
_("Tenant owning the port.") _("Tenant owning the port."),
type=attributes.Schema.STRING
), ),
ALLOWED_ADDRESS_PAIRS_ATTR: attributes.Schema( ALLOWED_ADDRESS_PAIRS_ATTR: attributes.Schema(
_("Additional MAC/IP address pairs allowed to pass through " _("Additional MAC/IP address pairs allowed to pass through "
"a port.") "a port."),
type=attributes.Schema.LIST
), ),
SHOW: attributes.Schema( SHOW: attributes.Schema(
_("All attributes.") _("All attributes."),
type=attributes.Schema.MAP
), ),
SUBNETS_ATTR: attributes.Schema( SUBNETS_ATTR: attributes.Schema(
_("A list of all subnet attributes for the port.") _("A list of all subnet attributes for the port."),
type=attributes.Schema.LIST
), ),
} }

View File

@ -76,13 +76,16 @@ class ProviderNet(net.Net):
attributes_schema = { attributes_schema = {
STATUS: attributes.Schema( STATUS: attributes.Schema(
_("The status of the network.") _("The status of the network."),
type=attributes.Schema.STRING
), ),
SUBNETS: attributes.Schema( SUBNETS: attributes.Schema(
_("Subnets of this network.") _("Subnets of this network."),
type=attributes.Schema.LIST
), ),
SHOW: attributes.Schema( SHOW: attributes.Schema(
_("All attributes.") _("All attributes."),
type=attributes.Schema.MAP
), ),
} }

View File

@ -128,22 +128,28 @@ class Router(neutron.NeutronResource):
attributes_schema = { attributes_schema = {
STATUS: attributes.Schema( STATUS: attributes.Schema(
_("The status of the router.") _("The status of the router."),
type=attributes.Schema.STRING
), ),
EXTERNAL_GATEWAY_INFO_ATTR: attributes.Schema( EXTERNAL_GATEWAY_INFO_ATTR: attributes.Schema(
_("Gateway network for the router.") _("Gateway network for the router."),
type=attributes.Schema.MAP
), ),
NAME_ATTR: attributes.Schema( NAME_ATTR: attributes.Schema(
_("Friendly name of the router.") _("Friendly name of the router."),
type=attributes.Schema.STRING
), ),
ADMIN_STATE_UP_ATTR: attributes.Schema( ADMIN_STATE_UP_ATTR: attributes.Schema(
_("Administrative state of the router.") _("Administrative state of the router."),
type=attributes.Schema.STRING
), ),
TENANT_ID: attributes.Schema( TENANT_ID: attributes.Schema(
_("Tenant owning the router.") _("Tenant owning the router."),
type=attributes.Schema.STRING
), ),
SHOW: attributes.Schema( SHOW: attributes.Schema(
_("All attributes.") _("All attributes."),
type=attributes.Schema.MAP
), ),
} }

View File

@ -199,37 +199,48 @@ class Subnet(neutron.NeutronResource):
attributes_schema = { attributes_schema = {
NAME_ATTR: attributes.Schema( NAME_ATTR: attributes.Schema(
_("Friendly name of the subnet.") _("Friendly name of the subnet."),
type=attributes.Schema.STRING
), ),
NETWORK_ID_ATTR: attributes.Schema( NETWORK_ID_ATTR: attributes.Schema(
_("Parent network of the subnet.") _("Parent network of the subnet."),
type=attributes.Schema.STRING
), ),
TENANT_ID_ATTR: attributes.Schema( TENANT_ID_ATTR: attributes.Schema(
_("Tenant owning the subnet.") _("Tenant owning the subnet."),
type=attributes.Schema.STRING
), ),
ALLOCATION_POOLS_ATTR: attributes.Schema( ALLOCATION_POOLS_ATTR: attributes.Schema(
_("Ip allocation pools and their ranges.") _("Ip allocation pools and their ranges."),
type=attributes.Schema.LIST
), ),
GATEWAY_IP_ATTR: attributes.Schema( GATEWAY_IP_ATTR: attributes.Schema(
_("Ip of the subnet's gateway.") _("Ip of the subnet's gateway."),
type=attributes.Schema.STRING
), ),
HOST_ROUTES_ATTR: attributes.Schema( HOST_ROUTES_ATTR: attributes.Schema(
_("Additional routes for this subnet.") _("Additional routes for this subnet."),
type=attributes.Schema.LIST
), ),
IP_VERSION_ATTR: attributes.Schema( IP_VERSION_ATTR: attributes.Schema(
_("Ip version for the subnet.") _("Ip version for the subnet."),
type=attributes.Schema.STRING
), ),
CIDR_ATTR: attributes.Schema( CIDR_ATTR: attributes.Schema(
_("CIDR block notation for this subnet.") _("CIDR block notation for this subnet."),
type=attributes.Schema.STRING
), ),
DNS_NAMESERVERS_ATTR: attributes.Schema( DNS_NAMESERVERS_ATTR: attributes.Schema(
_("List of dns nameservers.") _("List of dns nameservers."),
type=attributes.Schema.LIST
), ),
ENABLE_DHCP_ATTR: attributes.Schema( ENABLE_DHCP_ATTR: attributes.Schema(
_("'true' if DHCP is enabled for this subnet; 'false' otherwise.") _("'true' if DHCP is enabled for this subnet; 'false' otherwise."),
type=attributes.Schema.STRING
), ),
SHOW: attributes.Schema( SHOW: attributes.Schema(
_("All attributes.") _("All attributes."),
type=attributes.Schema.MAP
), ),
} }

View File

@ -99,30 +99,38 @@ class VPNService(neutron.NeutronResource):
attributes_schema = { attributes_schema = {
ADMIN_STATE_UP_ATTR: attributes.Schema( ADMIN_STATE_UP_ATTR: attributes.Schema(
_('The administrative state of the vpn service.') _('The administrative state of the vpn service.'),
type=attributes.Schema.STRING
), ),
DESCRIPTION_ATTR: attributes.Schema( DESCRIPTION_ATTR: attributes.Schema(
_('The description of the vpn service.') _('The description of the vpn service.'),
type=attributes.Schema.STRING
), ),
NAME_ATTR: attributes.Schema( NAME_ATTR: attributes.Schema(
_('The name of the vpn service.') _('The name of the vpn service.'),
type=attributes.Schema.STRING
), ),
ROUTER_ID_ATTR: attributes.Schema( ROUTER_ID_ATTR: attributes.Schema(
_('The unique identifier of the router to which the vpn service ' _('The unique identifier of the router to which the vpn service '
'was inserted.') 'was inserted.'),
type=attributes.Schema.STRING
), ),
STATUS: attributes.Schema( STATUS: attributes.Schema(
_('The status of the vpn service.') _('The status of the vpn service.'),
type=attributes.Schema.STRING
), ),
SUBNET_ID_ATTR: attributes.Schema( SUBNET_ID_ATTR: attributes.Schema(
_('The unique identifier of the subnet in which the vpn service ' _('The unique identifier of the subnet in which the vpn service '
'was created.') 'was created.'),
type=attributes.Schema.STRING
), ),
TENANT_ID: attributes.Schema( TENANT_ID: attributes.Schema(
_('The unique identifier of the tenant owning the vpn service.') _('The unique identifier of the tenant owning the vpn service.'),
type=attributes.Schema.STRING
), ),
SHOW: attributes.Schema( SHOW: attributes.Schema(
_('All attributes.') _('All attributes.'),
type=attributes.Schema.MAP
), ),
} }