Merge "Merge 'origin/feature/r1' into master"
This commit is contained in:
commit
fcd5be224c
@ -46,8 +46,8 @@ class BaremetalCloudMixin:
|
||||
def list_nics_for_machine(self, uuid):
|
||||
"""Returns a list of ports present on the machine node.
|
||||
|
||||
:param uuid: String representing machine UUID value in
|
||||
order to identify the machine.
|
||||
:param uuid: String representing machine UUID value in order to
|
||||
identify the machine.
|
||||
:returns: A list of ports.
|
||||
"""
|
||||
# TODO(dtantsur): support node names here.
|
||||
@ -92,8 +92,8 @@ class BaremetalCloudMixin:
|
||||
|
||||
:param mac: Port MAC address to query in order to return a node.
|
||||
|
||||
:returns: ``munch.Munch`` representing the node found or None
|
||||
if the node is not found.
|
||||
:returns: ``munch.Munch`` representing the node found or None if the
|
||||
node is not found.
|
||||
"""
|
||||
nic = self.get_nic_by_mac(mac)
|
||||
if nic is None:
|
||||
@ -113,7 +113,7 @@ class BaremetalCloudMixin:
|
||||
:param wait: Boolean value controlling if the method is to wait for
|
||||
the desired state to be reached or a failure to occur.
|
||||
|
||||
:param timeout: Integer value, defautling to 3600 seconds, for the$
|
||||
:param timeout: Integer value, defautling to 3600 seconds, for the
|
||||
wait state to reach completion.
|
||||
|
||||
:returns: ``munch.Munch`` representing the current state of the machine
|
||||
@ -185,21 +185,19 @@ class BaremetalCloudMixin:
|
||||
{'mac': 'aa:bb:cc:dd:ee:02'}
|
||||
]
|
||||
|
||||
:param wait: Boolean value, defaulting to false, to wait for the
|
||||
node to reach the available state where the node can be
|
||||
provisioned. It must be noted, when set to false, the
|
||||
method will still wait for locks to clear before sending
|
||||
the next required command.
|
||||
:param wait: Boolean value, defaulting to false, to wait for the node
|
||||
to reach the available state where the node can be provisioned. It
|
||||
must be noted, when set to false, the method will still wait for
|
||||
locks to clear before sending the next required command.
|
||||
|
||||
:param timeout: Integer value, defautling to 3600 seconds, for the
|
||||
wait state to reach completion.
|
||||
:param timeout: Integer value, defautling to 3600 seconds, for the wait
|
||||
state to reach completion.
|
||||
|
||||
:param lock_timeout: Integer value, defaulting to 600 seconds, for
|
||||
locks to clear.
|
||||
|
||||
:param kwargs: Key value pairs to be passed to the Ironic API,
|
||||
including uuid, name, chassis_uuid, driver_info,
|
||||
parameters.
|
||||
including uuid, name, chassis_uuid, driver_info, parameters.
|
||||
|
||||
:raises: OpenStackCloudException on operation error.
|
||||
|
||||
@ -338,8 +336,8 @@ class BaremetalCloudMixin:
|
||||
:param wait: DEPRECATED, do not use.
|
||||
|
||||
:param timeout: Integer value, representing seconds with a default
|
||||
value of 600, which controls the maximum amount of
|
||||
time to block until a lock is released on machine.
|
||||
value of 600, which controls the maximum amount of time to block
|
||||
until a lock is released on machine.
|
||||
|
||||
:raises: OpenStackCloudException on operation failure.
|
||||
"""
|
||||
@ -382,8 +380,8 @@ class BaremetalCloudMixin:
|
||||
|
||||
:param string name_or_id: A machine name or UUID to be updated.
|
||||
:param patch:
|
||||
The JSON Patch document is a list of dictonary objects
|
||||
that comply with RFC 6902 which can be found at
|
||||
The JSON Patch document is a list of dictonary objects that comply
|
||||
with RFC 6902 which can be found at
|
||||
https://tools.ietf.org/html/rfc6902.
|
||||
|
||||
Example patch construction::
|
||||
@ -423,9 +421,9 @@ class BaremetalCloudMixin:
|
||||
:raises: OpenStackCloudException on operation error.
|
||||
|
||||
:returns: ``munch.Munch`` containing a machine sub-dictonary consisting
|
||||
of the updated data returned from the API update operation,
|
||||
and a list named changes which contains all of the API paths
|
||||
that received updates.
|
||||
of the updated data returned from the API update operation, and a
|
||||
list named changes which contains all of the API paths that
|
||||
received updates.
|
||||
"""
|
||||
machine = self.get_machine(name_or_id)
|
||||
if not machine:
|
||||
@ -495,8 +493,7 @@ class BaremetalCloudMixin:
|
||||
:param string name_or_id: The Name or UUID value representing the
|
||||
baremetal node.
|
||||
:param bool for_deploy: If ``True``, validate readiness for deployment,
|
||||
otherwise validate only the power management
|
||||
properties.
|
||||
otherwise validate only the power management properties.
|
||||
:raises: :exc:`~openstack.exceptions.ValidationException`
|
||||
"""
|
||||
if for_deploy:
|
||||
@ -523,21 +520,18 @@ class BaremetalCloudMixin:
|
||||
|
||||
:param string name_or_id: The Name or UUID value representing the
|
||||
baremetal node.
|
||||
:param string state: The desired provision state for the
|
||||
baremetal node.
|
||||
:param string state: The desired provision state for the baremetal
|
||||
node.
|
||||
:param string configdrive: An optional URL or file or path
|
||||
representing the configdrive. In the
|
||||
case of a directory, the client API
|
||||
will create a properly formatted
|
||||
configuration drive file and post the
|
||||
file contents to the API for
|
||||
deployment.
|
||||
representing the configdrive. In the case of a directory, the
|
||||
client API will create a properly formatted configuration drive
|
||||
file and post the file contents to the API for deployment.
|
||||
:param boolean wait: A boolean value, defaulted to false, to control
|
||||
if the method will wait for the desire end state
|
||||
to be reached before returning.
|
||||
if the method will wait for the desire end state to be reached
|
||||
before returning.
|
||||
:param integer timeout: Integer value, defaulting to 3600 seconds,
|
||||
representing the amount of time to wait for
|
||||
the desire end state to be reached.
|
||||
representing the amount of time to wait for the desire end state to
|
||||
be reached.
|
||||
|
||||
:raises: OpenStackCloudException on operation error.
|
||||
|
||||
@ -561,12 +555,11 @@ class BaremetalCloudMixin:
|
||||
:param string name_or_id: The Name or UUID value representing the
|
||||
baremetal node.
|
||||
:param boolean state: The desired state of the node. True being in
|
||||
maintenance where as False means the machine
|
||||
is not in maintenance mode. This value
|
||||
defaults to True if not explicitly set.
|
||||
maintenance where as False means the machine is not in maintenance
|
||||
mode. This value defaults to True if not explicitly set.
|
||||
:param string reason: An optional freeform string that is supplied to
|
||||
the baremetal API to allow for notation as to why
|
||||
the node is in maintenance state.
|
||||
the baremetal API to allow for notation as to why the node is in
|
||||
maintenance state.
|
||||
|
||||
:raises: OpenStackCloudException on operation error.
|
||||
|
||||
@ -580,10 +573,10 @@ class BaremetalCloudMixin:
|
||||
def remove_machine_from_maintenance(self, name_or_id):
|
||||
"""Remove Baremetal Machine from Maintenance State
|
||||
|
||||
Similarly to set_machine_maintenance_state, this method
|
||||
removes a machine from maintenance state. It must be noted
|
||||
that this method simpily calls set_machine_maintenace_state
|
||||
for the name_or_id requested and sets the state to False.
|
||||
Similarly to set_machine_maintenance_state, this method removes a
|
||||
machine from maintenance state. It must be noted that this method
|
||||
simpily calls set_machine_maintenace_state for the name_or_id requested
|
||||
and sets the state to False.
|
||||
|
||||
:param string name_or_id: The Name or UUID value representing the
|
||||
baremetal node.
|
||||
@ -600,8 +593,7 @@ class BaremetalCloudMixin:
|
||||
This is a method that sets the node power state to "on".
|
||||
|
||||
:params string name_or_id: A string representing the baremetal
|
||||
node to have power turned to an "on"
|
||||
state.
|
||||
node to have power turned to an "on" state.
|
||||
|
||||
:raises: OpenStackCloudException on operation error.
|
||||
|
||||
@ -615,8 +607,7 @@ class BaremetalCloudMixin:
|
||||
This is a method that sets the node power state to "off".
|
||||
|
||||
:params string name_or_id: A string representing the baremetal
|
||||
node to have power turned to an "off"
|
||||
state.
|
||||
node to have power turned to an "off" state.
|
||||
|
||||
:raises: OpenStackCloudException on operation error.
|
||||
|
||||
@ -632,8 +623,7 @@ class BaremetalCloudMixin:
|
||||
to "on".
|
||||
|
||||
:params string name_or_id: A string representing the baremetal
|
||||
node to have power turned to an "off"
|
||||
state.
|
||||
node to have power turned to an "off" state.
|
||||
|
||||
:raises: OpenStackCloudException on operation error.
|
||||
|
||||
|
@ -91,7 +91,6 @@ class CoeCloudMixin(_normalize.Normalizer):
|
||||
|
||||
:param string name: Name of the cluster.
|
||||
:param string image_id: ID of the cluster template to use.
|
||||
|
||||
Other arguments will be passed in kwargs.
|
||||
|
||||
:returns: a dict containing the cluster description
|
||||
@ -144,7 +143,6 @@ class CoeCloudMixin(_normalize.Normalizer):
|
||||
|
||||
:param name_or_id: Name or ID of the COE cluster being updated.
|
||||
:param operation: Operation to perform - add, remove, replace.
|
||||
|
||||
Other arguments will be passed with kwargs.
|
||||
|
||||
:returns: a dict representing the updated cluster.
|
||||
@ -195,9 +193,8 @@ class CoeCloudMixin(_normalize.Normalizer):
|
||||
|
||||
:param cluster_id: UUID of the cluster.
|
||||
:param csr: Certificate Signing Request (CSR) for authenticating
|
||||
client key.The CSR will be used by Magnum to generate
|
||||
a signed certificate that client will use to communicate
|
||||
with the cluster.
|
||||
client key.The CSR will be used by Magnum to generate a signed
|
||||
certificate that client will use to communicate with the cluster.
|
||||
|
||||
:returns: a dict representing the signed certs.
|
||||
|
||||
@ -299,7 +296,6 @@ class CoeCloudMixin(_normalize.Normalizer):
|
||||
:param string image_id: Name or ID of the image to use.
|
||||
:param string keypair_id: Name or ID of the keypair to use.
|
||||
:param string coe: Name of the coe for the cluster template.
|
||||
|
||||
Other arguments will be passed in kwargs.
|
||||
|
||||
:returns: a dict containing the cluster template description
|
||||
@ -374,7 +370,6 @@ class CoeCloudMixin(_normalize.Normalizer):
|
||||
|
||||
:param name_or_id: Name or ID of the cluster template being updated.
|
||||
:param operation: Operation to perform - add, remove, replace.
|
||||
|
||||
Other arguments will be passed with kwargs.
|
||||
|
||||
:returns: a dict representing the updated cluster template.
|
||||
|
@ -150,9 +150,8 @@ class ComputeCloudMixin(_normalize.Normalizer):
|
||||
"""List all available flavors.
|
||||
|
||||
:param get_extra: Whether or not to fetch extra specs for each flavor.
|
||||
Defaults to True. Default behavior value can be
|
||||
overridden in clouds.yaml by setting
|
||||
openstack.cloud.get_extra_specs to False.
|
||||
Defaults to True. Default behavior value can be overridden in
|
||||
clouds.yaml by setting openstack.cloud.get_extra_specs to False.
|
||||
:returns: A list of flavor ``munch.Munch``.
|
||||
|
||||
"""
|
||||
@ -274,9 +273,9 @@ class ComputeCloudMixin(_normalize.Normalizer):
|
||||
:param all_projects: Whether to list servers from all projects or just
|
||||
the current auth scoped project.
|
||||
:param bare: Whether to skip adding any additional information to the
|
||||
server record. Defaults to False, meaning the addresses
|
||||
dict will be populated as needed from neutron. Setting
|
||||
to True implies detailed = False.
|
||||
server record. Defaults to False, meaning the addresses dict will
|
||||
be populated as needed from neutron. Setting to True implies
|
||||
detailed = False.
|
||||
:param filters: Additional query parameters passed to the API server.
|
||||
|
||||
:returns: A list of server ``munch.Munch``.
|
||||
@ -397,9 +396,8 @@ class ComputeCloudMixin(_normalize.Normalizer):
|
||||
OR
|
||||
A string containing a jmespath expression for further filtering.
|
||||
Example:: "[?last_name==`Smith`] | [?other.gender]==`Female`]"
|
||||
:param get_extra:
|
||||
Whether or not the list_flavors call should get the extra flavor
|
||||
specs.
|
||||
:param get_extra: Whether or not the list_flavors call should get the
|
||||
extra flavor specs.
|
||||
|
||||
:returns: A flavor ``munch.Munch`` or None if no matching flavor is
|
||||
found.
|
||||
@ -480,9 +478,9 @@ class ComputeCloudMixin(_normalize.Normalizer):
|
||||
:param detailed: Whether or not to add detailed additional information.
|
||||
Defaults to False.
|
||||
:param bare: Whether to skip adding any additional information to the
|
||||
server record. Defaults to False, meaning the addresses
|
||||
dict will be populated as needed from neutron. Setting
|
||||
to True implies detailed = False.
|
||||
server record. Defaults to False, meaning the addresses dict will
|
||||
be populated as needed from neutron. Setting to True implies
|
||||
detailed = False.
|
||||
:param all_projects: Whether to get server from all projects or just
|
||||
the current auth scoped project.
|
||||
|
||||
@ -576,10 +574,10 @@ class ComputeCloudMixin(_normalize.Normalizer):
|
||||
"""Create an image by snapshotting an existing server.
|
||||
|
||||
..note::
|
||||
On most clouds this is a cold snapshot - meaning that the server
|
||||
in question will be shutdown before taking the snapshot. It is
|
||||
possible that it's a live snapshot - but there is no way to know
|
||||
as a user, so caveat emptor.
|
||||
On most clouds this is a cold snapshot - meaning that the server in
|
||||
question will be shutdown before taking the snapshot. It is
|
||||
possible that it's a live snapshot - but there is no way to know as
|
||||
a user, so caveat emptor.
|
||||
|
||||
:param name: Name of the image to be created
|
||||
:param server: Server name or ID or dict representing the server
|
||||
@ -653,27 +651,24 @@ class ComputeCloudMixin(_normalize.Normalizer):
|
||||
:param boot_volume: Name or ID of a volume to boot from
|
||||
(defaults to None)
|
||||
:param terminate_volume: If booting from a volume, whether it should
|
||||
be deleted when the server is destroyed.
|
||||
(defaults to False)
|
||||
be deleted when the server is destroyed. (defaults to False)
|
||||
:param volumes: (optional) A list of volumes to attach to the server
|
||||
:param meta: (optional) A dict of arbitrary key/value metadata to
|
||||
store for this server. Both keys and values must be
|
||||
<=255 characters.
|
||||
store for this server. Both keys and values must be <=255
|
||||
characters.
|
||||
:param files: (optional, deprecated) A dict of files to overwrite
|
||||
on the server upon boot. Keys are file names (i.e.
|
||||
``/etc/passwd``) and values
|
||||
are the file contents (either as a string or as a
|
||||
file-like object). A maximum of five entries is allowed,
|
||||
and each file must be 10k or less.
|
||||
``/etc/passwd``) and values are the file contents (either as a
|
||||
string or as a file-like object). A maximum of five entries is
|
||||
allowed, and each file must be 10k or less.
|
||||
:param reservation_id: a UUID for the set of servers being requested.
|
||||
:param min_count: (optional extension) The minimum number of
|
||||
servers to launch.
|
||||
:param max_count: (optional extension) The maximum number of
|
||||
servers to launch.
|
||||
:param min_count: (optional extension) The minimum number of servers to
|
||||
launch.
|
||||
:param max_count: (optional extension) The maximum number of servers to
|
||||
launch.
|
||||
:param security_groups: A list of security group names
|
||||
:param userdata: user data to pass to be exposed by the metadata
|
||||
server this can be a file type object as well or a
|
||||
string.
|
||||
server this can be a file type object as well or a string.
|
||||
:param key_name: (optional extension) name of previously created
|
||||
keypair to inject into the instance.
|
||||
:param availability_zone: Name of the availability zone for instance
|
||||
@ -683,15 +678,15 @@ class ComputeCloudMixin(_normalize.Normalizer):
|
||||
:param block_device_mapping_v2: (optional) A dict of block
|
||||
device mappings for this server.
|
||||
:param nics: (optional extension) an ordered list of nics to be
|
||||
added to this server, with information about
|
||||
connected networks, fixed IPs, port etc.
|
||||
added to this server, with information about connected networks,
|
||||
fixed IPs, port etc.
|
||||
:param scheduler_hints: (optional extension) arbitrary key-value pairs
|
||||
specified by the client to help boot an instance
|
||||
:param config_drive: (optional extension) value for config drive
|
||||
either boolean, or volume-id
|
||||
:param disk_config: (optional extension) control how the disk is
|
||||
partitioned when the server is created. possible
|
||||
values are 'AUTO' or 'MANUAL'.
|
||||
partitioned when the server is created. possible values are 'AUTO'
|
||||
or 'MANUAL'.
|
||||
:param admin_pass: (optional extension) add a user supplied admin
|
||||
password.
|
||||
:param wait: (optional) Wait for the address to appear as assigned
|
||||
@ -699,26 +694,21 @@ class ComputeCloudMixin(_normalize.Normalizer):
|
||||
:param timeout: (optional) Seconds to wait, defaults to 60.
|
||||
See the ``wait`` parameter.
|
||||
:param reuse_ips: (optional) Whether to attempt to reuse pre-existing
|
||||
floating ips should a floating IP be
|
||||
needed (defaults to True)
|
||||
floating ips should a floating IP be needed (defaults to True)
|
||||
:param network: (optional) Network dict or name or ID to attach the
|
||||
server to. Mutually exclusive with the nics parameter.
|
||||
Can also be a list of network names or IDs or
|
||||
network dicts.
|
||||
server to. Mutually exclusive with the nics parameter. Can also
|
||||
be a list of network names or IDs or network dicts.
|
||||
:param boot_from_volume: Whether to boot from volume. 'boot_volume'
|
||||
implies True, but boot_from_volume=True with
|
||||
no boot_volume is valid and will create a
|
||||
volume from the image and use that.
|
||||
implies True, but boot_from_volume=True with no boot_volume is
|
||||
valid and will create a volume from the image and use that.
|
||||
:param volume_size: When booting an image from volume, how big should
|
||||
the created volume be? Defaults to 50.
|
||||
:param nat_destination: Which network should a created floating IP
|
||||
be attached to, if it's not possible to
|
||||
infer from the cloud's configuration.
|
||||
(Optional, defaults to None)
|
||||
be attached to, if it's not possible to infer from the cloud's
|
||||
configuration. (Optional, defaults to None)
|
||||
:param group: ServerGroup dict, name or id to boot the server in.
|
||||
If a group is provided in both scheduler_hints and in
|
||||
the group param, the group param will win.
|
||||
(Optional, defaults to None)
|
||||
If a group is provided in both scheduler_hints and in the group
|
||||
param, the group param will win. (Optional, defaults to None)
|
||||
:returns: A ``munch.Munch`` representing the created server.
|
||||
:raises: OpenStackCloudException on operation error.
|
||||
"""
|
||||
@ -1103,11 +1093,10 @@ class ComputeCloudMixin(_normalize.Normalizer):
|
||||
def set_server_metadata(self, name_or_id, metadata):
|
||||
"""Set metadata in a server instance.
|
||||
|
||||
:param str name_or_id: The name or ID of the server instance
|
||||
to update.
|
||||
:param str name_or_id: The name or ID of the server instance to update.
|
||||
:param dict metadata: A dictionary with the key=value pairs
|
||||
to set in the server instance. It only updates the key=value
|
||||
pairs provided. Existing ones will remain untouched.
|
||||
to set in the server instance. It only updates the key=value pairs
|
||||
provided. Existing ones will remain untouched.
|
||||
|
||||
:raises: OpenStackCloudException on operation error.
|
||||
"""
|
||||
@ -1249,11 +1238,11 @@ class ComputeCloudMixin(_normalize.Normalizer):
|
||||
:param detailed: Whether or not to add detailed additional information.
|
||||
Defaults to False.
|
||||
:param bare: Whether to skip adding any additional information to the
|
||||
server record. Defaults to False, meaning the addresses
|
||||
dict will be populated as needed from neutron. Setting
|
||||
to True implies detailed = False.
|
||||
:name: New name for the server
|
||||
:description: New description for the server
|
||||
server record. Defaults to False, meaning the addresses dict will
|
||||
be populated as needed from neutron. Setting to True implies
|
||||
detailed = False.
|
||||
:param name: New name for the server
|
||||
:param description: New description for the server
|
||||
|
||||
:returns: a dictionary representing the updated server.
|
||||
|
||||
@ -1625,8 +1614,8 @@ class ComputeCloudMixin(_normalize.Normalizer):
|
||||
|
||||
:param name_or_id: project name or id
|
||||
:param start: :class:`datetime.datetime` or string. Start date in UTC
|
||||
Defaults to 2010-07-06T12:00:00Z (the date the OpenStack
|
||||
project was started)
|
||||
Defaults to 2010-07-06T12:00:00Z (the date the OpenStack project
|
||||
was started)
|
||||
:param end: :class:`datetime.datetime` or string. End date in UTC.
|
||||
Defaults to now
|
||||
:raises: OpenStackCloudException if it's not a valid project
|
||||
|
@ -1113,8 +1113,8 @@ class IdentityCloudMixin:
|
||||
|
||||
NOTE: domain is a required argument when the grant is on a project,
|
||||
user or group specified by name. In that situation, they are all
|
||||
considered to be in that domain. If different domains are in use
|
||||
in the same role grant, it is required to specify those by ID.
|
||||
considered to be in that domain. If different domains are in use in
|
||||
the same role grant, it is required to specify those by ID.
|
||||
|
||||
NOTE: for wait and timeout, sometimes granting roles is not
|
||||
instantaneous.
|
||||
|
@ -469,6 +469,7 @@ class NetworkCloudMixin:
|
||||
:param dict provider: A dict of network provider options. Example::
|
||||
|
||||
{ 'network_type': 'vlan', 'segmentation_id': 'vlan1' }
|
||||
|
||||
:param string project_id: Specify the project ID this network
|
||||
will be created on (admin-only).
|
||||
:param types.ListType availability_zone_hints: A list of availability
|
||||
@ -559,6 +560,7 @@ class NetworkCloudMixin:
|
||||
:param dict provider: A dict of network provider options. Example::
|
||||
|
||||
{ 'network_type': 'vlan', 'segmentation_id': 'vlan1' }
|
||||
|
||||
:param int mtu_size: New maximum transmission unit value to address
|
||||
fragmentation. Minimum value is 68 for IPv4, and 1280 for IPv6.
|
||||
:param bool port_security_enabled: Enable or disable port security.
|
||||
@ -696,20 +698,17 @@ class NetworkCloudMixin:
|
||||
:param destination_ip_address: IPv4-, IPv6 address or CIDR.
|
||||
:param destination_port: Port or port range (e.g. 80:90)
|
||||
:param bool enabled: Status of firewall rule. You can disable rules
|
||||
without disassociating them from firewall
|
||||
policies. Defaults to True.
|
||||
:param int ip_version: IP Version.
|
||||
Valid values: 4, 6
|
||||
Defaults to 4.
|
||||
without disassociating them from firewall policies. Defaults to
|
||||
True.
|
||||
:param int ip_version: IP Version. Valid values: 4, 6 Defaults to 4.
|
||||
:param name: Human-readable name.
|
||||
:param project_id: Project id.
|
||||
:param protocol: IP protocol.
|
||||
Valid values: icmp, tcp, udp, null
|
||||
:param bool shared: Visibility to other projects.
|
||||
Defaults to False.
|
||||
:param protocol: IP protocol. Valid values: icmp, tcp, udp, null
|
||||
:param bool shared: Visibility to other projects. Defaults to False.
|
||||
:param source_firewall_group_id: ID of source firewall group.
|
||||
:param source_ip_address: IPv4-, IPv6 address or CIDR.
|
||||
:param source_port: Port or port range (e.g. 80:90)
|
||||
|
||||
:raises: BadRequestException if parameters are malformed
|
||||
:return: created firewall rule
|
||||
:rtype: FirewallRule
|
||||
@ -823,9 +822,8 @@ class NetworkCloudMixin:
|
||||
Create firewall policy.
|
||||
|
||||
:param bool audited: Status of audition of firewall policy.
|
||||
Set to False each time the firewall policy or the
|
||||
associated firewall rules are changed.
|
||||
Has to be explicitly set to True.
|
||||
Set to False each time the firewall policy or the associated
|
||||
firewall rules are changed. Has to be explicitly set to True.
|
||||
:param description: Human-readable description.
|
||||
:param list[str] firewall_rules: List of associated firewall rules.
|
||||
:param name: Human-readable name.
|
||||
@ -1023,16 +1021,14 @@ class NetworkCloudMixin:
|
||||
request.
|
||||
|
||||
:param bool admin_state_up: State of firewall group.
|
||||
Will block all traffic if set to False.
|
||||
Defaults to True.
|
||||
Will block all traffic if set to False. Defaults to True.
|
||||
:param description: Human-readable description.
|
||||
:param egress_firewall_policy: Name or id of egress firewall policy.
|
||||
:param ingress_firewall_policy: Name or id of ingress firewall policy.
|
||||
:param name: Human-readable name.
|
||||
:param list[str] ports: List of associated ports (name or id)
|
||||
:param project_id: Project id.
|
||||
:param shared: Visibility to other projects.
|
||||
Defaults to False.
|
||||
:param shared: Visibility to other projects. Defaults to False.
|
||||
:raises: BadRequestException if parameters are malformed
|
||||
:raises: DuplicateResource on multiple matches
|
||||
:raises: ResourceNotFound if (ingress-, egress-) firewall policy or
|
||||
@ -1187,16 +1183,12 @@ class NetworkCloudMixin:
|
||||
def update_qos_policy(self, name_or_id, **kwargs):
|
||||
"""Update an existing QoS policy.
|
||||
|
||||
:param string name_or_id:
|
||||
Name or ID of the QoS policy to update.
|
||||
:param string policy_name:
|
||||
The new name of the QoS policy.
|
||||
:param string description:
|
||||
The new description of the QoS policy.
|
||||
:param bool shared:
|
||||
If True, the QoS policy will be set as shared.
|
||||
:param bool default:
|
||||
If True, the QoS policy will be set as default for project.
|
||||
:param string name_or_id: Name or ID of the QoS policy to update.
|
||||
:param string policy_name: The new name of the QoS policy.
|
||||
:param string description: The new description of the QoS policy.
|
||||
:param bool shared: If True, the QoS policy will be set as shared.
|
||||
:param bool default: If True, the QoS policy will be set as default for
|
||||
project.
|
||||
|
||||
:returns: The updated QoS policy object.
|
||||
:raises: OpenStackCloudException on operation error.
|
||||
@ -1873,6 +1865,7 @@ class NetworkCloudMixin:
|
||||
"ip_address": "192.168.10.2"
|
||||
}
|
||||
]
|
||||
|
||||
:param string project_id: Project ID for the router.
|
||||
:param types.ListType availability_zone_hints:
|
||||
A list of availability zone hints.
|
||||
@ -1925,6 +1918,7 @@ class NetworkCloudMixin:
|
||||
"ip_address": "192.168.10.2"
|
||||
}
|
||||
]
|
||||
|
||||
:param list routes:
|
||||
A list of dictionaries with destination and nexthop parameters. To
|
||||
clear all routes pass an empty list ([]).
|
||||
@ -1937,6 +1931,7 @@ class NetworkCloudMixin:
|
||||
"nexthop": "172.24.3.99"
|
||||
}
|
||||
]
|
||||
|
||||
:returns: The router object.
|
||||
:raises: OpenStackCloudException on operation error.
|
||||
"""
|
||||
@ -2000,24 +1995,18 @@ class NetworkCloudMixin:
|
||||
prefixlen=None, use_default_subnetpool=False, **kwargs):
|
||||
"""Create a subnet on a specified network.
|
||||
|
||||
:param string network_name_or_id:
|
||||
The unique name or ID of the attached network. If a non-unique
|
||||
name is supplied, an exception is raised.
|
||||
:param string cidr:
|
||||
The CIDR.
|
||||
:param int ip_version:
|
||||
The IP version, which is 4 or 6.
|
||||
:param bool enable_dhcp:
|
||||
Set to ``True`` if DHCP is enabled and ``False`` if disabled.
|
||||
Default is ``False``.
|
||||
:param string subnet_name:
|
||||
The name of the subnet.
|
||||
:param string tenant_id:
|
||||
The ID of the tenant who owns the network. Only administrative users
|
||||
can specify a tenant ID other than their own.
|
||||
:param allocation_pools:
|
||||
A list of dictionaries of the start and end addresses for the
|
||||
allocation pools. For example::
|
||||
:param string network_name_or_id: The unique name or ID of the attached
|
||||
network. If a non-unique name is supplied, an exception is raised.
|
||||
:param string cidr: The CIDR.
|
||||
:param int ip_version: The IP version, which is 4 or 6.
|
||||
:param bool enable_dhcp: Set to ``True`` if DHCP is enabled and
|
||||
``False`` if disabled. Default is ``False``.
|
||||
:param string subnet_name: The name of the subnet.
|
||||
:param string tenant_id: The ID of the tenant who owns the network.
|
||||
Only administrative users can specify a tenant ID other than their
|
||||
own.
|
||||
:param allocation_pools: A list of dictionaries of the start and end
|
||||
addresses for the allocation pools. For example::
|
||||
|
||||
[
|
||||
{
|
||||
@ -2026,21 +2015,19 @@ class NetworkCloudMixin:
|
||||
}
|
||||
]
|
||||
|
||||
:param string gateway_ip:
|
||||
The gateway IP address. When you specify both allocation_pools and
|
||||
gateway_ip, you must ensure that the gateway IP does not overlap
|
||||
with the specified allocation pools.
|
||||
:param bool disable_gateway_ip:
|
||||
Set to ``True`` if gateway IP address is disabled and ``False`` if
|
||||
enabled. It is not allowed with gateway_ip.
|
||||
Default is ``False``.
|
||||
:param dns_nameservers:
|
||||
A list of DNS name servers for the subnet. For example::
|
||||
:param string gateway_ip: The gateway IP address. When you specify both
|
||||
allocation_pools and gateway_ip, you must ensure that the gateway
|
||||
IP does not overlap with the specified allocation pools.
|
||||
:param bool disable_gateway_ip: Set to ``True`` if gateway IP address
|
||||
is disabled and ``False`` if enabled. It is not allowed with
|
||||
gateway_ip. Default is ``False``.
|
||||
:param dns_nameservers: A list of DNS name servers for the subnet. For
|
||||
example::
|
||||
|
||||
[ "8.8.8.7", "8.8.8.8" ]
|
||||
|
||||
:param host_routes:
|
||||
A list of host route dictionaries for the subnet. For example::
|
||||
:param host_routes: A list of host route dictionaries for the subnet.
|
||||
For example::
|
||||
|
||||
[
|
||||
{
|
||||
@ -2053,18 +2040,15 @@ class NetworkCloudMixin:
|
||||
}
|
||||
]
|
||||
|
||||
:param string ipv6_ra_mode:
|
||||
IPv6 Router Advertisement mode. Valid values are: 'dhcpv6-stateful',
|
||||
'dhcpv6-stateless', or 'slaac'.
|
||||
:param string ipv6_address_mode:
|
||||
IPv6 address mode. Valid values are: 'dhcpv6-stateful',
|
||||
'dhcpv6-stateless', or 'slaac'.
|
||||
:param string prefixlen:
|
||||
The prefix length to use for subnet allocation from a subnet pool.
|
||||
:param bool use_default_subnetpool:
|
||||
Use the default subnetpool for ``ip_version`` to obtain a CIDR. It
|
||||
is required to pass ``None`` to the ``cidr`` argument when enabling
|
||||
this option.
|
||||
:param string ipv6_ra_mode: IPv6 Router Advertisement mode. Valid
|
||||
values are: 'dhcpv6-stateful', 'dhcpv6-stateless', or 'slaac'.
|
||||
:param string ipv6_address_mode: IPv6 address mode. Valid values are:
|
||||
'dhcpv6-stateful', 'dhcpv6-stateless', or 'slaac'.
|
||||
:param string prefixlen: The prefix length to use for subnet allocation
|
||||
from a subnet pool.
|
||||
:param bool use_default_subnetpool: Use the default subnetpool for
|
||||
``ip_version`` to obtain a CIDR. It is required to pass ``None`` to
|
||||
the ``cidr`` argument when enabling this option.
|
||||
:param kwargs: Key value pairs to be passed to the Neutron API.
|
||||
|
||||
:returns: The new subnet object.
|
||||
@ -2166,23 +2150,18 @@ class NetworkCloudMixin:
|
||||
host_routes=None):
|
||||
"""Update an existing subnet.
|
||||
|
||||
:param string name_or_id:
|
||||
Name or ID of the subnet to update.
|
||||
:param string subnet_name:
|
||||
The new name of the subnet.
|
||||
:param bool enable_dhcp:
|
||||
Set to ``True`` if DHCP is enabled and ``False`` if disabled.
|
||||
:param string gateway_ip:
|
||||
The gateway IP address. When you specify both allocation_pools and
|
||||
gateway_ip, you must ensure that the gateway IP does not overlap
|
||||
with the specified allocation pools.
|
||||
:param bool disable_gateway_ip:
|
||||
Set to ``True`` if gateway IP address is disabled and ``False`` if
|
||||
enabled. It is not allowed with gateway_ip.
|
||||
Default is ``False``.
|
||||
:param allocation_pools:
|
||||
A list of dictionaries of the start and end addresses for the
|
||||
allocation pools. For example::
|
||||
:param string name_or_id: Name or ID of the subnet to update.
|
||||
:param string subnet_name: The new name of the subnet.
|
||||
:param bool enable_dhcp: Set to ``True`` if DHCP is enabled and
|
||||
``False`` if disabled.
|
||||
:param string gateway_ip: The gateway IP address. When you specify both
|
||||
allocation_pools and gateway_ip, you must ensure that the gateway
|
||||
IP does not overlap with the specified allocation pools.
|
||||
:param bool disable_gateway_ip: Set to ``True`` if gateway IP address
|
||||
is disabled and ``False`` if enabled. It is not allowed with
|
||||
gateway_ip. Default is ``False``.
|
||||
:param allocation_pools: A list of dictionaries of the start and end
|
||||
addresses for the allocation pools. For example::
|
||||
|
||||
[
|
||||
{
|
||||
@ -2191,13 +2170,13 @@ class NetworkCloudMixin:
|
||||
}
|
||||
]
|
||||
|
||||
:param dns_nameservers:
|
||||
A list of DNS name servers for the subnet. For example::
|
||||
:param dns_nameservers: A list of DNS name servers for the subnet. For
|
||||
example::
|
||||
|
||||
[ "8.8.8.7", "8.8.8.8" ]
|
||||
|
||||
:param host_routes:
|
||||
A list of host route dictionaries for the subnet. For example::
|
||||
:param host_routes: A list of host route dictionaries for the subnet.
|
||||
For example::
|
||||
|
||||
[
|
||||
{
|
||||
@ -2259,8 +2238,7 @@ class NetworkCloudMixin:
|
||||
which is up (true, default) or down (false). (Optional)
|
||||
:param mac_address: The MAC address. (Optional)
|
||||
:param fixed_ips: List of ip_addresses and subnet_ids. See subnet_id
|
||||
and ip_address. (Optional)
|
||||
For example::
|
||||
and ip_address. (Optional) For example::
|
||||
|
||||
[
|
||||
{
|
||||
@ -2268,6 +2246,7 @@ class NetworkCloudMixin:
|
||||
"subnet_id": "a78484c4-c380-4b47-85aa-21c51a2d8cbd"
|
||||
}, ...
|
||||
]
|
||||
|
||||
:param subnet_id: If you specify only a subnet ID, OpenStack Networking
|
||||
allocates an available IP from that subnet to the port. (Optional)
|
||||
If you specify both a subnet ID and an IP address, OpenStack
|
||||
@ -2285,6 +2264,7 @@ class NetworkCloudMixin:
|
||||
"mac_address": "fa:16:3e:c4:cd:3f"
|
||||
}, ...
|
||||
]
|
||||
|
||||
:param extra_dhcp_opts: Extra DHCP options. (Optional).
|
||||
For example::
|
||||
|
||||
@ -2294,6 +2274,7 @@ class NetworkCloudMixin:
|
||||
"opt_value": "value1"
|
||||
}, ...
|
||||
]
|
||||
|
||||
:param device_owner: The ID of the entity that uses this port.
|
||||
For example, a DHCP agent. (Optional)
|
||||
:param device_id: The ID of the device that uses this port.
|
||||
@ -2340,6 +2321,7 @@ class NetworkCloudMixin:
|
||||
"subnet_id": "a78484c4-c380-4b47-85aa-21c51a2d8cbd"
|
||||
}, ...
|
||||
]
|
||||
|
||||
:param security_groups: List of security group UUIDs. (Optional)
|
||||
:param allowed_address_pairs: Allowed address pairs list (Optional)
|
||||
For example::
|
||||
@ -2350,6 +2332,7 @@ class NetworkCloudMixin:
|
||||
"mac_address": "fa:16:3e:c4:cd:3f"
|
||||
}, ...
|
||||
]
|
||||
|
||||
:param extra_dhcp_opts: Extra DHCP options. (Optional).
|
||||
For example::
|
||||
|
||||
@ -2359,6 +2342,7 @@ class NetworkCloudMixin:
|
||||
"opt_value": "value1"
|
||||
}, ...
|
||||
]
|
||||
|
||||
:param device_owner: The ID of the entity that uses this port.
|
||||
For example, a DHCP agent. (Optional)
|
||||
:param device_id: The ID of the resource this port is attached to.
|
||||
|
@ -37,8 +37,7 @@ _decorated_methods = []
|
||||
def _make_unicode(input):
|
||||
"""Turn an input into unicode unconditionally
|
||||
|
||||
:param input:
|
||||
A unicode, string or other object
|
||||
:param input: A unicode, string or other object
|
||||
"""
|
||||
try:
|
||||
if isinstance(input, unicode):
|
||||
@ -66,16 +65,13 @@ def _dictify_resource(resource):
|
||||
def _filter_list(data, name_or_id, filters):
|
||||
"""Filter a list by name/ID and arbitrary meta data.
|
||||
|
||||
:param list data:
|
||||
The list of dictionary data to filter. It is expected that
|
||||
each dictionary contains an 'id' and 'name'
|
||||
key if a value for name_or_id is given.
|
||||
:param string name_or_id:
|
||||
The name or ID of the entity being filtered. Can be a glob pattern,
|
||||
such as 'nb01*'.
|
||||
:param filters:
|
||||
A dictionary of meta data to use for further filtering. Elements
|
||||
of this dictionary may, themselves, be dictionaries. Example::
|
||||
:param list data: The list of dictionary data to filter. It is expected
|
||||
that each dictionary contains an 'id' and 'name' key if a value for
|
||||
name_or_id is given.
|
||||
:param string name_or_id: The name or ID of the entity being filtered. Can
|
||||
be a glob pattern, such as 'nb01*'.
|
||||
:param filters: A dictionary of meta data to use for further filtering.
|
||||
Elements of this dictionary may, themselves, be dictionaries. Example::
|
||||
|
||||
{
|
||||
'last_name': 'Smith',
|
||||
@ -83,7 +79,9 @@ def _filter_list(data, name_or_id, filters):
|
||||
'gender': 'Female'
|
||||
}
|
||||
}
|
||||
|
||||
OR
|
||||
|
||||
A string containing a jmespath expression for further filtering.
|
||||
"""
|
||||
# The logger is openstack.cloud.fmmatch to allow a user/operator to
|
||||
@ -158,20 +156,16 @@ def _filter_list(data, name_or_id, filters):
|
||||
def _get_entity(cloud, resource, name_or_id, filters, **kwargs):
|
||||
"""Return a single entity from the list returned by a given method.
|
||||
|
||||
:param object cloud:
|
||||
The controller class (Example: the main OpenStackCloud object) .
|
||||
:param string or callable resource:
|
||||
The string that identifies the resource to use to lookup the
|
||||
get_<>_by_id or search_<resource>s methods(Example: network)
|
||||
or a callable to invoke.
|
||||
:param string name_or_id:
|
||||
The name or ID of the entity being filtered or an object or dict.
|
||||
If this is an object/dict with an 'id' attr/key, we return it and
|
||||
bypass resource lookup.
|
||||
:param filters:
|
||||
A dictionary of meta data to use for further filtering.
|
||||
OR
|
||||
A string containing a jmespath expression for further filtering.
|
||||
:param object cloud: The controller class (Example: the main OpenStackCloud
|
||||
object).
|
||||
:param string or callable resource: The string that identifies the resource
|
||||
to use to lookup the get_<>_by_id or search_<resource>s methods
|
||||
(Example: network) or a callable to invoke.
|
||||
:param string name_or_id: The name or ID of the entity being filtered or an
|
||||
object or dict. If this is an object/dict with an 'id' attr/key, we
|
||||
return it and bypass resource lookup.
|
||||
:param filters: A dictionary of meta data to use for further filtering.
|
||||
OR A string containing a jmespath expression for further filtering.
|
||||
Example:: "[?last_name==`Smith`] | [?other.gender]==`Female`]"
|
||||
"""
|
||||
|
||||
@ -419,8 +413,8 @@ def shade_exceptions(error_message=None):
|
||||
exceptions without having to catch and reraise them.
|
||||
|
||||
Non-OpenStackCloudException exceptions thrown within the context will
|
||||
be wrapped and the exception message will be appended to the given error
|
||||
message.
|
||||
be wrapped and the exception message will be appended to the given
|
||||
error message.
|
||||
"""
|
||||
try:
|
||||
yield
|
||||
@ -512,8 +506,7 @@ def _call_client_and_retry(client, url, retry_on=None,
|
||||
The method also supports a single integer to be
|
||||
defined.
|
||||
:param integer call_retries: The number of times to retry the call upon
|
||||
the error code defined by the 'retry_on'
|
||||
parameter. Default: 3
|
||||
the error code defined by the 'retry_on' parameter. Default: 3
|
||||
:param integer retry_wait: The time in seconds to wait between retry
|
||||
attempts. Default: 2
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user