summaryrefslogtreecommitdiff
path: root/neutronclient/neutron
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-03-30 22:28:14 +0000
committerGerrit Code Review <review@openstack.org>2016-03-30 22:28:14 +0000
commit79beab9c22d51f883b434cc4c09cd01b7473a8dd (patch)
tree48f0240ec07d937d382247c35763320a6dec7f4b /neutronclient/neutron
parent214854bf7ac19113f0b460c83e217b3827063e3f (diff)
parent2db432fbf5be5c307b82117200649379859450e5 (diff)
downloadpython-neutronclient-79beab9c22d51f883b434cc4c09cd01b7473a8dd.tar.gz
Merge "Add parser options for description on resources"
Diffstat (limited to 'neutronclient/neutron')
-rw-r--r--neutronclient/neutron/v2_0/floatingip.py5
-rw-r--r--neutronclient/neutron/v2_0/network.py6
-rw-r--r--neutronclient/neutron/v2_0/port.py6
-rw-r--r--neutronclient/neutron/v2_0/router.py11
-rw-r--r--neutronclient/neutron/v2_0/securitygroup.py6
-rw-r--r--neutronclient/neutron/v2_0/subnet.py6
-rw-r--r--neutronclient/neutron/v2_0/subnetpool.py6
7 files changed, 38 insertions, 8 deletions
diff --git a/neutronclient/neutron/v2_0/floatingip.py b/neutronclient/neutron/v2_0/floatingip.py
index 78c0dd3..b6a0eba 100644
--- a/neutronclient/neutron/v2_0/floatingip.py
+++ b/neutronclient/neutron/v2_0/floatingip.py
@@ -50,6 +50,9 @@ class CreateFloatingIP(neutronV20.CreateCommand):
'floating_network_id', metavar='FLOATING_NETWORK',
help=_('Network name or ID to allocate floating IP from.'))
parser.add_argument(
+ '--description',
+ help=_('Description of the floating IP.'))
+ parser.add_argument(
'--port-id',
help=_('ID of the port to be associated with the floating IP.'))
parser.add_argument(
@@ -78,7 +81,7 @@ class CreateFloatingIP(neutronV20.CreateCommand):
body = {'floating_network_id': _network_id}
neutronV20.update_dict(parsed_args, body,
['port_id', 'tenant_id',
- 'fixed_ip_address',
+ 'fixed_ip_address', 'description',
'floating_ip_address', 'subnet_id'])
dns.args2body_dns_create(parsed_args, body, 'domain')
dns.args2body_dns_create(parsed_args, body, 'name')
diff --git a/neutronclient/neutron/v2_0/network.py b/neutronclient/neutron/v2_0/network.py
index 4ec7ace..23362e1 100644
--- a/neutronclient/neutron/v2_0/network.py
+++ b/neutronclient/neutron/v2_0/network.py
@@ -184,6 +184,9 @@ class CreateNetwork(neutronV20.CreateCommand, qos_policy.CreateQosPolicyMixin):
parser.add_argument(
'name', metavar='NAME',
help=_('Name of network to create.'))
+ parser.add_argument(
+ '--description',
+ help=_('Description of network.'))
self.add_arguments_qos_policy(parser)
availability_zone.add_az_hint_argument(parser, self.resource)
@@ -197,7 +200,8 @@ class CreateNetwork(neutronV20.CreateCommand, qos_policy.CreateQosPolicyMixin):
'vlan_transparent',
'provider:network_type',
'provider:physical_network',
- 'provider:segmentation_id'])
+ 'provider:segmentation_id',
+ 'description'])
self.args2body_qos_policy(parsed_args, body)
availability_zone.args2body_az_hint(parsed_args, body)
diff --git a/neutronclient/neutron/v2_0/port.py b/neutronclient/neutron/v2_0/port.py
index f491729..b68bfbe 100644
--- a/neutronclient/neutron/v2_0/port.py
+++ b/neutronclient/neutron/v2_0/port.py
@@ -45,6 +45,9 @@ def _add_updatable_args(parser):
'--name',
help=_('Name of this port.'))
parser.add_argument(
+ '--description',
+ help=_('Description of this port.'))
+ parser.add_argument(
'--fixed-ip', metavar='subnet_id=SUBNET,ip_address=IP_ADDR',
action='append',
type=utils.str2dict_type(optional_keys=['subnet_id', 'ip_address']),
@@ -71,7 +74,8 @@ def _add_updatable_args(parser):
def _updatable_args2body(parsed_args, body, client):
neutronV20.update_dict(parsed_args, body,
- ['device_id', 'device_owner', 'name'])
+ ['device_id', 'device_owner', 'name',
+ 'description'])
ips = []
if parsed_args.fixed_ip:
for ip_spec in parsed_args.fixed_ip:
diff --git a/neutronclient/neutron/v2_0/router.py b/neutronclient/neutron/v2_0/router.py
index 5eba1f2..605efc8 100644
--- a/neutronclient/neutron/v2_0/router.py
+++ b/neutronclient/neutron/v2_0/router.py
@@ -68,6 +68,9 @@ class CreateRouter(neutronV20.CreateCommand):
parser.add_argument(
'name', metavar='NAME',
help=_('Name of router to create.'))
+ parser.add_argument(
+ '--description',
+ help=_('Description of router.'))
utils.add_boolean_argument(
parser, '--distributed', dest='distributed',
help=_('Create a distributed router.'))
@@ -80,7 +83,8 @@ class CreateRouter(neutronV20.CreateCommand):
def args2body(self, parsed_args):
body = {'admin_state_up': parsed_args.admin_state}
neutronV20.update_dict(parsed_args, body,
- ['name', 'tenant_id', 'distributed', 'ha'])
+ ['name', 'tenant_id', 'distributed', 'ha',
+ 'description'])
availability_zone.args2body_az_hint(parsed_args, body)
return {self.resource: body}
@@ -100,6 +104,9 @@ class UpdateRouter(neutronV20.UpdateCommand):
parser.add_argument(
'--name',
help=_('Name of this router.'))
+ parser.add_argument(
+ '--description',
+ help=_('Description of router.'))
utils.add_boolean_argument(
parser, '--admin-state-up', dest='admin_state',
help=_('Specify the administrative state of the router'
@@ -128,7 +135,7 @@ class UpdateRouter(neutronV20.UpdateCommand):
if hasattr(parsed_args, 'admin_state'):
body['admin_state_up'] = parsed_args.admin_state
neutronV20.update_dict(parsed_args, body,
- ['name', 'distributed'])
+ ['name', 'distributed', 'description'])
if parsed_args.no_routes:
body['routes'] = None
elif parsed_args.routes:
diff --git a/neutronclient/neutron/v2_0/securitygroup.py b/neutronclient/neutron/v2_0/securitygroup.py
index 0e6728e..d79d897 100644
--- a/neutronclient/neutron/v2_0/securitygroup.py
+++ b/neutronclient/neutron/v2_0/securitygroup.py
@@ -306,6 +306,9 @@ class CreateSecurityGroupRule(neutronV20.CreateCommand):
def add_known_arguments(self, parser):
parser.add_argument(
+ '--description',
+ help=_('Description of security group rule.'))
+ parser.add_argument(
'security_group_id', metavar='SECURITY_GROUP',
help=_('Security group name or ID to add rule.'))
parser.add_argument(
@@ -354,7 +357,8 @@ class CreateSecurityGroupRule(neutronV20.CreateCommand):
generate_default_ethertype(parsed_args.protocol)}
neutronV20.update_dict(parsed_args, body,
['protocol', 'port_range_min', 'port_range_max',
- 'remote_ip_prefix', 'tenant_id'])
+ 'remote_ip_prefix', 'tenant_id',
+ 'description'])
if parsed_args.remote_group_id:
_remote_group_id = neutronV20.find_resourceid_by_name_or_id(
self.get_client(), 'security_group',
diff --git a/neutronclient/neutron/v2_0/subnet.py b/neutronclient/neutron/v2_0/subnet.py
index 2149ebf..3f27cb7 100644
--- a/neutronclient/neutron/v2_0/subnet.py
+++ b/neutronclient/neutron/v2_0/subnet.py
@@ -52,6 +52,9 @@ def add_updatable_arguments(parser):
parser.add_argument(
'--name',
help=_('Name of this subnet.'))
+ parser.add_argument(
+ '--description',
+ help=_('Description of this subnet.'))
gateway_sg = parser.add_mutually_exclusive_group()
gateway_sg.add_argument(
'--gateway', metavar='GATEWAY_IP',
@@ -112,7 +115,8 @@ def updatable_args2body(parsed_args, body, for_create=True, ip_version=None):
neutronV20.update_dict(parsed_args, body,
['name', 'allocation_pools',
- 'host_routes', 'dns_nameservers'])
+ 'host_routes', 'dns_nameservers',
+ 'description'])
if parsed_args.no_gateway:
body['gateway_ip'] = None
elif parsed_args.gateway:
diff --git a/neutronclient/neutron/v2_0/subnetpool.py b/neutronclient/neutron/v2_0/subnetpool.py
index a4a2247..138c521 100644
--- a/neutronclient/neutron/v2_0/subnetpool.py
+++ b/neutronclient/neutron/v2_0/subnetpool.py
@@ -28,6 +28,9 @@ def _format_prefixes(subnetpool):
def add_updatable_arguments(parser):
parser.add_argument(
+ '--description',
+ help=_('Description of subnetpool.'))
+ parser.add_argument(
'--min-prefixlen', type=int,
help=_('Subnetpool minimum prefix length.'))
parser.add_argument(
@@ -49,7 +52,8 @@ def add_updatable_arguments(parser):
def updatable_args2body(parsed_args, body, for_create=True):
neutronV20.update_dict(parsed_args, body,
['name', 'prefixes', 'default_prefixlen',
- 'min_prefixlen', 'max_prefixlen', 'is_default'])
+ 'min_prefixlen', 'max_prefixlen', 'is_default',
+ 'description'])
class ListSubnetPool(neutronV20.ListCommand):