Add documentation to the firewall properties

miss documentation for the firewall properties,add it.

ref:
  http://docs.openstack.org/api/openstack-network/2.0/content/fwaas_ext_ops_firewall.html

Change-Id: I7bca7d29b05133d11ed53dede0caa561e792fa09
This commit is contained in:
Zhang Yang 2014-03-04 01:56:13 -08:00
parent 96f427b592
commit 2951c2caf3
1 changed files with 57 additions and 28 deletions

View File

@ -37,32 +37,39 @@ class Firewall(neutron.NeutronResource):
properties_schema = { properties_schema = {
NAME: properties.Schema( NAME: properties.Schema(
properties.Schema.STRING, properties.Schema.STRING,
_('Name for the firewall.'),
update_allowed=True update_allowed=True
), ),
DESCRIPTION: properties.Schema( DESCRIPTION: properties.Schema(
properties.Schema.STRING, properties.Schema.STRING,
_('Description for the firewall.'),
update_allowed=True update_allowed=True
), ),
ADMIN_STATE_UP: properties.Schema( ADMIN_STATE_UP: properties.Schema(
properties.Schema.BOOLEAN, properties.Schema.BOOLEAN,
_('Administrative state of the firewall. If false (down), '
'firewall does not forward packets and will drop all '
'traffic to/from VMs behind the firewall.'),
default=True, default=True,
update_allowed=True update_allowed=True
), ),
FIREWALL_POLICY_ID: properties.Schema( FIREWALL_POLICY_ID: properties.Schema(
properties.Schema.STRING, properties.Schema.STRING,
_('The ID of the firewall policy that this firewall is '
'associated with.'),
required=True, required=True,
update_allowed=True update_allowed=True
), ),
} }
attributes_schema = { attributes_schema = {
'name': _('Name for the Firewall.'), 'name': _('Name for the firewall.'),
'description': _('Description of the Firewall.'), 'description': _('Description of the firewall.'),
'admin_state_up': _('The administrative state of the Firewall.'), 'admin_state_up': _('The administrative state of the firewall.'),
'firewall_policy_id': _('Unique identifier of the FirewallPolicy ' 'firewall_policy_id': _('Unique identifier of the firewall policy '
'used to create the Firewall.'), 'used to create the firewall.'),
'status': _('The status of the Firewall.'), 'status': _('The status of the firewall.'),
'tenant_id': _('Id of the tenant owning the Firewall.'), 'tenant_id': _('Id of the tenant owning the firewall.'),
'show': _('All attributes.'), 'show': _('All attributes.'),
} }
@ -108,36 +115,45 @@ class FirewallPolicy(neutron.NeutronResource):
properties_schema = { properties_schema = {
NAME: properties.Schema( NAME: properties.Schema(
properties.Schema.STRING, properties.Schema.STRING,
_('Name for the firewall policy.'),
update_allowed=True update_allowed=True
), ),
DESCRIPTION: properties.Schema( DESCRIPTION: properties.Schema(
properties.Schema.STRING, properties.Schema.STRING,
_('Description for the firewall policy.'),
update_allowed=True update_allowed=True
), ),
SHARED: properties.Schema( SHARED: properties.Schema(
properties.Schema.BOOLEAN, properties.Schema.BOOLEAN,
_('Whether this policy should be shared across all tenants.'),
default=False, default=False,
update_allowed=True update_allowed=True
), ),
AUDITED: properties.Schema( AUDITED: properties.Schema(
properties.Schema.BOOLEAN, properties.Schema.BOOLEAN,
_('Whether this policy should be audited. When set to True, '
'each time the firewall policy or the associated firewall '
'rules are changed, this attribute will be set to False and '
'will have to be explicitly set to True through an update '
'operation.'),
default=False, default=False,
update_allowed=True update_allowed=True
), ),
FIREWALL_RULES: properties.Schema( FIREWALL_RULES: properties.Schema(
properties.Schema.LIST, properties.Schema.LIST,
_('An ordered list of firewall rules to apply to the firewall.'),
required=True, required=True,
update_allowed=True update_allowed=True
), ),
} }
attributes_schema = { attributes_schema = {
'name': _('Name for the FirewallPolicy.'), 'name': _('Name for the firewall policy.'),
'description': _('Description of the FirewallPolicy.'), 'description': _('Description of the firewall policy.'),
'firewall_rules': _('List of FirewallRules in this FirewallPolicy.'), 'firewall_rules': _('List of firewall rules in this firewall policy.'),
'shared': _('Shared status of this FirewallPolicy.'), 'shared': _('Shared status of this firewall policy.'),
'audited': _('Audit status of this FirewallPolicy.'), 'audited': _('Audit status of this firewall policy.'),
'tenant_id': _('Id of the tenant owning the FirewallPolicy.') 'tenant_id': _('Id of the tenant owning the firewall policy.')
} }
update_allowed_keys = ('Properties',) update_allowed_keys = ('Properties',)
@ -187,19 +203,23 @@ class FirewallRule(neutron.NeutronResource):
properties_schema = { properties_schema = {
NAME: properties.Schema( NAME: properties.Schema(
properties.Schema.STRING, properties.Schema.STRING,
_('Name for the firewall rule.'),
update_allowed=True update_allowed=True
), ),
DESCRIPTION: properties.Schema( DESCRIPTION: properties.Schema(
properties.Schema.STRING, properties.Schema.STRING,
_('Description for the firewall rule.'),
update_allowed=True update_allowed=True
), ),
SHARED: properties.Schema( SHARED: properties.Schema(
properties.Schema.BOOLEAN, properties.Schema.BOOLEAN,
_('Whether this rule should be shared across all tenants.'),
default=False, default=False,
update_allowed=True update_allowed=True
), ),
PROTOCOL: properties.Schema( PROTOCOL: properties.Schema(
properties.Schema.STRING, properties.Schema.STRING,
_('Protocol for the firewall rule.'),
constraints=[ constraints=[
constraints.AllowedValues(['tcp', 'udp', 'icmp', None]), constraints.AllowedValues(['tcp', 'udp', 'icmp', None]),
], ],
@ -207,6 +227,7 @@ class FirewallRule(neutron.NeutronResource):
), ),
IP_VERSION: properties.Schema( IP_VERSION: properties.Schema(
properties.Schema.STRING, properties.Schema.STRING,
_('Internet protocol version.'),
default='4', default='4',
constraints=[ constraints=[
constraints.AllowedValues(['4', '6']), constraints.AllowedValues(['4', '6']),
@ -215,22 +236,27 @@ class FirewallRule(neutron.NeutronResource):
), ),
SOURCE_IP_ADDRESS: properties.Schema( SOURCE_IP_ADDRESS: properties.Schema(
properties.Schema.STRING, properties.Schema.STRING,
_('Source IP address or CIDR.'),
update_allowed=True update_allowed=True
), ),
DESTINATION_IP_ADDRESS: properties.Schema( DESTINATION_IP_ADDRESS: properties.Schema(
properties.Schema.STRING, properties.Schema.STRING,
_('Destination IP address or CIDR.'),
update_allowed=True update_allowed=True
), ),
SOURCE_PORT: properties.Schema( SOURCE_PORT: properties.Schema(
properties.Schema.STRING, properties.Schema.STRING,
_('Source port number or a range.'),
update_allowed=True update_allowed=True
), ),
DESTINATION_PORT: properties.Schema( DESTINATION_PORT: properties.Schema(
properties.Schema.STRING, properties.Schema.STRING,
_('Destination port number or a range.'),
update_allowed=True update_allowed=True
), ),
ACTION: properties.Schema( ACTION: properties.Schema(
properties.Schema.STRING, properties.Schema.STRING,
_('Action to be performed on the traffic matching the rule.'),
default='deny', default='deny',
constraints=[ constraints=[
constraints.AllowedValues(['allow', 'deny']), constraints.AllowedValues(['allow', 'deny']),
@ -239,28 +265,31 @@ class FirewallRule(neutron.NeutronResource):
), ),
ENABLED: properties.Schema( ENABLED: properties.Schema(
properties.Schema.BOOLEAN, properties.Schema.BOOLEAN,
_('Whether this rule should be enabled.'),
default=True, default=True,
update_allowed=True update_allowed=True
), ),
} }
attributes_schema = { attributes_schema = {
'name': _('Name for the FirewallRule.'), 'name': _('Name for the firewall rule.'),
'description': _('Description of the FirewallRule.'), 'description': _('Description of the firewall rule.'),
'firewall_policy_id': _('Unique identifier of the FirewallPolicy to ' 'firewall_policy_id': _('Unique identifier of the firewall policy to '
'which this FirewallRule belongs.'), 'which this firewall rule belongs.'),
'shared': _('Shared status of this FirewallRule.'), 'shared': _('Shared status of this firewall rule.'),
'protocol': _('Protocol value for this FirewallRule.'), 'protocol': _('Protocol value for this firewall rule.'),
'ip_version': _('Ip_version for this FirewallRule.'), 'ip_version': _('Ip_version for this firewall rule.'),
'source_ip_address': _('Source ip_address for this FirewallRule.'), 'source_ip_address': _('Source ip_address for this firewall rule.'),
'destination_ip_address': _('Destination ip_address for this ' 'destination_ip_address': _('Destination ip_address for this '
'FirewallRule.'), 'firewall rule.'),
'source_port': _('Source port range for this FirewallRule.'), 'source_port': _('Source port range for this firewall rule.'),
'destination_port': _('Destination port range for this FirewallRule.'), 'destination_port': _('Destination port range for this firewall '
'action': _('Allow or deny action for this FirewallRule.'), 'rule.'),
'enabled': _('Indicates whether this FirewallRule is enabled or not.'), 'action': _('Allow or deny action for this firewall rule.'),
'position': _('Position of the rule within the FirewallPolicy.'), 'enabled': _('Indicates whether this firewall rule is enabled or '
'tenant_id': _('Id of the tenant owning the Firewall.') 'not.'),
'position': _('Position of the rule within the firewall policy.'),
'tenant_id': _('Id of the tenant owning the firewall.')
} }
update_allowed_keys = ('Properties',) update_allowed_keys = ('Properties',)