Module for handling OpenStack Neutron calls
depends: |
|
---|---|
configuration: | This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example: keystone.user: 'admin'
keystone.password: 'password'
keystone.tenant: 'admin'
keystone.auth_url: 'http://127.0.0.1:5000/v2.0/'
keystone.region_name: 'RegionOne'
keystone.service_type: 'network'
If configuration for multiple OpenStack accounts is required, they can be set up as different configuration profiles: For example: openstack1:
keystone.user: 'admin'
keystone.password: 'password'
keystone.tenant: 'admin'
keystone.auth_url: 'http://127.0.0.1:5000/v2.0/'
keystone.region_name: 'RegionOne'
keystone.service_type: 'network'
openstack2:
keystone.user: 'admin'
keystone.password: 'password'
keystone.tenant: 'admin'
keystone.auth_url: 'http://127.0.0.2:5000/v2.0/'
keystone.region_name: 'RegionOne'
keystone.service_type: 'network'
With this configuration in place, any of the neutron functions can make use of a configuration profile by declaring it explicitly. For example: salt '*' neutron.network_list profile=openstack1
To use keystoneauth1 instead of keystoneclient, include the use_keystoneauth option in the pillar or minion config. Note this is required to use keystone v3 as for authentication. keystone.user: admin
keystone.password: verybadpass
keystone.tenant: admin
keystone.auth_url: 'http://127.0.0.1:5000/v3/'
keystone.region_name: 'RegionOne'
keystone.service_type: 'network'
keystone.use_keystoneauth: true
keystone.verify: '/path/to/custom/certs/ca-bundle.crt'
Note: by default the neutron module will attempt to verify its connection utilizing the system certificates. If you need to verify against another bundle of CA certificates or want to skip verification altogether you will need to specify the verify option. You can specify True or False to verify (or not) against system certificates, a path to a bundle or CA certs to check against, or None to allow keystoneauth to search for the certificates on its own.(defaults to True) |
salt.modules.neutron.
add_gateway_router
(router, ext_network, profile=None)¶Adds an external network gateway to the specified router
CLI Example:
salt '*' neutron.add_gateway_router router-name ext-network-name
Parameters: |
|
---|---|
Returns: | Added Gateway router information |
salt.modules.neutron.
add_interface_router
(router, subnet, profile=None)¶Adds an internal network interface to the specified router
CLI Example:
salt '*' neutron.add_interface_router router-name subnet-name
Parameters: |
|
---|---|
Returns: | Added interface information |
salt.modules.neutron.
create_firewall_rule
(protocol, action, profile=None, **kwargs)¶Creates a new firewall rule
CLI Example:
salt '*' neutron.create_firewall_rule protocol action
tenant_id=TENANT_ID name=NAME description=DESCRIPTION ip_version=IP_VERSION
source_ip_address=SOURCE_IP_ADDRESS destination_ip_address=DESTINATION_IP_ADDRESS source_port=SOURCE_PORT
destination_port=DESTINATION_PORT shared=SHARED enabled=ENABLED
Parameters: |
|
---|
salt.modules.neutron.
create_floatingip
(floating_network, port=None, profile=None)¶Creates a new floatingIP
CLI Example:
salt '*' neutron.create_floatingip network-name port-name
Parameters: |
|
---|---|
Returns: | Created floatingIP information |
salt.modules.neutron.
create_ikepolicy
(name, profile=None, **kwargs)¶Creates a new IKEPolicy
CLI Example:
salt '*' neutron.create_ikepolicy ikepolicy-name
phase1_negotiation_mode=main auth_algorithm=sha1
encryption_algorithm=aes-128 pfs=group5
Parameters: |
|
---|---|
Returns: | Created IKE policy information |
salt.modules.neutron.
create_ipsec_site_connection
(name, ipsecpolicy, ikepolicy, vpnservice, peer_cidrs, peer_address, peer_id, psk, admin_state_up=True, profile=None, **kwargs)¶Creates a new IPsecSiteConnection
CLI Example:
salt '*' neutron.show_ipsec_site_connection connection-name
ipsec-policy-name ikepolicy-name vpnservice-name
192.168.XXX.XXX/24 192.168.XXX.XXX 192.168.XXX.XXX secret
Parameters: |
|
---|---|
Returns: | Created IPSec site connection information |
salt.modules.neutron.
create_ipsecpolicy
(name, profile=None, **kwargs)¶Creates a new IPsecPolicy
CLI Example:
salt '*' neutron.create_ipsecpolicy ipsecpolicy-name
transform_protocol=esp auth_algorithm=sha1
encapsulation_mode=tunnel encryption_algorithm=aes-128
Parameters: |
|
---|---|
Returns: | Created IPSec policy information |
salt.modules.neutron.
create_network
(name, router_ext=None, admin_state_up=True, network_type=None, physical_network=None, segmentation_id=None, shared=None, profile=None)¶Creates a new network
CLI Example:
salt '*' neutron.create_network network-name
salt '*' neutron.create_network network-name profile=openstack1
Parameters: |
|
---|---|
Returns: | Created network information |
salt.modules.neutron.
create_port
(name, network, device_id=None, admin_state_up=True, profile=None)¶Creates a new port
CLI Example:
salt '*' neutron.create_port network-name port-name
Parameters: |
|
---|---|
Returns: | Created port information |
salt.modules.neutron.
create_router
(name, ext_network=None, admin_state_up=True, profile=None)¶Creates a new router
CLI Example:
salt '*' neutron.create_router new-router-name
Parameters: |
|
---|---|
Returns: | Created router information |
salt.modules.neutron.
create_security_group
(name=None, description=None, profile=None)¶Creates a new security group
CLI Example:
salt '*' neutron.create_security_group security-group-name description='Security group for servers'
Parameters: |
|
---|---|
Returns: | Created security group information |
salt.modules.neutron.
create_security_group_rule
(security_group, remote_group_id=None, direction='ingress', protocol=None, port_range_min=None, port_range_max=None, ethertype='IPv4', profile=None)¶Creates a new security group rule
CLI Example:
salt '*' neutron.show_security_group_rule security-group-rule-id
Parameters: |
|
---|---|
Returns: | Created security group rule information |
salt.modules.neutron.
create_subnet
(network, cidr, name=None, ip_version=4, profile=None)¶Creates a new subnet
CLI Example:
salt '*' neutron.create_subnet network-name 192.168.1.0/24
Parameters: |
|
---|---|
Returns: | Created subnet information |
salt.modules.neutron.
create_vpnservice
(subnet, router, name, admin_state_up=True, profile=None)¶Creates a new VPN service
CLI Example:
salt '*' neutron.create_vpnservice router-name name
Parameters: |
|
---|---|
Returns: | Created VPN service information |
salt.modules.neutron.
delete_firewall_rule
(firewall_rule, profile=None)¶Deletes the specified firewall_rule
CLI Example:
salt '*' neutron.delete_firewall_rule firewall-rule
Parameters: |
|
---|---|
Returns: | True(Succeed) or False |
salt.modules.neutron.
delete_floatingip
(floatingip_id, profile=None)¶Deletes the specified floating IP
CLI Example:
salt '*' neutron.delete_floatingip floatingip-id
Parameters: |
|
---|---|
Returns: | True(Succeed) or False |
salt.modules.neutron.
delete_ikepolicy
(ikepolicy, profile=None)¶Deletes the specified IKEPolicy
CLI Example:
salt '*' neutron.delete_ikepolicy ikepolicy-name
Parameters: |
|
---|---|
Returns: | True(Succeed) or False |
salt.modules.neutron.
delete_ipsec_site_connection
(ipsec_site_connection, profile=None)¶Deletes the specified IPsecSiteConnection
CLI Example:
salt '*' neutron.delete_ipsec_site_connection connection-name
Parameters: |
|
---|---|
Returns: | True(Succeed) or False |
salt.modules.neutron.
delete_ipsecpolicy
(ipsecpolicy, profile=None)¶Deletes the specified IPsecPolicy
CLI Example:
salt '*' neutron.delete_ipsecpolicy ipsecpolicy-name
Parameters: |
|
---|---|
Returns: | True(Succeed) or False |
salt.modules.neutron.
delete_network
(network, profile=None)¶Deletes the specified network
CLI Example:
salt '*' neutron.delete_network network-name
salt '*' neutron.delete_network network-name profile=openstack1
Parameters: |
|
---|---|
Returns: | True(Succeed) or False |
salt.modules.neutron.
delete_port
(port, profile=None)¶Deletes the specified port
CLI Example:
salt '*' neutron.delete_network port-name
salt '*' neutron.delete_network port-name profile=openstack1
Parameters: |
|
---|---|
Returns: | True(Succeed) or False |
salt.modules.neutron.
delete_quota
(tenant_id, profile=None)¶Delete the specified tenant's quota value
CLI Example:
salt '*' neutron.update_quota tenant-id
salt '*' neutron.update_quota tenant-id profile=openstack1
Parameters: |
|
---|---|
Returns: | True(Delete succeed) or False(Delete failed) |
salt.modules.neutron.
delete_router
(router, profile=None)¶Delete the specified router
CLI Example:
salt '*' neutron.delete_router router-name
Parameters: |
|
---|---|
Returns: | True(Succeed) or False |
salt.modules.neutron.
delete_security_group
(security_group, profile=None)¶Deletes the specified security group
CLI Example:
salt '*' neutron.delete_security_group security-group-name
Parameters: |
|
---|---|
Returns: | True(Succeed) or False |
salt.modules.neutron.
delete_security_group_rule
(security_group_rule_id, profile=None)¶Deletes the specified security group rule
CLI Example:
salt '*' neutron.delete_security_group_rule security-group-rule-id
Parameters: |
|
---|---|
Returns: | True(Succeed) or False |
salt.modules.neutron.
delete_subnet
(subnet, profile=None)¶Deletes the specified subnet
CLI Example:
salt '*' neutron.delete_subnet subnet-name
salt '*' neutron.delete_subnet subnet-name profile=openstack1
Parameters: |
|
---|---|
Returns: | True(Succeed) or False |
salt.modules.neutron.
delete_vpnservice
(vpnservice, profile=None)¶Deletes the specified VPN service
CLI Example:
salt '*' neutron.delete_vpnservice vpnservice-name
Parameters: |
|
---|---|
Returns: | True(Succeed) or False |
salt.modules.neutron.
get_quotas_tenant
(profile=None)¶Fetches tenant info in server's context for following quota operation
CLI Example:
salt '*' neutron.get_quotas_tenant
salt '*' neutron.get_quotas_tenant profile=openstack1
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | Quotas information |
salt.modules.neutron.
list_agents
(profile=None)¶List agents.
CLI Example:
salt '*' neutron.list_agents
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | agents message. |
salt.modules.neutron.
list_extensions
(profile=None)¶Fetches a list of all extensions on server side
CLI Example:
salt '*' neutron.list_extensions
salt '*' neutron.list_extensions profile=openstack1
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | List of extensions |
salt.modules.neutron.
list_firewall_rules
(profile=None)¶Fetches a list of all firewall rules for a tenant CLI Example:
salt '*' neutron.list_firewall_rules
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | List of firewall rules |
salt.modules.neutron.
list_firewalls
(profile=None)¶Fetches a list of all firewalls for a tenant CLI Example:
salt '*' neutron.list_firewalls
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | List of firewalls |
salt.modules.neutron.
list_floatingips
(profile=None)¶Fetch a list of all floatingIPs for a tenant
CLI Example:
salt '*' neutron.list_floatingips
salt '*' neutron.list_floatingips profile=openstack1
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | List of floatingIP |
salt.modules.neutron.
list_ikepolicies
(profile=None)¶Fetches a list of all configured IKEPolicies for a tenant
CLI Example:
salt '*' neutron.list_ikepolicies
salt '*' neutron.list_ikepolicies profile=openstack1
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | List of IKE policy |
salt.modules.neutron.
list_ipsec_site_connections
(profile=None)¶Fetches all configured IPsec Site Connections for a tenant
CLI Example:
salt '*' neutron.list_ipsec_site_connections
salt '*' neutron.list_ipsec_site_connections profile=openstack1
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | List of IPSec site connection |
salt.modules.neutron.
list_ipsecpolicies
(profile=None)¶Fetches a list of all configured IPsecPolicies for a tenant
CLI Example:
salt '*' neutron.list_ipsecpolicies ipsecpolicy-name
salt '*' neutron.list_ipsecpolicies ipsecpolicy-name profile=openstack1
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | List of IPSec policy |
salt.modules.neutron.
list_l3_agent_hosting_routers
(router, profile=None)¶List L3 agents hosting a router.
CLI Example:
salt '*' neutron.list_l3_agent_hosting_routers router
:param router:router name or ID to query. :param profile: Profile to build on (Optional) :return: L3 agents message.
salt.modules.neutron.
list_networks
(profile=None)¶Fetches a list of all networks for a tenant
CLI Example:
salt '*' neutron.list_networks
salt '*' neutron.list_networks profile=openstack1
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | List of network |
salt.modules.neutron.
list_ports
(profile=None)¶Fetches a list of all networks for a tenant
CLI Example:
salt '*' neutron.list_ports
salt '*' neutron.list_ports profile=openstack1
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | List of port |
salt.modules.neutron.
list_quotas
(profile=None)¶Fetches all tenants quotas
CLI Example:
salt '*' neutron.list_quotas
salt '*' neutron.list_quotas profile=openstack1
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | List of quotas |
salt.modules.neutron.
list_routers
(profile=None)¶Fetches a list of all routers for a tenant
CLI Example:
salt '*' neutron.list_routers
salt '*' neutron.list_routers profile=openstack1
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | List of router |
salt.modules.neutron.
list_security_group_rules
(profile=None)¶Fetches a list of all security group rules for a tenant
CLI Example:
salt '*' neutron.list_security_group_rules
salt '*' neutron.list_security_group_rules profile=openstack1
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | List of security group rule |
salt.modules.neutron.
list_security_groups
(profile=None)¶Fetches a list of all security groups for a tenant
CLI Example:
salt '*' neutron.list_security_groups
salt '*' neutron.list_security_groups profile=openstack1
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | List of security group |
salt.modules.neutron.
list_subnets
(profile=None)¶Fetches a list of all networks for a tenant
CLI Example:
salt '*' neutron.list_subnets
salt '*' neutron.list_subnets profile=openstack1
Parameters: | profile -- Profile to build on (Optional) |
---|---|
Returns: | List of subnet |
salt.modules.neutron.
list_vpnservices
(retrieve_all=True, profile=None, **kwargs)¶Fetches a list of all configured VPN services for a tenant
CLI Example:
salt '*' neutron.list_vpnservices
Parameters: |
|
---|---|
Returns: | List of VPN service |
salt.modules.neutron.
remove_gateway_router
(router, profile=None)¶Removes an external network gateway from the specified router
CLI Example:
salt '*' neutron.remove_gateway_router router-name
Parameters: |
|
---|---|
Returns: | True(Succeed) or False |
salt.modules.neutron.
remove_interface_router
(router, subnet, profile=None)¶Removes an internal network interface from the specified router
CLI Example:
salt '*' neutron.remove_interface_router router-name subnet-name
Parameters: |
|
---|---|
Returns: | True(Succeed) or False |
salt.modules.neutron.
show_firewall
(firewall, profile=None)¶Fetches information of a specific firewall rule
CLI Example:
salt '*' neutron.show_firewall firewall
Parameters: |
|
---|---|
Returns: | firewall information |
salt.modules.neutron.
show_firewall_rule
(firewall_rule, profile=None)¶Fetches information of a specific firewall rule
CLI Example:
salt '*' neutron.show_firewall_rule firewall-rule-name
Parameters: |
|
---|---|
Returns: | firewall rule information |
salt.modules.neutron.
show_floatingip
(floatingip_id, profile=None)¶Fetches information of a certain floatingIP
CLI Example:
salt '*' neutron.show_floatingip floatingip-id
Parameters: |
|
---|---|
Returns: | Floating IP information |
salt.modules.neutron.
show_ikepolicy
(ikepolicy, profile=None)¶Fetches information of a specific IKEPolicy
CLI Example:
salt '*' neutron.show_ikepolicy ikepolicy-name
Parameters: |
|
---|---|
Returns: | IKE policy information |
salt.modules.neutron.
show_ipsec_site_connection
(ipsec_site_connection, profile=None)¶Fetches information of a specific IPsecSiteConnection
CLI Example:
salt '*' neutron.show_ipsec_site_connection connection-name
Parameters: |
|
---|---|
Returns: | IPSec site connection information |
salt.modules.neutron.
show_ipsecpolicy
(ipsecpolicy, profile=None)¶Fetches information of a specific IPsecPolicy
CLI Example:
salt '*' neutron.show_ipsecpolicy ipsecpolicy-name
Parameters: |
|
---|---|
Returns: | IPSec policy information |
salt.modules.neutron.
show_network
(network, profile=None)¶Fetches information of a certain network
CLI Example:
salt '*' neutron.show_network network-name
salt '*' neutron.show_network network-name profile=openstack1
Parameters: |
|
---|---|
Returns: | Network information |
salt.modules.neutron.
show_port
(port, profile=None)¶Fetches information of a certain port
CLI Example:
salt '*' neutron.show_port port-id
salt '*' neutron.show_port port-id profile=openstack1
Parameters: |
|
---|---|
Returns: | Port information |
salt.modules.neutron.
show_quota
(tenant_id, profile=None)¶Fetches information of a certain tenant's quotas
CLI Example:
salt '*' neutron.show_quota tenant-id
salt '*' neutron.show_quota tenant-id profile=openstack1
Parameters: |
|
---|---|
Returns: | Quota information |
salt.modules.neutron.
show_router
(router, profile=None)¶Fetches information of a certain router
CLI Example:
salt '*' neutron.show_router router-name
Parameters: |
|
---|---|
Returns: | Router information |
salt.modules.neutron.
show_security_group
(security_group, profile=None)¶Fetches information of a certain security group
CLI Example:
salt '*' neutron.show_security_group security-group-name
Parameters: |
|
---|---|
Returns: | Security group information |
salt.modules.neutron.
show_security_group_rule
(security_group_rule_id, profile=None)¶Fetches information of a certain security group rule
CLI Example:
salt '*' neutron.show_security_group_rule security-group-rule-id
Parameters: |
|
---|---|
Returns: | Security group rule information |
salt.modules.neutron.
show_subnet
(subnet, profile=None)¶Fetches information of a certain subnet
CLI Example:
salt '*' neutron.show_subnet subnet-name
Parameters: |
|
---|---|
Returns: | Subnet information |
salt.modules.neutron.
show_vpnservice
(vpnservice, profile=None, **kwargs)¶Fetches information of a specific VPN service
CLI Example:
salt '*' neutron.show_vpnservice vpnservice-name
Parameters: |
|
---|---|
Returns: | VPN service information |
salt.modules.neutron.
update_firewall_rule
(firewall_rule, protocol=None, action=None, name=None, description=None, ip_version=None, source_ip_address=None, destination_ip_address=None, source_port=None, destination_port=None, shared=None, enabled=None, profile=None)¶Update a firewall rule
CLI Example:
salt '*' neutron.update_firewall_rule firewall_rule protocol=PROTOCOL action=ACTION
name=NAME description=DESCRIPTION ip_version=IP_VERSION
source_ip_address=SOURCE_IP_ADDRESS destination_ip_address=DESTINATION_IP_ADDRESS
source_port=SOURCE_PORT destination_port=DESTINATION_PORT shared=SHARED enabled=ENABLED
Parameters: |
|
---|
salt.modules.neutron.
update_floatingip
(floatingip_id, port=None, profile=None)¶Updates a floatingIP
CLI Example:
salt '*' neutron.update_floatingip network-name port-name
Parameters: |
|
---|---|
Returns: | Value of updated floating IP information |
salt.modules.neutron.
update_network
(network, name, profile=None)¶Updates a network
CLI Example:
salt '*' neutron.update_network network-name new-network-name
Parameters: |
|
---|---|
Returns: | Value of updated network information |
salt.modules.neutron.
update_port
(port, name, admin_state_up=True, profile=None)¶Updates a port
CLI Example:
salt '*' neutron.update_port port-name network-name new-port-name
Parameters: |
|
---|---|
Returns: | Value of updated port information |
salt.modules.neutron.
update_quota
(tenant_id, subnet=None, router=None, network=None, floatingip=None, port=None, security_group=None, security_group_rule=None, profile=None)¶Update a tenant's quota
CLI Example:
salt '*' neutron.update_quota tenant-id subnet=40 router=50
network=10 floatingip=30 port=30
Parameters: |
|
---|---|
Returns: | Value of updated quota |
salt.modules.neutron.
update_router
(router, name=None, admin_state_up=None, profile=None, **kwargs)¶Updates a router
CLI Example:
salt '*' neutron.update_router router_id name=new-router-name
admin_state_up=True
Parameters: |
|
---|---|
Returns: | Value of updated router information |
salt.modules.neutron.
update_security_group
(security_group, name=None, description=None, profile=None)¶Updates a security group
CLI Example:
salt '*' neutron.update_security_group security-group-name new-security-group-name
Parameters: |
|
---|---|
Returns: | Value of updated security group information |
salt.modules.neutron.
update_subnet
(subnet, name, profile=None)¶Updates a subnet
CLI Example:
salt '*' neutron.update_subnet subnet-name new-subnet-name
Parameters: |
|
---|---|
Returns: | Value of updated subnet information |
salt.modules.neutron.
update_vpnservice
(vpnservice, desc, profile=None)¶Updates a VPN service
CLI Example:
salt '*' neutron.update_vpnservice vpnservice-name desc='VPN Service1'
Parameters: |
|
---|---|
Returns: | Value of updated VPN service information |