neutron-lib-1.13.0/0000775000175100017510000000000013231472430014055 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib.egg-info/0000775000175100017510000000000013231472430020067 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib.egg-info/requires.txt0000664000175100017510000000060313231472427022474 0ustar zuulzuul00000000000000pbr!=2.1.0,>=2.0.0 SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 debtcollector>=1.2.0 keystoneauth1>=3.3.0 stevedore>=1.20.0 oslo.concurrency>=3.25.0 oslo.config>=5.1.0 oslo.context>=2.19.2 oslo.db>=4.27.0 oslo.i18n>=3.15.3 oslo.log>=3.36.0 oslo.messaging>=5.29.0 oslo.policy>=1.30.0 oslo.serialization!=2.19.1,>=2.18.0 oslo.service!=1.28.1,>=1.24.0 oslo.utils>=3.33.0 WebOb>=1.7.1 neutron-lib-1.13.0/neutron_lib.egg-info/not-zip-safe0000664000175100017510000000000113231472400022312 0ustar zuulzuul00000000000000 neutron-lib-1.13.0/neutron_lib.egg-info/SOURCES.txt0000664000175100017510000013164313231472430021763 0ustar zuulzuul00000000000000.coveragerc .mailmap .stestr.conf .testr.conf AUTHORS CONTRIBUTING.rst ChangeLog HACKING.rst LICENSE README.rst babel.cfg requirements.txt setup.cfg setup.py test-requirements.txt tox.ini api-ref/source/conf.py api-ref/source/index.rst api-ref/source/v2/agents.inc api-ref/source/v2/bgpvpn-bgpvpns.inc api-ref/source/v2/bgpvpn-network_associations.inc api-ref/source/v2/bgpvpn-overview.inc api-ref/source/v2/bgpvpn-port_associations.inc api-ref/source/v2/bgpvpn-router_associations.inc api-ref/source/v2/extensions.inc api-ref/source/v2/fip64.inc api-ref/source/v2/firewall_log.inc api-ref/source/v2/flavors.inc api-ref/source/v2/floatingips.inc api-ref/source/v2/fwaas-v2.inc api-ref/source/v2/fwaas.inc api-ref/source/v2/index.rst api-ref/source/v2/intro.inc api-ref/source/v2/lbaas-v2.inc api-ref/source/v2/logging.inc api-ref/source/v2/logging_resource.inc api-ref/source/v2/metering.inc api-ref/source/v2/network-ip-availability.inc api-ref/source/v2/networks.inc api-ref/source/v2/parameters.yaml api-ref/source/v2/ports.inc api-ref/source/v2/qos.inc api-ref/source/v2/quota_details.inc api-ref/source/v2/quotas.inc api-ref/source/v2/rbac-policy.inc api-ref/source/v2/router-interface-fip.inc api-ref/source/v2/routers.inc api-ref/source/v2/security-group-rules.inc api-ref/source/v2/security-groups.inc api-ref/source/v2/segments.inc api-ref/source/v2/service-providers.inc api-ref/source/v2/subnetpools.inc api-ref/source/v2/subnets.inc api-ref/source/v2/tags.inc api-ref/source/v2/trunk-details.inc api-ref/source/v2/trunk.inc api-ref/source/v2/versions.inc api-ref/source/v2/vpnaas.inc api-ref/source/v2/samples/service-type-response.json api-ref/source/v2/samples/agents/agent-show-response.json api-ref/source/v2/samples/agents/agent-update-request.json api-ref/source/v2/samples/agents/agent-update-response.json api-ref/source/v2/samples/agents/agents-list-response.json api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-create-request.json api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-create-response.json api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-show-response.json api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-update-request.json api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-update-response.json api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpns-list-response.json api-ref/source/v2/samples/bgpvpn/network_associations/network_association-create-request.json api-ref/source/v2/samples/bgpvpn/network_associations/network_association-create-response.json api-ref/source/v2/samples/bgpvpn/network_associations/network_association-list-response.json api-ref/source/v2/samples/bgpvpn/network_associations/network_association-show-response.json api-ref/source/v2/samples/bgpvpn/port_associations/port_association-create-request.json api-ref/source/v2/samples/bgpvpn/port_associations/port_association-create-response.json api-ref/source/v2/samples/bgpvpn/port_associations/port_association-list-response.json api-ref/source/v2/samples/bgpvpn/port_associations/port_association-show-response.json api-ref/source/v2/samples/bgpvpn/port_associations/port_association-update-request.json api-ref/source/v2/samples/bgpvpn/port_associations/port_association-update-response.json api-ref/source/v2/samples/bgpvpn/router_associations/router_association-create-request.json api-ref/source/v2/samples/bgpvpn/router_associations/router_association-create-response.json api-ref/source/v2/samples/bgpvpn/router_associations/router_association-list-response.json api-ref/source/v2/samples/bgpvpn/router_associations/router_association-show-response.json api-ref/source/v2/samples/bgpvpn/router_associations/router_association-update-request.json api-ref/source/v2/samples/bgpvpn/router_associations/router_association-update-response.json api-ref/source/v2/samples/extensions/extension-show-response.json api-ref/source/v2/samples/extensions/extensions-list-response.json api-ref/source/v2/samples/firewall-v2/firewall-group-create-request.json api-ref/source/v2/samples/firewall-v2/firewall-group-create-response.json api-ref/source/v2/samples/firewall-v2/firewall-group-show-response.json api-ref/source/v2/samples/firewall-v2/firewall-group-update-request.json api-ref/source/v2/samples/firewall-v2/firewall-group-update-response.json api-ref/source/v2/samples/firewall-v2/firewall-groups-list-response.json api-ref/source/v2/samples/firewall-v2/firewall-policies-list-response.json api-ref/source/v2/samples/firewall-v2/firewall-policy-create-request.json api-ref/source/v2/samples/firewall-v2/firewall-policy-create-response.json api-ref/source/v2/samples/firewall-v2/firewall-policy-insert-rule-request.json api-ref/source/v2/samples/firewall-v2/firewall-policy-insert-rule-response.json api-ref/source/v2/samples/firewall-v2/firewall-policy-remove-rule-request.json api-ref/source/v2/samples/firewall-v2/firewall-policy-remove-rule-response.json api-ref/source/v2/samples/firewall-v2/firewall-policy-show-response.json api-ref/source/v2/samples/firewall-v2/firewall-policy-update-request.json api-ref/source/v2/samples/firewall-v2/firewall-policy-update-response.json api-ref/source/v2/samples/firewall-v2/firewall-rule-create-request.json api-ref/source/v2/samples/firewall-v2/firewall-rule-create-response.json api-ref/source/v2/samples/firewall-v2/firewall-rule-show-response.json api-ref/source/v2/samples/firewall-v2/firewall-rule-update-request.json api-ref/source/v2/samples/firewall-v2/firewall-rule-update-response.json api-ref/source/v2/samples/firewall-v2/firewall-rules-list-response.json api-ref/source/v2/samples/firewall_log/firewall_log-create-request.json api-ref/source/v2/samples/firewall_log/firewall_log-create-response.json api-ref/source/v2/samples/firewall_log/firewall_log-show-response.json api-ref/source/v2/samples/firewall_log/firewall_log-update-request.json api-ref/source/v2/samples/firewall_log/firewall_log-update-response.json api-ref/source/v2/samples/firewall_log/firewall_logs-list-response.json api-ref/source/v2/samples/firewalls/firewall-create-request.json api-ref/source/v2/samples/firewalls/firewall-create-response.json api-ref/source/v2/samples/firewalls/firewall-policies-list-response.json api-ref/source/v2/samples/firewalls/firewall-policy-create-request.json api-ref/source/v2/samples/firewalls/firewall-policy-create-response.json api-ref/source/v2/samples/firewalls/firewall-policy-insert-rule-request.json api-ref/source/v2/samples/firewalls/firewall-policy-insert-rule-response.json api-ref/source/v2/samples/firewalls/firewall-policy-remove-rule-request.json api-ref/source/v2/samples/firewalls/firewall-policy-remove-rule-response.json api-ref/source/v2/samples/firewalls/firewall-policy-show-response.json api-ref/source/v2/samples/firewalls/firewall-policy-update-request.json api-ref/source/v2/samples/firewalls/firewall-policy-update-response.json api-ref/source/v2/samples/firewalls/firewall-rule-create-request.json api-ref/source/v2/samples/firewalls/firewall-rule-create-response.json api-ref/source/v2/samples/firewalls/firewall-rule-show-response.json api-ref/source/v2/samples/firewalls/firewall-rule-update-request.json api-ref/source/v2/samples/firewalls/firewall-rule-update-response.json api-ref/source/v2/samples/firewalls/firewall-rules-list-response.json api-ref/source/v2/samples/firewalls/firewall-show-response.json api-ref/source/v2/samples/firewalls/firewall-update-request.json api-ref/source/v2/samples/firewalls/firewall-update-response.json api-ref/source/v2/samples/firewalls/firewalls-list-response.json api-ref/source/v2/samples/flavors/flavor-associate-request.json api-ref/source/v2/samples/flavors/flavor-associate-response.json api-ref/source/v2/samples/flavors/flavor-create-request.json api-ref/source/v2/samples/flavors/flavor-create-response.json api-ref/source/v2/samples/flavors/flavor-show-response.json api-ref/source/v2/samples/flavors/flavor-update-request.json api-ref/source/v2/samples/flavors/flavor-update-response.json api-ref/source/v2/samples/flavors/flavors-list-response.json api-ref/source/v2/samples/flavors/service-profile-create-request.json api-ref/source/v2/samples/flavors/service-profile-create-response.json api-ref/source/v2/samples/flavors/service-profile-show-response.json api-ref/source/v2/samples/flavors/service-profile-update-request.json api-ref/source/v2/samples/flavors/service-profile-update-response.json api-ref/source/v2/samples/flavors/service-profiles-list-response.json api-ref/source/v2/samples/floatingips/floating-ips-list-response.json api-ref/source/v2/samples/floatingips/floatingip-create-request.json api-ref/source/v2/samples/floatingips/floatingip-create-response.json api-ref/source/v2/samples/floatingips/floatingip-disassociate-request.json api-ref/source/v2/samples/floatingips/floatingip-disassociate-response.json api-ref/source/v2/samples/floatingips/floatingip-show-response.json api-ref/source/v2/samples/floatingips/floatingip-update-request.json api-ref/source/v2/samples/floatingips/floatingip-update-response.json api-ref/source/v2/samples/lbaas/healthmonitor-associate-request.json api-ref/source/v2/samples/lbaas/healthmonitor-associate-response.json api-ref/source/v2/samples/lbaas/healthmonitor-create-request.json api-ref/source/v2/samples/lbaas/healthmonitor-create-response.json api-ref/source/v2/samples/lbaas/healthmonitor-show-response.json api-ref/source/v2/samples/lbaas/healthmonitor-update-request.json api-ref/source/v2/samples/lbaas/healthmonitor-update-response.json api-ref/source/v2/samples/lbaas/healthmonitors-list-response.json api-ref/source/v2/samples/lbaas/listener-create-request.json api-ref/source/v2/samples/lbaas/listener-create-response.json api-ref/source/v2/samples/lbaas/listener-show-response.json api-ref/source/v2/samples/lbaas/listener-update-request.json api-ref/source/v2/samples/lbaas/listener-update-response.json api-ref/source/v2/samples/lbaas/listeners-list-response.json api-ref/source/v2/samples/lbaas/loadbalancer-create-request.json api-ref/source/v2/samples/lbaas/loadbalancer-create-response.json api-ref/source/v2/samples/lbaas/loadbalancer-show-response.json api-ref/source/v2/samples/lbaas/loadbalancer-status-tree.json api-ref/source/v2/samples/lbaas/loadbalancer-update-request.json api-ref/source/v2/samples/lbaas/loadbalancer-update-response.json api-ref/source/v2/samples/lbaas/loadbalancer-update-response.txt api-ref/source/v2/samples/lbaas/loadbalancers-list-response.json api-ref/source/v2/samples/lbaas/member-create-request.json api-ref/source/v2/samples/lbaas/member-create-response.json api-ref/source/v2/samples/lbaas/member-show-response.json api-ref/source/v2/samples/lbaas/member-update-request.json api-ref/source/v2/samples/lbaas/member-update-response.json api-ref/source/v2/samples/lbaas/members-list-response.json api-ref/source/v2/samples/lbaas/pool-create-request.json api-ref/source/v2/samples/lbaas/pool-create-response.json api-ref/source/v2/samples/lbaas/pool-members-list-response.json api-ref/source/v2/samples/lbaas/pool-show-response.json api-ref/source/v2/samples/lbaas/pool-update-request.json api-ref/source/v2/samples/lbaas/pool-update-response.json api-ref/source/v2/samples/lbaas/pools-list-response.json api-ref/source/v2/samples/lbaas/pools-list-response2.json api-ref/source/v2/samples/lbaas/vip-create-request.json api-ref/source/v2/samples/lbaas/vip-create-response.json api-ref/source/v2/samples/lbaas/vip-show-response.json api-ref/source/v2/samples/lbaas/vip-update-request.json api-ref/source/v2/samples/lbaas/vip-update-response.json api-ref/source/v2/samples/lbaas/vips-list-response.json api-ref/source/v2/samples/logging_resource/logging_resource-create-request.json api-ref/source/v2/samples/logging_resource/logging_resource-create-response.json api-ref/source/v2/samples/logging_resource/logging_resource-show-response.json api-ref/source/v2/samples/logging_resource/logging_resource-update-request.json api-ref/source/v2/samples/logging_resource/logging_resource-update-response.json api-ref/source/v2/samples/logging_resource/logging_resources-list-response.json api-ref/source/v2/samples/logs/log-create-request.json api-ref/source/v2/samples/logs/log-create-response.json api-ref/source/v2/samples/logs/log-list-response.json api-ref/source/v2/samples/logs/log-show-response.json api-ref/source/v2/samples/logs/log-update-request.json api-ref/source/v2/samples/logs/log-update-response.json api-ref/source/v2/samples/logs/loggable_resources-list-response.json api-ref/source/v2/samples/metering/metering-label-create-request.json api-ref/source/v2/samples/metering/metering-label-create-response.json api-ref/source/v2/samples/metering/metering-label-delete-request-json-http.txt api-ref/source/v2/samples/metering/metering-label-delete-response-json-http.txt api-ref/source/v2/samples/metering/metering-label-rule-create-request.json api-ref/source/v2/samples/metering/metering-label-rule-create-response.json api-ref/source/v2/samples/metering/metering-label-rule-delete-request-json-http.txt api-ref/source/v2/samples/metering/metering-label-rule-delete-response-json-http.txt api-ref/source/v2/samples/metering/metering-label-rule-show-request-json-http.txt api-ref/source/v2/samples/metering/metering-label-rule-show-response.json api-ref/source/v2/samples/metering/metering-label-rules-list-request-json-http.txt api-ref/source/v2/samples/metering/metering-label-rules-list-response.json api-ref/source/v2/samples/metering/metering-label-show-request-json-http.txt api-ref/source/v2/samples/metering/metering-label-show-response.json api-ref/source/v2/samples/metering/metering-labels-list-request-json-http.txt api-ref/source/v2/samples/metering/metering-labels-list-response.json api-ref/source/v2/samples/network-ip-availability/network-ip-availability-list.json api-ref/source/v2/samples/network-ip-availability/network-ip-availability-show.json api-ref/source/v2/samples/networks/network-create-request.json api-ref/source/v2/samples/networks/network-create-response.json api-ref/source/v2/samples/networks/network-multi-create-request.json api-ref/source/v2/samples/networks/network-multi-create-response.json api-ref/source/v2/samples/networks/network-multi-show-response.json api-ref/source/v2/samples/networks/network-multi-update-request.json api-ref/source/v2/samples/networks/network-provider-create-request.json api-ref/source/v2/samples/networks/network-provider-create-response.json api-ref/source/v2/samples/networks/network-provider-show-response.json api-ref/source/v2/samples/networks/network-provider-update-request.json api-ref/source/v2/samples/networks/network-show-response.json api-ref/source/v2/samples/networks/network-update-request.json api-ref/source/v2/samples/networks/network-update-response.json api-ref/source/v2/samples/networks/networks-bulk-create-request.json api-ref/source/v2/samples/networks/networks-bulk-create-response.json api-ref/source/v2/samples/networks/networks-list-response.json api-ref/source/v2/samples/networks/networks-provider-list-response.json api-ref/source/v2/samples/networks/version-show-response.json api-ref/source/v2/samples/networks/versions-list-response.json api-ref/source/v2/samples/ports/port-bind-create-request.json api-ref/source/v2/samples/ports/port-bind-create-response.json api-ref/source/v2/samples/ports/port-bind-show-response.json api-ref/source/v2/samples/ports/port-bind-update-request.json api-ref/source/v2/samples/ports/port-bind-update-response.json api-ref/source/v2/samples/ports/port-create-request.json api-ref/source/v2/samples/ports/port-create-response.json api-ref/source/v2/samples/ports/port-show-response.json api-ref/source/v2/samples/ports/port-update-request.json api-ref/source/v2/samples/ports/port-update-response.json api-ref/source/v2/samples/ports/ports-bind-list-response.json api-ref/source/v2/samples/ports/ports-bulk-create-request.json api-ref/source/v2/samples/ports/ports-bulk-create-response.json api-ref/source/v2/samples/ports/ports-list-response.json api-ref/source/v2/samples/qos/bandwidth_limit_rule-create-request.json api-ref/source/v2/samples/qos/bandwidth_limit_rule-create-response.json api-ref/source/v2/samples/qos/bandwidth_limit_rule-show-response.json api-ref/source/v2/samples/qos/bandwidth_limit_rule-update-request.json api-ref/source/v2/samples/qos/bandwidth_limit_rule-update-response.json api-ref/source/v2/samples/qos/bandwidth_limit_rules-list-response.json api-ref/source/v2/samples/qos/dscp_marking_rule-create-request.json api-ref/source/v2/samples/qos/dscp_marking_rule-create-response.json api-ref/source/v2/samples/qos/dscp_marking_rule-show-response.json api-ref/source/v2/samples/qos/dscp_marking_rule-update-request.json api-ref/source/v2/samples/qos/dscp_marking_rule-update-response.json api-ref/source/v2/samples/qos/dscp_marking_rules-list-response.json api-ref/source/v2/samples/qos/minimum_bandwidth_rule-create-request.json api-ref/source/v2/samples/qos/minimum_bandwidth_rule-create-response.json api-ref/source/v2/samples/qos/minimum_bandwidth_rule-show-response.json api-ref/source/v2/samples/qos/minimum_bandwidth_rule-update-request.json api-ref/source/v2/samples/qos/minimum_bandwidth_rule-update-response.json api-ref/source/v2/samples/qos/minimum_bandwidth_rules-list-response.json api-ref/source/v2/samples/qos/policies-list-response.json api-ref/source/v2/samples/qos/policy-create-request.json api-ref/source/v2/samples/qos/policy-create-response.json api-ref/source/v2/samples/qos/policy-show-response.json api-ref/source/v2/samples/qos/policy-update-request.json api-ref/source/v2/samples/qos/policy-update-response.json api-ref/source/v2/samples/qos/rule_type-details-response.json api-ref/source/v2/samples/qos/rule_types-list-response.json api-ref/source/v2/samples/quota_details/quota-details-show-for-project-response.json api-ref/source/v2/samples/quotas/quotas-list-for-project-response.json api-ref/source/v2/samples/quotas/quotas-list-response.json api-ref/source/v2/samples/quotas/quotas-update-request.json api-ref/source/v2/samples/quotas/quotas-update-response.json api-ref/source/v2/samples/rbac_policy/rbac-policies-list-response.json api-ref/source/v2/samples/rbac_policy/rbac-policy-create-request.json api-ref/source/v2/samples/rbac_policy/rbac-policy-create-response.json api-ref/source/v2/samples/rbac_policy/rbac-policy-show-response.json api-ref/source/v2/samples/rbac_policy/rbac-policy-update-request.json api-ref/source/v2/samples/rbac_policy/rbac-policy-update-response.json api-ref/source/v2/samples/routers/router-add-interface-request-with-port.json api-ref/source/v2/samples/routers/router-add-interface-request.json api-ref/source/v2/samples/routers/router-add-interface-response.json api-ref/source/v2/samples/routers/router-create-request.json api-ref/source/v2/samples/routers/router-create-response.json api-ref/source/v2/samples/routers/router-remove-interface-request-with-port.json api-ref/source/v2/samples/routers/router-remove-interface-request.json api-ref/source/v2/samples/routers/router-remove-interface-response.json api-ref/source/v2/samples/routers/router-show-response.json api-ref/source/v2/samples/routers/router-update-request.json api-ref/source/v2/samples/routers/router-update-response.json api-ref/source/v2/samples/routers/routers-list-response.json api-ref/source/v2/samples/security-groups/security-group-create-request.json api-ref/source/v2/samples/security-groups/security-group-create-response.json api-ref/source/v2/samples/security-groups/security-group-delete-request-json-http.txt api-ref/source/v2/samples/security-groups/security-group-delete-response-json-http.txt api-ref/source/v2/samples/security-groups/security-group-rule-create-request.json api-ref/source/v2/samples/security-groups/security-group-rule-create-response.json api-ref/source/v2/samples/security-groups/security-group-rule-delete-request-json-http.txt api-ref/source/v2/samples/security-groups/security-group-rule-delete-response-json-http.txt api-ref/source/v2/samples/security-groups/security-group-rule-show-request-json-http.txt api-ref/source/v2/samples/security-groups/security-group-rule-show-response.json api-ref/source/v2/samples/security-groups/security-group-rules-list-request-json-http.txt api-ref/source/v2/samples/security-groups/security-group-rules-list-response.json api-ref/source/v2/samples/security-groups/security-group-show-request-json-http.txt api-ref/source/v2/samples/security-groups/security-group-show-response.json api-ref/source/v2/samples/security-groups/security-group-update-request.json api-ref/source/v2/samples/security-groups/security-group-update-response.json api-ref/source/v2/samples/security-groups/security-groups-list-request-json-http.txt api-ref/source/v2/samples/security-groups/security-groups-list-response.json api-ref/source/v2/samples/segments/segment-create-request.json api-ref/source/v2/samples/segments/segment-create-response.json api-ref/source/v2/samples/segments/segment-show-response.json api-ref/source/v2/samples/segments/segment-update-request.json api-ref/source/v2/samples/segments/segment-update-response.json api-ref/source/v2/samples/segments/segments-list-response.json api-ref/source/v2/samples/subnets/subnet-create-request.json api-ref/source/v2/samples/subnets/subnet-create-response.json api-ref/source/v2/samples/subnets/subnet-show-response.json api-ref/source/v2/samples/subnets/subnet-update-request.json api-ref/source/v2/samples/subnets/subnet-update-response.json api-ref/source/v2/samples/subnets/subnetpool-create-request.json api-ref/source/v2/samples/subnets/subnetpool-create-response.json api-ref/source/v2/samples/subnets/subnetpool-show-response.json api-ref/source/v2/samples/subnets/subnetpool-update-request.json api-ref/source/v2/samples/subnets/subnetpool-update-response.json api-ref/source/v2/samples/subnets/subnetpools-list-response.json api-ref/source/v2/samples/subnets/subnets-create-bulk-request.json api-ref/source/v2/samples/subnets/subnets-create-bulk-response.json api-ref/source/v2/samples/subnets/subnets-list-response.json api-ref/source/v2/samples/tag/tag-obtain-response.json api-ref/source/v2/samples/tag/tag-update-request.json api-ref/source/v2/samples/tag/tag-update-response.json api-ref/source/v2/samples/trunks/trunk-add-subports-request.json api-ref/source/v2/samples/trunks/trunk-add-subports-response.json api-ref/source/v2/samples/trunks/trunk-create-request.json api-ref/source/v2/samples/trunks/trunk-details-show-response.json api-ref/source/v2/samples/trunks/trunk-list-subports-response.json api-ref/source/v2/samples/trunks/trunk-remove-subports-request.json api-ref/source/v2/samples/trunks/trunk-remove-subports-response.json api-ref/source/v2/samples/trunks/trunk-show-response.json api-ref/source/v2/samples/trunks/trunk-update-request.json api-ref/source/v2/samples/trunks/trunk-update-response.json api-ref/source/v2/samples/trunks/trunks-create-response.json api-ref/source/v2/samples/trunks/trunks-list-response.json api-ref/source/v2/samples/vpn/ikepolicies-list-response.json api-ref/source/v2/samples/vpn/ikepolicy-create-request.json api-ref/source/v2/samples/vpn/ikepolicy-create-response.json api-ref/source/v2/samples/vpn/ikepolicy-show-response.json api-ref/source/v2/samples/vpn/ikepolicy-update-request.json api-ref/source/v2/samples/vpn/ikepolicy-update-response.json api-ref/source/v2/samples/vpn/ipsec-site-connection-create-request.json api-ref/source/v2/samples/vpn/ipsec-site-connection-create-response.json api-ref/source/v2/samples/vpn/ipsec-site-connection-show-response.json api-ref/source/v2/samples/vpn/ipsec-site-connection-update-request.json api-ref/source/v2/samples/vpn/ipsec-site-connection-update-response.json api-ref/source/v2/samples/vpn/ipsec-site-connections-list-response.json api-ref/source/v2/samples/vpn/ipsecpolicies-list-response.json api-ref/source/v2/samples/vpn/ipsecpolicy-create-request.json api-ref/source/v2/samples/vpn/ipsecpolicy-create-response.json api-ref/source/v2/samples/vpn/ipsecpolicy-show-response.json api-ref/source/v2/samples/vpn/ipsecpolicy-update-request.json api-ref/source/v2/samples/vpn/ipsecpolicy-update-response.json api-ref/source/v2/samples/vpn/vpn-endpoint-group-create-request.json api-ref/source/v2/samples/vpn/vpn-endpoint-group-create-response.json api-ref/source/v2/samples/vpn/vpn-endpoint-group-show-response.json api-ref/source/v2/samples/vpn/vpn-endpoint-group-update-request.json api-ref/source/v2/samples/vpn/vpn-endpoint-group-update-response.json api-ref/source/v2/samples/vpn/vpn-endpoint-groups-list-response.json api-ref/source/v2/samples/vpn/vpnservice-create-request.json api-ref/source/v2/samples/vpn/vpnservice-create-response.json api-ref/source/v2/samples/vpn/vpnservice-show-response.json api-ref/source/v2/samples/vpn/vpnservice-update-request.json api-ref/source/v2/samples/vpn/vpnservice-update-response.json api-ref/source/v2/samples/vpn/vpnservices-list-response.json doc/source/conf.py doc/source/index.rst doc/source/contributor/api_attributes.rst doc/source/contributor/api_converters.rst doc/source/contributor/api_extensions.rst doc/source/contributor/api_validators.rst doc/source/contributor/callbacks.rst doc/source/contributor/contributing.rst doc/source/contributor/conventions.rst doc/source/contributor/index.rst doc/source/contributor/internals.rst doc/source/contributor/releasing.rst doc/source/contributor/review-guidelines.rst doc/source/install/index.rst doc/source/reference/index.rst doc/source/user/hacking.rst doc/source/user/index.rst neutron_lib/__init__.py neutron_lib/_i18n.py neutron_lib/_policy.py neutron_lib/constants.py neutron_lib/context.py neutron_lib/fixture.py neutron_lib/version.py neutron_lib/worker.py neutron_lib.egg-info/PKG-INFO neutron_lib.egg-info/SOURCES.txt neutron_lib.egg-info/dependency_links.txt neutron_lib.egg-info/not-zip-safe neutron_lib.egg-info/pbr.json neutron_lib.egg-info/requires.txt neutron_lib.egg-info/top_level.txt neutron_lib/agent/__init__.py neutron_lib/agent/constants.py neutron_lib/agent/extension.py neutron_lib/agent/l2_extension.py neutron_lib/agent/l3_extension.py neutron_lib/agent/topics.py neutron_lib/api/__init__.py neutron_lib/api/attributes.py neutron_lib/api/converters.py neutron_lib/api/extensions.py neutron_lib/api/faults.py neutron_lib/api/utils.py neutron_lib/api/definitions/__init__.py neutron_lib/api/definitions/_dummy.py neutron_lib/api/definitions/address_scope.py neutron_lib/api/definitions/agent.py neutron_lib/api/definitions/allowedaddresspairs.py neutron_lib/api/definitions/auto_allocated_topology.py neutron_lib/api/definitions/availability_zone.py neutron_lib/api/definitions/base.py neutron_lib/api/definitions/bgpvpn.py neutron_lib/api/definitions/bgpvpn_routes_control.py neutron_lib/api/definitions/bgpvpn_vni.py neutron_lib/api/definitions/constants.py neutron_lib/api/definitions/data_plane_status.py neutron_lib/api/definitions/default_subnetpools.py neutron_lib/api/definitions/dns.py neutron_lib/api/definitions/dns_domain_ports.py neutron_lib/api/definitions/dvr.py neutron_lib/api/definitions/external_net.py neutron_lib/api/definitions/extra_dhcp_opt.py neutron_lib/api/definitions/extraroute.py neutron_lib/api/definitions/fip64.py neutron_lib/api/definitions/firewall.py neutron_lib/api/definitions/firewall_v2.py neutron_lib/api/definitions/firewallrouterinsertion.py neutron_lib/api/definitions/flavors.py neutron_lib/api/definitions/ip_allocation.py neutron_lib/api/definitions/ip_substring_port_filtering.py neutron_lib/api/definitions/l2_adjacency.py neutron_lib/api/definitions/l3.py neutron_lib/api/definitions/l3_ext_gw_mode.py neutron_lib/api/definitions/l3_ext_ha_mode.py neutron_lib/api/definitions/l3_flavors.py neutron_lib/api/definitions/logging.py neutron_lib/api/definitions/logging_resource.py neutron_lib/api/definitions/metering.py neutron_lib/api/definitions/multiprovidernet.py neutron_lib/api/definitions/network.py neutron_lib/api/definitions/network_availability_zone.py neutron_lib/api/definitions/network_ip_availability.py neutron_lib/api/definitions/network_mtu.py neutron_lib/api/definitions/network_mtu_writable.py neutron_lib/api/definitions/pagination.py neutron_lib/api/definitions/port.py neutron_lib/api/definitions/port_security.py neutron_lib/api/definitions/portbindings.py neutron_lib/api/definitions/portbindings_extended.py neutron_lib/api/definitions/project_id.py neutron_lib/api/definitions/provider_net.py neutron_lib/api/definitions/qos.py neutron_lib/api/definitions/qos_default.py neutron_lib/api/definitions/qos_rule_type_details.py neutron_lib/api/definitions/revisionifmatch.py neutron_lib/api/definitions/router_availability_zone.py neutron_lib/api/definitions/router_interface_fip.py neutron_lib/api/definitions/routerservicetype.py neutron_lib/api/definitions/segment.py neutron_lib/api/definitions/servicetype.py neutron_lib/api/definitions/sorting.py neutron_lib/api/definitions/subnet.py neutron_lib/api/definitions/subnet_onboard.py neutron_lib/api/definitions/subnetpool.py neutron_lib/api/definitions/trunk.py neutron_lib/api/definitions/trunk_details.py neutron_lib/api/definitions/vlantransparent.py neutron_lib/api/validators/__init__.py neutron_lib/api/validators/allowedaddresspairs.py neutron_lib/api/validators/availability_zone.py neutron_lib/api/validators/dns.py neutron_lib/api/validators/multiprovidernet.py neutron_lib/callbacks/__init__.py neutron_lib/callbacks/events.py neutron_lib/callbacks/exceptions.py neutron_lib/callbacks/manager.py neutron_lib/callbacks/registry.py neutron_lib/callbacks/resources.py neutron_lib/clients/__init__.py neutron_lib/clients/placement.py neutron_lib/db/__init__.py neutron_lib/db/api.py neutron_lib/db/constants.py neutron_lib/db/model_base.py neutron_lib/db/utils.py neutron_lib/exceptions/__init__.py neutron_lib/exceptions/address_scope.py neutron_lib/exceptions/agent.py neutron_lib/exceptions/allowedaddresspairs.py neutron_lib/exceptions/availability_zone.py neutron_lib/exceptions/dns.py neutron_lib/exceptions/dvr.py neutron_lib/exceptions/external_net.py neutron_lib/exceptions/extraroute.py neutron_lib/exceptions/firewall_v1.py neutron_lib/exceptions/firewall_v2.py neutron_lib/exceptions/flavors.py neutron_lib/exceptions/l3.py neutron_lib/exceptions/l3_ext_ha_mode.py neutron_lib/exceptions/metering.py neutron_lib/exceptions/multiprovidernet.py neutron_lib/exceptions/placement.py neutron_lib/exceptions/port_security.py neutron_lib/exceptions/vlantransparent.py neutron_lib/hacking/__init__.py neutron_lib/hacking/checks.py neutron_lib/hacking/translation_checks.py neutron_lib/legacy/README.rst neutron_lib/legacy/__init__.py neutron_lib/locale/zh_CN/LC_MESSAGES/neutron_lib.po neutron_lib/objects/__init__.py neutron_lib/objects/exceptions.py neutron_lib/plugins/__init__.py neutron_lib/plugins/constants.py neutron_lib/plugins/directory.py neutron_lib/plugins/utils.py neutron_lib/plugins/ml2/__init__.py neutron_lib/plugins/ml2/api.py neutron_lib/services/__init__.py neutron_lib/services/base.py neutron_lib/services/qos/__init__.py neutron_lib/services/qos/base.py neutron_lib/services/qos/constants.py neutron_lib/tests/__init__.py neutron_lib/tests/_base.py neutron_lib/tests/_post_mortem_debug.py neutron_lib/tests/_tools.py neutron_lib/tests/etc/neutron_lib.conf neutron_lib/tests/etc/no_policy.json neutron_lib/tests/etc/policy.json neutron_lib/tests/unit/__init__.py neutron_lib/tests/unit/test__policy.py neutron_lib/tests/unit/test_context.py neutron_lib/tests/unit/test_fixture.py neutron_lib/tests/unit/test_neutron_lib.py neutron_lib/tests/unit/test_worker.py neutron_lib/tests/unit/api/__init__.py neutron_lib/tests/unit/api/test_attributes.py neutron_lib/tests/unit/api/test_conversions.py neutron_lib/tests/unit/api/test_extensions.py neutron_lib/tests/unit/api/test_faults.py neutron_lib/tests/unit/api/definitions/__init__.py neutron_lib/tests/unit/api/definitions/base.py neutron_lib/tests/unit/api/definitions/ip_allocation.py neutron_lib/tests/unit/api/definitions/test__dummy.py neutron_lib/tests/unit/api/definitions/test_address_scope.py neutron_lib/tests/unit/api/definitions/test_agent.py neutron_lib/tests/unit/api/definitions/test_allowedaddresspairs.py neutron_lib/tests/unit/api/definitions/test_auto_allocated_topology.py neutron_lib/tests/unit/api/definitions/test_availability_zone.py neutron_lib/tests/unit/api/definitions/test_bgpvpn.py neutron_lib/tests/unit/api/definitions/test_bgpvpn_routes_control.py neutron_lib/tests/unit/api/definitions/test_bgpvpn_vni.py neutron_lib/tests/unit/api/definitions/test_data_plane_status.py neutron_lib/tests/unit/api/definitions/test_default_subnetpools.py neutron_lib/tests/unit/api/definitions/test_dns.py neutron_lib/tests/unit/api/definitions/test_dns_domain_ports.py neutron_lib/tests/unit/api/definitions/test_dvr.py neutron_lib/tests/unit/api/definitions/test_external_net.py neutron_lib/tests/unit/api/definitions/test_extra_dhcp_opt.py neutron_lib/tests/unit/api/definitions/test_extraroute.py neutron_lib/tests/unit/api/definitions/test_fip64.py neutron_lib/tests/unit/api/definitions/test_firewall.py neutron_lib/tests/unit/api/definitions/test_firewall_v2.py neutron_lib/tests/unit/api/definitions/test_firewallrouterinsertion.py neutron_lib/tests/unit/api/definitions/test_flavors.py neutron_lib/tests/unit/api/definitions/test_ip_substring_filtering.py neutron_lib/tests/unit/api/definitions/test_l2_adjancency.py neutron_lib/tests/unit/api/definitions/test_l3.py neutron_lib/tests/unit/api/definitions/test_l3_ext_gw_mode.py neutron_lib/tests/unit/api/definitions/test_l3_ext_ha_mode.py neutron_lib/tests/unit/api/definitions/test_l3_flavors.py neutron_lib/tests/unit/api/definitions/test_logging.py neutron_lib/tests/unit/api/definitions/test_logging_resource.py neutron_lib/tests/unit/api/definitions/test_metering.py neutron_lib/tests/unit/api/definitions/test_multiprovidernet.py neutron_lib/tests/unit/api/definitions/test_network.py neutron_lib/tests/unit/api/definitions/test_network_availability_zone.py neutron_lib/tests/unit/api/definitions/test_network_ip_availability.py neutron_lib/tests/unit/api/definitions/test_network_mtu.py neutron_lib/tests/unit/api/definitions/test_network_mtu_writable.py neutron_lib/tests/unit/api/definitions/test_pagination.py neutron_lib/tests/unit/api/definitions/test_port.py neutron_lib/tests/unit/api/definitions/test_port_security.py neutron_lib/tests/unit/api/definitions/test_portbindings.py neutron_lib/tests/unit/api/definitions/test_portbindings_extended.py neutron_lib/tests/unit/api/definitions/test_project_id.py neutron_lib/tests/unit/api/definitions/test_provider_net.py neutron_lib/tests/unit/api/definitions/test_qos.py neutron_lib/tests/unit/api/definitions/test_qos_default.py neutron_lib/tests/unit/api/definitions/test_qos_rule_type_details.py neutron_lib/tests/unit/api/definitions/test_revisionifmatch.py neutron_lib/tests/unit/api/definitions/test_router_availability_zone.py neutron_lib/tests/unit/api/definitions/test_router_interface_fip.py neutron_lib/tests/unit/api/definitions/test_routerservicetype.py neutron_lib/tests/unit/api/definitions/test_segment.py neutron_lib/tests/unit/api/definitions/test_servicetype.py neutron_lib/tests/unit/api/definitions/test_sorting.py neutron_lib/tests/unit/api/definitions/test_subnet.py neutron_lib/tests/unit/api/definitions/test_subnet_onboard.py neutron_lib/tests/unit/api/definitions/test_subnetpool.py neutron_lib/tests/unit/api/definitions/test_trunk.py neutron_lib/tests/unit/api/definitions/test_trunk_details.py neutron_lib/tests/unit/api/definitions/test_vlantransparent.py neutron_lib/tests/unit/api/validators/__init__.py neutron_lib/tests/unit/api/validators/test_allowedaddresspairs.py neutron_lib/tests/unit/api/validators/test_availability_zone.py neutron_lib/tests/unit/api/validators/test_dns.py neutron_lib/tests/unit/api/validators/test_multiprovidernet.py neutron_lib/tests/unit/api/validators/test_validators.py neutron_lib/tests/unit/callbacks/__init__.py neutron_lib/tests/unit/callbacks/test_callback_exceptions.py neutron_lib/tests/unit/callbacks/test_events.py neutron_lib/tests/unit/callbacks/test_manager.py neutron_lib/tests/unit/callbacks/test_registry.py neutron_lib/tests/unit/clients/__init__.py neutron_lib/tests/unit/clients/test_placement.py neutron_lib/tests/unit/db/__init__.py neutron_lib/tests/unit/db/_base.py neutron_lib/tests/unit/db/test_model_base.py neutron_lib/tests/unit/db/test_utils.py neutron_lib/tests/unit/exceptions/__init__.py neutron_lib/tests/unit/exceptions/test_exceptions.py neutron_lib/tests/unit/hacking/__init__.py neutron_lib/tests/unit/hacking/test_checks.py neutron_lib/tests/unit/legacy/__init__.py neutron_lib/tests/unit/plugins/__init__.py neutron_lib/tests/unit/plugins/test_directory.py neutron_lib/tests/unit/plugins/test_utils.py neutron_lib/tests/unit/plugins/ml2/__init__.py neutron_lib/tests/unit/plugins/ml2/test_api.py neutron_lib/tests/unit/services/__init__.py neutron_lib/tests/unit/services/test_base.py neutron_lib/tests/unit/services/qos/__init__.py neutron_lib/tests/unit/services/qos/test_base.py neutron_lib/tests/unit/utils/__init__.py neutron_lib/tests/unit/utils/test_file.py neutron_lib/tests/unit/utils/test_helpers.py neutron_lib/tests/unit/utils/test_host.py neutron_lib/tests/unit/utils/test_net.py neutron_lib/tests/unit/utils/test_runtime.py neutron_lib/utils/__init__.py neutron_lib/utils/file.py neutron_lib/utils/helpers.py neutron_lib/utils/host.py neutron_lib/utils/net.py neutron_lib/utils/runtime.py releasenotes/notes/.placeholder releasenotes/notes/add-action-status-3dbfe2490a0d231a.yaml releasenotes/notes/add-convert-to-string-524541aa6224f66f.yaml releasenotes/notes/add-directory-is-loaded-e9da5b65824dddad.yaml releasenotes/notes/add-exception-pkg-5a14389891abf358.yaml releasenotes/notes/add-extension-supported-be6f7069856d2891.yaml releasenotes/notes/add-ip-substring-filtering-extension-06bb0c1f738ee330.yaml releasenotes/notes/add-ipinip-protocol-ab9287f9b698f34c.yaml releasenotes/notes/add-port-binding-resource-73f9800dbda121ca.yaml releasenotes/notes/add-validator-pkg-a6565a2d4fbfa1d8.yaml releasenotes/notes/add-vif-type-agilio-ovs-6bee5b2557aca10e.yaml releasenotes/notes/add-vni-to-bgpvpn-7531df9fa4f8955b.yaml releasenotes/notes/add-vnic-virtio-forwarder-portbinding-f7f87dfbef456ed1.yaml releasenotes/notes/add_fwg_group-9252d07f1011613d.yaml releasenotes/notes/agent_extensions-2b497ff33c6dc3e8.yaml releasenotes/notes/alembic-branches-6d5947d141efd26e.yaml releasenotes/notes/api-definition-base-d2e9514c5ee2ef5b.yaml releasenotes/notes/bgpvpn-api-def-22c7072575316ddd.yaml releasenotes/notes/bgpvpn-api-ref-f0294d9ddec726a0.yaml releasenotes/notes/bgpvpn-routes-control-51cd95d6ab265cb1.yaml releasenotes/notes/bgpvpn_rt_fix-6d02db6a1c22f002.yaml releasenotes/notes/boilerplate-ext-descriptor-a5cec8b9b900cbfd.yaml releasenotes/notes/cidr_for_canonical_format-4e7925d76a27a19d.yaml releasenotes/notes/context-manager-23538670cd9c701f.yaml releasenotes/notes/context-public-6df198b77027c224.yaml releasenotes/notes/core-attributes-43e6969f1b187e5c.yaml releasenotes/notes/create-netmtu-writable-extension-284892119ef6595c.yaml releasenotes/notes/data-plane-status-ext-c3452a01ef5007ce.yaml releasenotes/notes/deprecate-api-utils-4f86288591c95679.yaml releasenotes/notes/directory-fixture-083c5c5f365670d6.yaml releasenotes/notes/dns-api-def-bc24a58f56c5fbfb.yaml releasenotes/notes/dns-domain-ports-ext-39a069119e79e59b.yaml releasenotes/notes/enable-hacking-check-H904-f512ecc98c0a4033.yaml releasenotes/notes/events_l3_flavors-053714858ced693d.yaml releasenotes/notes/expose-and-enhance-callback-api-714cce65a3c44fe7.yaml releasenotes/notes/extension-fixture-b7fd61384f1a4d1d.yaml releasenotes/notes/extension_descriptor-04025e86249cc94c.yaml releasenotes/notes/extra-dhcp-opt-public-vars-ec4e1c2dcac43d69.yaml releasenotes/notes/fip64-0c6bb38417d602f1.yaml releasenotes/notes/flush_on_subtransaction-99ef11dfb56b706d.yaml releasenotes/notes/fwaas-api-def-a6f03db369177b4a.yaml releasenotes/notes/fwaas-exceptions-e580766205b466d4.yaml releasenotes/notes/fwaas_converters_validators-c310900b4386146e.yaml releasenotes/notes/hacking-check-n537-280ec39c061d9dd7.yaml releasenotes/notes/introduce-logging-api-031d00eb84d5d061.yaml releasenotes/notes/ipv6_address_usage-ef3d65ad5aa5798b.yaml releasenotes/notes/l3-agent-extensions-ha-state-change-837140efe4187a99.yaml releasenotes/notes/l3-apidef-exceptions-ee57b9df1c7443d4.yaml releasenotes/notes/l3-apidefs-d028c708c22ef2a0.yaml releasenotes/notes/logging-api-ref-fafb884367ca60a2.yaml releasenotes/notes/logging-resource-api-cecf33e3be468eb2.yaml releasenotes/notes/migrate-public-to-shared-0c67b32f9c37c751.yaml releasenotes/notes/move-get-random-mac-98f47d81cb34483d.yaml releasenotes/notes/moved-netmtu-extension-5999348000adcfaf.yaml releasenotes/notes/new-hacking-check-no-log-translations-4a430a38aeb06452.yaml releasenotes/notes/new-validator-range-or-none-dc8d557ec1f2622a.yaml releasenotes/notes/one-hacking-factory-01053e8e3d88c3d5.yaml releasenotes/notes/plugin-directory-55861f4098813ba6.yaml releasenotes/notes/policy-redux-25c26836219fd02d.yaml releasenotes/notes/port-range-compared-as-int-4d07fe030206f818.yaml releasenotes/notes/portbindings-apidef-3d7893bcb94d7f61.yaml releasenotes/notes/portbindings-extended-3a89560ee63824e1.yaml releasenotes/notes/provider-net-apidef-9ebe9f56840c79f7.yaml releasenotes/notes/public-service-classes-e52d7c79a075b799.yaml releasenotes/notes/rehome-address-scope-apidef-f4e8bb74be61729a.yaml releasenotes/notes/rehome-agent-apidef-7a2dde6a9810f55c.yaml releasenotes/notes/rehome-allowedaddrpairs-apidef-cd342b9a57a2dfdf.yaml releasenotes/notes/rehome-api-faults-cf30246e5e5bf8b8.yaml releasenotes/notes/rehome-autotopology-apidef-4a77e8ba0c783f7e.yaml releasenotes/notes/rehome-az-apidef-1e63cbd2359994fa.yaml releasenotes/notes/rehome-common-constants-8ac9580e52fd3618.yaml releasenotes/notes/rehome-core-api-defs-390735ff3bd5d2ab.yaml releasenotes/notes/rehome-dftsnetpool-apidef-4de5d75d2a63dec9.yaml releasenotes/notes/rehome-dhcpopts-apidef-389ab9d8935e5e0d.yaml releasenotes/notes/rehome-dvr-apidef-a6aa415152457c9a.yaml releasenotes/notes/rehome-dvr-related-leftover-constants-2cf329794166b3f2.yaml releasenotes/notes/rehome-externalnet-apidef-d377f87da900eabe.yaml releasenotes/notes/rehome-extraroute-apidef-e14e72e03ce18ead.yaml releasenotes/notes/rehome-flavors-apidef-ef84b2c1c7eaeed7.yaml releasenotes/notes/rehome-ipalloc-apidef-dee59cfffd903b7a.yaml releasenotes/notes/rehome-ipv6pdprefix-const-d3b39992df4adef8.yaml releasenotes/notes/rehome-l2adjacency-apidef-f91bf184d90122c8.yaml releasenotes/notes/rehome-l3extgwmode-apidef-8f83e0f6cf0515e7.yaml releasenotes/notes/rehome-l3exthamode-apidef-9b3ef0956edb3883.yaml releasenotes/notes/rehome-l3flavors-apidef-da5e9b5d46df5cc7.yaml releasenotes/notes/rehome-metering-apidef-d9a0e70cbecc2bcc.yaml releasenotes/notes/rehome-ml2-api-extaliases-4db48e113893c7a5.yaml releasenotes/notes/rehome-ml2-driverapi-363db4b8fa42f8f1.yaml releasenotes/notes/rehome-ml2-mechdriver-cc86d3a2fe4c2822.yaml releasenotes/notes/rehome-multiprovidernet-apidef-367e57772e931758.yaml releasenotes/notes/rehome-netaz-apidef-74e962ef682380bc.yaml releasenotes/notes/rehome-netipavail-apidef-d03558ac48b71333.yaml releasenotes/notes/rehome-ovo-exceptions-fbddfeea582ef3f1.yaml releasenotes/notes/rehome-pagination-apidef-9aebf1c7a6bcb58b.yaml releasenotes/notes/rehome-placement-api-client-a9ac5d96ca8570aa.yaml releasenotes/notes/rehome-plugin-constants-ebf350dfd989957a.yaml releasenotes/notes/rehome-plugin-utils-39e3f839c0538de9.yaml releasenotes/notes/rehome-port-dev-util-ea6f4a5c4da42f6c.yaml releasenotes/notes/rehome-projid-apidef-a433b1b003f27a20.yaml releasenotes/notes/rehome-psec-apidef-bd9344ec1e6066b4.yaml releasenotes/notes/rehome-qos-apidef-0dbe094b8b21a580.yaml releasenotes/notes/rehome-qos-driverbase-f729875b2ad74ce0.yaml releasenotes/notes/rehome-qosdft-apidef-b70596ca11c08803.yaml releasenotes/notes/rehome-qosrtdetails-apidef-2276ec66a0e545ca.yaml releasenotes/notes/rehome-rbac-policy-callbacks-24fa12ad1ab4c443.yaml releasenotes/notes/rehome-revisionifmatch-apidef-574ac0a930cdaf3f.yaml releasenotes/notes/rehome-routeraz-apidef-efc5f202e04b8272.yaml releasenotes/notes/rehome-routersvctype-apidef-1d9d712fd5383eb5.yaml releasenotes/notes/rehome-runtime-utils-acb4451326cbe4d9.yaml releasenotes/notes/rehome-segment-apidef-a5f81adb834328f8.yaml releasenotes/notes/rehome-shared-const-d847b2e190122425.yaml releasenotes/notes/rehome-sorting-apidef-1547f093da322c14.yaml releasenotes/notes/rehome-svctype-apidef-9002b2e2bcbeec8e.yaml releasenotes/notes/rehome-topics-ca451e72c8c9603a.yaml releasenotes/notes/rehome-vlantransp-apidef-1cd7d3ace9042686.yaml releasenotes/notes/rehome-worker-b7e9c7f477bdb926.yaml releasenotes/notes/remove-hacking-check-n523-014d163a5ae23adb.yaml releasenotes/notes/revert-review-400408-4999a9159689c0c5.yaml releasenotes/notes/router-interface-fip-1e79b7909f8b264f.yaml releasenotes/notes/separate-hacking-factories-6fc36b38de95662a.yaml releasenotes/notes/service-plugin-base-a42c2241a2fe0d26.yaml releasenotes/notes/subnet-onboard-allow-create-update-subnets-74a4be6e9e97bbb6.yaml releasenotes/notes/subnet-onboard-api-definition-f4918ff1f1d12c97.yaml releasenotes/notes/subresource-update-attrmap-and-classmethods-76accdd5c56a3bd4.yaml releasenotes/notes/transaction_constraint-d3f93c2ced4a74c6.yaml releasenotes/notes/trunk-api-08bfdcdd80f7e666.yaml releasenotes/notes/update-hacking-check-n536-2f63898bea693125.yaml releasenotes/notes/validator_ip_or_subnet_or_none-0175f906a9113954.yaml releasenotes/source/README.rst releasenotes/source/conf.py releasenotes/source/index.rst releasenotes/source/ocata.rst releasenotes/source/pike.rst releasenotes/source/unreleased.rst releasenotes/source/_static/.placeholder releasenotes/source/_templates/.placeholder tools/api_report.sh tools/check_samples.sh tools/migration_report.sh tools/pyir.py tools/tox_install.shneutron-lib-1.13.0/neutron_lib.egg-info/top_level.txt0000664000175100017510000000001413231472427022622 0ustar zuulzuul00000000000000neutron_lib neutron-lib-1.13.0/neutron_lib.egg-info/pbr.json0000664000175100017510000000005613231472427021554 0ustar zuulzuul00000000000000{"git_version": "dcf96cd", "is_release": true}neutron-lib-1.13.0/neutron_lib.egg-info/PKG-INFO0000664000175100017510000000311213231472427021167 0ustar zuulzuul00000000000000Metadata-Version: 1.1 Name: neutron-lib Version: 1.13.0 Summary: Neutron shared routines and utilities Home-page: https://docs.openstack.org/neutron-lib/latest/ Author: OpenStack Author-email: openstack-dev@lists.openstack.org License: UNKNOWN Description-Content-Type: UNKNOWN Description: ======================== Team and repository tags ======================== .. image:: https://governance.openstack.org/tc/badges/neutron-lib.svg :target: https://governance.openstack.org/tc/reference/tags/index.html .. Change things from this point on =============================== neutron-lib =============================== Neutron shared routines and utilities * Free software: Apache license * Documentation: https://docs.openstack.org/neutron-lib/latest/ * Source: http://git.openstack.org/cgit/openstack/neutron-lib * Bugs: http://bugs.launchpad.net/neutron Features -------- * TODO Platform: UNKNOWN Classifier: Environment :: OpenStack Classifier: Intended Audience :: Information Technology Classifier: Intended Audience :: System Administrators Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 neutron-lib-1.13.0/neutron_lib.egg-info/dependency_links.txt0000664000175100017510000000000113231472427024143 0ustar zuulzuul00000000000000 neutron-lib-1.13.0/babel.cfg0000666000175100017510000000002113231472055015601 0ustar zuulzuul00000000000000[python: **.py] neutron-lib-1.13.0/CONTRIBUTING.rst0000666000175100017510000000130213231472055016517 0ustar zuulzuul00000000000000If you would like to contribute to the development of OpenStack, you must follow the steps in this page: https://docs.openstack.org/infra/manual/developers.html If you already have a good understanding of how the system works and your OpenStack accounts are set up, you can skip to the development workflow section of this documentation to learn how changes to OpenStack should be submitted for review via the Gerrit tool: https://docs.openstack.org/infra/manual/developers.html#development-workflow Pull requests submitted through GitHub will be ignored. Bugs should be filed on Launchpad in the neutron project using the ``lib`` tag, not GitHub: https://bugs.launchpad.net/neutron/+bugs?field.tag=lib neutron-lib-1.13.0/AUTHORS0000664000175100017510000001007513231472427015136 0ustar zuulzuul00000000000000Abhishek Raut Akihiro Motoki Akihiro Motoki Andreas Jaeger Andreas Scheuring Andrey Shestakov Anh Tran Anindita Das Ann Taraday Antoni Segura Puimedon Armando Migliaccio Bertrand Lallau Boden R Brandon Logan Brian Haley Cao Xuan Hoang Carl Baldwin Carlos Goncalves ChangBo Guo(gcb) Cédric Savignan Dariusz Smigiel Darla Ahlert Deepthi V V Dirk Mueller Dongcan Ye Doug Wiegley Dustin Lundquist Felipe Monteiro Flavio Percoco Gal Sagie Gary Kotton German Eichberger Graham Hayes Guillaume Giamarchi Ha Van Tu Harshada Mangesh Kakad Henry Gessau Henry Gessau Hirofumi Ichihara Hongbin Lu Hunt Xu Ihar Hrachyshka Jakub Libosvar Jan Gutter Jens Harbott Kevin Benton Kyle Mestery Li Ma Li-zhigang Luong Anh Tuan Manjeet Singh Bhatia Margaret Frances Martin Roy Michael Johnson Michal Kelner Mishali Miguel Lavalle Miguel Lavalle Mohit Malik Monty Taylor Moshe Levi Nakul Dahiwade Nam Nguyen Hoai Nate Johnston Ngo Quoc Cuong Nguyen Phuong An Omer Anson OpenStack Release Bot Pablo Iranzo Gómez Paul Carver Paul Michali Pavel Gluschak QunyingRan RYAN D. MOATS Reedip Reedip Reedip Rodolfo Alonso Hernandez Sean Dague Shashank Kumar Shankar Swaminathan Vasudevan Swapnil Kulkarni (coolsvap) Sławek Kapłoński Takashi NATSUME Thomas Morin Thomas Morin Tony Breeds Tony Xu Trevor McCasland Van Hung Pham Vu Cong Tuan YAMAMOTO Takashi Yushiro FURUKAWA Zeus Arias Lucero ZhaoBo Zuul ashish.billore chen csatari huangtianhua lidong lilintan nanaboat nizam reedip venkata anil ycx zhaorenming@inspur.com neutron-lib-1.13.0/test-requirements.txt0000666000175100017510000000124313231472055020323 0ustar zuulzuul00000000000000# The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD flake8-import-order==0.12 # LGPLv3 python-subunit>=1.0.0 # Apache-2.0/BSD sphinx!=1.6.6,>=1.6.2 # BSD openstackdocstheme>=1.17.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0 os-api-ref>=1.4.0 # Apache-2.0 os-testr>=1.0.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0 testresources>=2.0.0 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD testtools>=2.2.0 # MIT neutron-lib-1.13.0/.coveragerc0000666000175100017510000000014313231472055016201 0ustar zuulzuul00000000000000[run] branch = True source = neutron_lib omit = neutron_lib/tests/* [report] ignore_errors = True neutron-lib-1.13.0/doc/0000775000175100017510000000000013231472430014622 5ustar zuulzuul00000000000000neutron-lib-1.13.0/doc/source/0000775000175100017510000000000013231472430016122 5ustar zuulzuul00000000000000neutron-lib-1.13.0/doc/source/user/0000775000175100017510000000000013231472430017100 5ustar zuulzuul00000000000000neutron-lib-1.13.0/doc/source/user/index.rst0000666000175100017510000000007413231472055020747 0ustar zuulzuul00000000000000===== Usage ===== .. toctree:: :maxdepth: 2 hacking neutron-lib-1.13.0/doc/source/user/hacking.rst0000666000175100017510000000461413231472055021250 0ustar zuulzuul00000000000000============== Hacking Checks ============== The ``neutron_lib.hacking`` package implements a number of public `hacking checks `_ intended to help adopters validate their compliance with the latest hacking standards. To adopt neutron-lib's hacking checks: #. Update your project's ``tox.ini`` to use ``neutron_lib.hacking.checks.factory`` for its ``local-check-factory``. For example in your ``tox.ini``:: [hacking] local-check-factory = neutron_lib.hacking.checks.factory If your project needs to register additional project specific hacking checks, you can define your own factory function that calls neutron-lib's ``factory`` function. For example in your project's python source:: def my_factory(register): # register neutron-lib checks neutron_lib_checks.factory(register) # register project specific checks register(my_project_check) And use your project's own factory in ``tox.ini``:: [hacking] local-check-factory = myproject.mypkg.my_factory #. Update your project's ``tox.ini`` enable any flake8 extensions neutron-lib's ``tox.ini`` does. These are hacking checks otherwise disabled by default that neutron-lib expects to run. For example in neutron-lib's ``tox.ini``:: [flake8] # H904: Delay string interpolations at logging calls enable-extensions=H904 In the example above, adopters should also add ``H904`` to the ``enable-extensions`` in their ``tox.ini``. #. Actively adopt neutron-lib hacking checks by running and monitoring the neutron-lib `periodic job `_ (as per `stadium guidelines `_ and watching for announcements. Announcements regarding neutron-lib adopter hacking checks will be communicated via openstack-dev email list and `neutron meetings `_. Under certain circumstances, adopters may need to ignore specific neutron-lib hacking checks temporarily. This can be done using the ``ignore`` property in the ``[flake8]`` section of your ``tox.ini``. For example, to ignore the hacking check ``N536`` your tox.ini might have:: [flake8] # temporarily ignore N536 while fixing failing checks ignore = N536 neutron-lib-1.13.0/doc/source/conf.py0000777000175100017510000001735713231472055017446 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. # Build configuration file that is execfile()'d with the current directory # set to it's containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import os import subprocess import sys import warnings # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.abspath(os.path.join(BASE_DIR, "..", "..")) sys.path.insert(0, ROOT_DIR) # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', 'sphinx.ext.graphviz', 'sphinx.ext.todo', 'openstackdocstheme',] todo_include_todos = True # Add any paths that contain templates here, relative to this directory. templates_path = [] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8' # The master doctree document. master_doc = 'index' # General information about the project. project = u'Neutron Library' copyright = u'2015-present, OpenStack Foundation.' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # Version info from neutron_lib.version import version_info as neutron_lib_version release = neutron_lib_version.release_string() # The short X.Y version. version = neutron_lib_version.version_string() # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of documents that shouldn't be included in the build. # unused_docs = [] # List of directories, relative to source directory, that shouldn't be searched # for source files. exclude_trees = [] # The reST default role (for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. show_authors = True # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. modindex_common_prefix = ['neutron_lib.'] # -- Options for man page output -------------------------------------------- # Grouping the document tree for man pages. # List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual' # man_pages = [ # ('man/neutron-lib', 'neutron-lib', u'Neutron Library', # [u'OpenStack'], 1) # ] # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. # html_theme_path = ["."] # html_theme = '_theme' html_theme = 'openstackdocs' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = ['_theme'] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". # html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' html_last_updated_fmt = '%Y-%m-%d %H:%M' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_use_modindex = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = '' # Output file base name for HTML help builder. #htmlhelp_basename = 'neutronlibdoc' # -- Options for LaTeX output ------------------------------------------------ # The paper size ('letter' or 'a4'). #latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). #latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, # documentclass [howto/manual]). # latex_documents = [ # ('index', 'NeutronLib.tex', u'Neutron Library Documentation', # u'Neutron development team', 'manual'), # ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # Additional stuff for the LaTeX preamble. #latex_preamble = '' # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_use_modindex = True # -- Options for openstackdocstheme ------------------------------------------- repository_name = 'openstack/neutron-lib' bug_project = 'neutron' bug_tag = 'doc' linkcheck_anchors_ignore = [ # skip gerrit anchors '\/q\/.*', 'q\,.*', '\/c\/.*' ] neutron-lib-1.13.0/doc/source/contributor/0000775000175100017510000000000013231472430020474 5ustar zuulzuul00000000000000neutron-lib-1.13.0/doc/source/contributor/api_extensions.rst0000666000175100017510000000672413231472055024274 0ustar zuulzuul00000000000000.. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Convention for heading levels in Neutron devref: ======= Heading 0 (reserved for the title in a document) ------- Heading 1 ~~~~~~~ Heading 2 +++++++ Heading 3 ''''''' Heading 4 (Avoid deeper levels because they do not render well.) API Extensions ============== API extensions provide a standardized way of introducing new API functionality. While the ``neutron-lib`` project itself does not serve an API, the ``neutron`` project does and leverages the API extension framework from ``neutron-lib``. API extensions consist of the following high-level constructs: - API definitions that specify the extension's static metadata. This metadata includes basic details about the extension such as its name, description, alias, etc. as well as its extended resources/sub-resources and required/optional extensions. These definitions live in the ``neutron_lib.api.definitions`` package. - API reference documenting the APIs/resources added/modified by the extension. This documentation is in ``rst`` format and is used to generate the `openstack API reference `_. The API reference lives under the ``api-ref/source/v2`` directory of the ``neutron-lib`` project repository. - An extension descriptor class that must be defined in an extension directory for ``neutron`` or other sub-project that supports extensions. This concrete class provides the extension's metadata to the API server. These extension classes reside outside of ``neutron-lib``, but leverage the base classes from ``neutron_lib.api.extensions``. For more details see the section below on using neutron-lib's extension classes. - The API extension plugin implementation itself. This is the code that implements the extension's behavior and should carry out the operations defined by the extension. This code resides under its respective project repository, not in ``neutron-lib``. For more details see the `neutron api extension dev-ref `_. Using neutron-lib's base extension classes ------------------------------------------ The ``neutron_lib.api.extensions`` module provides a set of base extension descriptor classes consumers can use to define their extension descriptor(s). For those extensions that have an API definition in ``neutron_lib.api.definitions``, the ``APIExtensionDescriptor`` class can be used. For example:: from neutron_lib.api.definitions import provider_net from neutron_lib.api import extensions class Providernet(extensions.APIExtensionDescriptor): api_definition = provider_net # nothing else needed if default behavior is acceptable For extensions that do not yet have a definition in ``neutron_lib.api.definitions``, they can continue to use the ``ExtensionDescriptor`` as has been done historically. neutron-lib-1.13.0/doc/source/contributor/conventions.rst0000666000175100017510000000670313231472055023606 0ustar zuulzuul00000000000000======================= Neutron-Lib Conventions ======================= Summary ------- * Standard modules - current cycle + 2 deprecation policy * Legacy modules - current cycle + 1 deprecation policy * Private modules - no deprecation warnings of any kind Interface Contract ------------------ The neutron-lib repo exists to provide code with a long-term stable interface for subprojects. If we do need to deprecate something, a debtcollector warning will be added, the neutron-lib core team will make every effort to update any neutron stadium project for you, and you will get at least the current release plus two cycles before it disappears. In keeping with how hard it is to remove things, the change velocity of this library will be slower than neutron. There are two notable cases where code should go into standard neutron instead of this lib (or your repo): * It is something common, but changes a lot. An example is something like the neutron Port object. Everyone uses it, but it changes frequently. You don't want to wait for a library release to tweak some neutron feature, and we are not going to force releases quickly because you tried to put it here. Those items will need to be addressed in some other manner (in the case of the Port object, it'll be via an auto-magic container object that mimics it.) * It is something common, but you need it now. Put it in the repo that needs it, get your stuff working. Then consider making it available in the lib, and eventually remove it from your repo when the lib is publishing it. An example would be a new neutron constant. The process would be, put it in neutron along with your change, submit it to the lib, when that constant is eventually available, remove it from neutron and use the lib version. Private Interfaces ------------------ Private interfaces are *PRIVATE*. They will disappear, be renamed, and absolutely no regard will be given to anyone that is using them. They are for internal library use only. DO NOT USE THEM. THEY WILL CHANGE. Private interfaces in this library will always have a leading underscore, on the module or function name. Legacy Modules -------------- This library has a special namespace called neutron_lib.legacy. Anything in this directory will likely get a new interface in the top-level library sometime in the near future, and then a debtcollector deprecation notice. Expect to get current cycle plus one release of maintenance at that point, and then they will be removed. Why this intermediary step? Because neutron has some serious dependency issues with its subprojects that need breaking, we do not want to rush some of the refactors to our interfaces that need to happen, we have limited resources, but we still need to make addressing those dependency issues a high priority. The legacy module is for those existing modules in neutron that are in wide use by subprojects, but which are not super interfaces. The legacy submodule is for routines that will still be maintained with a long-term backwards compatibility interface contract, but which are not considered "library worthy" by the neutron core team. This can easily be abused as a kitchen sink to just move stuff and make fast progress. Please do not do this, and do not expect this kind of thing to be favorably reviewed. Good candidates for this area are things that we want to refactor, but are lower priority, AND they have been around for a long time with no changes (i.e. an existing history of stability). neutron-lib-1.13.0/doc/source/contributor/internals.rst0000666000175100017510000000203113231472055023226 0ustar zuulzuul00000000000000.. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Convention for heading levels in Neutron lib devref: ======= Heading 0 (reserved for the title in a document) ------- Heading 1 ~~~~~~~ Heading 2 +++++++ Heading 3 ''''''' Heading 4 (Avoid deeper levels because they do not render well.) ===================== Neutron Lib Internals ===================== .. toctree:: :maxdepth: 3 api_attributes api_extensions api_converters api_validators callbacks neutron-lib-1.13.0/doc/source/contributor/api_converters.rst0000666000175100017510000000646513231472055024271 0ustar zuulzuul00000000000000.. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Convention for heading levels in Neutron devref: ======= Heading 0 (reserved for the title in a document) ------- Heading 1 ~~~~~~~ Heading 2 +++++++ Heading 3 ''''''' Heading 4 (Avoid deeper levels because they do not render well.) API Converters ============== Definitions for REST API attributes, can include conversion methods to help normalize user input or transform the input into a form that can be used. Defining A Converter Method --------------------------- By convention, the name should start with ``convert_to_``, and will take a single argument for the data to be converted. The method should return the converted data (which, if the input is None, and no conversion is performed, the implicit None returned by the method may be used). If the conversion is impossible, an InvalidInput exception should be raised, indicating what is wrong. For example, here is one that converts a variety of user inputs to a boolean value. :: def convert_to_boolean(data): if isinstance(data, six.string_types): val = data.lower() if val == "true" or val == "1": return True if val == "false" or val == "0": return False elif isinstance(data, bool): return data elif isinstance(data, int): if data == 0: return False elif data == 1: return True msg = _("'%s' cannot be converted to boolean") % data raise n_exc.InvalidInput(error_message=msg) Using Validators ---------------- In client code, the conversion can be used in a REST API definition, by specifying the name of the method as a value for the 'convert_to' key on an attribute. For example: :: 'admin_state_up': {'allow_post': True, 'allow_put': True, 'default': True, 'convert_to': conversions.convert_to_boolean, 'is_visible': True}, Here, the admin_state_up is a boolean, so the converter is used to take user's (string) input and transform it to a boolean. Test The Validator ------------------ Do the right thing, and make sure you've created a unit test for any converter that you add to verify that it works as expected. IPv6 canonical address formatter -------------------------------- There are several ways to display an IPv6 address, which can lead to a lot of confusion for users, engineers and operators alike. To reduce the impact of the multifaceted style of writing an IPv6 address, it is proposed that the IPv6 address in Neutron should be saved in the canonical format. If a user passes an IPv6 address, it will be saved in the canonical format. The full document is found at : http://tools.ietf.org/html/rfc5952 neutron-lib-1.13.0/doc/source/contributor/releasing.rst0000666000175100017510000000362513231472055023212 0ustar zuulzuul00000000000000========= Releasing ========= Before you intend to release a new version of neutron-lib consider posting a `sentinel patch `_ that will allow to validate that the neutron-lib hash chosen for tagging is not breaking gate or check jobs affecting a project you care about, first and foremost Neutron. As the patch shows, upper-constraints must be bypassed and that may itself lead to failures due to upstream package changes. The patch also shows (expected) Grenade failures in that Grenade pulls its own upper-constraints file during the upgrade phase. In general a newer version of neutron-lib is validated through the Tempest -full job (and Grenade runs a subset of it), so Grenade failures can be safely ignored. In any other case consider (for failures caused by unpinned global requirements) hard-coding a dummy upper-constraints file that itself uses the specific neutron-lib hash you want to test. Furthermore, consider using a commit header that starts with DNM (Do Not Merge) to indicate that the change is just a test, or -2, if you have the right access permissions. It is also worth noting that every Stadium project will have a periodic job running unit tests and pep8 against the master version of neutron-lib Checking Grafana's `periodic `_ dashboard can give you a glimpse into the sanity of the integration between neutron-lib and the Stadium projects, and can be considered the quick check before going ahead with a full blown sentinel patch. Periodic failures can be debugged by viewing the `periodic logs `_ In addition, both the API reference as well as the project docs should be validated to ensure there are no dead links. To do so run ``tox -e linkcheck`` and address the errors. neutron-lib-1.13.0/doc/source/contributor/callbacks.rst0000666000175100017510000006131613231472055023161 0ustar zuulzuul00000000000000.. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Convention for heading levels in Neutron devref: ======= Heading 0 (reserved for the title in a document) ------- Heading 1 ~~~~~~~ Heading 2 +++++++ Heading 3 ''''''' Heading 4 (Avoid deeper levels because they do not render well.) Neutron Callback System ======================= In Neutron, core and service components may need to cooperate during the execution of certain operations, or they may need to react upon the occurrence of certain events. For instance, when a Neutron resource is associated to multiple services, the components in charge of these services may need to play an active role in determining what the right state of the resource needs to be. The cooperation may be achieved by making each object aware of each other, but this leads to tight coupling, or alternatively it can be achieved by using a callback-based system, where the same objects are allowed to cooperate in a loose manner. This is particularly important since the spin off of the advanced services like VPN, Firewall and Load Balancer, where each service's codebase lives independently from the core and from one another. This means that the tight coupling is no longer a practical solution for object cooperation. In addition to this, if more services are developed independently, there is no viable integration between them and the Neutron core. A callback system, and its registry, tries to address these issues. In object-oriented software systems, method invocation is also known as message passing: an object passes a message to another object, and it may or may not expect a message back. This point-to-point interaction can take place between the parties directly involved in the communication, or it can happen via an intermediary. The intermediary is then in charge of keeping track of who is interested in the messages and in delivering the messages forth and back, when required. As mentioned earlier, the use of an intermediary has the benefit of decoupling the parties involved in the communications, as now they only need to know about the intermediary; the other benefit is that the use of an intermediary opens up the possibility of multiple party communication: more than one object can express interest in receiving the same message, and the same message can be delivered to more than one object. To this aim, the intermediary is the entity that exists throughout the system lifecycle, as it needs to be able to track whose interest is associated to what message. In a design for a system that enables callback-based communication, the following aspects need to be taken into account: * how to become consumer of messages (i.e. how to be on the receiving end of the message); * how to become producer of messages (i.e. how to be on the sending end of the message); * how to consume/produce messages selectively; Translate and narrow this down to Neutron needs, and this means the design of a callback system where messages are about lifecycle events (e.g. before creation, before deletion, etc.) of Neutron resources (e.g. networks, routers, ports, etc.), where the various parties can express interest in knowing when these events for a specific resources take place. Rather than keeping the conversation abstract, let us delve into some examples, that would help understand better some of the principles behind the provided mechanism. Event payloads -------------- The use of ``**kwargs`` for callback event payloads is deprecated (slated to be removed in 'Queens') in favor of standardized event payload objects as described herein. The event payloads are defined in ``neutron_lib.callbacks.events`` and define a set of payload objects based on consumption pattern. The following event objects are defined today: - ``EventPayload``: Base object for all other payloads and define the common set of attributes used by events. The ``EventPayload`` can also be used directly for basic payloads that don't need to transport additional values. - ``DBEventPayload``: Payloads pertaining to database callbacks. These objects capture both the pre and post state (among other things) for database changes. - ``APIEventPayload``: Payloads pertaining to API callbacks. These objects capture details relating to an API event; such as the method name and API action. Each event object is described in greater detail in its own subsection below. For backwards compatibility the callback registry and manager still provide the ``notify`` method for passing ``**kwargs``, but also provide the ``publish`` method for passing an event object. Event objects: EventPayload ~~~~~~~~~~~~~~~~~~~~~~~~~~~ The ``EventPayload`` object is the parent class of all other payload objects and defines the common set of attributes applicable to most events. For example, the ``EventPayload`` contains the ``context``, ``request_body``, etc. In addition, a ``metadata`` attribute is available to transport event data that's not yet standardized. While the ``metadata`` attribute is there for use, it should only be used in special cases like phasing in new payload attributes. Payload objects also transport resource state via the ``states`` attribute. This collection of resource objects tracks the state changes for the respective resource related to the event. For example database changes might have a pre and post updated resource that's used as ``states``. Tracking states allows consumers to inspect the various changes in the resource and take action as needed; for example checking the pre and post object to determine the delta. State object types are event specific; API events may use python ``dicts`` as state objects whereas database events use resource/OVO model objects. Note that states as well as any other event payload attributes are not copied; subscribers obtain a direct reference to event payload objects (states, metadata, etc.) and should not be modified by subscribers. Event objects: DBEventPayload ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For datastore/database events, ``DBEventPayload`` can be used as the payload event object. In addition to the attributes inherited from ``EventPayload``, database payloads also contain an additional ``desired_state``. The desired state is intended for use with pre create/commit scenarios where the publisher has a resource object (yet to be persisted) that's used in the event payload. These event objects are suitable for the standard before/after database events we have today as well as any that might arise in the future. Example usage:: # BEFORE_CREATE: DBEventPayload(context, request_body=params_of_create_request, resource_id=id_of_resource_if_avail, desired_state=db_resource_to_commit) # AFTER_CREATE: DBEventPayload(context, request_body=params_of_create_request, states=[my_new_copy_after_create], resource_id=id_of_resource) # PRECOMMIT_CREATE: DBEventPayload(context, request_body=params_of_create_request, resource_id=id_of_resource_if_avail, desired_state=db_resource_to_commit) # BEFORE_DELETE: DBEventPayload(context, states=[resource_to_delete], resource_id=id_of_resource) # AFTER_DELETE: DBEventPayload(context, states=[copy_of_deleted_resource], resource_id=id_of_resource) # BEFORE_UPDATE: DBEventPayload(context, request_body=body_of_update_request, states=[original_db_resource], resource_id=id_of_resource desired_state=updated_db_resource_to_commit) # AFTER_UPDATE: DBEventPayload(context, request_body=body_of_update_request, states=[original_db_resource, updated_db_resource], resource_id=id_of_resource) Event objects: APIEventPayload ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For API related callbacks, the ``APIEventPayload`` object can be used to transport callback payloads. For example, the REST API resource controller can use API events for pre/post operation callbacks. In addition to transporting all the attributes of ``EventPayload``, the ``APIEventPayload`` object also includes the ``action``, ``method_name`` and ``collection_name`` payload attributes permitting API components to pass along API controller specifics. Sample usage:: # BEFORE_RESPONSE for create: APIEventPayload(context, notifier_method, action, request_body=req_body, states=[create_result], collection_name=self._collection_name) # BEFORE_RESPONSE for delete: APIEventPayload(context, notifier_method, action, states=[copy_of_deleted_resource], collection_name=self._collection_name) # BEFORE_RESPONSE for update: APIEventPayload(context, notifier_method, action, states=[original, updated], collection_name=self._collection_name) Subscribing to events --------------------- Imagine that you have entity A, B, and C that have some common business over router creation. A wants to tell B and C that the router has been created and that they need to get on and do whatever they are supposed to do. In a callback-less world this would work like so: :: # A is done creating the resource # A gets hold of the references of B and C # A calls B # A calls C B->my_random_method_for_knowing_about_router_created() C->my_random_very_difficult_to_remember_method_about_router_created() If B and/or C change, things become sour. In a callback-based world, things become a lot more uniform and straightforward: :: # B and C ask I to be notified when A is done creating the resource # ... # A is done creating the resource # A gets hold of the reference to the intermediary I # A calls I I->notify() Since B and C will have expressed interest in knowing about A's business, 'I' will deliver the messages to B and C. If B and C changes, A and 'I' do not need to change. In practical terms this scenario would be translated in the code below: :: from neutron_lib.callbacks import events from neutron_lib.callbacks import resources from neutron_lib.callbacks import registry def callback1(resource, event, trigger, payload): print('Callback1 called by trigger: ', trigger) print('payload: ', payload) def callback2(resource, event, trigger, payload): print('Callback2 called by trigger: ', trigger) print('payload: ', payload) # B and C express interest with I registry.subscribe(callback1, resources.ROUTER, events.BEFORE_CREATE) registry.subscribe(callback2, resources.ROUTER, events.BEFORE_CREATE) print('Subscribed') # A notifies def do_notify(): registry.publish(resources.ROUTER, events.BEFORE_CREATE, do_notify, events.EventPayload(None)) print('Notifying...') do_notify() The output is: :: > Subscribed > Notifying... > Callback2 called by trigger: > payload: > Callback1 called by trigger: > payload: Thanks to the intermediary existence throughout the life of the system, A, B, and C are flexible to evolve their internals, dynamics, and lifecycles. Subscribing and aborting events ------------------------------- Interestingly in Neutron, certain events may need to be forbidden from happening due to the nature of the resources involved. To this aim, the callback-based mechanism has been designed to support a use case where, when callbacks subscribe to specific events, the action that results from it, may lead to the propagation of a message back to the sender, so that it itself can be alerted and stop the execution of the activity that led to the message dispatch in the first place. The typical example is where a resource, like a router, is used by one or more high-level service(s), like a VPN or a Firewall, and actions like interface removal or router destruction cannot not take place, because the resource is shared. To address this scenario, special events are introduced, 'BEFORE_*' events, to which callbacks can subscribe and have the opportunity to 'abort', by raising an exception when notified. Since multiple callbacks may express an interest in the same event for a particular resource, and since callbacks are executed independently from one another, this may lead to situations where notifications that occurred before the exception must be aborted. To this aim, when an exception occurs during the notification process, an abort_* event is propagated immediately after. It is up to the callback developer to determine whether subscribing to an abort notification is required in order to revert the actions performed during the initial execution of the callback (when the BEFORE_* event was fired). Exceptions caused by callbacks registered to abort events are ignored. The snippet below shows this in action: :: from neutron_lib.callbacks import events from neutron_lib.callbacks import exceptions from neutron_lib.callbacks import resources from neutron_lib.callbacks import registry def callback1(resource, event, trigger, payload=None): raise Exception('I am failing!') def callback2(resource, event, trigger, payload=None): print('Callback2 called by %s on event %s' % (trigger, event)) registry.subscribe(callback1, resources.ROUTER, events.BEFORE_CREATE) registry.subscribe(callback2, resources.ROUTER, events.BEFORE_CREATE) registry.subscribe(callback2, resources.ROUTER, events.ABORT_CREATE) print('Subscribed') def do_notify(): registry.publish(resources.ROUTER, events.BEFORE_CREATE, do_notify) print('Notifying...') try: do_notify() except exceptions.CallbackFailure as e: print("Error: %s" % e) The output is: :: > Subscribed > Notifying... > Callback2 called by on event before_create > Callback2 called by on event abort_create > Error: Callback __main__.callback1 failed with "I am failing!" In this case, upon the notification of the BEFORE_CREATE event, Callback1 triggers an exception that can be used to stop the action from taking place in do_notify(). On the other end, Callback2 will be executing twice, once for dealing with the BEFORE_CREATE event, and once to undo the actions during the ABORT_CREATE event. It is worth noting that it is not mandatory to have the same callback register to both BEFORE_* and the respective ABORT_* event; as a matter of fact, it is best to make use of different callbacks to keep the two logic separate. Unsubscribing to events ----------------------- There are a few options to unsubscribe registered callbacks: * clear(): it unsubscribes all subscribed callbacks: this can be useful especially when winding down the system, and notifications shall no longer be triggered. * unsubscribe(): it selectively unsubscribes a callback for a specific resource's event. Say callback C has subscribed to event A for resource R, any notification of event A for resource R will no longer be handed over to C, after the unsubscribe() invocation. * unsubscribe_by_resource(): say that callback C has subscribed to event A, B, and C for resource R, any notification of events related to resource R will no longer be handed over to C, after the unsubscribe_by_resource() invocation. * unsubscribe_all(): say that callback C has subscribed to events A, B for resource R1, and events C, D for resource R2, any notification of events pertaining resources R1 and R2 will no longer be handed over to C, after the unsubscribe_all() invocation. The snippet below shows these concepts in action: :: from neutron_lib.callbacks import events from neutron_lib.callbacks import exceptions from neutron_lib.callbacks import resources from neutron_lib.callbacks import registry def callback1(resource, event, trigger, payload=None): print('Callback1 called by %s on event %s for resource %s' % (trigger, event, resource)) def callback2(resource, event, trigger, payload=None): print('Callback2 called by %s on event %s for resource %s' % (trigger, event, resource)) registry.subscribe(callback1, resources.ROUTER, events.BEFORE_READ) registry.subscribe(callback1, resources.ROUTER, events.BEFORE_CREATE) registry.subscribe(callback1, resources.ROUTER, events.AFTER_DELETE) registry.subscribe(callback1, resources.PORT, events.BEFORE_UPDATE) registry.subscribe(callback2, resources.ROUTER_GATEWAY, events.BEFORE_UPDATE) print('Subscribed') def do_notify(): print('Notifying...') registry.publish(resources.ROUTER, events.BEFORE_READ, do_notify) registry.publish(resources.ROUTER, events.BEFORE_CREATE, do_notify) registry.publish(resources.ROUTER, events.AFTER_DELETE, do_notify) registry.publish(resources.PORT, events.BEFORE_UPDATE, do_notify) registry.publish(resources.ROUTER_GATEWAY, events.BEFORE_UPDATE, do_notify) do_notify() registry.unsubscribe(callback1, resources.ROUTER, events.BEFORE_READ) do_notify() registry.unsubscribe_by_resource(callback1, resources.PORT) do_notify() registry.unsubscribe_all(callback1) do_notify() registry.clear() do_notify() The output is: :: Subscribed Notifying... Callback1 called by on event before_read for resource router Callback1 called by on event before_create for resource router Callback1 called by on event after_delete for resource router Callback1 called by on event before_update for resource port Callback2 called by on event before_update for resource router_gateway Notifying... Callback1 called by on event before_create for resource router Callback1 called by on event after_delete for resource router Callback1 called by on event before_update for resource port Callback2 called by on event before_update for resource router_gateway Notifying... Callback1 called by on event before_create for resource router Callback1 called by on event after_delete for resource router Callback2 called by on event before_update for resource router_gateway Notifying... Callback2 called by on event before_update for resource router_gateway Notifying... Subscribing events using registry decorator ------------------------------------------- Now neutron-lib supports using registry decorators to subscribe events. There are two decorators ``has_registry_receivers``, which sets up the class ``__new__`` method to subscribe the bound method in the callback registry after object instantiation. ``receives`` use to decorate callback method which must defines the resource and events. Any class use ``receives`` must be decorated with ``has_registry_receivers``. Testing with callbacks ---------------------- A python `fixture `_ is provided for implementations that need to unit test and mock the callback registry. This can be used for example, when your code publishes callback events that you need to verify. Consumers can use ``neutron_lib.tests.unit.callbacks.base.CallbackRegistryFixture`` in their unit test classes with the ``useFixture()`` method passing along a ``CallbackRegistryFixture`` instance. If mocking of the actual singleton callback manager is necessary, consumers can pass a value to with the ``callback_manager`` kwarg. For example:: def setUp(self): super(MyTestClass, self).setUp() self.registry_fixture = callback_base.CallbackRegistryFixture() self.useFixture(self.registry_fixture) # each test now uses an isolated callback manager FAQ --- Can I use the callbacks registry to subscribe and notify non-core resources and events? Short answer is yes. The callbacks module defines literals for what are considered core Neutron resources and events. However, the ability to subscribe/notify is not limited to these as you can use your own defined resources and/or events. Just make sure you use string literals, as typos are common, and the registry does not provide any runtime validation. Therefore, make sure you test your code! What is the relationship between Callbacks and Taskflow? There is no overlap between Callbacks and Taskflow or mutual exclusion; as matter of fact they can be combined; You could have a callback that goes on and trigger a taskflow. It is a nice way of separating implementation from abstraction, because you can keep the callback in place and change Taskflow with something else. Is there any ordering guarantee during notifications? No, the ordering in which callbacks are notified is completely arbitrary by design: callbacks should know nothing about each other, and ordering should not matter; a callback will always be notified and its outcome should always be the same regardless as to in which order is it notified. Priorities can be a future extension, if a use case arises that require enforced ordering. How is the notifying object expected to interact with the subscribing objects? The ``notify`` method implements a one-way communication paradigm: the notifier sends a message without expecting a response back (in other words it fires and forget). However, due to the nature of Python, the payload can be mutated by the subscribing objects, and this can lead to unexpected behavior of your code, if you assume that this is the intentional design. Bear in mind, that passing-by-value using deepcopy was not chosen for efficiency reasons. Having said that, if you intend for the notifier object to expect a response, then the notifier itself would need to act as a subscriber. Is the registry thread-safe? Short answer is no: it is not safe to make mutations while callbacks are being called (more details as to why can be found line 937 of `dictobject `_). A mutation could happen if a 'subscribe'/'unsubscribe' operation interleaves with the execution of the notify loop. Albeit there is a possibility that things may end up in a bad state, the registry works correctly under the assumption that subscriptions happen at the very beginning of the life of the process and that the unsubscriptions (if any) take place at the very end. In this case, chances that things do go badly may be pretty slim. Making the registry thread-safe will be considered as a future improvement. What kind of function can be a callback? Anything you fancy: lambdas, 'closures', class, object or module methods. For instance: :: from neutron_lib.callbacks import events from neutron_lib.callbacks import resources from neutron_lib.callbacks import registry def callback1(resource, event, trigger, payload): print('module callback') class MyCallback(object): def callback2(self, resource, event, trigger, payload): print('object callback') @classmethod def callback3(cls, resource, event, trigger, payload): print('class callback') c = MyCallback() registry.subscribe(callback1, resources.ROUTER, events.BEFORE_CREATE) registry.subscribe(c.callback2, resources.ROUTER, events.BEFORE_CREATE) registry.subscribe(MyCallback.callback3, resources.ROUTER, events.BEFORE_CREATE) def do_notify(): def nested_subscribe(resource, event, trigger, payload): print('nested callback') registry.subscribe(nested_subscribe, resources.ROUTER, events.BEFORE_CREATE) registry.publish(resources.ROUTER, events.BEFORE_CREATE, do_notify, events.EventPayload(None)) print('Notifying...') do_notify() And the output is going to be: :: Notifying... module callback object callback class callback nested callback neutron-lib-1.13.0/doc/source/contributor/api_attributes.rst0000666000175100017510000000700613231472055024255 0ustar zuulzuul00000000000000.. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Convention for heading levels in Neutron devref: ======= Heading 0 (reserved for the title in a document) ------- Heading 1 ~~~~~~~ Heading 2 +++++++ Heading 3 ''''''' Heading 4 (Avoid deeper levels because they do not render well.) API Attributes ============== Neutron's resource attributes are defined in dictionaries in ``api/definitions``. The map containing all installed resources (for core and active extensions) is in ``api/attributes.py``. Attribute map structure ----------------------- Example attribute definitions for ``dns_name``: .. code-block:: python 'dns_name': { 'allow_post': True, 'allow_put': True, 'default': '', 'convert_to': convert_to_lowercase, 'validate': {'type:dns_name': FQDN_MAX_LEN}, 'is_visible': True }, The ``validate`` item specifies rules for `validating `_ the attribute. The ``convert_to`` item specifies rules for `converting `_ the attribute. Example attribute definitions for ``gateway_ip``: .. code-block:: python 'gateway_ip': { 'allow_post': True, 'allow_put': True, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': {'type:ip_address_or_none': None}, 'is_visible': True } Note: a default of ``ATTR_NOT_SPECIFIED`` indicates that an attribute is not required, but will be generated by the plugin if it is not specified. Particularly, a value of ``ATTR_NOT_SPECIFIED`` is different from an attribute that has been specified with a value of ``None``. For example, if ``gateway_ip`` is omitted in a request to create a subnet, the plugin will receive ``ATTR_NOT_SPECIFIED`` and the default gateway IP will be generated. However, if ``gateway_ip`` is specified as ``None``, this means that the subnet does not have a gateway IP. The following are the defined keys for attribute maps: ====================== ====== ``default`` default value of the attribute (if missing, the attribute becomes mandatory) ``allow_post`` the attribute can be used on ``POST`` requests ``allow_put`` the attribute can be used on ``PUT`` requests ``validate`` specifies rules for validating data in the attribute ``convert_to`` transformation to apply to the value before it is returned ``convert_list_to`` if the value is a list, apply this transformation to the value before it is returned ``is_visible`` the attribute is returned in ``GET`` responses ``required_by_policy`` the attribute is required by the policy engine and should therefore be filled by the API layer even if not present in request body ``enforce_policy`` the attribute is actively part of the policy enforcing mechanism, ie: there might be rules which refer to this attribute ``primary_key`` Mark the attribute as a unique key. ====================== ====== neutron-lib-1.13.0/doc/source/contributor/review-guidelines.rst0000666000175100017510000000744313231472055024672 0ustar zuulzuul00000000000000================= Review Guidelines ================= When reviewing neutron-lib changes, please be aware: * When code is moved from neutron, please evaluate with the following criteria: - Is all of the code shared? Don't move neutron-only code. - Is the interface good, or does it need to be refactored? If refactoring is required it must be done before the public interface is released to PyPI as once released it must follow our `conventions <./conventions.html>`_. - Does it need new tests, specifically around the interface? We want a global unit coverage greater than 90%, and a per-module coverage greater than 80%. If neutron does not yet have a test, it needs to be added. Note that tests on things like constants are uninteresting, but any code or interface should have a unit test, if you cannot tell for sure that it is not going to be traversed in some alternative way (e.g. tempest/functional coverage). - Do the public APIs have their parameters and return values documented using reStructuredText docstring format (see below)? - In certain cases, it may be beneficial to determine how the neutron-lib code changes impact neutron `master`. This can be done as follows: - Publish a 'Do Not Merge' dummy patch to neutron that uses the code changes proposed (or already in) neutron-lib. Make sure to mark this neutron change as a 'DNM' (or 'WIP') and use -1 for workflow to indicate. - Publish a change to neutron-lib that uses `Depends-On:` for the dummy change in neutron; this pulls the neutron dummy change into the neutron-lib gate job. For example `386846 `_ uses a dummy neutron-lib patch to test code that already exists in neutron-lib `master` whereas `346554 `_ tests the neutron-lib patch's code itself. - View neutron-lib gate job results and repeat as necessary. * Public APIs should be documented using `reST style docstrings `_ that include an overview as well as parameter and return documentation. The format of docstrings can be found in the `OpenStack developer hacking docs `_. Note that public API documentation is a bonus, not a requirement. * Once public classes and methods are pushed to PyPI as part of a neutron-lib release, they must not be destructively changed without following the full OpenStack deprecation path. For example, do not: - Change names of classes or methods - Reorder method arguments - Change side effects Alternatives: - Add a second method with the new signature - Add keyword arguments The above implies that if you add something, we are stuck with that interface for a long time, so be careful. * Removing the code from neutron can be done without a temporary `debtcollector `_ notice by following the steps described in the 'Consume' phase of the `contributing doc <./contributing.html>`_. * Any code that imports/uses the following python modules should not be moved into neutron-lib: - eventlet * With respect to `Oslo config options `_: - Config options should only be included in neutron-lib when the respective functionality that uses the options lives in neutron-lib. In this case the options will need to be exposed as entry points for `config generation `_. - Common functionality in neutron-lib that accesses config values should assume the caller has registered them and document such in the docstring for the respective functionality in neutron-lib. neutron-lib-1.13.0/doc/source/contributor/index.rst0000666000175100017510000000220313231472055022337 0ustar zuulzuul00000000000000.. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Convention for heading levels in Neutron lib devref: ======= Heading 0 (reserved for the title in a document) ------- Heading 1 ~~~~~~~ Heading 2 +++++++ Heading 3 ''''''' Heading 4 (Avoid deeper levels because they do not render well.) Contributor Guide ================= In the Contributor Guide, you will find information on the Neutron Library components and in how to use them, from a development standpoint. .. toctree:: :maxdepth: 2 conventions review-guidelines contributing releasing internals neutron-lib-1.13.0/doc/source/contributor/contributing.rst0000666000175100017510000002020213231472055023736 0ustar zuulzuul00000000000000============ Contributing ============ .. include:: ../../../CONTRIBUTING.rst As your code is subject to the `review guidelines <./review-guidelines.html>`_, please take the time to familiarize yourself with those guidelines. Rehoming Existing Code ---------------------- The checklist below aims to provide guidance for developers rehoming (moving) code into neutron-lib. Rehoming approaches that fall outside the scope herein will need to be considered on a case by case basis. The rehoming workflow procedure has four main phases: #. `Phase 1: Rehome`_ the code from neutron into neutron-lib. #. `Phase 2: Enhance`_ the code in neutron-lib if necessary. #. `Phase 3: Release`_ neutron-lib with the code so consumers can use it. #. `Phase 4: Consume`_ by removing the rehomed code from its source and changing references to use neutron-lib. Phase 1: Rehome ~~~~~~~~~~~~~~~ #. Identify the chunk of code for rehoming. Applicable code includes common classes/functions/modules/etc. that are consumed by networking project(s) outside of neutron. Optimal consumption patterns of the code at hand must also be considered to ensure the rehomed code addresses any technical debt. Finally, leave low-hanging fruit for last and tackle the most commonly used code first. If you have any doubt about the applicability of code for rehoming, reach out to one of the neutron core developers before digging in. #. Find and identify any unit tests for the code being rehomed. These unit tests can often be moved into neutron-lib with minimal effort. After inspecting the applicable unit tests, rewrite any that are non-optimal. #. Search and understand the consumers of the code being rehomed. This must include other networking projects in addition to neutron itself. At this point it may be determined that the code should be refactored before it is consumed. There are a few common strategies for refactoring, and the one chosen will depend on the nature of the code at hand: - Refactor/enhance the code as part of the initial neutron-lib patch. If this change will be disruptive to consumers, clearly communicate the change via email list or `meeting topic `_. - Leave the refactoring to the next (Enhance) phase. In this rehome phase, copy the code as-is into a private module according to our `conventions <./conventions.html>`_. This approach is slower, but may be necessary in some cases. #. Understand existing work underway which may impact the rehomed code, for example, in-flight patch sets that update the code being rehomed. In some cases it may make sense to let the in-flight patch merge and solidify a bit before rehoming. #. Prepare the code for neutron-lib. This may require replacing existing imports with those provided by neutron-lib and/or rewriting/rearchitecting non-optimal code (see above). The interfaces in the rehomed code are subject to our `conventions <./conventions.html>`_. #. Prepare the unit test code for neutron-lib. As indicated in the `review guidelines <./review-guidelines.html>`_ we are looking for a high code coverage by tests. This may require adding additional tests if neutron was lacking in coverage. #. Submit and shepherd your patch through its neutron-lib review. Include a `release note `_ that describes the code's old neutron location and new neutron-lib location. Also note that in some cases it makes sense to prototype a change in a consumer project to better understand the impacts of the change, which can be done using the ``Depends-On:`` approach described in the `review guidelines <./review-guidelines.html>`_ Examples: - `319769 `_ brought over a number of common utility functions as-is from neutron into a new package structure within neutron-lib. - `253661 `_ rehomed neutron callbacks into a private package that's enhanced via `346554 `_. - `319386 `_ rehomes a validator from neutron into neutron-lib. Phase 2: Enhance ~~~~~~~~~~~~~~~~ If the rehomed code is not applicable for enhancements and wasn't made private in Phase 1, you can skip this step. Develop and shepherd the enhancements to the private rehomed code applicable at this time. Private APIs made public as part of this phase will also need `release notes `_ indicating the new public functionality. Examples: - `346554 `_ enhances the rehomed private callback API in neutron-lib. Phase 3: Release ~~~~~~~~~~~~~~~~ A new neutron-lib release can be cut at any time. You can also request a release by following the README instructions in the `openstack/releases `_ project. Once a release is cut, an openstack infra proposal bot will submit patches to the master branch of all projects that consume neutron-lib to set the new release as the minimum requirement. Someone from the neutron release team can bump `global requirements` (g-r); for example `review 393600 `_. When the bot-proposed requirement patches have merged, your rehomed code can be consumed. Phase 4: Consume ~~~~~~~~~~~~~~~~ It's critical that before you submit your patch to remove the rehomed code from its source that you perform a diff between it and the rehomed version in neutron-lib to ensure nothing has changed in the source. If something has changed in the source, you need to push and shepherd a patch to neutron-lib with the difference(s) before proceeding with this consumption phase. The following guidelines are intended to provide a smooth transition to the rehomed code in neutron-lib and minimize impacts to subprojects consuming the rehomed code from its source. - If the change to consume the code from neutron-lib is widespread and/or "important", introduce your intentions for the change via the Neutron team `meeting slot `_ for neutron-lib. Subsequently follow-up with an email to openstack-dev list using a subject with ``[neutron] neutron-lib impact`` providing additional details as necessary. Ideally we can identify the main impacted subprojects by `grepping the OpenStack code `_. - Prepare a neutron core patch to remove and update the rehomed code from its source. This can be done without a `debtcollector `_ notice by following the steps here. In the patch's commit message include the ``NeutronLibImpact`` so that we can easily `query `_ for such changes. Mark the patch as a work in progress with a -1 workflow vote. - If the change is significant enough, it may warrant a "reference implementation" in an impacted subproject to ensure the impacts are fully understood. Testing this change can be done using the ``Depends-On:`` approach described in the `review guidelines <./review-guidelines.html>`_. - If you are a core reviewer and about to approve a NeutronLibImpact change, please consider checking the state of all Stadium subprojects by looking at the `grafana periodic dashboard `_. This dashboard shows the status of subprojects' unit tests against neutron and neutron-lib master branches, and even though it is not exactly validating unit tests against a released version of neutron-lib it may be enough of an alarm bell to indicate that something might be wrong because of a patch that recently landed in neutron (assuming that the subprojects still has direct neutron imports). The check happens daily therefore consider waiting to approve if you are either aware of another impactful change recently merged that has not been yet processed or you see failure rates spiking. Examples: - `348472 `_ removes a validator in neutron that was rehomed to neutron-lib. neutron-lib-1.13.0/doc/source/contributor/api_validators.rst0000666000175100017510000000661413231472055024243 0ustar zuulzuul00000000000000.. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Convention for heading levels in Neutron devref: ======= Heading 0 (reserved for the title in a document) ------- Heading 1 ~~~~~~~ Heading 2 +++++++ Heading 3 ''''''' Heading 4 (Avoid deeper levels because they do not render well.) API Validators ============== For the REST API, attributes may have custom validators defined. Each validator will have a method to perform the validation, and a type definition string, so that the validator can be referenced. Defining A Validator Method --------------------------- The validation method will have a positional argument for the data to be validated, and may have additional (optional) keyword arguments that can be used during validation. The method must handle any exceptions and either return None (success) or a i18n string indicating the validation failure message. By convention, the method name is prefixed with ``validate_`` and then includes the data type. For example: :: def validate_uuid(data, valid_values=None): if not uuidutils.is_uuid_like(data): msg = _("'%s' is not a valid UUID") % data LOG.debug(msg) return msg There is a validation dictionary that maps the method to a validation type that can be referred to in REST API definitions. An entry in the dictionary would look like the following: :: 'type:uuid': validate_uuid, Using Validators ---------------- In client code, the validator can be used in a REST API by using the dictionary key for the validator. For example: :: NETWORKS: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': NAME_MAX_LEN}, 'default': '', 'is_visible': True}} Here, the networks resource has an 'id' attribute with a UUID validator, as seen by the 'validate' key containing a dictionary with a key of 'type:uuid'. Any addition arguments for the validator can be specified as values for the dictionary entry (None in this case, NAME_MAX_LEN in the 'name' attribute that uses a string validator). In a IP version attribute, one could have a validator defined as follows: :: 'ip_version': {'allow_post': True, 'allow_put': False, 'convert_to': conversions.convert_to_int, 'validate': {'type:values': [4, 6]}, 'is_visible': True}} Here, the validate_values() method will take the list of values as the allowable values that can be specified for this attribute. Test The Validator ------------------ Do the right thing, and make sure you've created a unit test for any validator that you add to verify that it works as expected, even for simple validators. neutron-lib-1.13.0/doc/source/reference/0000775000175100017510000000000013231472430020060 5ustar zuulzuul00000000000000neutron-lib-1.13.0/doc/source/reference/index.rst0000666000175100017510000000175713231472055021740 0ustar zuulzuul00000000000000.. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Convention for heading levels in Neutron lib devref: ======= Heading 0 (reserved for the title in a document) ------- Heading 1 ~~~~~~~ Heading 2 +++++++ Heading 3 ''''''' Heading 4 (Avoid deeper levels because they do not render well.) ================ Module Reference ================ .. toctree:: :maxdepth: 1 :glob: modules/* * :ref:`genindex` * :ref:`search` neutron-lib-1.13.0/doc/source/install/0000775000175100017510000000000013231472430017570 5ustar zuulzuul00000000000000neutron-lib-1.13.0/doc/source/install/index.rst0000666000175100017510000000031213231472055021432 0ustar zuulzuul00000000000000============ Installation ============ At the command line:: $ pip install neutron-lib Or, if you have virtualenvwrapper installed:: $ mkvirtualenv neutron-lib $ pip install neutron-lib neutron-lib-1.13.0/doc/source/index.rst0000666000175100017510000000372113231472055017773 0ustar zuulzuul00000000000000.. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Welcome to Neutron Lib documentation! ===================================== Neutron-lib is an OpenStack library project used by Neutron, Advanced Services, and third-party projects that aims to provide common functionality across all such consumers. The library is developed with the following goals in mind: - Decouple sub-projects from Neutron (i.e. no direct neutron imports in sub-projects). - Pay down Neutron technical debt via refactoring/re-architecting of sub-optimal patterns in their respective neutron-lib implementation. This document describes the library for contributors of the project, and assumes that you are already familiar with Neutron from an end-user perspective. If not, hop over to the `OpenStack doc site `__ This documentation is generated by the Sphinx toolkit and lives in the source tree. Additional documentation on Neutron and other components of OpenStack can be found on the `OpenStack wiki`_ and the `Neutron section of the wiki`. The `Neutron Development wiki`_ is also a good resource for new contributors. .. _`OpenStack wiki`: http://wiki.openstack.org .. _`Neutron section of the wiki`: http://wiki.openstack.org/Neutron .. _`Neutron Development wiki`: http://wiki.openstack.org/NeutronDevelopment Enjoy! .. toctree:: :maxdepth: 2 install/index user/index contributor/index .. toctree:: :maxdepth: 1 reference/index neutron-lib-1.13.0/setup.cfg0000666000175100017510000000264713231472430015711 0ustar zuulzuul00000000000000[metadata] name = neutron-lib summary = Neutron shared routines and utilities description-file = README.rst author = OpenStack author-email = openstack-dev@lists.openstack.org home-page = https://docs.openstack.org/neutron-lib/latest/ classifier = Environment :: OpenStack Intended Audience :: Information Technology Intended Audience :: System Administrators License :: OSI Approved :: Apache Software License Operating System :: POSIX :: Linux Programming Language :: Python Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.5 [files] packages = neutron_lib [build_sphinx] source-dir = doc/source build-dir = doc/build all_files = 1 warning-is-error = 1 [upload_sphinx] upload-dir = doc/build/html [compile_catalog] directory = neutron_lib/locale domain = neutron_lib [update_catalog] domain = neutron_lib output_dir = neutron_lib/locale input_file = neutron_lib/locale/neutron_lib.pot [extract_messages] keywords = _ gettext ngettext l_ lazy_gettext mapping_file = babel.cfg output_file = neutron_lib/locale/neutron_lib.pot [pbr] autodoc_tree_index_modules = True autodoc_tree_excludes = setup.py neutron_lib/tests # In case neutron_lib.legacy has no actual content, this causes # an error in sphinx autodoc, so let's exclude it. neutron_lib/legacy api_doc_dir = reference/modules [egg_info] tag_build = tag_date = 0 neutron-lib-1.13.0/ChangeLog0000664000175100017510000005273013231472427015644 0ustar zuulzuul00000000000000CHANGES ======= 1.13.0 ------ * Imported Translations from Zanata * Add events and resources for L3 flavors * Adopted to new oslo.context code to remove deprecation warnings * Updated from global requirements * Remove unreferenced protocol parameters * Update security group rule protocol parameter text * rehome plugin utils * Fix openstackdocstheme options for api-ref * Documenting Router AZ extension in routers api-ref * rehome shared constant * rehome revisionifmatch api def * Updated from global requirements * fix typos * rehome common topics into neutron-lib * rehome segement api def * DVR: Move DVR agent related constants to neutron-lib * Fix one small typo in api-ref 1.12.0 ------ * Add the IP substring filter extension * Adds Remote Firewall Groups to FWaaS V2 Rules * rehome router service type api def * rehome the qos rule type details api def * rehome sorting api def * fix linkcheck tox target * Rehome placement client to neutron-lib * Remove periods at the end of validator and converter messages * update releasing doc links for zuul v3 * Fix port comparison in port range validation * Updated from global requirements * Add default value as none for vni attribute in bgpvpn resource * Add support to Create/Update subnets in subnet\_onboard * rehome service type api def * rehome vlantransparent api def * finish qos\_rule\_type\_details extension api-ref * rehome the qos default api def * add description in api-ref for external net extension * class methods and sub resources in base api ext * Remove setting of version/release from releasenotes * Updated from global requirements * Updated from global requirements * fix up dvr api def exceptions * Adds IPinIP protocol * docs: Subscribing events using registry decorator * Add empty BGPVPN Route Target to unit test * Check that duplicate Segmentation IDs 0 get caught * add api ref for agents * rehome multi provider net extension api definition * docs: Add primary\_key attribute key * Modify the validator for segmentation\_id 0 * Remove pep8 from test-requirements * Fix RBAC POST parameter of api-ref * Add new resource for port bindings * Remove rbac-policy callback into lib * add DCCP, SCTP and UDP-Lite to validated protos for port ranges * Add a new method ha\_state\_change to L3 agent extension * complete api-ref for addr pairs and port security * Updated from global requirements * net\_utils: Speed up mac address generation * Fix typos and address formatting issues * Add headers for sections in LBaaS v2.0 API docs 1.11.0 ------ * Updated from global requirements * revert get\_random\_mac behavior from review 400408 * Fix comment in context.py * Remove a bogus leftover string * bgpvpn-vni api extension * add PROVISIONAL\_IPV6\_PD\_PREFIX to constants * fix doc links * add api ref and doc link validation to release * sync plugin common constants * Update links in CONTRIBUTING.rst * Revert "Withdraw doc for bgpvpn-routes-control API extension" * Don't allow an empty-string Route Target * rehome flavor extension API definition * api ref for quota details extension * finish routes api ref * Fix value of pool\_id-request required attribute 1.10.0 ------ * Add the default-subnetpools extension to api-ref * Fix unit test failures due to switch to testr changes * rehome dvr extension api def * rehome l3 flavors extension api definition * api-ref for inherit trunk segmentation type * rehome l3 ext ha mode extension api definition * Fix some typos * Add exception when a synthetic field is invalid * Update links in README * Remove vestigate HUDSON\_PUBLISH\_DOCS reference * Rehome net-mtu-enh extension definition * Document the new net-mtu-writable extension * rehome ip allocation extension API definition * complete api ref for std attr revisions * api ref for standard-attr-tag extension * rehome l3 ext gw mode extension api definition * sync ml2 plugin api * Updated from global requirements * api ref for dns integration * rehome project id api definition * rehome network availability zone extension api definition * rehome qos api definition * Updated from global requirements * Parameter modifications of edit-constraints * rehome router availability zone extension api def * rehome pagination api definition * rehome network ip availability extension api definition * Add API Definition for Subnet Onboard * rehome metering extension api definition * Fix API Doc LBaaS v2 When a Listener and pool are created the parameter protocol\_port is optional according to the official documentation, but in reality it is required * rehome l2 adjacency extension API definition * rehome extraroute api definition * rehome external net api definition * Security Groups: Fix rule docs regarding protocols * Add description about QoS minimum bandwidth rules API * rehome allowedaddresspairs API definition * rehome default subnet pools API def * Add missing library into requirements.txt * rehome availability zone API def * Add description of API call to get QoS rule type details * Updated from global requirements * Update reno for stable/pike * Introduce API for port bindings extended * Removing LBaaS v1 API reference * Fix spaces in Firewall's error messages * Add 'convert\_to\_string' and apply for firewall-rule 1.9.1 ----- * Revert "hardware offload support for openvswitch" * Update the documentation link for doc migration * Fix typo in release note for import path 1.9.0 ----- * Add backward compatible alias * Change comment to match new constant name * rehome neutron's auto-allocated-topology extension API definition * rehome neutron's address-scope extension API definition * Updated from global requirements * rectify the definition of API timestamp for trunk\_details * Add interface to add a constraint to context * Add Agilio OVS VIF and virtio-forwarder VNIC type * Rehome FAULT\_MAP from the neutron API * Fix N536 - Use assertIsNone regex * Updated api-ref with more details on net-mtu extension * Moved net-mtu extension definition * rehome neutron's agent extension API definition * Remove unnecessary variables in UT * Add headers for QoS sections in api-ref * Add info about direction in QoS bandwidth limit rule * Withdraw doc for bgpvpn-routes-control API extension * Move Firewall Exceptions to neutron-lib * bgpvpn\_routes\_control: API definition fixes * hardware offload support for openvswitch 1.8.0 ----- * Use flake8-import-order plugin * Enable module reference * rearrange content to fit the new standard layout * Enable warning-is-error in doc build * Introduce logging api extension * Switch from oslosphinx to openstackdocstheme * api-ref: Introduce logging api reference * api-ref: RBAC policies api reference * Add missing LOG.debug to hacking rule * remove deprecated N523 hacking check * Define dns-domain-ports extension * Updated from global requirements * rehome consumed neutron.common.constants * rehome ml2 driver\_api * rehome ovo exceptions * Rehome dns-integration extension * bgpvpn-routes-control extension * Add OVS\_DATAPATH\_TYPE in portbindings constants * Add sanity check to receives decorator * rehome qos service DriverBase class * Make port\_range validator accept an integer * Replace assertTrue(isinstance()) with assertIsInstance() * Fix html\_last\_updated\_fmt for Python3 * Updated from global requirements * enforce maximum length for name and tenant\_id fields * Add validators package * Fix rst heading while reading * Repair link in Neutron documentation * Updated from global requirements * Fix API ref with regards to OR queries * APIDefinitionFixture bugfix * sync callbacks: Eliminate SUBNET\_GATEWAY resource * rehome utils: synchronized decorator and load\_class\_by\_alias\_or\_classname 1.7.0 ----- * Trivial fix typos * Add AFTER\_SPAWN event to callbacks * Remove duplicated "set of" * Add VIF\_TYPE\_TAP constant to portbindings * Updated from global requirements * make extra\_dhcp\_opt vars public * rehome NETWORK\_ID ml2 constant * use constants rather than static strings 1.6.0 ----- 1.5.0 ----- * Rehome neutron.api.v2.attributes * rehome extra\_dhcp\_opt api-def * Patch \_get\_callback\_manager for callback fixture * sync callbacks with neutron * Add new protocols in Firewalls * rehome core resource api-defs * api-ref: Add a few type checks for consistency * Updated from global requirements * Add CIDR for canonical format conversion * [FWaaS] Migrate Public attribute to Shared * Enforce log messages not being translated * rehome is\_port\_trusted util function * Updated from global requirements 1.4.0 ----- * Add flush\_on\_subtransaction=True to engine config * rehome plugin common constants * Updated from global requirements * Add ACTION\_STATUS to dummy of API definition * Add bgpvpn to list of known extensions * Handle tenant\_name and project\_name more equally * Stop enforcing non-debug log translations * extensions: Tweak docstring for get\_required\_extensions * API extension updates and fixture * api-ref: provider and multiple provider are allowed to update * Downgrade callback abortable event log to debug 1.3.0 ----- * Updated from global requirements * rehome NeutronWorker class * Indicating the location tests directory in oslo\_debug\_helper * Clarify pep8 inclusion in periodic job * api-ref: some quota APIs don't return 404 * API definition and reference for data plane status extension * Change dashboard for periodic jobs * Formalize base service classes * rehome port security api-def * rehome ml2 MechanismDriver class * Sync neutron callbacks into lib * Updated from global requirements * boilerplate extension descriptor for api-def * Use a single hacking check factory * Tweak trunk extension to support Ironic use case * api-ref: Cleanup quotas API * api-ref: Fix using examples of API * api-ref: Add QoS rule types list API * api-ref: Remove tags for neutron-in-tree-api-ref from LBaaSv1 * Add a note about the current status of FWaaS v1 * api-ref: Correcting QoS policies in API extension 1.2.0 ----- * Move networking-bgpvpn API reference into neutron-lib * Drop dictionary construction on get\_plugin * Move BGPVPN API definition into neutron-lib * Add is\_extension\_supported to neutron\_lib * rehome l3 api-def exceptions * add exceptions package * Only log IDs of callbacks in debug message * fix broken link in review guidelines * Updated from global requirements * Validate API sample JSON files * Remove tag-obtain-response.json in the top directory * Remove support for py34 * Update api-ref for enhanced tag mechanism * Remove trailing whitespaces from VPN api doc * Add a space after comma * Add FIP64 extension from networking-midonet * Add router-interface-fip extension from networking-midonet * Migrate logging-resource extension from networking-midonet * api: Fix firewall aliases * api-ref: Add 'qos\_policy\_id' parameter to PUT * api-ref: Correct port binding extension * api-ref: Improve network IP availability extension * api-ref: Fix api-ref for ports * Stop creating a context manager during db.\_api module import * api-ref: add description to ports * api-ref: add pools to loadbalancer response * api-ref: add description to security groups * api-ref: add description to security group rules * api-ref: add description to subnets * api-ref: fix description for subnetpools * api-ref: fix description for floating IPs * api-ref: add description to routers * api-ref: add description to networks * Support empty list as api-def default * api-ref: Refactoring parameters in Networks APIs * Correctly set project\_name * Remove devref modindex ref * api-ref: Fix LBaaS v1 API reference * Fix api-ref errors * bugfix: l3 api-def router constant * Update reno for stable/ocata * Remove support for py33 * Add action map for neutron-fwaas API definition * Fix api-ref for tags * Use assertIsNone instead of assertEqual(None, \*) 1.1.0 ----- * Rehome providernet api-def * Rehome portbindings api-def into neutron-lib * Rehome l3 API definitions into neutron-lib * api-ref: Fix api-ref for vpnaas * Rehome ServicePluginBase * api-ref: Fix descriptions of sec-grp parameters * Follow-up review comments * FWaaS v2 API reference * Migrate neutron-fwaas API definitions to neutron-lib * Capture wider list of extension aliases * Revisit exported policy module * Make neutron context available in neutron-lib * Add dummy API definitions for extension subresources * Expose/Improve callback notification interface * Add validators/converters needed by neutron-fwaas * Improve floatingip api-ref * api-ref: Fix api-ref for metering * Add fixture for plugin directory * Updated from global requirements * Removed incorrect docstring for Context * Add FQDN\_FIELD\_SIZE constant * api-ref: Adding request parameter for sec-grp-rule * Remove discover from test-requirements * Directory: fix concurreny issue * Removes unnecessary utf-8 encoding * Sync up bare minimum from neutron.db.api into lib * api-ref: project\_id in req/resp body should be "body" * Fix the status parameters in api-ref * Modify API response information in API documents * [api-ref] Add max number of characters for tag * Migrate neutron agent extensions to neutron-lib * Add validator to check for IP or subnet or none * Use new checks in hacking 0.12 * Correcting Floating IPs * Use constranits for api-ref target * Policy: reuse common code * Updated from global requirements * Separate hacking check factories * Provide dummy API definition for documentation purposes * Add converter to convert IPv6 addresses to canonical format * Sync latest neutron context into lib * Remove README from docs build * Explain how to use the latest neutron-lib dashboard * api-ref: Fix api-ref for fwaas * Add alembic branch constants * Typo in ExtensionDescriptor.get\_request\_extensions() * [doc]Add sha256, sha384 and sha512 auth algorithms * Show team and repo badges on README * Make the get\_random\_mac more versatile * Correcting Networking API v2.0 flavor extension * Revise status of VPNaaS in neutron * Update contributing doc * Updated from global requirements * Replace six.iteritems() with .items() * api-ref: Fix api-ref for lbaas-v2 * Add is\_bsd() to neutron-lib * Use api/attributes.py instead of api/utils.py * Doc olso config option approach * Revert "Move wait\_until\_true to neutron-lib" * Move wait\_until\_true to neutron-lib * api-ref: Fix api-ref for subnetpools * Sync latest neutron callbacks into lib * Move get\_random\_mac into neutron-lib * api-ref: Correcting Network v2.0 API extensions * Add missing is\_loaded() method on directory's interface * TrivialFix: Perfect the unit test in test\_utils * Fix typo for comparision => comparison * Updated from global requirements * Add section headings to Neutron API Reference 1.0.0 ----- * Updates to API report tooling * Updated from global requirements * Add ExtensionDescriptor to neutron-lib * api-ref: Fix api-ref for subnets * Add release note for plugin directory * Introduce Plugin Directory for Neutron * Updated from global requirements * Fix doc build if git is absent * Updated from global requirements * Initial seed for neutron-lib release notes * Updated from global requirements * Revise coverage guidelines * Add release notes target * api-ref: Fix api-ref for service-providers * Enable fatal exceptions during tests * Introduce API definition for trunk/trunk\_details extensions * Updated from global requirements * [doc] Allow creating loadbalancer with network\_id * Change wording around router:external * Add segments to v2 API reference * Enhance valid\_values to use \_\_contains\_\_ * Add missing tenant\_id/project\_id request parameter * Add unit test for test\_exceptions * [api-ref] Corrected the redirect URL to Openstack Identity Service * api-ref: Update to current state of Keystone V3 support * Rehome populate\_project\_info() from neutron * api-ref: remove notion of supported xml format * Add unit test for test\_helpers * Simplify method convert\_to\_boolean with strutils.bool\_from\_string * Deprecate method ensure\_dir * Trivial: Remove 'MANIFEST.in' * Config logABug feature for Neutron-lib api-ref * Fix typo: remove redundant 'the' * api-ref: Update local\_id configuration * Updated from global requirements * Do not make project depends on Babel by default * Correct test\_tenant\_id\_attribute * Updated from global requirements * Updated from global requirements * Add support for upper-constraints.txt for all tox targets * api-ref: Add Networking v2.0 API versions response parameters * Updated from global requirements * Add info about API method to get default quotas * [api-ref] Remove temporary block * Fix regression in validate\_uuid\_list() * Add docstrings for api.validators * Fix confusion between Neutron and FWaaS versions * Add eventlet hacking check UT * api-ref: added a note to lbaasv1 about its removal in N+ * Move valuable API info from neutron-specs repo * api-ref: introduced a stub sub-page to cover general info * Updated from global requirements 0.4.0 ----- * Remove new checks from hacking factory() * Trivial DevRef Spelling corrections * Correcting information in configuration * api-ref: Correcting parameters type * Updated from global requirements * Add docstrings for utils.net * Add docstrings for utils.host * Add docstrings for utils.helpers * Add docstrings for utils.file * Add docstrings for hacking.translation\_checks * Add docstrings for hacking.checks * Updated from global requirements * Add docstrings for db.utils * Get ready for os-api-ref sphinx theme change * Add docstrings for policy * Base DB: rehome model\_base * Start migration of utility methods * Add docstrings for exceptions * Add docstrings for converters * Enhance pyir tooling CLI * Support copy() in Sentinel * Don't run api-report during pep8 * Add a hacking rule for string interpolation at logging * Correcting 'extention' parameter on Networking API v2.0 * Remove invalid depreaction warning * Generate API report tooling * Updated from global requirements * Add DeviceNotFoundError to neutron\_lib exceptions * Revert "Update hacking check consumption" * Enable DeprecationWarning in test environments * Update the home-page in setup.cfg * Add Python 3.5 classifier and venv * Updated from global requirements * Don't pass argument sqlite\_db in method set\_defaults * api-ref: Fix api-ref for routers * Updated from global requirements * api-ref: Rename file names for consistency * api-ref: Move sample JSON files under v2 directory * api-ref: Merge v2 and v2-ext into one directory * Sync neutron callbacks into lib * Forbid eventlet hacking check * api-ref: Split LBaaS API reference into v1 and v2 * Update hacking check consumption * translation\_checks: Exclude rally plugins * Add Neutron context module and some policy methods * Updated from global requirements 0.3.0 ----- * Add DEVICE\_OWNER\_BAREMETAL\_PREFIX const * Remove discover from test-requirements * Add validator to test integers * Deprecate N523 check that forbids oslo.\* imports * devref for public API docstring * Fix api-ref response code formatting * Migration report: validate that bc is installed * add tags to api-ref files for the content verification phase * Add tool to track migration to neutron-lib * Document release steps for neutron-lib * Expand the API reference Table of Content * Updated from global requirements * Fix simple typo * Tweak validation logic for subport validator * Updated from global requirements * Update documents to address some issues * Updated from global requirements * Rehome IPV6\_MODES constants * Update validator accessors * Forbid eventlet based code * Make the constant Sentinel() class public * 100% unit test coverage for hacking/checks.py * Localized exception message hacking check * Updated from global requirements * WADL to RST migration * Add translation validations to the hacking policy * Updated from global requirements * Fix E128 hacking errors and enable it * TrivialFix: Fix a bad indentation in a doc file * Enable local hacking rule in neutron-lib * Hacking: update iteritems hacking message * Add Neutron L3 agent types * Fix exception for invalid type * Add subport validator for vlan-aware-vms * Updated from global requirements * Remove unused oslo.service requirement 0.2.0 ----- * Updated from global requirements * Add IPv6\_LLA\_PREFIX constant * Remove ICMPV6\_ALLOWED\_TYPES * Maintain ATTR\_NOT\_SPECIFIED constant with deepcopy * Add constants for additional ICMPv6 types * Fixed type:dict validator passes unexpected keys * Define legacy ICMPv6 protocol name 'icmpv6' for backward compaty 0.1.0 ----- * Updated from global requirements * Remove config module * Updated from global requirements * Revert "Add Collector Agent type string" * Remove fake\_consume\_in\_threads dummy method * Updated from global requirements 0.0.3 ----- * Add pagination helpers * New device owner flag for HA router interface * Fix 'import neutron' hacking check * Add in missing constants * Remove unused pngmath Sphinx extension 0.0.2 ----- * Updated from global requirements * Callbacks: add precommit support * Add constants for macvtap agent * Callbacks: add in missing callback resources * Add Collector Agent type string * Add a hacking check against importing neutron * Lib specific hacking rules * Move some common test and framework goo into neutron-lib * Update translation setup * API validators and converters * Replace deprecated library function os.popen() with subprocess * Add popular IP protocols for security group 0.0.1 ----- * Improvements to tox envs * Adding callback mechanism * Setup for translation * Add neutron/plugin/common/constants.py module to neutron-lib * Setup for devref documentation * Initial list of constants * Use assertRaises instead of try-except in unit tests * Initial shared exceptions * Remove pypy as tox env * Insert references to debtcollector in review guidelines * Cleanup .gitignore * Beginning of lib review guidelines * Initial cookiecutter commit * Added .gitreview neutron-lib-1.13.0/setup.py0000666000175100017510000000200613231472055015572 0ustar zuulzuul00000000000000# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. # THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT import setuptools # In python < 2.7.4, a lazy loading of package `pbr` will break # setuptools if some other modules registered functions in `atexit`. # solution from: http://bugs.python.org/issue15881#msg170215 try: import multiprocessing # noqa except ImportError: pass setuptools.setup( setup_requires=['pbr>=2.0.0'], pbr=True) neutron-lib-1.13.0/requirements.txt0000666000175100017510000000144613231472055017353 0ustar zuulzuul00000000000000# The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. pbr!=2.1.0,>=2.0.0 # Apache-2.0 SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT debtcollector>=1.2.0 # Apache-2.0 keystoneauth1>=3.3.0 # Apache-2.0 stevedore>=1.20.0 # Apache-2.0 oslo.concurrency>=3.25.0 # Apache-2.0 oslo.config>=5.1.0 # Apache-2.0 oslo.context>=2.19.2 # Apache-2.0 oslo.db>=4.27.0 # Apache-2.0 oslo.i18n>=3.15.3 # Apache-2.0 oslo.log>=3.36.0 # Apache-2.0 oslo.messaging>=5.29.0 # Apache-2.0 oslo.policy>=1.30.0 # Apache-2.0 oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0 oslo.service!=1.28.1,>=1.24.0 # Apache-2.0 oslo.utils>=3.33.0 # Apache-2.0 WebOb>=1.7.1 # MIT neutron-lib-1.13.0/PKG-INFO0000664000175100017510000000311213231472430015147 0ustar zuulzuul00000000000000Metadata-Version: 1.1 Name: neutron-lib Version: 1.13.0 Summary: Neutron shared routines and utilities Home-page: https://docs.openstack.org/neutron-lib/latest/ Author: OpenStack Author-email: openstack-dev@lists.openstack.org License: UNKNOWN Description-Content-Type: UNKNOWN Description: ======================== Team and repository tags ======================== .. image:: https://governance.openstack.org/tc/badges/neutron-lib.svg :target: https://governance.openstack.org/tc/reference/tags/index.html .. Change things from this point on =============================== neutron-lib =============================== Neutron shared routines and utilities * Free software: Apache license * Documentation: https://docs.openstack.org/neutron-lib/latest/ * Source: http://git.openstack.org/cgit/openstack/neutron-lib * Bugs: http://bugs.launchpad.net/neutron Features -------- * TODO Platform: UNKNOWN Classifier: Environment :: OpenStack Classifier: Intended Audience :: Information Technology Classifier: Intended Audience :: System Administrators Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 neutron-lib-1.13.0/neutron_lib/0000775000175100017510000000000013231472430016375 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/legacy/0000775000175100017510000000000013231472430017641 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/legacy/__init__.py0000666000175100017510000000000013231472055021745 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/legacy/README.rst0000666000175100017510000000044613231472055021341 0ustar zuulzuul00000000000000=========================== neutron-lib legacy routines =========================== This is a special namespace with lower deprecation policy standards, and specific rules for its use. Please refer to the 'Legacy Modules' section of this library's 'conventions' document for more information. neutron-lib-1.13.0/neutron_lib/fixture.py0000666000175100017510000001672313231472055020453 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import copy import fixtures import mock from neutron_lib.api import attributes from neutron_lib.api import definitions from neutron_lib.callbacks import manager from neutron_lib.callbacks import registry from neutron_lib.db import api as db_api from neutron_lib.db import model_base from neutron_lib.plugins import directory class PluginDirectoryFixture(fixtures.Fixture): def __init__(self, plugin_directory=None): super(PluginDirectoryFixture, self).__init__() self.plugin_directory = ( plugin_directory or directory._PluginDirectory()) def _setUp(self): self._orig_directory = directory._PLUGIN_DIRECTORY directory._PLUGIN_DIRECTORY = self.plugin_directory self.addCleanup(self._restore) def _restore(self): directory._PLUGIN_DIRECTORY = self._orig_directory class CallbackRegistryFixture(fixtures.Fixture): """Callback registry fixture. This class is intended to be used as a fixture within unit tests and therefore consumers must register it using useFixture() within their unit test class. The implementation optionally allows consumers to pass in the CallbacksManager manager to use for your tests. """ def __init__(self, callback_manager=None): """Creates a new RegistryFixture. :param callback_manager: If specified, the return value to use for _get_callback_manager(). Otherwise a new instance of CallbacksManager is used. """ super(CallbackRegistryFixture, self).__init__() self.callback_manager = callback_manager or manager.CallbacksManager() self.patcher = None def _setUp(self): self._orig_manager = registry._get_callback_manager() self.patcher = mock.patch.object( registry, '_get_callback_manager', return_value=self.callback_manager) self.patcher.start() self.addCleanup(self._restore) def _restore(self): registry._CALLBACK_MANAGER = self._orig_manager self.patcher.stop() class SqlFixture(fixtures.Fixture): # flag to indicate that the models have been loaded _TABLES_ESTABLISHED = False def _setUp(self): # Register all data models engine = db_api.get_context_manager().writer.get_engine() if not SqlFixture._TABLES_ESTABLISHED: model_base.BASEV2.metadata.create_all(engine) SqlFixture._TABLES_ESTABLISHED = True def clear_tables(): with engine.begin() as conn: for table in reversed( model_base.BASEV2.metadata.sorted_tables): conn.execute(table.delete()) self.addCleanup(clear_tables) class APIDefinitionFixture(fixtures.Fixture): """Test fixture for testing neutron-lib API definitions. Extension API definition RESOURCE_ATTRIBUTE_MAP dicts get updated as part of standard extension processing/handling. While this behavior is fine for service runtime, it can impact testing scenarios whereby test1 updates the attribute map (globally) and test2 doesn't expect the test1 updates. This fixture saves and restores 1 or more neutron-lib API definitions attribute maps. It should be used anywhere multiple tests can be run that might update an extension attribute map. In addition the fixture backs up and restores the global attribute RESOURCES base on the boolean value of its backup_global_resources attribute. """ def __init__(self, *api_definitions): """Create a new instance. Consumers can also control if the fixture should handle the global attribute RESOURCE map using the backup_global_resources of the fixture instance. If True the fixture will also handle neutron_lib.api.attributes.RESOURCES. :param api_definitions: Zero or more API definitions the fixture should handle. If no api_definitions are passed, the default is to handle all neutron_lib API definitions as well as the global RESOURCES attribute map. """ self.definitions = api_definitions or definitions._ALL_API_DEFINITIONS self._orig_attr_maps = {} self._orig_resources = {} self.backup_global_resources = True def _setUp(self): for api_def in self.definitions: self._orig_attr_maps[api_def.ALIAS] = ( api_def, {k: copy.deepcopy(v) for k, v in api_def.RESOURCE_ATTRIBUTE_MAP.items()}) if self.backup_global_resources: for resource, attrs in attributes.RESOURCES.items(): self._orig_resources[resource] = copy.deepcopy(attrs) self.addCleanup(self._restore) def _restore(self): # clear + repopulate so consumer refs don't change for alias, def_and_map in self._orig_attr_maps.items(): api_def, attr_map = def_and_map[0], def_and_map[1] api_def.RESOURCE_ATTRIBUTE_MAP.clear() api_def.RESOURCE_ATTRIBUTE_MAP.update(attr_map) if self.backup_global_resources: attributes.RESOURCES.clear() attributes.RESOURCES.update(self._orig_resources) @classmethod def all_api_definitions_fixture(cls): """Return a fixture that handles all neutron-lib api-defs.""" return APIDefinitionFixture(*tuple(definitions._ALL_API_DEFINITIONS)) class PlacementAPIClientFixture(fixtures.Fixture): """Placement API client fixture. This class is intended to be used as a fixture within unit tests and therefore consumers must register it using useFixture() within their unit test class. """ def __init__(self, placement_api_client): """Creates a new PlacementAPIClientFixture. :param placement_api_client: Placement API client object. """ super(PlacementAPIClientFixture, self).__init__() self.placement_api_client = placement_api_client def _setUp(self): self.addCleanup(self._restore) def mock_create_client(): self.placement_api_client.client = mock.Mock() self._mock_create_client = mock.patch.object( self.placement_api_client, '_create_client', side_effect=mock_create_client) self._mock_get = mock.patch.object(self.placement_api_client, '_get') self._mock_post = mock.patch.object(self.placement_api_client, '_post') self._mock_put = mock.patch.object(self.placement_api_client, '_put') self._mock_delete = mock.patch.object(self.placement_api_client, '_delete') self._mock_create_client.start() self.mock_get = self._mock_get.start() self.mock_post = self._mock_post.start() self.mock_put = self._mock_put.start() self.mock_delete = self._mock_delete.start() def _restore(self): self._mock_create_client.stop() self._mock_get.stop() self._mock_post.stop() self._mock_put.stop() self._mock_delete.stop() neutron-lib-1.13.0/neutron_lib/__init__.py0000666000175100017510000000120213231472055020506 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import pbr.version __version__ = pbr.version.VersionInfo( 'neutron_lib').version_string() neutron-lib-1.13.0/neutron_lib/locale/0000775000175100017510000000000013231472430017634 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/locale/zh_CN/0000775000175100017510000000000013231472430020635 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/locale/zh_CN/LC_MESSAGES/0000775000175100017510000000000013231472430022422 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/locale/zh_CN/LC_MESSAGES/neutron_lib.po0000666000175100017510000012440213231472055025312 0ustar zuulzuul00000000000000# Lucas Palm , 2015. #zanata # OpenStack Infra , 2015. #zanata # Andreas Jaeger , 2016. #zanata # Lucas Palm , 2016. #zanata # Frank Wang , 2018. #zanata msgid "" msgstr "" "Project-Id-Version: neutron-lib VERSION\n" "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" "POT-Creation-Date: 2018-01-21 08:22+0000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2018-01-19 11:13+0000\n" "Last-Translator: Frank Wang \n" "Language-Team: Chinese (China)\n" "Language: zh-CN\n" "X-Generator: Zanata 3.9.6\n" "Plural-Forms: nplurals=1; plural=0\n" #, python-format msgid "%(child)s does not define a foreign key for %(parent)s" msgstr "%(child)s 没有为 %(parent)s定义外键" #, python-format msgid "%(data)s is not in %(valid_values)s" msgstr "“%(data)s”不在 %(valid_values)s 中" #, python-format msgid "%(driver)s: Internal driver error." msgstr "%(driver)s:内部驱动错误。" #, python-format msgid "%(id)s is not a valid %(type)s identifier" msgstr "%(id)s 是无效 %(type)s 标识" #, python-format msgid "%(param)s are not allowed when protocol is set to ICMP." msgstr "协议设为ICMP时%(param)s不被允许。" #, python-format msgid "%s is not a valid VLAN tag" msgstr "%s 是无效 VLAN 标记" #, python-format msgid "%s is not in a CIDR format" msgstr "%s不是CIDR格式" #, python-format msgid "" "'%(data)s' contains %(length)s characters. Adding a domain name will cause " "it to exceed the maximum length of a FQDN of '%(max_len)s'" msgstr "" "“%(data)s”包含%(length)s个字符。添加域名将导致它超出 FQDN 的最大长" "度“%(max_len)s”" #, python-format msgid "" "'%(data)s' contains %(length)s characters. Adding a sub-domain will cause it " "to exceed the maximum length of a FQDN of '%(max_len)s'" msgstr "" "“%(data)s”包含%(length)s个字符。添加子域将导致它超出 FQDN 的最大长" "度“%(max_len)s”" #, python-format msgid "'%(data)s' exceeds maximum length of %(max_len)s" msgstr "“%(data)s”超过最大长度 %(max_len)s" #, python-format msgid "'%(data)s' is neither a valid IP address, nor is it a valid IP subnet" msgstr "“%(data)s”不是一个合法的IP地址,也不是一个合法的IP子网" #, python-format msgid "'%(data)s' is not an accepted IP address, '%(ip)s' is recommended" msgstr "“%(data)s”并非已接受 IP 地址。建议使用“%(ip)s”" #, python-format msgid "'%(data)s' is too large - must be no larger than '%(limit)d'" msgstr "'%(data)s' 太大 - 必须不能大于 '%(limit)d'" #, python-format msgid "'%(data)s' is too small - must be at least '%(limit)d'" msgstr "'%(data)s' 太小 - 必须至少 '%(limit)d'" #, python-format msgid "'%(data)s' isn't a recognized IP subnet cidr, '%(cidr)s' is recommended" msgstr "'%(data)s' 不是一个可识别的IP子网CIDR, 建议'%(cidr)s' " #, python-format msgid "'%(data)s' not a valid PQDN or FQDN. Reason: %(reason)s" msgstr "“%(data)s”是无效 PQDN 或 FQDN。原因:%(reason)s" #, python-format msgid "'%(host)s' is not a valid nameserver. %(msg)s" msgstr "'%(host)s' 不是合法的nameserver %(msg)s" #, python-format msgid "'%(trimmed)s' exceeds the %(maxlen)s character FQDN limit" msgstr "“%(trimmed)s”超过了 %(maxlen)s字符这一 FQDN 限制" #, python-format msgid "'%s' Blank strings are not permitted" msgstr "'%s' 不允许空白字符串" #, python-format msgid "'%s' cannot be converted to boolean" msgstr "无法将“%s”转换为布尔值" #, python-format msgid "'%s' contains whitespace" msgstr "'%s' 包含空格" #, python-format msgid "'%s' is a FQDN. It should be a relative domain name" msgstr "“%s”为 FQDN。它应该是相对域名" #, python-format msgid "'%s' is an invalid attribute for sort key" msgstr "%s 对于 sort_keys 是无效属性" #, python-format msgid "'%s' is not a FQDN" msgstr "“%s”并非 FQDN" #, python-format msgid "'%s' is not a dictionary" msgstr "“%s”不是字典" #, python-format msgid "'%s' is not a list" msgstr "“%s”不是列表" #, python-format msgid "'%s' is not a valid IP address" msgstr "“%s”是无效 IP 地址" #, python-format msgid "'%s' is not a valid IP subnet" msgstr "“%s”是无效 IP 子网" #, python-format msgid "'%s' is not a valid MAC address" msgstr "“%s”是无效 MAC 地址" #, python-format msgid "'%s' is not a valid UUID" msgstr "“%s”是无效 UUID" #, python-format msgid "'%s' is not a valid boolean value" msgstr "'%s' 不是一个有效的布尔值" #, python-format msgid "'%s' is not a valid input" msgstr "“%s”不是有效的输入" #, python-format msgid "'%s' is not a valid string" msgstr "“%s”是无效字符串" #, python-format msgid "'%s' is not an integer" msgstr "“%s”不是整数" #, python-format msgid "'%s' is not an integer:boolean" msgstr "“%s”不是一个整数:布尔" #, python-format msgid "'%s' is not of the form =[value]" msgstr "“%s”没有采用格式 =[value]" #, python-format msgid "'%s' must be a non negative decimal" msgstr "“%s”必须为非负十进制数" #, python-format msgid "'%s' should be non-negative" msgstr "“%s”应该为非负" #, python-format msgid "" "'data' of type '%(typedata)s' and 'valid_values'of type '%(typevalues)s' are " "not compatible for comparison" msgstr "" "“%(typedata)s”的“data”类型和“%(typevalues)s”的“valid_values”的类型是不兼容的" "比较" msgid "'project_id' and 'tenant_id' do not match" msgstr "“project_id”与“tenant_id”不匹配" msgid "'valid_values' does not support membership operations" msgstr "“valid_values”不支持会员操作" msgid "A valid port UUID must be specified" msgstr "必须指定一个有效的端口UUID" #, python-format msgid "" "Action %(action)s is not supported. Only action values %(values)s are " "supported." msgstr "行为%(action)s不被支持。仅行为数值%(values)s被支持。" #, python-format msgid "Address scope %(address_scope_id)s could not be found." msgstr "找不到地址范围 %(address_scope_id)s。" #, python-format msgid "Agent %(id)s could not be found." msgstr "找不到 Agent %(id)s" #, python-format msgid "" "Agent with agent_type=%(agent_type)s and host=%(host)s could not be found." msgstr "找不到符合以下条件的代理:agent_type=%(agent_type)s 且 host=%(host)s。" #, python-format msgid "Aggregate not found for resource provider %(resource_provider)s." msgstr "资源提供者 %(resource_provider)s没有发现聚合。" msgid "Allowed address pairs must be a list." msgstr "允许的地址对必须是列表。" msgid "AllowedAddressPair must contain ip_address" msgstr "AllowedAddressPair 必须包含 ip_address" #, python-format msgid "An invalid value was provided for %(opt_name)s: %(opt_value)s." msgstr "对于 %(opt_name)s,已提供的值无效:%(opt_value)s。" msgid "An invalid value was provided for which muppet: big bird." msgstr "对于 muppet,已提供的值无效:big brid。" msgid "An unknown exception occurred." msgstr "发生未知异常。" #, python-format msgid "" "Attribute '%(attr)s' references another resource and cannot be used to sort " "'%(resource)s' resources" msgstr "属性“%(attr)s”是对其他资源的引用,无法由排序“%(resource)s”使用" #, python-format msgid "Attribute '%s' not allowed in POST" msgstr "属性“%s”不允许进行POST操作" #, python-format msgid "AvailabilityZone %(availability_zone)s could not be found." msgstr "找不到 AvailabilityZone %(availability_zone)s。" msgid "Backend does not support VLAN Transparency." msgstr "后端不支持 VLAN 透明。" #, python-format msgid "Bad %(resource)s request: %(msg)s." msgstr "%(resource)s 请求不正确:%(msg)s。" msgid "Bad A request: B." msgstr "错误请求" #, python-format msgid "" "Cannot associate floating IP %(floating_ip_address)s (%(fip_id)s) with port " "%(port_id)s using fixed IP %(fixed_ip)s, as that fixed IP already has a " "floating IP on external network %(net_id)s." msgstr "" "无法使浮动 IP %(floating_ip_address)s (%(fip_id)s) 与使用固定 IP " "%(fixed_ip)s 的端口 %(port_id)s 关联,因为该固定 IP 已具有外部网络 " "%(net_id)s 上的浮动 IP。" msgid "Class not found." msgstr "找不到类。" #, python-format msgid "Creation failed. %(dev_name)s already exists." msgstr "创建失败。%(dev_name)s 已存在。" msgid "Creation failed. hal9000 already exists." msgstr "创建失败。hal9000已存在。" msgid "" "Default firewall group already exists. 'default' is the reserved name for " "firewall group." msgstr "默认防火墙组已经存在。“default”已经被防火墙组预留。" msgid "Deleting default firewall group not allowed." msgstr "正在删除的缺省安全组内容不被允许。" #, python-format msgid "Device '%(device_name)s' does not exist." msgstr "设备“%(device_name)s”不存在。" msgid "Device 'device' does not exist." msgstr "设备“device”不存在。" #, python-format msgid "" "Distributed Virtual Router Mac Address for host %(host)s does not exist." msgstr "主机 %(host)s 的分布式虚拟路由器 MAC 地址不存在。" #, python-format msgid "Domain %(dns_domain)s not found in the external DNS service" msgstr "在外部 DNS 服务中找不到域 %(dns_domain)s" #, python-format msgid "Duplicate IP address '%s'" msgstr "IP 地址“%s”重复" msgid "Duplicate Metering Rule in POST." msgstr "POST 中的测量规则重复。" #, python-format msgid "Duplicate hostroute '%s'" msgstr "主机路由“%s”重复" #, python-format msgid "Duplicate items in the list: '%s'" msgstr "列表“%s”中的项重复" #, python-format msgid "Duplicate nameserver '%s'" msgstr "名称服务器“%s”重复" msgid "Duplicate segment entry in request." msgstr "请求中的分段条目重复。" msgid "Empty physical network name." msgstr "空的物理网络名。" msgid "Encountered an empty component" msgstr "遇到空组件" msgid "End of VLAN range is less than start of VLAN range" msgstr "VLAN 范围结束值比开始值小" msgid "End of tunnel range is less than start of tunnel range" msgstr "隧道范围的结束小于隧道范围的起始" #, python-format msgid "Error %(reason)s while attempting the operation." msgstr "尝试执行该操作时发生错误 %(reason)s。" #, python-format msgid "Extension module API definition does not define '%s'" msgstr "扩展模块API中没有定义“%s”" msgid "Extension module API definition not set." msgstr "扩展模块API定义未设置" #, python-format msgid "External DNS driver %(driver)s could not be found." msgstr "找不到外部 DNS 驱动程序 %(driver)s。" #, python-format msgid "" "External network %(external_network_id)s is not reachable from subnet " "%(subnet_id)s. Therefore, cannot associate Port %(port_id)s with a Floating " "IP." msgstr "" "无法从子网 %(subnet_id)s 访问外部网络 %(external_network_id)s。因此,无法使端" "口 %(port_id)s 与浮动 IP 关联。" #, python-format msgid "" "External network %(net_id)s cannot be updated to be made non-external, since " "it has existing gateway ports." msgstr "无法将外部网络 %(net_id)s 更新为非外部网络,因为它包含现有的网关端口。" #, python-format msgid "" "Failed to allocate a VRID in the network %(network_id)s for the router " "%(router_id)s after %(max_tries)s tries." msgstr "" "在 %(max_tries)s 次尝试之后,未能在网络 %(network_id)s 中为路由器 " "%(router_id)s 分配 VRID。" #, python-format msgid "Failed to check policy %(policy)s because %(reason)s." msgstr "无法检查策略 %(policy)s,因为 %(reason)s。" msgid "Failed to check policy policy because reason." msgstr "无法检查策略 policy,因为reason。" #, python-format msgid "" "Failed to create a duplicate %(object_type)s: for attribute(s) " "%(attributes)s with value(s) %(values)s" msgstr "" "对于具有值 %(values)s 的属性 %(attributes)s,未能创建重复的 %(object_type)s" #, python-format msgid "Failed to initialize policy %(policy)s because %(reason)s." msgstr "无法初始化策略 %(policy)s,因为 %(reason)s。" msgid "Failed to initialize policy policy because reason." msgstr "无法初始化策略 policy,因为reason。" #, python-format msgid "Failed to parse request. Required attribute '%s' not specified" msgstr "未能解析请求。未指定必需属性“%s”" #, python-format msgid "Firewall %(firewall_id)s could not be found." msgstr "防火墙%(firewall_id)s没有找到。" #, python-format msgid "Firewall %(firewall_id)s is still active." msgstr "防火墙%(firewall_id)s仍处于active状态。" #, python-format msgid "Firewall group %(firewall_id)s could not be found." msgstr "没有发现防火墙组%(firewall_id)s。" #, python-format msgid "Firewall group %(firewall_id)s is still active." msgstr "防火墙组%(firewall_id)s仍处于active状态。" #, python-format msgid "Firewall policy %(firewall_policy_id)s could not be found." msgstr "没有发现防火墙策略%(firewall_policy_id)s。" #, python-format msgid "Firewall policy %(firewall_policy_id)s is being used." msgstr "防火墙%(firewall_policy_id)s正在使用" #, python-format msgid "Firewall rule %(firewall_rule_id)s could not be found." msgstr "没有发现防火墙规则%(firewall_rule_id)s。" #, python-format msgid "Firewall rule %(firewall_rule_id)s is being used." msgstr "防火墙规则%(firewall_rule_id)s正在使用。" #, python-format msgid "" "Firewall rule %(firewall_rule_id)s is not associated with firewall policy " "%(firewall_policy_id)s." msgstr "" "防火墙规则%(firewall_rule_id)s没有关联防火墙策略%(firewall_policy_id)s。" #, python-format msgid "" "Firewall rule action %(action)s is not supported. Only action values " "%(values)s are supported." msgstr "防火墙规则行为%(action)s不被支持。仅行为数值%(values)s被支持。" #, python-format msgid "" "Firewall rule protocol %(protocol)s is not supported. Only protocol values " "%(values)s and their integer representation (0 to 255) are supported." msgstr "" "防火墙规则协议%(protocol)s不被支持。仅支持协议数值%(values)s的整数类型范围" "(0-255)。" msgid "First port in a port range must be lower than the second port" msgstr "端口范围的第一个端口必须小于第二个端口" #, python-format msgid "Flavor %(flavor_id)s could not be found." msgstr "找不到 flavor %(flavor_id)s。" #, python-format msgid "Flavor %(flavor_id)s is used by some service instance." msgstr "类型 %(flavor_id)s 已被某个服务实例使用。" msgid "Flavor is not enabled." msgstr "类型未启用。" #, python-format msgid "Floating IP %(floatingip_id)s could not be found" msgstr "找不到浮动 IP %(floatingip_id)s" #, python-format msgid "For class %(object_type)s missing primary keys: %(missing_keys)s" msgstr "对于类 %(object_type)s,缺少主键:%(missing_keys)s" #, python-format msgid "" "Gateway cannot be updated for router %(router_id)s, since a gateway to " "external network %(net_id)s is required by one or more floating IPs." msgstr "" "无法为路由器 %(router_id)s 更新网关,因为一个或多个浮动 IP 需要指向外部网络 " "%(net_id)s 的网关。" #, python-format msgid "" "IP address %(ip_address)s is not a valid IP for any of the subnets on the " "specified network." msgstr "对于所指定网络上的任何子网,IP 地址 %(ip_address)s 不是有效 IP。" #, python-format msgid "IP address %(ip_address)s is not a valid IP for the specified subnet." msgstr "对于所指定子网,IP 地址 %(ip_address)s 是无效 IP。" msgid "IP address 300.400.500.600 is not a valid IP for the specified subnet." msgstr "对于所指定子网,IP 地址300.400.500.600 是无效 IP。" msgid "" "IP address shazam! is not a valid IP for any of the subnets on the specified " "network." msgstr "对于所指定网络上的任何子网,IP 地址shazam是无效 IP。" #, python-format msgid "" "IP protocol '%s' is not supported. Only protocol names and their integer " "representation (0 to 255) are supported" msgstr "不支持IP协议“%s”。仅支持协议名称及它们的整数类型表示(0-255)。" #, python-format msgid "Incorrect range limits specified: start = %(start)s, end = %(end)s" msgstr "指定了错误的限制范围:开始= %(start)s,结束= %(end)s" #, python-format msgid "Input value %s must be string type" msgstr "输入值%s必须为字符串" #, python-format msgid "Invalid UUID for subport: '%s'" msgstr "无效的子端口UUID:“%s”" #, python-format msgid "Invalid content type %(content_type)s." msgstr "无效的内容类型 %(content_type)s。" msgid "Invalid content type porn." msgstr "无效的内容类型 porn。" #, python-format msgid "Invalid data format for IP pool: '%s'" msgstr "IP 池的数据格式无效:“%s”" #, python-format msgid "Invalid data format for fixed IP: '%s'" msgstr "固定 IP 的数据格式无效:“%s”" #, python-format msgid "Invalid data format for hostroute: '%s'" msgstr "主机路由“%s”的数据格式无效" #, python-format msgid "Invalid data format for nameserver: '%s'" msgstr "名称服务器“%s”的数据格式无效" #, python-format msgid "Invalid data format for subport: '%s' is not a dict" msgstr "子端口无效的数据格式:“%s”不是一个字典" #, python-format msgid "Invalid data format for subports: '%s' is not a list" msgstr "子端口无效的数据格式:“%s”不是一个列表" #, python-format msgid "Invalid format for routes: %(routes)s, %(reason)s" msgstr "路由 %(routes)s 的格式无效,%(reason)s" msgid "Invalid input - IP addresses do not agree with IP Version." msgstr "无效输入-IP地址与IP版本不一致。" #, python-format msgid "Invalid input for %(attr)s. Reason: %(reason)s." msgstr "输入对于 %(attr)s 无效。原因:%(reason)s。" #, python-format msgid "Invalid input for operation: %(error_message)s." msgstr "针对操作的输入无效:%(error_message)s。" msgid "Invalid input for operation: warp core breach." msgstr "针对操作的输入无效:warp core breach。" #, python-format msgid "" "Invalid input. '%(target_dict)s' must be a dictionary with keys: " "%(expected_keys)s" msgstr "输入无效。“%(target_dict)s”必须是具有以下键的字典:%(expected_keys)s" #, python-format msgid "Invalid mapping: '%s'" msgstr "映射无效:“%s”" #, python-format msgid "Invalid network VLAN range: '%(vlan_range)s' - '%(error)s'." msgstr "无效网络 VLAN 范围:“%(vlan_range)s”-“%(error)s”。" #, python-format msgid "Invalid network tunnel range: '%(tunnel_range)s' - %(error)s." msgstr "网络隧道范围“%(tunnel_range)s”无效 - %(error)s。" msgid "Invalid network tunnel range: '3:4' - present." msgstr "网络隧道范围“3:4”无效。" msgid "Invalid network tunnel range: 'rats' - present." msgstr "网络隧道范围“rats”无效。" #, python-format msgid "Invalid port: %s" msgstr "无效端口:'%s'" #, python-format msgid "Invalid service type: %(service_type)s." msgstr "无效服务类型: %(service_type)s 。" #, python-format msgid "" "Invalid subport details '%s': missing segmentation information. Must specify " "both segmentation_id and segmentation_type" msgstr "" "无效的子端口信息“%s”:没有的段信息。必须指定segmentation_id和" "segmentation_type" #, python-format msgid "Invalid value for port %(port)s." msgstr "端口%(port)s数值无效。" #, python-format msgid "Key %(key)s in mapping: '%(mapping)s' not unique" msgstr "映射“%(mapping)s”中的键 %(key)s 不唯一" #, python-format msgid "Metering label '%(label_id)s' does not exist." msgstr "测量标签规则 “%(label_id)s ” 不存在" #, python-format msgid "Metering label rule '%(rule_id)s' does not exist." msgstr "测量标签规则 “%(rule_id)s ” 不存在" #, python-format msgid "" "Metering label rule with remote_ip_prefix '%(remote_ip_prefix)s' overlaps " "another." msgstr "" "带有 remote_ip_prefix “%(remote_ip_prefix)s” 的测量标签规则与另一测量标签规则" "重叠" #, python-format msgid "Missing key in mapping: '%s'" msgstr "映射中缺少键:“%s”" msgid "Missing rule info argument for insert/remove rule operation." msgstr "插入/删除规则操作缺省规则信息参数。" #, python-format msgid "Missing value in mapping: '%s'" msgstr "映射中缺少值:“%s”" msgid "More than one external network exists." msgstr "存在多个外部网络。" #, python-format msgid "Multiple agents with agent_type=%(agent_type)s and host=%(host)s found." msgstr "" "找到多个符合以下条件的代理:agent_type=%(agent_type)s 且 host=%(host)s。" #, python-format msgid "Name %(dns_name)s is duplicated in the external DNS service" msgstr "名称 %(dns_name)s 在外部 DNS 服务中重复" #, python-format msgid "" "Name '%s' must be 1-63 characters long, each of which can only be " "alphanumeric or a hyphen" msgstr "" "名称“%s”的长度必须在 1 到 63 个字符之间,其中每个字符只能是字母数字或连字符" #, python-format msgid "Name '%s' must not start or end with a hyphen" msgstr "名称“%s”不能以连字符开头或结尾" msgid "Need exactly two values for VLAN range" msgstr "VLAN范围需要两个数值" #, python-format msgid "Network %(net_id)s could not be found." msgstr "找不到网络 %(net_id)s。" #, python-format msgid "Network for tenant %(tenant_id)s concurrently deleted." msgstr "租户 %(tenant_id)s网络被并发删除。" msgid "Network spam could not be found." msgstr "网络未找到。" #, python-format msgid "NeutronDbObject not found by model %(model)s." msgstr "NeutronDbObject 未通过模型 %(model)s发现。" msgid "No inventory of class" msgstr "无库存类" #, python-format msgid "No more IP addresses available on network %(net_id)s." msgstr "在网络 %(net_id)s 上,没有更多 IP 地址可用。" msgid "No more IP addresses available on network nuke." msgstr "在网络 nuke上,没有更多 IP 地址可用。" #, python-format msgid "" "No more Virtual Router Identifier (VRID) available when creating router " "%(router_id)s. The limit of number of HA Routers per tenant is 254." msgstr "" "当创建路由器 %(router_id)s 时,没有更多虚拟路由器标识 (VRID) 可用。每个租户" "的 HA 路由器数的限制为 254。" #, python-format msgid "No valid key specs matched for: %s" msgstr "“%s”没有匹配的有效使用者" #, python-format msgid "Non unique UUID for subport: '%s'" msgstr "不唯一的子端口UUID:“%s”" msgid "Not authorized." msgstr "未授权。" #, python-format msgid "Object %(id)s not found." msgstr "找不到对象 %(id)s。" msgid "Object fallout tato not found." msgstr "相关对象未找到。" msgid "One or more ports have an IP allocation from this subnet" msgstr "一个或多个端口具有从此子网进行的 IP 分配" #, python-format msgid "" "Operation cannot be performed as port %(port_id)s is in an invalid project " "%(project_id)s." msgstr "" "相关操作不能执行,因为端口 %(port_id)s在一个无效的租户 %(project_id)s中" #, python-format msgid "" "Operation cannot be performed since associated firewall %(firewall_id)s is " "in %(pending_state)s." msgstr "相关联防火墙%(firewall_id)s处于%(pending_state)s,因此操作不会执行。" #, python-format msgid "" "Operation cannot be performed since associated firewall group " "%(firewall_id)s is in %(pending_state)s." msgstr "相关联防火墙组%(firewall_id)s处于%(pending_state)s,因此操作不会执行。" #, python-format msgid "" "Operation cannot be performed since firewall policy %(firewall_policy_id)s " "could not find the firewall rule %(firewall_rule_id)s. Please confirm if the " "firewall rule exists and is shared." msgstr "" "相关操作不能执行,因为租户的防火墙策略 %(firewall_policy_id)s找不到防火墙规" "则 %(firewall_rule_id)s。请确认防火墙规则是否存在并且是共享的 。" #, python-format msgid "" "Operation cannot be performed since firewall policy %(firewall_policy_id)s " "for your project could not be found. Please confirm if the firewall policy " "exists and is shared." msgstr "" "相关操作不能执行,因为租户的防火墙策略 %(firewall_policy_id)s未找到。请确认防" "火墙策略是否存在并且是共享的 。" #, python-format msgid "" "Operation cannot be performed since firewall policy %(firewall_policy_id)s " "is not shared and does not belong to your project." msgstr "" "由于防火墙策略%(firewall_policy_id)s不共享,不属于您的租户,因此操作无法执" "行。" #, python-format msgid "" "Operation cannot be performed since firewall policy %(firewall_policy_id)s " "is shared but firewall rule %(firewall_rule_id)s is not shared." msgstr "" "防火墙策略%(firewall_policy_id)s共享,但防火墙规则%(firewall_rule_id)s不共" "享,因此操作无法执行。" #, python-format msgid "" "Operation cannot be performed since firewall rule %(firewall_rule_id)s is " "already associated with firewall policy %(firewall_policy_id)s." msgstr "" "由于防火墙规则%(firewall_rule_id)s已关联至防火墙策略%(firewall_policy_id)s," "因此操作无法执行。" #, python-format msgid "" "Operation cannot be performed since firewall rule %(firewall_rule_id)s is " "not shared and belongs to another project %(project_id)s." msgstr "" "操作无法执行,防火墙规则%(firewall_rule_id)s属于另一租户%(project_id)s不被共" "享。" #, python-format msgid "" "Operation cannot be performed. Before sharing firewall policy " "%(firewall_policy_id)s, share associated firewall rule %(firewall_rule_id)s." msgstr "" "操作无法执行。共享防火墙策略%(firewall_policy_id)s前首先共享关联的防火墙规" "则%(firewall_rule_id)s。" msgid "Placement API endpoint not found." msgstr "没有发现Placement API服务站点。" #, python-format msgid "" "Placement inventory not found for resource provider %(resource_provider)s, " "resource class %(resource_class)s." msgstr "" "Placement库存没有发现对应的资源提供者 %(resource_provider)s,资源类 " "%(resource_class)s。" #, python-format msgid "" "Placement inventory update conflict for resource provider " "%(resource_provider)s, resource class %(resource_class)s." msgstr "" "Placement库存对应的资源提供者 %(resource_provider)s更新冲突,资源类 " "%(resource_class)s。" #, python-format msgid "Placement resource provider not found %(resource_provider)s." msgstr "没有发现Placement资源提供者 %(resource_provider)s。" #, python-format msgid "" "Port %(port_id)s cannot be deleted directly via the port API: %(reason)s." msgstr "无法直接通过端口 API 删除端口 %(port_id)s:%(reason)s。" #, python-format msgid "Port %(port_id)s could not be found on network %(net_id)s." msgstr "在网络 %(net_id)s 上找不到端口 %(port_id)s。" #, python-format msgid "Port %(port_id)s could not be found." msgstr "端口 %(port_id)s 无法被发现。" #, python-format msgid "Port %(port_id)s of firewall group is invalid." msgstr "防火墙组的端口 %(port_id)s无效 。" msgid "" "Port Security must be enabled in order to have allowed address pairs on a " "port." msgstr "必须启用端口安全性,以便在端口上具有所允许的地址对。" msgid "Port harbor cannot be deleted directly via the port API: docking." msgstr "端口不能直接通过API删除。" msgid "Port harbor could not be found." msgstr "端口未找到。" msgid "" "Port has security group associated. Cannot disable port security or IP " "address until security group is removed." msgstr "端口已使安全组关联。直到除去安全组,才能禁用端口安全性或 IP 地址。" msgid "Port range must be two integers separated by a colon" msgstr "端口范围必须是用冒号分隔的两个整数。" msgid "" "Port security must be enabled and port must have an IP address in order to " "use security groups." msgstr "必须启用端口安全性,并且端口必须具有 IP 地址以使用安全组。" msgid "Port serial could not be found on network USB." msgstr "网络USB上找不到端口" #, python-format msgid "" "Port(s) %(port_ids)s provided already associated with other firewall " "group(s)." msgstr "提供的端口%(port_ids)s已关联至其他防火墙组。" #, python-format msgid "" "Protocol %(protocol)s is not supported. Only protocol values %(values)s and " "their integer representation (0 to 255) are supported." msgstr "" "协议%(protocol)s不被支持。仅支持协议数值%(values)s的整数类型范围(0-255)。" #, python-format msgid "Quota exceeded for resources: %(overs)s." msgstr "资源超过了配额:%(overs)s。" msgid "Quota exceeded for resources: tube socks." msgstr "资源超过了配额:tube socks。" #, python-format msgid "" "Request contains duplicate address pair: mac_address %(mac_address)s " "ip_address %(ip_address)s." msgstr "" "请求包含重复地址对:mac_address %(mac_address)s ip_address %(ip_address)s。" #, python-format msgid "Router %(router_id)s %(reason)s" msgstr "路由器 %(router_id)s %(reason)s" #, python-format msgid "Router %(router_id)s could not be found" msgstr "找不到路由器 %(router_id)s" #, python-format msgid "Router %(router_id)s does not have an interface with id %(port_id)s" msgstr "路由器 %(router_id)s 没有具有标识 %(port_id)s 的接口" #, python-format msgid "Router %(router_id)s has no interface on subnet %(subnet_id)s" msgstr "路由器 %(router_id)s 在子网 %(subnet_id)s 上没有任何接口" #, python-format msgid "" "Router interface for subnet %(subnet_id)s on router %(router_id)s cannot be " "deleted, as it is required by one or more floating IPs." msgstr "" "无法删除路由器 %(router_id)s 上用于子网 %(subnet_id)s 的路由器接口,因为一个" "或多个浮动 IP 需要该接口。" #, python-format msgid "" "Router interface for subnet %(subnet_id)s on router %(router_id)s cannot be " "deleted, as it is required by one or more routes." msgstr "" "无法删除路由器 %(router_id)s 上用于子网 %(subnet_id)s 的路由器接口,因为一个" "或多个路由需要该接口。" #, python-format msgid "" "Router(s) %(router_ids)s provided already associated with other firewall(s)." msgstr "路由%(router_ids)s已关联至其他防火墙。" msgid "Running without keystone AuthN requires that tenant_id is specified" msgstr "在没有 keystone AuthN 的情况下运行要求指定 tenant_id" #, python-format msgid "Segmentation ID '%(seg_id)s' for '%(subport)s' is not unique" msgstr "“%(subport)s” 的段ID “%(seg_id)s”不是唯一的" msgid "Segments and provider values cannot both be set." msgstr "无法同时设置段和提供程序值。" #, python-format msgid "Service Profile %(sp_id)s could not be found." msgstr "找不到服务概要文件 %(sp_id)s。" #, python-format msgid "Service Profile %(sp_id)s is already associated with flavor %(fl_id)s." msgstr "服务概要文件 %(sp_id)s 已与类型 %(fl_id)s 相关联。" #, python-format msgid "Service Profile %(sp_id)s is not associated with flavor %(fl_id)s." msgstr "服务概要文件 %(sp_id)s 未与类型 %(fl_id)s 相关联。" #, python-format msgid "Service Profile %(sp_id)s is used by some service instance." msgstr "服务概要文件 %(sp_id)s 已被某个服务实例使用。" #, python-format msgid "Service Profile driver %(driver)s could not be found." msgstr "找不到服务概要文件驱动程序 %(driver)s。" msgid "Service Profile is not enabled." msgstr "服务概要文件未启用。" msgid "Service Profile needs either a driver or metainfo." msgstr "服务概要文件需要驱动程序或元信息。" msgid "Source/destination port requires a protocol." msgstr "源/目的端口需要一个协议。" msgid "" "Specifying 'project_id' or 'tenant_id' other than the authenticated project " "in request requires admin privileges" msgstr "在请求中指定除了已认证租户之外的“project_id”或“tenant_id”需要管理特权" #, python-format msgid "Subnet %(subnet_id)s could not be found." msgstr "找不到子网 %(subnet_id)s。" #, python-format msgid "" "Subnet on port %(port_id)s does not match the requested subnet %(subnet_id)s." msgstr "端口 %(port_id)s 上的子网与所请求子网 %(subnet_id)s 不匹配。" msgid "Subnet on port porter does not match the requested subnet submit." msgstr "端口 porter上的子网与所请求子网 submit不匹配。" msgid "Subnet root could not be found." msgstr "根子网未找到。" #, python-format msgid "Synthetic field %(field)s shouldn't have more than one foreign key" msgstr "合成域 %(field)s 最多有一个外键" #, python-format msgid "" "Synthetic field(s) %(fields)s undefined, misspelled, or otherwise invalid" msgstr "合成域 %(fields)s 未定义,未定义或者无效" #, python-format msgid "TLD '%s' must not be all numeric" msgstr "TLD“%s”不能全部为数字" #, python-format msgid "" "The HA Network CIDR specified in the configuration file isn't valid; " "%(cidr)s." msgstr "配置文件中指定的 HA 网络 CIDR 无效;%(cidr)s。" #, python-format msgid "" "The dns_name passed is a FQDN. Its higher level labels must be equal to the " "dns_domain option in neutron.conf, that has been set to '%(dns_domain)s'. It " "must also include one or more valid DNS labels to the left of " "'%(dns_domain)s'" msgstr "" "所传递的 dns_name 为 FQDN。它的更高级别的标签必须与neutron.conf 中的 " "dns_domain 选项相同,该选项已设置为“%(dns_domain)s”。它还必须" "在“%(dns_domain)s”的左边包括一个或多个有效 DNS 标签" #, python-format msgid "" "The dns_name passed is a PQDN and its size is '%(dns_name_len)s'. The " "dns_domain option in neutron.conf is set to %(dns_domain)s, with a length of " "'%(higher_labels_len)s'. When the two are concatenated to form a FQDN (with " "a '.' at the end), the resulting length exceeds the maximum size of " "'%(fqdn_max_len)s'" msgstr "" "所传递的 dns_name 为 PQDN,其大小为“%(dns_name_len)s”。neutron.conf 中的 " "dns_domain 选项设置为 %(dns_domain)s,长度为“%(higher_labels_len)s”。当这两者" "合并以组成 FQDN 时(末尾为“.”),最终获得的长度超过了最大大" "小“%(fqdn_max_len)s”" #, python-format msgid "The number of allowed address pair exceeds the maximum %(quota)s." msgstr "允许的地址对数超过最大值 %(quota)s。" msgid "The resource is in use." msgstr "资源正在使用。" msgid "The service is unavailable." msgstr "服务不可用。" #, python-format msgid "The value '%(value)s' for %(element)s is not valid." msgstr "%(element)s 的值“%(value)s”无效。" msgid "" "Too long prefix provided. New name would exceed given length for an " "interface name." msgstr "提供的前缀太长。新名称将超出接口名称的给定长度。" msgid "Too many availability_zone_hints specified" msgstr "指定了过多 availability_zone_hints" msgid "Two or more concurrent subnets allocated" msgstr "两个或多个子网并发申请" #, python-format msgid "" "Unable to complete operation for %(router_id)s. The number of routes exceeds " "the maximum %(quota)s." msgstr "对于 %(router_id)s,无法完成操作。路由数超过最大值 %(quota)s。" #, python-format msgid "" "Unable to complete operation for network %(net_id)s. The IP address " "%(ip_address)s is in use." msgstr "对于网络 %(net_id)s,无法完成操作。IP 地址 %(ip_address)s 在使用中。" #, python-format msgid "" "Unable to complete operation for network %(net_id)s. The mac address %(mac)s " "is in use." msgstr "对于网络 %(net_id)s,无法完成操作。MAC 地址 %(mac)s 在使用中。" msgid "" "Unable to complete operation for network boredom. The IP address crazytown " "is in use." msgstr "对于网络 boredom,无法完成操作。IP 地址 crazytown 在使用中。" msgid "" "Unable to complete operation for network nutters. The mac address grill is " "in use." msgstr "对于网络 nutter,无法完成操作。MAC 地址grill 在使用中。" #, python-format msgid "" "Unable to complete operation on address scope %(address_scope_id)s. There " "are one or more subnet pools in use on the address scope." msgstr "" "无法对地址范围 %(address_scope_id)s 完成操作。在该地址范围内,正在使用一个或" "多个子网池。" #, python-format msgid "" "Unable to complete operation on network %(net_id)s. There are one or more " "ports still in use on the network." msgstr "" "无法在网络 %(net_id)s 上完成操作。在该网络上,一个或多个端口仍然在使用中。" msgid "" "Unable to complete operation on network foo. There are one or more ports " "still in use on the network." msgstr "无法在网络 foo上完成操作。在该网络上,一个或多个端口仍然在使用中。" #, python-format msgid "" "Unable to complete operation on port %(port_id)s for network %(net_id)s. " "Port already has an attached device %(device_id)s." msgstr "" "对于网络 %(net_id)s,无法在端口 %(port_id)s 上完成操作。端口已具有连接的设备 " "%(device_id)s。" #, python-format msgid "" "Unable to complete operation on port %(port_id)s, port is already bound, " "port type: %(vif_type)s, old_mac %(old_mac)s, new_mac %(new_mac)s." msgstr "" "无法在端口 %(port_id)s 上完成操作,端口已绑定,端口类型:%(vif_type)s," "old_mac %(old_mac)s,new_mac %(new_mac)s。" msgid "" "Unable to complete operation on port a for network c. Port already has an " "attached device b." msgstr "无法完成对在网络c上的端口a的操作:端口已经添加到设备b上。" msgid "" "Unable to complete operation on port bigmac, port is already bound, port " "type: ketchup, old_mac onions, new_mac salt." msgstr "" "无法完成对端口bigmac操作,端口已经绑定,端口类型:ketchup,旧mac:onions,新" "mac: salt。" #, python-format msgid "Unable to complete operation on subnet %(subnet_id)s: %(reason)s." msgstr "无法在子网 %(subnet_id)s上完成操作:%(reason)s。" msgid "" "Unable to complete operation on subnet garbage: One or more ports have an IP " "allocation from this subnet." msgstr "无法在子网garbage上完成操作:有多个端口从这个子网申请了IP地址" msgid "Unable to complete operation on subnet garbage: not full." msgstr "无法在子网garbage上完成操作。" #, python-format msgid "" "Unable to complete operation on subnet pool %(subnet_pool_id)s. %(reason)s." msgstr "无法在子网 %(subnet_pool_id)s上完成操作:%(reason)s。" msgid "" "Unable to complete operation on subnet pool ymca. Two or more concurrent " "subnets allocated." msgstr "无法在子网池ymca完成操作:有两个以上的子网被申请了。" msgid "Unable to complete operation on subnet pool ymca. because." msgstr "无法在子网池ymca完成操作。" msgid "" "Unable to create the network. No tenant network is available for allocation." msgstr "无法创建该网络。没有任何租户网络可用于分配。" #, python-format msgid "" "Unable to create the network. The VLAN %(vlan_id)s on physical network " "%(physical_network)s is in use." msgstr "" "无法创建该网络。物理网络 %(physical_network)s 上的 VLAN %(vlan_id)s 在使用" "中。" msgid "" "Unable to create the network. The VLAN virtual on physical network phys is " "in use." msgstr "无法创建该网络。物理网络 phys上的 VLAN virtual在使用中。" #, python-format msgid "Unable to create the network. The tunnel ID %(tunnel_id)s is in use." msgstr "无法创建该网络。隧道标识 %(tunnel_id)s 在使用中。" msgid "Unable to create the network. The tunnel ID sewer is in use." msgstr "无法创建该网络。隧道标识 sewer 在使用中。" #, python-format msgid "Unable to find any IP address on external network %(net_id)s." msgstr "在外部网络上找不到任何 IP 地址%(net_id)s." msgid "Unable to find any IP address on external network darpanet." msgstr "在外部网络darpanet上找不到任何 IP 地址。" #, python-format msgid "Unable to generate unique mac for host %(host)s." msgstr "无法为主机 %(host)s 生成唯一 MAC。" #, python-format msgid "Unable to generate unique mac on network %(net_id)s." msgstr "无法在网络 %(net_id)s 上生成唯一 MAC。" #, python-format msgid "Unable to update address scope %(address_scope_id)s : %(reason)s." msgstr "无法更新地址范围 %(address_scope_id)s:%(reason)s。" #, python-format msgid "Unable to update the following object fields: %(fields)s" msgstr "无法更新下列对象字段:%(fields)s" #, python-format msgid "Unexpected keys supplied: %s" msgstr "提供未预期keys:%s" #, python-format msgid "Unknown attribute '%s'." msgstr "属性“%s”未知。" #, python-format msgid "Unrecognized attribute(s) '%s'" msgstr "无法识别属性“%s”" msgid "Updating default firewall group not allowed." msgstr "正在更新的缺省防火墙内容不被允许。" #, python-format msgid "User does not have admin privileges: %(reason)s." msgstr "用户没有管理员特权:%(reason)s。" msgid "User does not have admin privileges: hoser." msgstr "用户没有管理员特权" #, python-format msgid "" "Validation of dictionary's keys failed. Expected keys: %(expected_keys)s " "Provided keys: %(provided_keys)s" msgstr "" "对字典的键进行的验证失败。期望的键是 %(expected_keys)s,提供的键是 " "%(provided_keys)s" #, python-format msgid "Validator '%s' does not exist" msgstr "验证器“%s”不存在" #, python-format msgid "Validator type %s is already defined" msgstr "验证器类型 %s已经定义" #, python-format msgid "Value %(value)s in mapping: '%(mapping)s' not unique" msgstr "映射“%(mapping)s”中的值 %(value)s 不唯一" #, python-format msgid "" "Value of %(parameter)s has to be multiple of %(number)s, with maximum value " "of %(maximum)s and minimum value of %(minimum)s" msgstr "" "%(parameter)s 的值必须是 %(number)s 的倍数,最大值为 %(maximum)s,最小值为 " "%(minimum)s" #, python-format msgid "" "max_l3_agents_per_router %(max_agents)s config parameter is not valid as it " "cannot be negative. It must be 1 or greater. Alternatively, it can be 0 to " "mean unlimited." msgstr "" "max_l3_agents_per_router %(max_agents)s 配置参数无效。因为它不能为负数。它必" "须大于等于1。另外,如果它为0意味着不限制。" neutron-lib-1.13.0/neutron_lib/db/0000775000175100017510000000000013231472430016762 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/db/__init__.py0000666000175100017510000000000013231472055021066 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/db/utils.py0000666000175100017510000001013613231472055020502 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import six from neutron_lib import exceptions as n_exc from sqlalchemy.orm import properties from neutron_lib._i18n import _ from oslo_db import exception as db_exc from oslo_utils import excutils from sqlalchemy.orm import exc def get_and_validate_sort_keys(sorts, model): """Extract sort keys from sorts and ensure they are valid for the model. :param sorts: A list of (key, direction) tuples. :param model: A sqlalchemy ORM model class. :returns: A list of the extracted sort keys. :raises BadRequest: If a sort key attribute references another resource and cannot be used in the sort. """ sort_keys = [s[0] for s in sorts] for sort_key in sort_keys: try: sort_key_attr = getattr(model, sort_key) except AttributeError: # Extension attributes don't support sorting. Because it # existed in attr_info, it will be caught here. msg = _("'%s' is an invalid attribute for sort key") % sort_key raise n_exc.BadRequest(resource=model.__tablename__, msg=msg) if isinstance(sort_key_attr.property, properties.RelationshipProperty): msg = _("Attribute '%(attr)s' references another resource and " "cannot be used to sort '%(resource)s' resources" ) % {'attr': sort_key, 'resource': model.__tablename__} raise n_exc.BadRequest(resource=model.__tablename__, msg=msg) return sort_keys def get_sort_dirs(sorts, page_reverse=False): """Extract sort directions from sorts, possibly reversed. :param sorts: A list of (key, direction) tuples. :param page_reverse: True if sort direction is reversed. :returns: The list of extracted sort directions optionally reversed. """ if page_reverse: return ['desc' if s[1] else 'asc' for s in sorts] return ['asc' if s[1] else 'desc' for s in sorts] def _is_nested_instance(exception, etypes): """Check if exception or its inner excepts are an instance of etypes.""" return (isinstance(exception, etypes) or isinstance(exception, n_exc.MultipleExceptions) and any(_is_nested_instance(i, etypes) for i in exception.inner_exceptions)) def is_retriable(exception): """Determine if the said exception is retriable. :param exception: The exception to check. :returns: True if 'exception' is retriable, otherwise False. """ if _is_nested_instance(exception, (db_exc.DBDeadlock, exc.StaleDataError, db_exc.DBConnectionError, db_exc.DBDuplicateEntry, db_exc.RetryRequest)): return True # Look for savepoints mangled by deadlocks. See bug/1590298 for details. return (_is_nested_instance(exception, db_exc.DBError) and '1305' in str(exception)) def reraise_as_retryrequest(function): """Wrap the said function with a RetryRequest upon error. :param function: The function to wrap/decorate. :returns: The 'function' wrapped in a try block that will reraise any Exception's as a RetryRequest. :raises RetryRequest: If the wrapped function raises retriable exception. """ @six.wraps(function) def _wrapped(*args, **kwargs): try: return function(*args, **kwargs) except Exception as e: with excutils.save_and_reraise_exception() as ctx: if is_retriable(e): ctx.reraise = False raise db_exc.RetryRequest(e) return _wrapped neutron-lib-1.13.0/neutron_lib/db/model_base.py0000666000175100017510000000711213231472055021434 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_db.sqlalchemy import models from oslo_utils import uuidutils import sqlalchemy as sa from sqlalchemy.ext import declarative from sqlalchemy import orm from neutron_lib.db import constants as db_const class HasProject(object): """Project mixin, add to subclasses that have a user.""" # NOTE: project_id is just a free form string project_id = sa.Column(sa.String(db_const.PROJECT_ID_FIELD_SIZE), index=True) def get_tenant_id(self): return self.project_id def set_tenant_id(self, value): self.project_id = value @declarative.declared_attr def tenant_id(cls): return orm.synonym( 'project_id', descriptor=property(cls.get_tenant_id, cls.set_tenant_id)) class HasProjectNoIndex(HasProject): """Project mixin, add to subclasses that have a user.""" # NOTE: project_id is just a free form string project_id = sa.Column(sa.String(db_const.PROJECT_ID_FIELD_SIZE)) class HasProjectPrimaryKeyIndex(HasProject): """Project mixin, add to subclasses that have a user.""" # NOTE: project_id is just a free form string project_id = sa.Column(sa.String(db_const.PROJECT_ID_FIELD_SIZE), nullable=False, primary_key=True, index=True) class HasProjectPrimaryKey(HasProject): """Project mixin, add to subclasses that have a user.""" # NOTE: project_id is just a free form string project_id = sa.Column(sa.String(db_const.PROJECT_ID_FIELD_SIZE), nullable=False, primary_key=True) class HasId(object): """id mixin, add to subclasses that have an id.""" id = sa.Column(sa.String(db_const.UUID_FIELD_SIZE), primary_key=True, default=uuidutils.generate_uuid) class HasStatusDescription(object): """Status with description mixin.""" status = sa.Column(sa.String(db_const.STATUS_FIELD_SIZE), nullable=False) status_description = sa.Column(sa.String(db_const.DESCRIPTION_FIELD_SIZE)) class _NeutronBase(models.ModelBase): """Base class for Neutron Models.""" __table_args__ = {'mysql_engine': 'InnoDB'} def __iter__(self): self._i = iter(orm.object_mapper(self).columns) return self def next(self): n = next(self._i).name return n, getattr(self, n) __next__ = next def __repr__(self): """sqlalchemy based automatic __repr__ method.""" items = ['%s=%r' % (col.name, getattr(self, col.name)) for col in self.__table__.columns] return "<%s.%s[object at %x] {%s}>" % (self.__class__.__module__, self.__class__.__name__, id(self), ', '.join(items)) class NeutronBaseV2(_NeutronBase): @declarative.declared_attr def __tablename__(cls): # Use the pluralized name of the class as the table name. return cls.__name__.lower() + 's' BASEV2 = declarative.declarative_base(cls=NeutronBaseV2) neutron-lib-1.13.0/neutron_lib/db/constants.py0000666000175100017510000000236613231472055021364 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # Database field sizes NAME_FIELD_SIZE = 255 LONG_DESCRIPTION_FIELD_SIZE = 1024 DESCRIPTION_FIELD_SIZE = 255 PROJECT_ID_FIELD_SIZE = 255 DEVICE_ID_FIELD_SIZE = 255 DEVICE_OWNER_FIELD_SIZE = 255 UUID_FIELD_SIZE = 36 STATUS_FIELD_SIZE = 16 IP_ADDR_FIELD_SIZE = 64 # large enough to hold a v4 or v6 address MAC_ADDR_FIELD_SIZE = 32 RESOURCE_TYPE_FIELD_SIZE = 255 FQDN_FIELD_SIZE = 255 AZ_HINTS_DB_LEN = 255 # Alembic branches EXPAND_BRANCH = 'expand' CONTRACT_BRANCH = 'contract' # Maximum value integer can take in MySQL and PostgreSQL # In SQLite integer can be stored in 1, 2, 3, 4, 6, or 8 bytes, # but here it will be limited by this value for consistency. DB_INTEGER_MAX_VALUE = 2 ** 31 - 1 neutron-lib-1.13.0/neutron_lib/db/api.py0000666000175100017510000000305713231472055020117 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_concurrency import lockutils from oslo_db.sqlalchemy import enginefacade _synchronized = lockutils.synchronized_with_prefix("neutron-") _CTX_MANAGER = None @_synchronized("context-manager") def _create_context_manager(): global _CTX_MANAGER if _CTX_MANAGER is None: _CTX_MANAGER = enginefacade.transaction_context() _CTX_MANAGER.configure(sqlite_fk=True, flush_on_subtransaction=True) return _CTX_MANAGER def get_context_manager(): """Transaction Context Manager accessor. :returns: The transaction context manager. """ if _CTX_MANAGER is None: return _create_context_manager() return _CTX_MANAGER def get_reader_session(): """Helper to get reader session. :returns: The reader session. """ return get_context_manager().reader.get_sessionmaker()() def get_writer_session(): """Helper to get writer session. :returns: The writer session. """ return get_context_manager().writer.get_sessionmaker()() neutron-lib-1.13.0/neutron_lib/callbacks/0000775000175100017510000000000013231472430020314 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/callbacks/exceptions.py0000666000175100017510000000370313231472055023057 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class Invalid(exceptions.NeutronException): message = _("The value '%(value)s' for %(element)s is not valid.") class CallbackFailure(exceptions.MultipleExceptions): def __init__(self, errors): self.errors = errors def __str__(self): if isinstance(self.errors, list): return ','.join(str(error) for error in self.errors) else: return str(self.errors) @property def inner_exceptions(self): """The list of unpacked errors for this exception. :return: A list of unpacked errors for this exception. An unpacked error is the Exception's 'error' attribute if it inherits from NotificationError, otherwise it's the exception itself. """ if isinstance(self.errors, list): return [self._unpack_if_notification_error(e) for e in self.errors] return [self._unpack_if_notification_error(self.errors)] @staticmethod def _unpack_if_notification_error(exc): if isinstance(exc, NotificationError): return exc.error return exc class NotificationError(object): def __init__(self, callback_id, error): self.callback_id = callback_id self.error = error def __str__(self): return 'Callback %s failed with "%s"' % (self.callback_id, self.error) neutron-lib-1.13.0/neutron_lib/callbacks/resources.py0000666000175100017510000000226713231472055022714 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # String literals representing core resources. AGENT = 'agent' FLOATING_IP = 'floatingip' NETWORK = 'network' NETWORKS = 'networks' PORT = 'port' PORTS = 'ports' PORT_BINDING = 'port_binding' PORT_DEVICE = 'port_device' PROCESS = 'process' RBAC_POLICY = 'rbac-policy' ROUTER = 'router' ROUTER_CONTROLLER = 'router_controller' ROUTER_GATEWAY = 'router_gateway' ROUTER_INTERFACE = 'router_interface' SECURITY_GROUP = 'security_group' SECURITY_GROUP_RULE = 'security_group_rule' SEGMENT = 'segment' SEGMENT_HOST_MAPPING = 'segment_host_mapping' SUBNET = 'subnet' SUBNETS = 'subnets' SUBNETPOOL_ADDRESS_SCOPE = 'subnetpool_address_scope' neutron-lib-1.13.0/neutron_lib/callbacks/__init__.py0000666000175100017510000000000013231472055022420 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/callbacks/registry.py0000666000175100017510000001055613231472055022552 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import collections import inspect from neutron_lib.callbacks import manager # TODO(armax): consider adding locking _CALLBACK_MANAGER = None # stores a dictionary keyed on function pointers with a list of # (resource, event) tuples to subscribe to on class initialization _REGISTERED_CLASS_METHODS = collections.defaultdict(list) def _get_callback_manager(): global _CALLBACK_MANAGER if _CALLBACK_MANAGER is None: _CALLBACK_MANAGER = manager.CallbacksManager() return _CALLBACK_MANAGER def subscribe(callback, resource, event): _get_callback_manager().subscribe(callback, resource, event) def unsubscribe(callback, resource, event): _get_callback_manager().unsubscribe(callback, resource, event) def unsubscribe_by_resource(callback, resource): _get_callback_manager().unsubscribe_by_resource(callback, resource) def unsubscribe_all(callback): _get_callback_manager().unsubscribe_all(callback) # NOTE(boden): This method is deprecated in favor of publish() and will be # removed in Queens, but not deprecation message to reduce log flooding def notify(resource, event, trigger, **kwargs): _get_callback_manager().notify(resource, event, trigger, **kwargs) def publish(resource, event, trigger, payload=None): _get_callback_manager().publish(resource, event, trigger, payload=payload) def clear(): _get_callback_manager().clear() def receives(resource, events): """Use to decorate methods on classes before initialization. Any classes that use this must themselves be decorated with the @has_registry_receivers decorator to setup the __new__ method to actually register the instance methods after initialization. """ assert isinstance(events, (list, tuple, set)), 'events must be collection' def decorator(f): for e in events: _REGISTERED_CLASS_METHODS[f].append((resource, e)) return f return decorator def has_registry_receivers(klass): """Decorator to setup __new__ method in classes to subscribe bound methods. Any method decorated with @receives above is an unbound method on a class. This decorator sets up the class __new__ method to subscribe the bound method in the callback registry after object instantiation. """ orig_new = klass.__new__ new_inherited = '__new__' not in klass.__dict__ @staticmethod def replacement_new(cls, *args, **kwargs): if new_inherited: # class didn't define __new__ so we need to call inherited __new__ super_new = super(klass, cls).__new__ if super_new is object.__new__: # object.__new__ doesn't accept args nor kwargs instance = super_new(cls) else: instance = super_new(cls, *args, **kwargs) else: instance = orig_new(cls, *args, **kwargs) if getattr(instance, '_DECORATED_METHODS_SUBSCRIBED', False): # Avoid running this logic twice for classes inheriting other # classes with this same decorator. Only one needs to execute # to subscribe all decorated methods. return instance for name, unbound_method in inspect.getmembers(cls): if (not inspect.ismethod(unbound_method) and not inspect.isfunction(unbound_method)): continue # handle py27/py34 difference func = getattr(unbound_method, 'im_func', unbound_method) if func not in _REGISTERED_CLASS_METHODS: continue for resource, event in _REGISTERED_CLASS_METHODS[func]: # subscribe the bound method subscribe(getattr(instance, name), resource, event) setattr(instance, '_DECORATED_METHODS_SUBSCRIBED', True) return instance klass.__new__ = replacement_new return klass neutron-lib-1.13.0/neutron_lib/callbacks/manager.py0000666000175100017510000002053213231472055022307 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import collections from oslo_log import log as logging from oslo_utils import reflection from neutron_lib.callbacks import events from neutron_lib.callbacks import exceptions from neutron_lib.db import utils as db_utils LOG = logging.getLogger(__name__) class CallbacksManager(object): """A callback system that allows objects to cooperate in a loose manner.""" def __init__(self): self.clear() def subscribe(self, callback, resource, event): """Subscribe callback for a resource event. The same callback may register for more than one event. :param callback: the callback. It must raise or return a boolean. :param resource: the resource. It must be a valid resource. :param event: the event. It must be a valid event. """ LOG.debug("Subscribe: %(callback)s %(resource)s %(event)s", {'callback': callback, 'resource': resource, 'event': event}) callback_id = _get_id(callback) try: self._callbacks[resource][event][callback_id] = callback except KeyError: # Initialize the registry for unknown resources and/or events # prior to enlisting the callback. self._callbacks[resource][event] = {} self._callbacks[resource][event][callback_id] = callback # We keep a copy of callbacks to speed the unsubscribe operation. if callback_id not in self._index: self._index[callback_id] = collections.defaultdict(set) self._index[callback_id][resource].add(event) def unsubscribe(self, callback, resource, event): """Unsubscribe callback from the registry. :param callback: the callback. :param resource: the resource. :param event: the event. """ LOG.debug("Unsubscribe: %(callback)s %(resource)s %(event)s", {'callback': callback, 'resource': resource, 'event': event}) callback_id = self._find(callback) if not callback_id: LOG.debug("Callback %s not found", callback_id) return if resource and event: del self._callbacks[resource][event][callback_id] self._index[callback_id][resource].discard(event) if not self._index[callback_id][resource]: del self._index[callback_id][resource] if not self._index[callback_id]: del self._index[callback_id] else: value = '%s,%s' % (resource, event) raise exceptions.Invalid(element='resource,event', value=value) def unsubscribe_by_resource(self, callback, resource): """Unsubscribe callback for any event associated to the resource. :param callback: the callback. :param resource: the resource. """ callback_id = self._find(callback) if callback_id: if resource in self._index[callback_id]: for event in self._index[callback_id][resource]: del self._callbacks[resource][event][callback_id] del self._index[callback_id][resource] if not self._index[callback_id]: del self._index[callback_id] def unsubscribe_all(self, callback): """Unsubscribe callback for all events and all resources. :param callback: the callback. """ callback_id = self._find(callback) if callback_id: for resource, resource_events in self._index[callback_id].items(): for event in resource_events: del self._callbacks[resource][event][callback_id] del self._index[callback_id] def publish(self, resource, event, trigger, payload=None): """Notify all subscribed callback(s) with a payload. Dispatch the resource's event to the subscribed callbacks. :param resource: The resource for the event. :param event: The event. :param trigger: The trigger. A reference to the sender of the event. :param payload: The optional event object to send to subscribers. If passed this must be an instance of BaseEvent. :raises neutron_lib.callbacks.exceptions.Invalid: if the payload object is not an instance of BaseEvent. :raises CallbackFailure: if the underlying callback has errors. """ if payload: if not isinstance(payload, events.EventPayload): raise exceptions.Invalid(element='event payload', value=type(payload)) return self.notify(resource, event, trigger, payload=payload) # NOTE(boden): We plan to deprecate the usage of this method and **kwargs # as the payload in Queens, but no warning here to avoid log flooding @db_utils.reraise_as_retryrequest def notify(self, resource, event, trigger, **kwargs): """Notify all subscribed callback(s). Dispatch the resource's event to the subscribed callbacks. :param resource: The resource for the event. :param event: The event. :param trigger: The trigger. A reference to the sender of the event. :param kwargs: (deprecated) Unstructured key/value pairs to invoke the callback with. Using event objects with publish() is preferred. :raises CallbackFailure: CallbackFailure is raised if the underlying callback has errors. """ errors = self._notify_loop(resource, event, trigger, **kwargs) if errors: if event.startswith(events.BEFORE): abort_event = event.replace( events.BEFORE, events.ABORT) self._notify_loop(resource, abort_event, trigger, **kwargs) raise exceptions.CallbackFailure(errors=errors) if event.startswith(events.PRECOMMIT): raise exceptions.CallbackFailure(errors=errors) def clear(self): """Brings the manager to a clean slate.""" self._callbacks = collections.defaultdict(dict) self._index = collections.defaultdict(dict) def _notify_loop(self, resource, event, trigger, **kwargs): """The notification loop.""" errors = [] callbacks = list(self._callbacks[resource].get(event, {}).items()) LOG.debug("Notify callbacks %s for %s, %s", [c[0] for c in callbacks], resource, event) # TODO(armax): consider using a GreenPile for callback_id, callback in callbacks: try: callback(resource, event, trigger, **kwargs) except Exception as e: abortable_event = ( event.startswith(events.BEFORE) or event.startswith(events.PRECOMMIT) ) if not abortable_event: LOG.exception("Error during notification for " "%(callback)s %(resource)s, %(event)s", {'callback': callback_id, 'resource': resource, 'event': event}) else: LOG.debug("Callback %(callback)s raised %(error)s", {'callback': callback_id, 'error': e}) errors.append(exceptions.NotificationError(callback_id, e)) return errors def _find(self, callback): """Return the callback_id if found, None otherwise.""" callback_id = _get_id(callback) return callback_id if callback_id in self._index else None def _get_id(callback): """Return a unique identifier for the callback.""" # TODO(armax): consider using something other than names # https://www.python.org/dev/peps/pep-3155/, but this # might be okay for now. parts = (reflection.get_callable_name(callback), str(hash(callback))) return '-'.join(parts) neutron-lib-1.13.0/neutron_lib/callbacks/events.py0000666000175100017510000001267613231472055022213 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # String literals representing events associated to data store operations BEFORE_CREATE = 'before_create' BEFORE_READ = 'before_read' BEFORE_UPDATE = 'before_update' BEFORE_DELETE = 'before_delete' PRECOMMIT_CREATE = 'precommit_create' PRECOMMIT_UPDATE = 'precommit_update' PRECOMMIT_DELETE = 'precommit_delete' PRECOMMIT_ADD_ASSOCIATION = 'precommit_add_association' PRECOMMIT_DELETE_ASSOCIATIONS = 'precommit_delete_associations' AFTER_CREATE = 'after_create' AFTER_READ = 'after_read' AFTER_UPDATE = 'after_update' AFTER_DELETE = 'after_delete' # String literals representing events associated to API operations BEFORE_RESPONSE = 'before_response' AFTER_REQUEST = 'after_request' # String literals representing events associated to process operations BEFORE_INIT = 'before_init' BEFORE_SPAWN = 'before_spawn' # sent per process AFTER_SPAWN = 'after_spawn' # sent per process AFTER_INIT = 'after_init' # sent per worker # String literals representing events associated to error conditions ABORT_CREATE = 'abort_create' ABORT_READ = 'abort_read' ABORT_UPDATE = 'abort_update' ABORT_DELETE = 'abort_delete' ABORT = 'abort_' BEFORE = 'before_' PRECOMMIT = 'precommit_' OVS_RESTARTED = 'ovs_restarted' class EventPayload(object): """Base event payload object. This class is intended to be the super class for all event payloads. As such, it defines common attributes many events are likely to use in their payload. Note that event attributes are passed by reference; no copying of states, metadata or request_body is performed and thus consumers should not modify payload references. For more information, see the callbacks dev-ref documentation for this project. """ def __init__(self, context, metadata=None, request_body=None, states=None, resource_id=None): # the event context self.context = context # NOTE(boden): longer term we should consider removing metadata # optional 'unstructured' (key,value) pairs for special needs self.metadata = metadata if metadata else {} # the request body associated to the resource self.request_body = request_body # an iterable of states for the resource from the newest to the oldest # for example db states or api request/response # the actual object type for states will vary depending on event caller self.states = states if states else [] # a unique ID for the event resource; may be None if the resource # isn't created yet self.resource_id = resource_id @property def has_states(self): """Determines if this event payload has any states. :returns: True if this event payload has states, otherwise False. """ return len(self.states) > 0 @property def latest_state(self): """Returns the latest state for the event payload. :returns: The last state of this event payload if has_state else None. """ return self.states[-1] if self.has_states else None class DBEventPayload(EventPayload): """The payload for data store events payloads.""" def __init__(self, context, metadata=None, request_body=None, states=None, resource_id=None, desired_state=None): super(DBEventPayload, self).__init__( context, metadata=metadata, request_body=request_body, states=states, resource_id=resource_id) # the model object to be persisted in pre create/commit payloads self.desired_state = desired_state @property def is_persisted(self): """Determine if the resource for this event payload is persisted. :returns: True if this payload's resource is persisted, otherwise False. """ return self.resource_id is not None and self.has_states @property def is_to_be_committed(self): """"Determine if the event payload resource is to be committed. :returns: True if the desired state has been populated, else False. """ return self.desired_state is not None @property def latest_state(self): """Returns the latest state for the event payload resource. :returns: If this payload has a desired_state its returned, otherwise latest_state is returned. """ return (self.desired_state or super(DBEventPayload, self).latest_state) class APIEventPayload(EventPayload): """The payload for API events.""" def __init__(self, context, method_name, action, metadata=None, request_body=None, states=None, resource_id=None, collection_name=None): super(APIEventPayload, self).__init__( context, metadata=metadata, request_body=request_body, states=states, resource_id=resource_id) self.method_name = method_name self.action = action self.collection_name = collection_name neutron-lib-1.13.0/neutron_lib/plugins/0000775000175100017510000000000013231472430020056 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/plugins/__init__.py0000666000175100017510000000000013231472055022162 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/plugins/utils.py0000666000175100017510000002334213231472055021601 0ustar zuulzuul00000000000000# Copyright 2013 Cisco Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import collections import contextlib import hashlib from oslo_log import log as logging from oslo_utils import encodeutils from oslo_utils import excutils from neutron_lib._i18n import _ from neutron_lib import constants from neutron_lib import exceptions LOG = logging.getLogger(__name__) INTERFACE_HASH_LEN = 6 def _is_valid_range(val, min, max): try: # NOTE: use str value to not permit booleans val = int(str(val)) return min <= val <= max except (ValueError, TypeError): return False def is_valid_vlan_tag(vlan): """Validate a VLAN tag. :param vlan: The VLAN tag to validate. :returns: True if vlan is a number that is a valid VLAN tag. """ return _is_valid_range( vlan, constants.MIN_VLAN_TAG, constants.MAX_VLAN_TAG) def is_valid_gre_id(gre_id): """Validate a GRE ID. :param gre_id: The GRE ID to validate. :returns: True if gre_id is a number that's a valid GRE ID. """ return _is_valid_range( gre_id, constants.MIN_GRE_ID, constants.MAX_GRE_ID) def is_valid_vxlan_vni(vni): """Validate a VXLAN VNI. :param vni: The VNI to validate. :returns: True if vni is a number that's a valid VXLAN VNI. """ return _is_valid_range( vni, constants.MIN_VXLAN_VNI, constants.MAX_VXLAN_VNI) def is_valid_geneve_vni(vni): """Validate a Geneve VNI :param vni: The VNI to validate. :returns: True if vni is a number that's a valid Geneve VNI. """ return _is_valid_range( vni, constants.MIN_GENEVE_VNI, constants.MAX_GENEVE_VNI) _TUNNEL_MAPPINGS = { constants.TYPE_GRE: is_valid_gre_id, constants.TYPE_VXLAN: is_valid_vxlan_vni, constants.TYPE_GENEVE: is_valid_geneve_vni } def verify_tunnel_range(tunnel_range, tunnel_type): """Verify a given tunnel range is valid given it's tunnel type. Existing validation is done for GRE, VXLAN and GENEVE types as per _TUNNEL_MAPPINGS. :param tunnel_range: An iterable who's 0 index is the min tunnel range and who's 1 index is the max tunnel range. :param tunnel_type: The tunnel type of the range. :returns: None if the tunnel_range is valid. :raises: NetworkTunnelRangeError if tunnel_range is invalid. """ if tunnel_type in _TUNNEL_MAPPINGS: for ident in tunnel_range: if not _TUNNEL_MAPPINGS[tunnel_type](ident): raise exceptions.NetworkTunnelRangeError( tunnel_range=tunnel_range, error=_("%(id)s is not a valid %(type)s identifier") % {'id': ident, 'type': tunnel_type}) if tunnel_range[1] < tunnel_range[0]: raise exceptions.NetworkTunnelRangeError( tunnel_range=tunnel_range, error=_("End of tunnel range is less " "than start of tunnel range")) def _raise_invalid_tag(vlan_str, vlan_range): """Raise an exception for invalid tag.""" raise exceptions.NetworkVlanRangeError( vlan_range=vlan_range, error=_("%s is not a valid VLAN tag") % vlan_str) def verify_vlan_range(vlan_range): """Verify a VLAN range is valid. :param vlan_range: An iterable who's 0 index is the min tunnel range and who's 1 index is the max tunnel range. :returns: None if the vlan_range is valid. :raises: NetworkVlanRangeError if vlan_range is not valid. """ for vlan_tag in vlan_range: if not is_valid_vlan_tag(vlan_tag): _raise_invalid_tag(str(vlan_tag), vlan_range) if vlan_range[1] < vlan_range[0]: raise exceptions.NetworkVlanRangeError( vlan_range=vlan_range, error=_("End of VLAN range is less than start of VLAN range")) def parse_network_vlan_range(network_vlan_range): """Parse a well formed network VLAN range string. The network VLAN range string has the format: network[:vlan_begin:vlan_end] :param network_vlan_range: The network VLAN range string to parse. :returns: A tuple who's 1st element is the network name and 2nd element is the VLAN range parsed from network_vlan_range. :raises: NetworkVlanRangeError if network_vlan_range is malformed. PhysicalNetworkNameError if network_vlan_range is missing a network name. """ entry = network_vlan_range.strip() if ':' in entry: if entry.count(':') != 2: raise exceptions.NetworkVlanRangeError( vlan_range=entry, error=_("Need exactly two values for VLAN range")) network, vlan_min, vlan_max = entry.split(':') if not network: raise exceptions.PhysicalNetworkNameError() try: vlan_min = int(vlan_min) except ValueError: _raise_invalid_tag(vlan_min, entry) try: vlan_max = int(vlan_max) except ValueError: _raise_invalid_tag(vlan_max, entry) vlan_range = (vlan_min, vlan_max) verify_vlan_range(vlan_range) return network, vlan_range else: return entry, None def parse_network_vlan_ranges(network_vlan_ranges_cfg_entries): """Parse a list of well formed network VLAN range string. Behaves like parse_network_vlan_range, but parses a list of network VLAN strings into an ordered dict. :param network_vlan_ranges_cfg_entries: The list of network VLAN strings to parse. :returns: An OrderedDict who's keys are network names and values are the list of VLAN ranges parsed. :raises: See parse_network_vlan_range. """ networks = collections.OrderedDict() for entry in network_vlan_ranges_cfg_entries: network, vlan_range = parse_network_vlan_range(entry) if vlan_range: networks.setdefault(network, []).append(vlan_range) else: networks.setdefault(network, []) return networks def in_pending_status(status): """Return True if status is a form of pending""" return status in (constants.PENDING_CREATE, constants.PENDING_UPDATE, constants.PENDING_DELETE) @contextlib.contextmanager def delete_port_on_error(core_plugin, context, port_id): """A decorator that deletes a port upon exception. This decorator can be used to wrap a block of code that should delete a port if an exception is raised during the block's execution. :param core_plugin: The core plugin implementing the delete_port method to call. :param context: The context. :param port_id: The port's ID. :returns: None """ try: yield except Exception: with excutils.save_and_reraise_exception(): try: core_plugin.delete_port(context, port_id, l3_port_check=False) except exceptions.PortNotFound: LOG.debug("Port %s not found", port_id) except Exception: LOG.exception("Failed to delete port: %s", port_id) @contextlib.contextmanager def update_port_on_error(core_plugin, context, port_id, revert_value): """A decorator that updates a port upon exception. This decorator can be used to wrap a block of code that should update a port if an exception is raised during the block's execution. :param core_plugin: The core plugin implementing the update_port method to call. :param context: The context. :param port_id: The port's ID. :param revert_value: The value to revert on the port object. :returns: None """ try: yield except Exception: with excutils.save_and_reraise_exception(): try: core_plugin.update_port(context, port_id, {'port': revert_value}) except Exception: LOG.exception("Failed to update port: %s", port_id) def get_interface_name(name, prefix='', max_len=constants.DEVICE_NAME_MAX_LEN): """Construct an interface name based on the prefix and name. The interface name can not exceed the maximum length passed in. Longer names are hashed to help ensure uniqueness. """ requested_name = prefix + name if len(requested_name) <= max_len: return requested_name # We can't just truncate because interfaces may be distinguished # by an ident at the end. A hash over the name should be unique. # Leave part of the interface name on for easier identification if (len(prefix) + INTERFACE_HASH_LEN) > max_len: raise ValueError(_("Too long prefix provided. New name would exceed " "given length for an interface name.")) namelen = max_len - len(prefix) - INTERFACE_HASH_LEN hashed_name = hashlib.sha1(encodeutils.to_utf8(name)) new_name = ('%(prefix)s%(truncated)s%(hash)s' % {'prefix': prefix, 'truncated': name[0:namelen], 'hash': hashed_name.hexdigest()[0:INTERFACE_HASH_LEN]}) LOG.info("The requested interface name %(requested_name)s exceeds the " "%(limit)d character limitation. It was shortened to " "%(new_name)s to fit.", {'requested_name': requested_name, 'limit': max_len, 'new_name': new_name}) return new_name neutron-lib-1.13.0/neutron_lib/plugins/constants.py0000666000175100017510000000151213231472055022450 0ustar zuulzuul00000000000000# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # Well-known service type constants: LOADBALANCER = "LOADBALANCER" LOADBALANCERV2 = "LOADBALANCERV2" FIREWALL = "FIREWALL" VPN = "VPN" METERING = "METERING" FLAVORS = "FLAVORS" QOS = "QOS" CORE = 'CORE' L3 = 'L3_ROUTER_NAT' LOG_API = "LOGGING" neutron-lib-1.13.0/neutron_lib/plugins/directory.py0000666000175100017510000000542613231472055022450 0ustar zuulzuul00000000000000# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import weakref from oslo_concurrency import lockutils from neutron_lib import constants _synchronized = lockutils.synchronized_with_prefix("neutron-") class _PluginDirectory(object): """A directory of activated plugins in a Neutron Deployment. The directory is bootstrapped by a Neutron Manager running in the context of a Neutron Server process. """ def __init__(self): self._plugins = {} def add_plugin(self, alias, plugin): """Add a plugin of type 'alias'.""" self._plugins[alias] = plugin def get_plugin(self, alias): """Get a plugin for a given alias or None if not present.""" p = self._plugins.get(alias) return weakref.proxy(p) if p else None @property def plugins(self): """The mapping alias -> weak reference to the plugin.""" return dict((x, weakref.proxy(y)) for x, y in self._plugins.items()) @property def unique_plugins(self): """A sequence of the unique plugins activated in the environments.""" return tuple(weakref.proxy(x) for x in set(self._plugins.values())) @property def is_loaded(self): """True if the directory is non empty.""" return len(self._plugins) > 0 # Create a singleton plugins directory for the Neutron server instance. # Accessing these methods before a Neutron Manager has had the chance # to load the environment may result in callers handling an empty directory. _PLUGIN_DIRECTORY = None @_synchronized("plugin-directory") def _create_plugin_directory(): global _PLUGIN_DIRECTORY if _PLUGIN_DIRECTORY is None: _PLUGIN_DIRECTORY = _PluginDirectory() return _PLUGIN_DIRECTORY def _get_plugin_directory(): if _PLUGIN_DIRECTORY is None: return _create_plugin_directory() return _PLUGIN_DIRECTORY def add_plugin(alias, plugin): _get_plugin_directory().add_plugin(alias, plugin) def get_plugin(alias=constants.CORE): return _get_plugin_directory().get_plugin(alias) def get_plugins(): return _get_plugin_directory().plugins def get_unique_plugins(): return _get_plugin_directory().unique_plugins def is_loaded(): return _get_plugin_directory().is_loaded neutron-lib-1.13.0/neutron_lib/plugins/ml2/0000775000175100017510000000000013231472430020550 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/plugins/ml2/__init__.py0000666000175100017510000000000013231472055022654 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/plugins/ml2/api.py0000666000175100017510000012612213231472055021704 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import abc import six # The following keys are used in the segment dictionaries passed via # the driver API. ID = 'id' NETWORK_TYPE = 'network_type' PHYSICAL_NETWORK = 'physical_network' SEGMENTATION_ID = 'segmentation_id' MTU = 'mtu' NETWORK_ID = 'network_id' # The following keys are used in the binding level dictionaries # available via the binding_levels and original_binding_levels # PortContext properties. BOUND_DRIVER = 'bound_driver' BOUND_SEGMENT = 'bound_segment' @six.add_metaclass(abc.ABCMeta) class MechanismDriver(object): """Define stable abstract interface for ML2 mechanism drivers. A mechanism driver is called on the creation, update, and deletion of networks and ports. For every event, there are two methods that get called - one within the database transaction (method suffix of _precommit), one right afterwards (method suffix of _postcommit). Exceptions raised by methods called inside the transaction can rollback, but should not make any blocking calls (for example, REST requests to an outside controller). Methods called after transaction commits can make blocking external calls, though these will block the entire process. Exceptions raised in calls after the transaction commits may cause the associated resource to be deleted. Because rollback outside of the transaction is not done in the update network/port case, all data validation must be done within methods that are part of the database transaction. """ @abc.abstractmethod def initialize(self): """Perform driver initialization. Called after all drivers have been loaded and the database has been initialized. No abstract methods defined below will be called prior to this method being called. """ pass def create_network_precommit(self, context): """Allocate resources for a new network. :param context: NetworkContext instance describing the new network. Create a new network, allocating resources as necessary in the database. Called inside transaction context on session. Call cannot block. Raising an exception will result in a rollback of the current transaction. """ pass def create_network_postcommit(self, context): """Create a network. :param context: NetworkContext instance describing the new network. Called after the transaction commits. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Raising an exception will cause the deletion of the resource. """ pass def update_network_precommit(self, context): """Update resources of a network. :param context: NetworkContext instance describing the new state of the network, as well as the original state prior to the update_network call. Update values of a network, updating the associated resources in the database. Called inside transaction context on session. Raising an exception will result in rollback of the transaction. update_network_precommit is called for all changes to the network state. It is up to the mechanism driver to ignore state or state changes that it does not know or care about. """ pass def update_network_postcommit(self, context): """Update a network. :param context: NetworkContext instance describing the new state of the network, as well as the original state prior to the update_network call. Called after the transaction commits. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Raising an exception will cause the deletion of the resource. update_network_postcommit is called for all changes to the network state. It is up to the mechanism driver to ignore state or state changes that it does not know or care about. """ pass def delete_network_precommit(self, context): """Delete resources for a network. :param context: NetworkContext instance describing the current state of the network, prior to the call to delete it. Delete network resources previously allocated by this mechanism driver for a network. Called inside transaction context on session. Runtime errors are not expected, but raising an exception will result in rollback of the transaction. """ pass def delete_network_postcommit(self, context): """Delete a network. :param context: NetworkContext instance describing the current state of the network, prior to the call to delete it. Called after the transaction commits. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Runtime errors are not expected, and will not prevent the resource from being deleted. """ pass def create_subnet_precommit(self, context): """Allocate resources for a new subnet. :param context: SubnetContext instance describing the new subnet. Create a new subnet, allocating resources as necessary in the database. Called inside transaction context on session. Call cannot block. Raising an exception will result in a rollback of the current transaction. """ pass def create_subnet_postcommit(self, context): """Create a subnet. :param context: SubnetContext instance describing the new subnet. Called after the transaction commits. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Raising an exception will cause the deletion of the resource. """ pass def update_subnet_precommit(self, context): """Update resources of a subnet. :param context: SubnetContext instance describing the new state of the subnet, as well as the original state prior to the update_subnet call. Update values of a subnet, updating the associated resources in the database. Called inside transaction context on session. Raising an exception will result in rollback of the transaction. update_subnet_precommit is called for all changes to the subnet state. It is up to the mechanism driver to ignore state or state changes that it does not know or care about. """ pass def update_subnet_postcommit(self, context): """Update a subnet. :param context: SubnetContext instance describing the new state of the subnet, as well as the original state prior to the update_subnet call. Called after the transaction commits. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Raising an exception will cause the deletion of the resource. update_subnet_postcommit is called for all changes to the subnet state. It is up to the mechanism driver to ignore state or state changes that it does not know or care about. """ pass def delete_subnet_precommit(self, context): """Delete resources for a subnet. :param context: SubnetContext instance describing the current state of the subnet, prior to the call to delete it. Delete subnet resources previously allocated by this mechanism driver for a subnet. Called inside transaction context on session. Runtime errors are not expected, but raising an exception will result in rollback of the transaction. """ pass def delete_subnet_postcommit(self, context): """Delete a subnet. :param context: SubnetContext instance describing the current state of the subnet, prior to the call to delete it. Called after the transaction commits. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Runtime errors are not expected, and will not prevent the resource from being deleted. """ pass def create_port_precommit(self, context): """Allocate resources for a new port. :param context: PortContext instance describing the port. Create a new port, allocating resources as necessary in the database. Called inside transaction context on session. Call cannot block. Raising an exception will result in a rollback of the current transaction. """ pass def create_port_postcommit(self, context): """Create a port. :param context: PortContext instance describing the port. Called after the transaction completes. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Raising an exception will result in the deletion of the resource. """ pass def update_port_precommit(self, context): """Update resources of a port. :param context: PortContext instance describing the new state of the port, as well as the original state prior to the update_port call. Called inside transaction context on session to complete a port update as defined by this mechanism driver. Raising an exception will result in rollback of the transaction. update_port_precommit is called for all changes to the port state. It is up to the mechanism driver to ignore state or state changes that it does not know or care about. """ pass def update_port_postcommit(self, context): """Update a port. :param context: PortContext instance describing the new state of the port, as well as the original state prior to the update_port call. Called after the transaction completes. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Raising an exception will result in the deletion of the resource. update_port_postcommit is called for all changes to the port state. It is up to the mechanism driver to ignore state or state changes that it does not know or care about. """ pass def delete_port_precommit(self, context): """Delete resources of a port. :param context: PortContext instance describing the current state of the port, prior to the call to delete it. Called inside transaction context on session. Runtime errors are not expected, but raising an exception will result in rollback of the transaction. """ pass def delete_port_postcommit(self, context): """Delete a port. :param context: PortContext instance describing the current state of the port, prior to the call to delete it. Called after the transaction completes. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Runtime errors are not expected, and will not prevent the resource from being deleted. """ pass def bind_port(self, context): """Attempt to bind a port. :param context: PortContext instance describing the port This method is called outside any transaction to attempt to establish a port binding using this mechanism driver. Bindings may be created at each of multiple levels of a hierarchical network, and are established from the top level downward. At each level, the mechanism driver determines whether it can bind to any of the network segments in the context.segments_to_bind property, based on the value of the context.host property, any relevant port or network attributes, and its own knowledge of the network topology. At the top level, context.segments_to_bind contains the static segments of the port's network. At each lower level of binding, it contains static or dynamic segments supplied by the driver that bound at the level above. If the driver is able to complete the binding of the port to any segment in context.segments_to_bind, it must call context.set_binding with the binding details. If it can partially bind the port, it must call context.continue_binding with the network segments to be used to bind at the next lower level. If the binding results are committed after bind_port returns, they will be seen by all mechanism drivers as update_port_precommit and update_port_postcommit calls. But if some other thread or process concurrently binds or updates the port, these binding results will not be committed, and update_port_precommit and update_port_postcommit will not be called on the mechanism drivers with these results. Because binding results can be discarded rather than committed, drivers should avoid making persistent state changes in bind_port, or else must ensure that such state changes are eventually cleaned up. Implementing this method explicitly declares the mechanism driver as having the intention to bind ports. This is inspected by the QoS service to identify the available QoS rules you can use with ports. """ pass @property def _supports_port_binding(self): return self.__class__.bind_port != MechanismDriver.bind_port def check_vlan_transparency(self, context): """Check if the network supports vlan transparency. :param context: NetworkContext instance describing the network. Check if the network supports vlan transparency or not. """ pass def get_workers(self): """Get any NeutronWorker instances that should have their own process Any driver that needs to run processes separate from the API or RPC workers, can return a sequence of NeutronWorker instances. """ return () @classmethod def is_host_filtering_supported(cls): return (cls.filter_hosts_with_segment_access != MechanismDriver.filter_hosts_with_segment_access) def filter_hosts_with_segment_access( self, context, segments, candidate_hosts, agent_getter): """Filter hosts with access to at least one segment. :returns: a set with a subset of candidate_hosts. A driver can overload this method to return a subset of candidate_hosts with the ones with access to at least one segment. Default implementation returns all hosts to disable filtering (backward compatibility). """ return candidate_hosts @six.add_metaclass(abc.ABCMeta) class _TypeDriverBase(object): @abc.abstractmethod def get_type(self): """Get driver's network type. :returns: network_type value handled by this driver """ pass @abc.abstractmethod def initialize(self): """Perform driver initialization. Called after all drivers have been loaded and the database has been initialized. No abstract methods defined below will be called prior to this method being called. """ pass @abc.abstractmethod def is_partial_segment(self, segment): """Return True if segment is a partially specified segment. :param segment: segment dictionary :returns: boolean """ @abc.abstractmethod def validate_provider_segment(self, segment): """Validate attributes of a provider network segment. :param segment: segment dictionary using keys defined above :raises: neutron_lib.exceptions.InvalidInput if invalid Called outside transaction context to validate the provider attributes for a provider network segment. Raise InvalidInput if: - any required attribute is missing - any prohibited or unrecognized attribute is present - any attribute value is not valid The network_type attribute is present in segment, but need not be validated. """ pass @abc.abstractmethod def get_mtu(self, physical): """Get driver's network MTU. :returns: mtu maximum transmission unit Returns the mtu for the network based on the config values and the network type. """ pass @six.add_metaclass(abc.ABCMeta) class TypeDriver(_TypeDriverBase): """Define abstract interface for ML2 type drivers. ML2 type drivers each support a specific network_type for provider and/or tenant network segments. Type drivers must implement this abstract interface, which defines the API by which the plugin uses the driver to manage the persistent type-specific resource allocation state associated with network segments of that type. Network segments are represented by segment dictionaries using the NETWORK_TYPE, PHYSICAL_NETWORK, and SEGMENTATION_ID keys defined above, corresponding to the provider attributes. Future revisions of the TypeDriver API may add additional segment dictionary keys. Attributes not applicable for a particular network_type may either be excluded or stored as None. TypeDriver passes session as argument for: - reserve_provider_segment - allocate_tenant_segment - release_segment - get_allocation """ @abc.abstractmethod def reserve_provider_segment(self, session, segment): """Reserve resource associated with a provider network segment. :param session: database session :param segment: segment dictionary :returns: segment dictionary Called inside transaction context on session to reserve the type-specific resource for a provider network segment. The segment dictionary passed in was returned by a previous validate_provider_segment() call. """ pass @abc.abstractmethod def allocate_tenant_segment(self, session): """Allocate resource for a new tenant network segment. :param session: database session :returns: segment dictionary using keys defined above Called inside transaction context on session to allocate a new tenant network, typically from a type-specific resource pool. If successful, return a segment dictionary describing the segment. If tenant network segment cannot be allocated (i.e. tenant networks not supported or resource pool is exhausted), return None. """ pass @abc.abstractmethod def release_segment(self, session, segment): """Release network segment. :param session: database session :param segment: segment dictionary using keys defined above Called inside transaction context on session to release a tenant or provider network's type-specific resource. Runtime errors are not expected, but raising an exception will result in rollback of the transaction. """ pass @six.add_metaclass(abc.ABCMeta) class ML2TypeDriver(_TypeDriverBase): """Define abstract interface for ML2 type drivers. ML2 type drivers each support a specific network_type for provider and/or tenant network segments. Type drivers must implement this abstract interface, which defines the API by which the plugin uses the driver to manage the persistent type-specific resource allocation state associated with network segments of that type. Network segments are represented by segment dictionaries using the NETWORK_TYPE, PHYSICAL_NETWORK, and SEGMENTATION_ID keys defined above, corresponding to the provider attributes. Future revisions of the TypeDriver API may add additional segment dictionary keys. Attributes not applicable for a particular network_type may either be excluded or stored as None. ML2TypeDriver passes context as argument for: - reserve_provider_segment - allocate_tenant_segment - release_segment - get_allocation """ @abc.abstractmethod def reserve_provider_segment(self, context, segment): """Reserve resource associated with a provider network segment. :param context: instance of neutron context with DB session :param segment: segment dictionary :returns: segment dictionary Called inside transaction context on session to reserve the type-specific resource for a provider network segment. The segment dictionary passed in was returned by a previous validate_provider_segment() call. """ pass @abc.abstractmethod def allocate_tenant_segment(self, context): """Allocate resource for a new tenant network segment. :param context: instance of neutron context with DB session :returns: segment dictionary using keys defined above Called inside transaction context on session to allocate a new tenant network, typically from a type-specific resource pool. If successful, return a segment dictionary describing the segment. If tenant network segment cannot be allocated (i.e. tenant networks not supported or resource pool is exhausted), return None. """ pass @abc.abstractmethod def release_segment(self, context, segment): """Release network segment. :param context: instance of neutron context with DB session :param segment: segment dictionary using keys defined above Called inside transaction context on session to release a tenant or provider network's type-specific resource. Runtime errors are not expected, but raising an exception will result in rollback of the transaction. """ pass @six.add_metaclass(abc.ABCMeta) class NetworkContext(object): """Context passed to MechanismDrivers for changes to network resources. A NetworkContext instance wraps a network resource. It provides helper methods for accessing other relevant information. Results from expensive operations are cached so that other MechanismDrivers can freely access the same information. """ @abc.abstractproperty def current(self): """Return the network in its current configuration. Return the network, as defined by NeutronPluginBaseV2. create_network and all extensions in the ml2 plugin, with all its properties 'current' at the time the context was established. """ pass @abc.abstractproperty def original(self): """Return the network in its original configuration. Return the network, with all its properties set to their original values prior to a call to update_network. Method is only valid within calls to update_network_precommit and update_network_postcommit. """ pass @abc.abstractproperty def network_segments(self): """Return the segments associated with this network resource.""" pass @six.add_metaclass(abc.ABCMeta) class SubnetContext(object): """Context passed to MechanismDrivers for changes to subnet resources. A SubnetContext instance wraps a subnet resource. It provides helper methods for accessing other relevant information. Results from expensive operations are cached so that other MechanismDrivers can freely access the same information. """ @abc.abstractproperty def current(self): """Return the subnet in its current configuration. Return the subnet, as defined by NeutronPluginBaseV2. create_subnet and all extensions in the ml2 plugin, with all its properties 'current' at the time the context was established. """ pass @abc.abstractproperty def original(self): """Return the subnet in its original configuration. Return the subnet, with all its properties set to their original values prior to a call to update_subnet. Method is only valid within calls to update_subnet_precommit and update_subnet_postcommit. """ pass @six.add_metaclass(abc.ABCMeta) class PortContext(object): """Context passed to MechanismDrivers for changes to port resources. A PortContext instance wraps a port resource. It provides helper methods for accessing other relevant information. Results from expensive operations are cached so that other MechanismDrivers can freely access the same information. """ @abc.abstractproperty def current(self): """Return the port in its current configuration. Return the port, as defined by NeutronPluginBaseV2. create_port and all extensions in the ml2 plugin, with all its properties 'current' at the time the context was established. """ pass @abc.abstractproperty def original(self): """Return the port in its original configuration. Return the port, with all its properties set to their original values prior to a call to update_port. Method is only valid within calls to update_port_precommit and update_port_postcommit. """ pass @abc.abstractproperty def status(self): """Return the status of the current port.""" pass @abc.abstractproperty def original_status(self): """Return the status of the original port. The method is only valid within calls to update_port_precommit and update_port_postcommit. """ pass @abc.abstractproperty def network(self): """Return the NetworkContext associated with this port.""" pass @abc.abstractproperty def binding_levels(self): """Return dictionaries describing the current binding levels. This property returns a list of dictionaries describing each binding level if the port is bound or partially bound, or None if the port is unbound. Each returned dictionary contains the name of the bound driver under the BOUND_DRIVER key, and the bound segment dictionary under the BOUND_SEGMENT key. The first entry (index 0) describes the top-level binding, which always involves one of the port's network's static segments. In the case of a hierarchical binding, subsequent entries describe the lower-level bindings in descending order, which may involve dynamic segments. Adjacent levels where different drivers bind the same static or dynamic segment are possible. The last entry (index -1) describes the bottom-level binding that supplied the port's binding:vif_type and binding:vif_details attribute values. Within calls to MechanismDriver.bind_port, descriptions of the levels above the level currently being bound are returned. """ pass @abc.abstractproperty def original_binding_levels(self): """Return dictionaries describing the original binding levels. This property returns a list of dictionaries describing each original binding level if the port was previously bound, or None if the port was unbound. The content is as described for the binding_levels property. This property is only valid within calls to update_port_precommit and update_port_postcommit. It returns None otherwise. """ pass @abc.abstractproperty def top_bound_segment(self): """Return the current top-level bound segment dictionary. This property returns the current top-level bound segment dictionary, or None if the port is unbound. For a bound port, top_bound_segment is equivalent to binding_levels[0][BOUND_SEGMENT], and returns one of the port's network's static segments. """ pass @abc.abstractproperty def original_top_bound_segment(self): """Return the original top-level bound segment dictionary. This property returns the original top-level bound segment dictionary, or None if the port was previously unbound. For a previously bound port, original_top_bound_segment is equivalent to original_binding_levels[0][BOUND_SEGMENT], and returns one of the port's network's static segments. This property is only valid within calls to update_port_precommit and update_port_postcommit. It returns None otherwise. """ pass @abc.abstractproperty def bottom_bound_segment(self): """Return the current bottom-level bound segment dictionary. This property returns the current bottom-level bound segment dictionary, or None if the port is unbound. For a bound port, bottom_bound_segment is equivalent to binding_levels[-1][BOUND_SEGMENT], and returns the segment whose binding supplied the port's binding:vif_type and binding:vif_details attribute values. """ pass @abc.abstractproperty def original_bottom_bound_segment(self): """Return the original bottom-level bound segment dictionary. This property returns the original bottom-level bound segment dictionary, or None if the port was previously unbound. For a previously bound port, original_bottom_bound_segment is equivalent to original_binding_levels[-1][BOUND_SEGMENT], and returns the segment whose binding supplied the port's previous binding:vif_type and binding:vif_details attribute values. This property is only valid within calls to update_port_precommit and update_port_postcommit. It returns None otherwise. """ pass @abc.abstractproperty def host(self): """Return the host with which the port is associated. In the context of a host-specific operation on a distributed port, the host property indicates the host for which the port operation is being performed. Otherwise, it is the same value as current['binding:host_id']. """ pass @abc.abstractproperty def original_host(self): """Return the original host with which the port was associated. In the context of a host-specific operation on a distributed port, the original_host property indicates the host for which the port operation is being performed. Otherwise, it is the same value as original['binding:host_id']. This property is only valid within calls to update_port_precommit and update_port_postcommit. It returns None otherwise. """ pass @abc.abstractproperty def vif_type(self): """Return the vif_type indicating the binding state of the port. In the context of a host-specific operation on a distributed port, the vif_type property indicates the binding state for the host for which the port operation is being performed. Otherwise, it is the same value as current['binding:vif_type']. """ pass @abc.abstractproperty def original_vif_type(self): """Return the original vif_type of the port. In the context of a host-specific operation on a distributed port, the original_vif_type property indicates original binding state for the host for which the port operation is being performed. Otherwise, it is the same value as original['binding:vif_type']. This property is only valid within calls to update_port_precommit and update_port_postcommit. It returns None otherwise. """ pass @abc.abstractproperty def vif_details(self): """Return the vif_details describing the binding of the port. In the context of a host-specific operation on a distributed port, the vif_details property describes the binding for the host for which the port operation is being performed. Otherwise, it is the same value as current['binding:vif_details']. """ pass @abc.abstractproperty def original_vif_details(self): """Return the original vif_details of the port. In the context of a host-specific operation on a distributed port, the original_vif_details property describes the original binding for the host for which the port operation is being performed. Otherwise, it is the same value as original['binding:vif_details']. This property is only valid within calls to update_port_precommit and update_port_postcommit. It returns None otherwise. """ pass @abc.abstractproperty def segments_to_bind(self): """Return the list of segments with which to bind the port. This property returns the list of segment dictionaries with which the mechanism driver may bind the port. When establishing a top-level binding, these will be the port's network's static segments. For each subsequent level, these will be the segments passed to continue_binding by the mechanism driver that bound the level above. This property is only valid within calls to MechanismDriver.bind_port. It returns None otherwise. """ pass @abc.abstractmethod def host_agents(self, agent_type): """Get agents of the specified type on port's host. :param agent_type: Agent type identifier :returns: List of neutron.db.models.agent.Agent records """ pass @abc.abstractmethod def set_binding(self, segment_id, vif_type, vif_details, status=None): """Set the bottom-level binding for the port. :param segment_id: Network segment bound for the port. :param vif_type: The VIF type for the bound port. :param vif_details: Dictionary with details for VIF driver. :param status: Port status to set if not None. This method is called by MechanismDriver.bind_port to indicate success and specify binding details to use for port. The segment_id must identify an item in the current value of the segments_to_bind property. """ pass @abc.abstractmethod def continue_binding(self, segment_id, next_segments_to_bind): """Continue binding the port with different segments. :param segment_id: Network segment partially bound for the port. :param next_segments_to_bind: Segments to continue binding with. This method is called by MechanismDriver.bind_port to indicate it was able to partially bind the port, but that one or more additional mechanism drivers are required to complete the binding. The segment_id must identify an item in the current value of the segments_to_bind property. The list of segments IDs passed as next_segments_to_bind identify dynamic (or static) segments of the port's network that will be used to populate segments_to_bind for the next lower level of a hierarchical binding. """ pass @abc.abstractmethod def allocate_dynamic_segment(self, segment): """Allocate a dynamic segment. :param segment: A partially or fully specified segment dictionary Called by the MechanismDriver.bind_port, create_port or update_port to dynamically allocate a segment for the port using the partial segment specified. The segment dictionary can be a fully or partially specified segment. At a minimum it needs the network_type populated to call on the appropriate type driver. """ pass @abc.abstractmethod def release_dynamic_segment(self, segment_id): """Release an allocated dynamic segment. :param segment_id: UUID of the dynamic network segment. Called by the MechanismDriver.delete_port or update_port to release the dynamic segment allocated for this port. """ pass @six.add_metaclass(abc.ABCMeta) class ExtensionDriver(object): """Define stable abstract interface for ML2 extension drivers. An extension driver extends the core resources implemented by the ML2 plugin with additional attributes. Methods that process create and update operations for these resources validate and persist values for extended attributes supplied through the API. Other methods extend the resource dictionaries returned from the API operations with the values of the extended attributes. """ @abc.abstractmethod def initialize(self): """Perform driver initialization. Called after all drivers have been loaded and the database has been initialized. No abstract methods defined below will be called prior to this method being called. """ pass @property def extension_alias(self): """Supported extension alias. Return the alias identifying the core API extension supported by this driver. Do not declare if API extension handling will be left to a service plugin, and we just need to provide core resource extension and updates. """ pass @property def extension_aliases(self): """List of extension aliases supported by the driver. Return a list of aliases identifying the core API extensions supported by the driver. By default this just returns the extension_alias property for backwards compatibility. """ return [self.extension_alias] def process_create_network(self, plugin_context, data, result): """Process extended attributes for create network. :param plugin_context: plugin request context :param data: dictionary of incoming network data :param result: network dictionary to extend Called inside transaction context on plugin_context.session to validate and persist any extended network attributes defined by this driver. Extended attribute values must also be added to result. """ pass def process_create_subnet(self, plugin_context, data, result): """Process extended attributes for create subnet. :param plugin_context: plugin request context :param data: dictionary of incoming subnet data :param result: subnet dictionary to extend Called inside transaction context on plugin_context.session to validate and persist any extended subnet attributes defined by this driver. Extended attribute values must also be added to result. """ pass def process_create_port(self, plugin_context, data, result): """Process extended attributes for create port. :param plugin_context: plugin request context :param data: dictionary of incoming port data :param result: port dictionary to extend Called inside transaction context on plugin_context.session to validate and persist any extended port attributes defined by this driver. Extended attribute values must also be added to result. """ pass def process_update_network(self, plugin_context, data, result): """Process extended attributes for update network. :param plugin_context: plugin request context :param data: dictionary of incoming network data :param result: network dictionary to extend Called inside transaction context on plugin_context.session to validate and update any extended network attributes defined by this driver. Extended attribute values, whether updated or not, must also be added to result. """ pass def process_update_subnet(self, plugin_context, data, result): """Process extended attributes for update subnet. :param plugin_context: plugin request context :param data: dictionary of incoming subnet data :param result: subnet dictionary to extend Called inside transaction context on plugin_context.session to validate and update any extended subnet attributes defined by this driver. Extended attribute values, whether updated or not, must also be added to result. """ pass def process_update_port(self, plugin_context, data, result): """Process extended attributes for update port. :param plugin_context: plugin request context :param data: dictionary of incoming port data :param result: port dictionary to extend Called inside transaction context on plugin_context.session to validate and update any extended port attributes defined by this driver. Extended attribute values, whether updated or not, must also be added to result. """ pass def extend_network_dict(self, session, base_model, result): """Add extended attributes to network dictionary. :param session: database session :param base_model: network model data :param result: network dictionary to extend Called inside transaction context on session to add any extended attributes defined by this driver to a network dictionary to be used for mechanism driver calls and/or returned as the result of a network operation. """ pass def extend_subnet_dict(self, session, base_model, result): """Add extended attributes to subnet dictionary. :param session: database session :param base_model: subnet model data :param result: subnet dictionary to extend Called inside transaction context on session to add any extended attributes defined by this driver to a subnet dictionary to be used for mechanism driver calls and/or returned as the result of a subnet operation. """ pass def extend_port_dict(self, session, base_model, result): """Add extended attributes to port dictionary. :param session: database session :param base_model: port model data :param result: port dictionary to extend Called inside transaction context on session to add any extended attributes defined by this driver to a port dictionary to be used for mechanism driver calls and/or returned as the result of a port operation. """ pass neutron-lib-1.13.0/neutron_lib/api/0000775000175100017510000000000013231472430017146 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/api/converters.py0000666000175100017510000002203413231472055021720 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import netaddr from oslo_utils import strutils import six from neutron_lib._i18n import _ from neutron_lib.api import validators from neutron_lib import constants from neutron_lib import exceptions as n_exc def convert_to_boolean(data): """Convert a data value into a python bool. :param data: The data value to convert to a python bool. This function supports string types, bools, and ints for conversion of representation to python bool. :returns: The bool value of 'data' if it can be coerced. :raises InvalidInput: If the value can't be coerced to a python bool. """ try: return strutils.bool_from_string(data, strict=True) except ValueError: msg = _("'%s' cannot be converted to boolean") % data raise n_exc.InvalidInput(error_message=msg) def convert_to_boolean_if_not_none(data): """Uses convert_to_boolean() on the data if the data is not None. :param data: The data value to convert. :returns: The 'data' returned from convert_to_boolean() if 'data' is not None. None is returned if data is None. """ if data is not None: return convert_to_boolean(data) def convert_to_int(data): """Convert a data value to a python int. :param data: The data value to convert to a python int via python's built-in int() constructor. :returns: The int value of the data. :raises InvalidInput: If the value can't be converted to an int. """ try: return int(data) except (ValueError, TypeError): msg = _("'%s' is not an integer") % data raise n_exc.InvalidInput(error_message=msg) def convert_to_int_if_not_none(data): """Uses convert_to_int() on the data if the data is not None. :param data: The data value to convert. :returns: The 'data' returned from convert_to_int() if 'data' is not None. None is returned if data is None. """ if data is not None: return convert_to_int(data) return data def convert_to_positive_float_or_none(val): """Converts a value to a python float if the value is positive. :param val: The value to convert to a positive python float. :returns: The value as a python float. If the val is None, None is returned. :raises ValueError, InvalidInput: A ValueError is raised if the 'val' is a float, but is negative. InvalidInput is raised if 'val' can't be converted to a python float. """ # NOTE(salv-orlando): This conversion function is currently used by # a vendor specific extension only at the moment It is used for # port's RXTX factor in neutron.plugins.vmware.extensions.qos. # It is deemed however generic enough to be in this module as it # might be used in future for other API attributes. if val is None: return try: val = float(val) if val < 0: raise ValueError() except (ValueError, TypeError): msg = _("'%s' must be a non negative decimal") % val raise n_exc.InvalidInput(error_message=msg) return val def convert_kvp_str_to_list(data): """Convert a value of the form 'key=value' to ['key', 'value']. :param data: The string to parse for a key value pair. :returns: A list where element 0 is the key and element 1 is the value. :raises InvalidInput: If 'data' is not a key value string. """ kvp = [x.strip() for x in data.split('=', 1)] if len(kvp) == 2 and kvp[0]: return kvp msg = _("'%s' is not of the form =[value]") % data raise n_exc.InvalidInput(error_message=msg) def convert_kvp_list_to_dict(kvp_list): """Convert a list of 'key=value' strings to a dict. :param kvp_list: A list of key value pair strings. For more info on the format see; convert_kvp_str_to_list(). :returns: A dict who's key value pairs are populated by parsing 'kvp_list'. :raises InvalidInput: If any of the key value strings are malformed. """ if kvp_list == ['True']: # No values were provided (i.e. '--flag-name') return {} kvp_map = {} for kvp_str in kvp_list: key, value = convert_kvp_str_to_list(kvp_str) kvp_map.setdefault(key, set()) kvp_map[key].add(value) return dict((x, list(y)) for x, y in kvp_map.items()) def convert_none_to_empty_list(value): """Convert value to an empty list if it's None. :param value: The value to convert. :returns: An empty list of 'value' is None, otherwise 'value'. """ return [] if value is None else value def convert_none_to_empty_dict(value): """Convert the value to an empty dict if it's None. :param value: The value to convert. :returns: An empty dict if 'value' is None, otherwise 'value'. """ return {} if value is None else value def convert_to_list(data): """Convert a value into a list. :param data: The value to convert. :return: A new list wrapped around 'data' whereupon the list is empty if 'data' is None. """ if data is None: return [] elif hasattr(data, '__iter__') and not isinstance(data, six.string_types): return list(data) else: return [data] def convert_ip_to_canonical_format(value): """IP Address is validated and then converted to canonical format. :param value: The IP Address which needs to be checked. :returns: - None if 'value' is None, - 'value' if 'value' is IPv4 address, - 'value' if 'value' is not an IP Address - canonical IPv6 address if 'value' is IPv6 address. """ try: ip = netaddr.IPAddress(value) if ip.version == constants.IP_VERSION_6: return six.text_type(ip.format(dialect=netaddr.ipv6_compact)) except netaddr.core.AddrFormatError: pass return value def convert_cidr_to_canonical_format(value): """CIDR is validated and converted to canonical format. :param value: The CIDR which needs to be checked. :returns: - 'value' if 'value' is CIDR with IPv4 address, - CIDR with canonical IPv6 address if 'value' is IPv6 CIDR. :raises: InvalidInput if 'value' is None, not a valid CIDR or invalid IP Format. """ error_message = _("%s is not in a CIDR format") % value try: cidr = netaddr.IPNetwork(value) return str(convert_ip_to_canonical_format( cidr.ip)) + "/" + str(cidr.prefixlen) except netaddr.core.AddrFormatError: raise n_exc.InvalidInput(error_message=error_message) def convert_string_to_case_insensitive(data): """Convert a string value into a lower case string. This effectively makes the string case-insensitive. :param data: The value to convert. :return: The lower-cased string representation of the value, or None is 'data' is None. :raises InvalidInput: If the value is not a string. """ try: return data.lower() except AttributeError: error_message = _("Input value %s must be string type") % data raise n_exc.InvalidInput(error_message=error_message) def convert_to_protocol(data): """Validate that a specified IP protocol is valid. For the authoritative list mapping protocol names to numbers, see the IANA: http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml :param data: The value to verify is an IP protocol. :returns: If data is an int between 0 and 255 or None, return that; if data is a string then return it lower-cased if it matches one of the allowed protocol names. :raises exceptions.InvalidInput: If data is an int < 0, an int > 255, or a string that does not match one of the allowed protocol names. """ if data is None: return val = convert_string_to_case_insensitive(data) if val in constants.IPTABLES_PROTOCOL_MAP: return data error_message = _("IP protocol '%s' is not supported. Only protocol " "names and their integer representation (0 to " "255) are supported") % data try: if validators.validate_range(convert_to_int(data), [0, 255]) is None: return data else: raise n_exc.InvalidInput(error_message=error_message) except n_exc.InvalidInput: raise n_exc.InvalidInput(error_message=error_message) def convert_to_string(data): """Convert a data value into a string. :param data: The data value to convert to a string. :returns: The string value of 'data' if data is not None """ if data is not None: return str(data) neutron-lib-1.13.0/neutron_lib/api/faults.py0000666000175100017510000000214213231472055021022 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import netaddr from oslo_policy import policy import webob.exc from neutron_lib import exceptions FAULT_MAP = { exceptions.NotFound: webob.exc.HTTPNotFound, exceptions.Conflict: webob.exc.HTTPConflict, exceptions.InUse: webob.exc.HTTPConflict, exceptions.BadRequest: webob.exc.HTTPBadRequest, exceptions.ServiceUnavailable: webob.exc.HTTPServiceUnavailable, exceptions.NotAuthorized: webob.exc.HTTPForbidden, netaddr.AddrFormatError: webob.exc.HTTPBadRequest, policy.PolicyNotAuthorized: webob.exc.HTTPForbidden, } neutron-lib-1.13.0/neutron_lib/api/__init__.py0000666000175100017510000000000013231472055021252 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/api/attributes.py0000666000175100017510000002161613231472055021721 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from webob import exc from neutron_lib._i18n import _ from neutron_lib.api.definitions import network from neutron_lib.api.definitions import port from neutron_lib.api.definitions import subnet from neutron_lib.api.definitions import subnetpool from neutron_lib.api import validators from neutron_lib import constants from neutron_lib import exceptions def _validate_privileges(context, res_dict): if ('project_id' in res_dict and res_dict['project_id'] != context.project_id and not context.is_admin): msg = _("Specifying 'project_id' or 'tenant_id' other than the " "authenticated project in request requires admin privileges") raise exc.HTTPBadRequest(msg) def populate_project_info(attributes): """Ensure that both project_id and tenant_id attributes are present. If either project_id or tenant_id is present in attributes then ensure that both are present. If neither are present then attributes is not updated. :param attributes: A dictionary of resource/API attributes or API request/response dict. :returns: attributes (updated with project_id if applicable). :raises: HTTPBadRequest if the attributes project_id and tenant_id don't match. """ if 'tenant_id' in attributes and 'project_id' not in attributes: attributes['project_id'] = attributes['tenant_id'] elif 'project_id' in attributes and 'tenant_id' not in attributes: # Backward compatibility for code still using tenant_id attributes['tenant_id'] = attributes['project_id'] if attributes.get('project_id') != attributes.get('tenant_id'): msg = _("'project_id' and 'tenant_id' do not match") raise exc.HTTPBadRequest(msg) return attributes class AttributeInfo(object): """Provides operations on a resource's attribute map. AttributeInfo wraps an API resource's attribute dict and provides methods for filling defaults, validating, converting, etc. based on the underlying attributes. """ def __init__(self, resource_attrs): """Create a new instance that wraps the given resource attributes. :param resource_attrs: The resource's attributes that can be any of the following types: an instance of AttributeInfo, an API definition that contains a RESOURCE_ATTRIBUTE_MAP attribute or a dict of attributes for the resource. """ if isinstance(resource_attrs, AttributeInfo): resource_attrs = resource_attrs.attributes elif getattr(resource_attrs, 'RESOURCE_ATTRIBUTE_MAP', None) is not None: # handle neutron_lib API definitions resource_attrs = resource_attrs.RESOURCE_ATTRIBUTE_MAP self.attributes = resource_attrs def fill_post_defaults( self, res_dict, exc_cls=lambda m: exceptions.InvalidInput(error_message=m), check_allow_post=True): """Fill in default values for attributes in a POST request. When a POST request is made, the attributes with default values do not need to be specified by the user. This function fills in the values of any unspecified attributes if they have a default value. If an attribute is not specified and it does not have a default value, an exception is raised. If an attribute is specified and it is not allowed in POST requests, an exception is raised. The caller can override this behavior by setting check_allow_post=False (used by some internal admin operations). :param res_dict: The resource attributes from the request. :param exc_cls: Exception to be raised on error that must take a single error message as it's only constructor arg. :param check_allow_post: Raises an exception if a non-POST-able attribute is specified. :raises: exc_cls If check_allow_post is True and this instance of ResourceAttributes doesn't support POST. """ for attr, attr_vals in self.attributes.items(): if attr_vals['allow_post']: if 'default' not in attr_vals and attr not in res_dict: msg = _("Failed to parse request. Required " "attribute '%s' not specified") % attr raise exc_cls(msg) res_dict[attr] = res_dict.get(attr, attr_vals.get('default')) elif check_allow_post: if attr in res_dict: msg = _("Attribute '%s' not allowed in POST") % attr raise exc_cls(msg) def convert_values( self, res_dict, exc_cls=lambda m: exceptions.InvalidInput(error_message=m)): """Convert and validate attribute values for a request. :param res_dict: The resource attributes from the request. :param exc_cls: Exception to be raised on error that must take a single error message as it's only constructor arg. :raises: exc_cls If any errors occur converting/validating the res_dict. """ for attr, attr_vals in self.attributes.items(): if (attr not in res_dict or res_dict[attr] is constants.ATTR_NOT_SPECIFIED): continue # Convert values if necessary if 'convert_to' in attr_vals: res_dict[attr] = attr_vals['convert_to'](res_dict[attr]) # Check that configured values are correct if 'validate' not in attr_vals: continue for rule in attr_vals['validate']: validator = validators.get_validator(rule) res = validator(res_dict[attr], attr_vals['validate'][rule]) if res: msg_dict = dict(attr=attr, reason=res) msg = _("Invalid input for %(attr)s. " "Reason: %(reason)s.") % msg_dict raise exc_cls(msg) def populate_project_id(self, context, res_dict, is_create): """Populate the owner information in a request body. Ensure both project_id and tenant_id attributes are present. Validate that the requestor has the required privileges. For a create request, copy owner info from context to request body if needed and verify that owner is specified if required. :param context: The request context. :param res_dict: The resource attributes from the request. :param attr_info: The attribute map for the resource. :param is_create: Is this a create request? :raises: HTTPBadRequest If neither the project_id nor tenant_id are specified in the res_dict. """ populate_project_info(res_dict) _validate_privileges(context, res_dict) if is_create and 'project_id' not in res_dict: if context.project_id: res_dict['project_id'] = context.project_id # For backward compatibility res_dict['tenant_id'] = context.project_id elif 'tenant_id' in self.attributes: msg = _("Running without keystone AuthN requires " "that tenant_id is specified") raise exc.HTTPBadRequest(msg) def verify_attributes(self, attrs_to_verify): """Reject unknown attributes. Consumers should ensure the project info is populated in the attrs_to_verify before calling this method. :param attrs_to_verify: The attributes to verify against this resource attributes. :raises: HTTPBadRequest: If attrs_to_verify contains any unrecognized for this resource attributes instance. """ extra_keys = set(attrs_to_verify.keys()) - set(self.attributes.keys()) if extra_keys: msg = _("Unrecognized attribute(s) '%s'") % ', '.join(extra_keys) raise exc.HTTPBadRequest(msg) def _core_resource_attributes(): resources = {} for core_def in [network.RESOURCE_ATTRIBUTE_MAP, port.RESOURCE_ATTRIBUTE_MAP, subnet.RESOURCE_ATTRIBUTE_MAP, subnetpool.RESOURCE_ATTRIBUTE_MAP]: resources.update(core_def) return resources # populate core resources into singleton global RESOURCES = _core_resource_attributes() neutron-lib-1.13.0/neutron_lib/api/extensions.py0000666000175100017510000002303513231472055021727 0ustar zuulzuul00000000000000# Copyright 2011 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import abc import six from neutron_lib._i18n import _ from neutron_lib import constants _UNSET = constants.Sentinel() def is_extension_supported(plugin, alias): """Validate that the extension is supported. :param plugin: The plugin class. :param alias: The alias to check. :returns: True if the alias is supported else False. """ return alias in getattr(plugin, "supported_extension_aliases", []) @six.add_metaclass(abc.ABCMeta) class ExtensionDescriptor(object): """Base class that defines the contract for extensions.""" @abc.abstractmethod def get_name(self): """The name of the extension. e.g. 'Fox In Socks' """ @abc.abstractmethod def get_alias(self): """The alias for the extension. e.g. 'FOXNSOX' """ @abc.abstractmethod def get_description(self): """Friendly description for the extension. e.g. 'The Fox In Socks Extension' """ @abc.abstractmethod def get_updated(self): """The timestamp when the extension was last updated. e.g. '2011-01-22T13:25:27-06:00' """ # NOTE(justinsb): Not sure of the purpose of this is, vs the XML NS def get_resources(self): """List of extensions.ResourceExtension extension objects. Resources define new nouns, and are accessible through URLs. """ return [] def get_actions(self): """List of extensions.ActionExtension extension objects. Actions are verbs callable from the API. """ return [] def get_request_extensions(self): """List of extensions.RequestExtension extension objects. Request extensions are used to handle custom request data. """ return [] def get_extended_resources(self, version): """Retrieve extended resources or attributes for core resources. Extended attributes are implemented by a core plugin similarly to the attributes defined in the core, and can appear in request and response messages. Their names are scoped with the extension's prefix. The core API version is passed to this function, which must return a map[][][] specifying the extended resource attribute properties required by that API version. Extension can add resources and their attr definitions too. The returned map can be integrated into RESOURCE_ATTRIBUTE_MAP. """ return {} def get_plugin_interface(self): """Returns an abstract class which defines contract for the plugin. The abstract class should inherit from neutron_lib.services.base.ServicePluginBase. Methods in this abstract class should be decorated as abstractmethod """ def get_required_extensions(self): """Return list of extensions required for processing this descriptor. Without these extensions present in a neutron deployment, the introduced extension cannot load or function properly. """ return [] def get_optional_extensions(self): """Returns a list of optionally required extensions. Unlike get_required_extensions. This will not fail the loading of the extension if one of these extensions is not present. This is useful for an extension that extends multiple resources across other extensions that should still work for the remaining extensions when one is missing. """ return [] def update_attributes_map(self, extended_attributes, extension_attrs_map=None): """Update attributes map for this extension. This is default method for extending an extension's attributes map. An extension can use this method and supplying its own resource attribute map in extension_attrs_map argument to extend all its attributes that needs to be extended. If an extension does not implement update_attributes_map, the method does nothing and just return. """ if not extension_attrs_map: return for resource, attrs in extension_attrs_map.items(): extended_attrs = extended_attributes.get(resource) if extended_attrs: attrs.update(extended_attrs) def get_pecan_resources(self): """List of PecanResourceExtension extension objects. Resources define new nouns, and are accessible through URLs. The controllers associated with each instance of extensions.ResourceExtension should be a subclass of neutron.pecan_wsgi.controllers.utils.NeutronPecanController. If a resource is defined in both get_resources and get_pecan_resources, the resource defined in get_pecan_resources will take precedence. """ return [] class APIExtensionDescriptor(ExtensionDescriptor): """Base class that defines the contract for extensions. Concrete implementations of API extensions should first provide an API definition in neutron_lib.api.definitions. The API definition module (object reference) can then be specified as a class level attribute on the concrete extension. For example:: from neutron_lib.api.definitions import provider_net from neutron_lib.api import extensions class Providernet(extensions.APIExtensionDescriptor): api_definition = provider_net # nothing else needed if default behavior is acceptable If extension implementations need to override the default behavior of this class they can override the respective method directly. """ api_definition = _UNSET @classmethod def _assert_api_definition(cls, attr=None): if cls.api_definition == _UNSET: raise NotImplementedError( _("Extension module API definition not set.")) if attr and getattr(cls.api_definition, attr, _UNSET) == _UNSET: raise NotImplementedError(_("Extension module API definition " "does not define '%s'") % attr) @classmethod def get_name(cls): """The name of the API definition.""" cls._assert_api_definition('NAME') return cls.api_definition.NAME @classmethod def get_alias(cls): """The alias for the API definition.""" cls._assert_api_definition('ALIAS') return cls.api_definition.ALIAS @classmethod def get_description(cls): """Friendly description for the API definition.""" cls._assert_api_definition('DESCRIPTION') return cls.api_definition.DESCRIPTION @classmethod def get_updated(cls): """The timestamp when the API definition was last updated.""" cls._assert_api_definition('UPDATED_TIMESTAMP') return cls.api_definition.UPDATED_TIMESTAMP @classmethod def get_extended_resources(cls, version): """Retrieve the extended resource map for the API definition. :param version: The API version to retrieve the resource attribute map for. :returns: The extended resource map for the underlying API definition if the version is 2.0. The extended resource map returned includes both the API definition's RESOURCE_ATTRIBUTE_MAP and SUB_RESOURCE_ATTRIBUTE_MAP where applicable. If the version is not 2.0, an empty dict is returned. """ if version == "2.0": cls._assert_api_definition('RESOURCE_ATTRIBUTE_MAP') cls._assert_api_definition('SUB_RESOURCE_ATTRIBUTE_MAP') # support api defs that use None for sub attr map sub_attrs = cls.api_definition.SUB_RESOURCE_ATTRIBUTE_MAP or {} return dict( list(cls.api_definition.RESOURCE_ATTRIBUTE_MAP.items()) + list(sub_attrs.items())) else: return {} @classmethod def get_required_extensions(cls): """Returns the API definition's required extensions.""" cls._assert_api_definition('REQUIRED_EXTENSIONS') return cls.api_definition.REQUIRED_EXTENSIONS @classmethod def get_optional_extensions(cls): """Returns the API definition's optional extensions.""" cls._assert_api_definition('OPTIONAL_EXTENSIONS') return cls.api_definition.OPTIONAL_EXTENSIONS @classmethod def update_attributes_map(cls, attributes, extension_attrs_map=None): """Update attributes map for this extension. Behaves like ExtensionDescriptor.update_attributes_map(), but if extension_attrs_map is not given the dict returned from self.get_extended_resources('2.0') is used. """ if extension_attrs_map is None: extension_attrs_map = cls.get_extended_resources('2.0') super(APIExtensionDescriptor, cls()).update_attributes_map( attributes, extension_attrs_map=extension_attrs_map) neutron-lib-1.13.0/neutron_lib/api/utils.py0000666000175100017510000000156313231472055020672 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ NOTE: Do not use this module to add random utils. We want to avoid having a generic utils.py dumping ground. """ from debtcollector import moves from neutron_lib.api import attributes populate_project_info = moves.moved_function( attributes.populate_project_info, 'populate_project_info', __name__) neutron-lib-1.13.0/neutron_lib/api/validators/0000775000175100017510000000000013231472430021316 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/api/validators/__init__.py0000666000175100017510000011747013231472055023446 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import collections import functools import inspect import re import netaddr from oslo_log import log as logging from oslo_utils import netutils from oslo_utils import strutils from oslo_utils import uuidutils import six from neutron_lib._i18n import _ from neutron_lib import constants from neutron_lib import exceptions as n_exc from neutron_lib.plugins import directory LOG = logging.getLogger(__name__) # Used by range check to indicate no limit for a bound. UNLIMITED = None # Note: In order to ensure that the MAC address is unicast the first byte # must be even. MAC_PATTERN = "^%s[aceACE02468](:%s{2}){5}$" % (constants.HEX_ELEM, constants.HEX_ELEM) def _verify_dict_keys(expected_keys, target_dict, strict=True): """Verify expected keys in a dictionary. :param expected_keys: A list of keys expected to be present. :param target_dict: The dictionary which should be verified. :param strict: Specifies whether additional keys are allowed to be present. :returns: None if the expected keys are found. Otherwise a human readable message indicating why the validation failed. """ if not isinstance(target_dict, dict): msg = (_("Invalid input. '%(target_dict)s' must be a dictionary " "with keys: %(expected_keys)s") % {'target_dict': target_dict, 'expected_keys': expected_keys}) LOG.debug(msg) return msg expected_keys = set(expected_keys) provided_keys = set(target_dict.keys()) predicate = expected_keys.__eq__ if strict else expected_keys.issubset if not predicate(provided_keys): msg = (_("Validation of dictionary's keys failed. " "Expected keys: %(expected_keys)s " "Provided keys: %(provided_keys)s") % {'expected_keys': expected_keys, 'provided_keys': provided_keys}) LOG.debug(msg) return msg def _collect_duplicates(data_list): """Collects duplicate items from a list and returns them. :param data_list: A list of items to check for duplicates. The list may include dict items. :returns: A set of items that are duplicates in data_list. If no duplicates are found, the returned set is empty. """ seen = [] dups = set() for datum in data_list: if datum in seen: dups.add(datum) continue seen.append(datum) return dups def is_attr_set(attribute): """Determine if an attribute value is set. :param attribute: The attribute value to check. :returns: False if the attribute value is None or ATTR_NOT_SPECIFIED, otherwise True. """ return not (attribute is None or attribute is constants.ATTR_NOT_SPECIFIED) def _validate_list_of_items(item_validator, data, *args, **kwargs): if not isinstance(data, list): msg = _("'%s' is not a list") % data return msg dups = _collect_duplicates(data) if dups: msg = _("Duplicate items in the list: '%s'") % ', '.join( [str(d) for d in dups]) return msg for item in data: msg = item_validator(item, *args, **kwargs) if msg: return msg def validate_values(data, valid_values=None, valid_values_display=None): """Validate that the provided 'data' is within 'valid_values'. :param data: The data to check within valid_values. :param valid_values: A collection of values that 'data' must be in to be valid. The collection can be any type that supports the 'in' operation. :param valid_values_display: A string to display that describes the valid values. This string is only displayed when an invalid value is encountered. If no string is provided, the string "valid_values" will be used. :returns: The message to return if data not in valid_values. :raises: TypeError if the values for 'data' or 'valid_values' are not compatible for comparison or doesn't have __contains__. If TypeError is raised this is considered a programming error and the inputs (data) and (valid_values) must be checked so this is never raised on validation. """ # If valid_values is not specified we don't check against it. if valid_values is None: return # Check if we can use 'in' to find membership of data in valid_values contains = getattr(valid_values, "__contains__", None) if callable(contains): try: if data not in valid_values: valid_values_display = valid_values_display or 'valid_values' msg = (_("%(data)s is not in %(valid_values)s") % {'data': data, 'valid_values': valid_values_display}) LOG.debug(msg) return msg except TypeError: # This is a programming error msg = (_("'data' of type '%(typedata)s' and 'valid_values'" "of type '%(typevalues)s' are not " "compatible for comparison") % {'typedata': type(data), 'typevalues': type(valid_values)}) raise TypeError(msg) else: # This is a programming error msg = (_("'valid_values' does not support membership operations")) raise TypeError(msg) def validate_not_empty_string_or_none(data, max_len=None): """Validate data is a non-empty string or None. :param data: The data to validate. :param max_len: An optional cap on the str length to validate. :returns: None if the data string is not None and is not an empty string, otherwise a human readable message as to why the string data is invalid. """ if data is not None: return validate_not_empty_string(data, max_len=max_len) def validate_not_empty_string(data, max_len=None): """Validate data is a non-empty/non-blank string. :param data: The data to validate. :param max_len: An optional cap on the length of the string data. :returns: None if the data is non-empty/non-blank, otherwise a human readable string message indicating why validation failed. """ msg = validate_string(data, max_len=max_len) if msg: return msg if not data.strip(): msg = _("'%s' Blank strings are not permitted") % data LOG.debug(msg) return msg def validate_string_or_none(data, max_len=None): """Validate data is a string or None. :param data: The data to validate. :param max_len: An optional cap on the length of the string data. :returns: None if the data is None or a valid string, otherwise a human readable message indicating why validation failed. """ if data is not None: return validate_string(data, max_len=max_len) def validate_string(data, max_len=None): """Validate data is a string object optionally capping it length. :param data: The data to validate. :param max_len: An optional cap on the length of the string. :returns: None if the data is a valid string type and (optionally) within the given max_len. Otherwise a human readable message indicating why the data is invalid. """ if not isinstance(data, six.string_types): msg = _("'%s' is not a valid string") % data LOG.debug(msg) return msg if max_len is not None and len(data) > max_len: msg = (_("'%(data)s' exceeds maximum length of %(max_len)s") % {'data': data, 'max_len': max_len}) LOG.debug(msg) return msg _validate_list_of_unique_strings = functools.partial(_validate_list_of_items, validate_string) # NOTE(boden): stubbed out for docstring comments. def validate_list_of_unique_strings(data, max_len=None): """Validate data is a list of unique strings. :param data: The data to validate. :param max_len: An optional cap on the length of the string. :returns: None if the data is a list of non-empty/non-blank strings, otherwise a human readable message indicating why validation failed. """ return _validate_list_of_unique_strings(data, max_len=max_len) def validate_boolean(data, valid_values=None): """Validate data is a python bool compatible object. :param data: The data to validate. :param valid_values: Not used! :return: None if the value can be converted to a bool, otherwise a human readable message indicating why data is invalid. """ try: strutils.bool_from_string(data, strict=True) except ValueError: msg = _("'%s' is not a valid boolean value") % data LOG.debug(msg) return msg def validate_integer(data, valid_values=None): """This function validates if the data is an integer. It checks both number or string provided to validate it's an integer and returns a message with the error if it's not :param data: The string or number to validate as integer. :param valid_values: values to limit the 'data' to. :returns: None if data is an integer, otherwise a human readable message indicating why validation failed.. """ if valid_values is not None: msg = validate_values(data=data, valid_values=valid_values) if msg: return msg msg = _("'%s' is not an integer") % data try: fl_n = float(data) int_n = int(data) except (ValueError, TypeError, OverflowError): LOG.debug(msg) return msg # Fail test if non equal or boolean if fl_n != int_n: LOG.debug(msg) return msg elif isinstance(data, bool): msg = _("'%s' is not an integer:boolean") % data LOG.debug(msg) return msg def validate_range(data, valid_values=None): """Check that integer value is within a range provided. Test is inclusive. Allows either limit to be ignored, to allow checking ranges where only the lower or upper limit matter. It is expected that the limits provided are valid integers or the value None. :param data: The data to validate. :param valid_values: A list of 2 elements where element 0 is the min value the int data can have and element 1 is the max. :returns: None if the data is a valid int in the given range, otherwise a human readable message as to why validation failed. """ min_value = valid_values[0] max_value = valid_values[1] try: data = int(data) except (ValueError, TypeError): msg = _("'%s' is not an integer") % data LOG.debug(msg) return msg if min_value is not UNLIMITED and data < min_value: msg = _("'%(data)s' is too small - must be at least " "'%(limit)d'") % {'data': data, 'limit': min_value} LOG.debug(msg) return msg if max_value is not UNLIMITED and data > max_value: msg = _("'%(data)s' is too large - must be no larger than " "'%(limit)d'") % {'data': data, 'limit': max_value} LOG.debug(msg) return msg def validate_range_or_none(data, valid_values=None): """Check that the provided value is none or a ranged integer""" if data is not None: return validate_range(data, valid_values) def validate_no_whitespace(data): """Validates that input has no whitespace. :param data: The data to validate. Must be a python string type suitable for searching via regex. :returns: The data itself. :raises InvalidInput: If the data contains whitespace. """ if re.search(r'\s', data): msg = _("'%s' contains whitespace") % data LOG.debug(msg) raise n_exc.InvalidInput(error_message=msg) return data def validate_mac_address(data, valid_values=None): """Validate data is a MAC address. :param data: The data to validate. :param valid_values: Not used! :returns: None if the data is a valid MAC address, otherwise a human readable message as to why validation failed. """ try: valid_mac = netaddr.valid_mac(validate_no_whitespace(data)) except Exception: valid_mac = False if valid_mac: valid_mac = (not netaddr.EUI(data) in map(netaddr.EUI, constants.INVALID_MAC_ADDRESSES)) # TODO(arosen): The code in this file should be refactored # so it catches the correct exceptions. validate_no_whitespace # raises AttributeError if data is None. if not valid_mac: msg = _("'%s' is not a valid MAC address") % data LOG.debug(msg) return msg def validate_mac_address_or_none(data, valid_values=None): """Validate data is a MAC address if the data isn't None. :param data: The data to validate. :param valid_values: Not used! :returns: None if the data is None or a valid MAC address, otherwise a human readable message indicating why validation failed. """ if data is not None: return validate_mac_address(data, valid_values) def validate_ip_address(data, valid_values=None): """Validate data is an IP address. :param data: The data to validate. :param valid_values: Not used! :returns: None if data is an IP address, otherwise a human readable message indicating why data isn't an IP address. """ msg = None try: # netaddr.core.ZEROFILL is only applicable to IPv4. # it will remove leading zeros from IPv4 address octets. ip = netaddr.IPAddress(validate_no_whitespace(data), flags=netaddr.core.ZEROFILL) # The followings are quick checks for IPv6 (has ':') and # IPv4. (has 3 periods like 'xx.xx.xx.xx') # NOTE(yamamoto): netaddr uses libraries provided by the underlying # platform to convert addresses. For example, inet_aton(3). # Some platforms, including NetBSD and OS X, have inet_aton # implementation which accepts more varying forms of addresses than # we want to accept here. The following check is to reject such # addresses. For Example: # >>> netaddr.IPAddress('1' * 59) # IPAddress('199.28.113.199') # >>> netaddr.IPAddress(str(int('1' * 59) & 0xffffffff)) # IPAddress('199.28.113.199') # >>> if ':' not in data and data.count('.') != 3: msg = _("'%s' is not a valid IP address") % data # A leading '0' in IPv4 address may be interpreted as an octal number, # e.g. 011 octal is 9 decimal. Since there is no standard saying # whether IP address with leading '0's should be interpreted as octal # or decimal, hence we reject leading '0's to avoid ambiguity. elif ip.version == 4 and str(ip) != data: msg = _("'%(data)s' is not an accepted IP address, " "'%(ip)s' is recommended") % {"data": data, "ip": ip} except Exception: msg = _("'%s' is not a valid IP address") % data if msg: LOG.debug(msg) return msg def _validate_any_key_spec(data, key_specs=None): """Validate a dict matches at least 1 key spec. :param data: The dict to validate. :param key_specs: An iterable collection of key spec dicts used to validate data. :returns: None if at least 1 of the key_specs matches data, otherwise a message is returned indicating data could not be matched with any of the key_specs. """ for spec in key_specs: if validate_dict(data, spec) is None: return None msg = _("No valid key specs matched for: %s") % data LOG.debug(msg) return msg def validate_any_key_specs_or_none(data, key_specs=None): """Validate each dict in a list matches at least 1 key_spec. :param data: The list of dicts to validate. :param key_specs: An iterable collection of key spec dicts that is used to check each dict in data. :returns: None. :raises InvalidInput: If any of the dicts in data do not match at least 1 of the key_specs given. """ if data is None: return def dict_validator(data_dict): msg = _validate_any_key_spec(data_dict, key_specs=key_specs) if msg: raise n_exc.InvalidInput(error_message=msg) msg = _validate_list_of_items(dict_validator, data) if msg: raise n_exc.InvalidInput(error_message=msg) def validate_ip_pools(data, valid_values=None): """Validate that start and end IP addresses are present. In addition to this the IP addresses will also be validated. :param data: The data to validate. Must be a list-like structure of IP pool dicts that each have a 'start' and 'end' key value. :param valid_values: Not used! :returns: None if data is a valid list of IP pools, otherwise a message indicating why the data is invalid. """ if not isinstance(data, list): msg = _("Invalid data format for IP pool: '%s'") % data LOG.debug(msg) return msg expected_keys = ['start', 'end'] for ip_pool in data: msg = _verify_dict_keys(expected_keys, ip_pool) if msg: return msg for k in expected_keys: msg = validate_ip_address(ip_pool[k]) if msg: return msg def validate_fixed_ips(data, valid_values=None): """Validate data is a list of fixed IP dicts. In addition this function validates the ip_address and subnet_id if present in each fixed IP dict. :param data: The data to validate. :param valid_values: Not used! :returns: None if data is a valid list of fixed IP dicts. Otherwise a human readable message is returned indicating why validation failed. """ if not isinstance(data, list): msg = _("Invalid data format for fixed IP: '%s'") % data LOG.debug(msg) return msg ips = [] for fixed_ip in data: if not isinstance(fixed_ip, dict): msg = _("Invalid data format for fixed IP: '%s'") % fixed_ip LOG.debug(msg) return msg if 'ip_address' in fixed_ip: # Ensure that duplicate entries are not set - just checking IP # suffices. Duplicate subnet_id's are legitimate. fixed_ip_address = fixed_ip['ip_address'] if fixed_ip_address in ips: msg = _("Duplicate IP address '%s'") % fixed_ip_address LOG.debug(msg) else: msg = validate_ip_address(fixed_ip_address) if msg: return msg ips.append(fixed_ip_address) if 'subnet_id' in fixed_ip: msg = validate_uuid(fixed_ip['subnet_id']) if msg: return msg def validate_nameservers(data, valid_values=None): """Validate a list of unique IP addresses. :param data: The data to validate. :param valid_values: Not used! :returns: None if data is a list of valid IP addresses, otherwise a human readable message is returned indicating why validation failed. """ if not hasattr(data, '__iter__'): msg = _("Invalid data format for nameserver: '%s'") % data LOG.debug(msg) return msg hosts = [] for host in data: # This must be an IP address only msg = validate_ip_address(host) if msg: msg = _("'%(host)s' is not a valid nameserver. %(msg)s") % { 'host': host, 'msg': msg} LOG.debug(msg) return msg if host in hosts: msg = _("Duplicate nameserver '%s'") % host LOG.debug(msg) return msg hosts.append(host) def validate_hostroutes(data, valid_values=None): """Validate a list of unique host route dicts. :param data: The data to validate. To be valid it must be a list like structure of host route dicts, each containing 'destination' and 'nexthop' key values. :param valid_values: Not used! :returns: None if data is a valid list of unique host route dicts, otherwise a human readable message indicating why validation failed. """ if not isinstance(data, list): msg = _("Invalid data format for hostroute: '%s'") % data LOG.debug(msg) return msg expected_keys = ['destination', 'nexthop'] hostroutes = [] for hostroute in data: msg = _verify_dict_keys(expected_keys, hostroute) if msg: return msg msg = validate_subnet(hostroute['destination']) if msg: return msg msg = validate_ip_address(hostroute['nexthop']) if msg: return msg if hostroute in hostroutes: msg = _("Duplicate hostroute '%s'") % hostroute LOG.debug(msg) return msg hostroutes.append(hostroute) def validate_ip_address_or_none(data, valid_values=None): """Validate data is an IP address or None. :param data: The data to validate. :param valid_values: An optional list of values data may take on. :return: None if data is None or a valid IP address, otherwise a human readable message indicating why the data is invalid. """ if data is not None: return validate_ip_address(data, valid_values) def validate_ip_or_subnet_or_none(data, valid_values=None): """Validate data is an IP address, a valid IP subnet string, or None. :param data: The data to validate. :param valid_values: Not used! :return: None if data is None or a valid IP address or a valid IP subnet, otherwise a human readable message indicating why the data is neither an IP address nor IP subnet. """ msg_ip = validate_ip_address_or_none(data) msg_subnet = validate_subnet_or_none(data) if msg_ip is not None and msg_subnet is not None: return _("'%(data)s' is neither a valid IP address, nor " "is it a valid IP subnet") % {'data': data} def validate_subnet(data, valid_values=None): """Validate data is an IP network subnet string. :param data: The data to validate. :param valid_values: Not used! :returns: None if data is valid IP network address. Otherwise a human readable message as to why data is invalid. """ msg = None try: net = netaddr.IPNetwork(validate_no_whitespace(data)) if '/' not in data or (net.version == 4 and str(net) != data): msg = _("'%(data)s' isn't a recognized IP subnet cidr," " '%(cidr)s' is recommended") % {"data": data, "cidr": net.cidr} else: return except Exception: msg = _("'%s' is not a valid IP subnet") % data if msg: LOG.debug(msg) return msg def validate_subnet_or_none(data, valid_values=None): """Validate data is a valid subnet address string or None. :param data: The data to validate. :param valid_values: The optional list of values data may take on. :returns: None if data is None or a valid subnet, otherwise a human readable message as to why data is invalid. """ if data is not None: return validate_subnet(data, valid_values) _validate_subnet_list = functools.partial(_validate_list_of_items, validate_subnet) # NOTE(boden): subbed out for docstring comments. def validate_subnet_list(data, valid_values=None): """Validate data is a list of subnet dicts. :param data: The data to validate. :param valid_values: Not used! :returns: None if data is a valid list of subnet dicts, otherwise a human readable message as to why the data is invalid. """ return _validate_subnet_list(data, valid_values) def validate_regex(data, valid_values=None): """Validate data is matched against a regex. :param data: The data to validate. :param valid_values: The regular expression to use with re.match on the data. :returns: None if data contains matches for valid_values, otherwise a human readable message as to why data is invalid. """ try: if re.match(valid_values, data): return except TypeError: pass msg = _("'%s' is not a valid input") % data LOG.debug(msg) return msg def validate_regex_or_none(data, valid_values=None): """Validate data is None or matched against a regex. :param data: The data to validate. :param valid_values: The regular expression to use with re.match on the data. :returns: None if data is None or contains matches for valid_values, otherwise a human readable message as to why data is invalid. """ if data is not None: return validate_regex(data, valid_values) def validate_list_of_regex_or_none(data, valid_values=None): """Validate data is None or a list of items matching regex. :param data: A list of data to validate. :param valid_values: The regular expression to use with re.match on each element of the data. :returns: None if data is None or contains matches for valid_values, otherwise a human readable message as to why data is invalid. """ if data is not None: return _validate_list_of_items(validate_regex, data, valid_values) def validate_subnetpool_id(data, valid_values=None): """Validate data is valid subnet pool ID. :param data: The data to validate. :param valid_values: Not used! :returns: None if data is a valid subnet pool ID, otherwise a human readable message as to why it's invalid. """ if data != constants.IPV6_PD_POOL_ID: return validate_uuid_or_none(data, valid_values) def validate_subnetpool_id_or_none(data, valid_values=None): """Validate data is valid subnet pool ID or None. :param data: The data to validate. :param valid_values: Not used! :returns: None if data is a valid subnet pool ID or None, otherwise a human readable message as to why it's invalid. """ if data is not None: return validate_subnetpool_id(data, valid_values) def validate_uuid(data, valid_values=None): """Validate data is UUID like. :param data: The data to validate. :param valid_values: Not used! :returns: None if data is UUID like in form, otherwise a human readable message indicating why data is invalid. """ if not uuidutils.is_uuid_like(data): msg = _("'%s' is not a valid UUID") % data LOG.debug(msg) return msg def validate_uuid_or_none(data, valid_values=None): """Validate data is UUID like or None. :param data: The data to validate. :param valid_values: Not used! :returns: None if data is UUID like in form or None, otherwise a human readable message indicating why data is invalid. """ if data is not None: return validate_uuid(data) _validate_uuid_list = functools.partial(_validate_list_of_items, validate_uuid) # NOTE(boden): subbed out for docstring comments. def validate_uuid_list(data, valid_values=None): """Validate data is a list of UUID like values. :param data: The data to validate. :param valid_values: Not used! :returns: None if data is an iterable that contains valid UUID values, otherwise a message is returned indicating why validation failed. """ return _validate_uuid_list(data, valid_values) def _validate_dict_item(key, key_validator, data): # Find conversion function, if any, and apply it conv_func = key_validator.get('convert_to') if conv_func: data[key] = conv_func(data.get(key)) # Find validator function # TODO(salv-orlando): Structure of dict attributes should be improved # to avoid iterating over items val_func = val_params = None for (k, v) in key_validator.items(): if k.startswith('type:'): # ask forgiveness, not permission try: val_func = validators[k] except KeyError: msg = _("Validator '%s' does not exist") % k LOG.debug(msg) return msg val_params = v break # Process validation if val_func: return val_func(data.get(key), val_params) def validate_dict(data, key_specs=None): """Validate data is a dict optionally containing a specific set of keys. :param data: The data to validate. :param key_specs: The optional list of keys that must be contained in data. :returns: None if data is a dict and (optionally) contains only key_specs. Otherwise a human readable message is returned indicating why data is not valid. """ if not isinstance(data, dict): msg = _("'%s' is not a dictionary") % data LOG.debug(msg) return msg # Do not perform any further validation, if no constraints are supplied if not key_specs: return # Check whether all required keys are present required_keys = [key for key, spec in key_specs.items() if spec.get('required')] if required_keys: msg = _verify_dict_keys(required_keys, data, False) if msg: return msg # Check whether unexpected keys are supplied in data unexpected_keys = [key for key in data if key not in key_specs] if unexpected_keys: msg = _("Unexpected keys supplied: %s") % ', '.join(unexpected_keys) LOG.debug(msg) return msg # Perform validation and conversion of all values # according to the specifications. for key, key_validator in [(k, v) for k, v in key_specs.items() if k in data]: msg = _validate_dict_item(key, key_validator, data) if msg: return msg def validate_dict_or_none(data, key_specs=None): """Validate data is None or a dict containing a specific set of keys. :param data: The data to validate. :param key_specs: The optional list of keys that must be contained in data. :returns: None if data is None or a dict that (optionally) contains all key_specs. Otherwise a human readable message is returned indicating why data is not valid. """ if data is not None: return validate_dict(data, key_specs) def validate_dict_or_empty(data, key_specs=None): """Validate data is {} or a dict containing a specific set of keys. :param data: The data to validate. :param key_specs: The optional list of keys that must be contained in data. :returns: None if data is {} or a dict (optionally) containing only key_specs. Otherwise a human readable message is returned indicating why data is not valid. """ if data != {}: return validate_dict(data, key_specs) def validate_dict_or_nodata(data, key_specs=None): """Validate no data or a dict containing a specific set of keys. :param data: The data to validate. May be None. :param key_specs: The optional list of keys that must be contained in data. :returns: None if no data/empty dict or a dict and (optionally) contains all key_specs. Otherwise a human readable message is returned indicating why data is not valid. """ if data: return validate_dict(data, key_specs) def validate_non_negative(data, valid_values=None): """Validate data is a positive int. :param data: The data to validate :param valid_values: Not used! :returns: None if data is an int and is positive, otherwise a human readable message as to why data is invalid. """ try: data = int(data) except (ValueError, TypeError): msg = _("'%s' is not an integer") % data LOG.debug(msg) return msg if data < 0: msg = _("'%s' should be non-negative") % data LOG.debug(msg) return msg def validate_port_range_or_none(data, valid_values=None): """Validate data is a range of TCP/UDP port numbers :param data: The data to validate :param valid_values: Not used! :returns: None if data is an int between 0 and 65535, or two ints between 0 and 65535 with a colon between them, otherwise a human readable message as to why data is invalid. """ if data is None: return data = str(data) ports = data.split(':') if len(ports) > 2: msg = _("Port range must be two integers separated by a colon") LOG.debug(msg) return msg for p in ports: if len(p) == 0: msg = _("Port range must be two integers separated by a colon") LOG.debug(msg) return msg if not netutils.is_valid_port(p): msg = _("Invalid port: %s") % p LOG.debug(msg) return msg if len(ports) > 1 and int(ports[0]) > int(ports[1]): msg = _("First port in a port range must be lower than the second " "port") LOG.debug(msg) return msg def validate_subports(data, valid_values=None): """Validate data is a list of subnet port dicts. :param data: The data to validate. :param valid_values: Not used! :returns: None if data is a list of subport dicts each with a unique valid port_id, segmentation_id and segmentation_type. Otherwise a human readable message is returned indicating why the data is invalid. """ if not isinstance(data, list): msg = _("Invalid data format for subports: '%s' is not a list") % data LOG.debug(msg) return msg subport_ids = set() segmentations = collections.defaultdict(set) for subport in data: if not isinstance(subport, dict): msg = _("Invalid data format for subport: " "'%s' is not a dict") % subport LOG.debug(msg) return msg # Expect a non duplicated and valid port_id for the subport if 'port_id' not in subport: msg = _("A valid port UUID must be specified") LOG.debug(msg) return msg elif validate_uuid(subport["port_id"]): msg = _("Invalid UUID for subport: '%s'") % subport["port_id"] return msg elif subport["port_id"] in subport_ids: msg = _("Non unique UUID for subport: '%s'") % subport["port_id"] return msg subport_ids.add(subport["port_id"]) # Validate that both segmentation ID and segmentation type are # specified, and that the client does not duplicate segmentation # IDs (unless it is explicitly asked to inherit segmentation # details from the underlying subport's network). segmentation_type = subport.get("segmentation_type") if segmentation_type == 'inherit': return segmentation_id = subport.get("segmentation_id") if ((not segmentation_type or segmentation_id is None) and len(subport) > 1): msg = _("Invalid subport details '%s': missing segmentation " "information. Must specify both segmentation_id and " "segmentation_type") % subport LOG.debug(msg) return msg if segmentation_id in segmentations.get(segmentation_type, []): msg = _("Segmentation ID '%(seg_id)s' for '%(subport)s' is not " "unique") % {"seg_id": segmentation_id, "subport": subport["port_id"]} LOG.debug(msg) return msg if segmentation_id is not None: segmentations[segmentation_type].add(segmentation_id) def validate_service_plugin_type(data, valid_values=None): """Validates data is a valid service plugin. :param data: The service plugin type to validate. :param valid_values: Not used. :returns: None if data is a valid service plugin known to the plugin directory. :raises: InvalidServiceType if data is not a service known by the plugin directory. """ if not directory.get_plugin(data): raise n_exc.InvalidServiceType(service_type=data) # Dictionary that maintains a list of validation functions validators = {'type:dict': validate_dict, 'type:dict_or_none': validate_dict_or_none, 'type:dict_or_empty': validate_dict_or_empty, 'type:dict_or_nodata': validate_dict_or_nodata, 'type:fixed_ips': validate_fixed_ips, 'type:hostroutes': validate_hostroutes, 'type:ip_address': validate_ip_address, 'type:ip_address_or_none': validate_ip_address_or_none, 'type:ip_or_subnet_or_none': validate_ip_or_subnet_or_none, 'type:ip_pools': validate_ip_pools, 'type:list_of_regex_or_none': validate_list_of_regex_or_none, 'type:mac_address': validate_mac_address, 'type:mac_address_or_none': validate_mac_address_or_none, 'type:nameservers': validate_nameservers, 'type:non_negative': validate_non_negative, 'type:port_range': validate_port_range_or_none, 'type:range': validate_range, 'type:range_or_none': validate_range_or_none, 'type:regex': validate_regex, 'type:regex_or_none': validate_regex_or_none, 'type:string': validate_string, 'type:string_or_none': validate_string_or_none, 'type:not_empty_string': validate_not_empty_string, 'type:not_empty_string_or_none': validate_not_empty_string_or_none, 'type:subnet': validate_subnet, 'type:subnet_list': validate_subnet_list, 'type:subnet_or_none': validate_subnet_or_none, 'type:subnetpool_id': validate_subnetpool_id, 'type:subnetpool_id_or_none': validate_subnetpool_id_or_none, 'type:subports': validate_subports, 'type:uuid': validate_uuid, 'type:uuid_or_none': validate_uuid_or_none, 'type:uuid_list': validate_uuid_list, 'type:values': validate_values, 'type:boolean': validate_boolean, 'type:integer': validate_integer, 'type:list_of_unique_strings': validate_list_of_unique_strings, 'type:list_of_any_key_specs_or_none': validate_any_key_specs_or_none, 'type:service_plugin_type': validate_service_plugin_type} def _to_validation_type(validation_type): return (validation_type if validation_type.startswith('type:') else 'type:' + validation_type) def get_validator(validation_type, default=None): """Get a registered validator by type. :param validation_type: The type to retrieve the validator for. :param default: A default value to return if the validator is not registered. :return: The validator if registered, otherwise the default value. """ return validators.get(_to_validation_type(validation_type), default) def add_validator(validation_type, validator): """Dynamically add a validator. This can be used by clients to add their own, private validators, rather than directly modifying the data structure. The clients can NOT modify existing validators. """ key = _to_validation_type(validation_type) if key in validators: # NOTE(boden): imp.load_source() forces module reinitialization that # can lead to validator redefinition from the same call site if inspect.getsource(validator) != inspect.getsource(validators[key]): msg = _("Validator type %s is already defined") % validation_type raise KeyError(msg) return validators[key] = validator neutron-lib-1.13.0/neutron_lib/api/validators/dns.py0000666000175100017510000001670613231472055022473 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import re from oslo_config import cfg from neutron_lib._i18n import _ from neutron_lib.api import validators from neutron_lib import constants from neutron_lib.db import constants as db_constants def _validate_dns_format(data, max_len=db_constants.FQDN_FIELD_SIZE): # NOTE: An individual name regex instead of an entire FQDN was used # because its easier to make correct. The logic should validate that the # dns_name matches RFC 1123 (section 2.1) and RFC 952. if not data: return try: # A trailing period is allowed to indicate that a name is fully # qualified per RFC 1034 (page 7). trimmed = data[:-1] if data.endswith('.') else data if len(trimmed) > max_len: raise TypeError( _("'%(trimmed)s' exceeds the %(maxlen)s character FQDN " "limit") % {'trimmed': trimmed, 'maxlen': max_len}) labels = trimmed.split('.') for label in labels: if not label: raise TypeError(_("Encountered an empty component")) if label.endswith('-') or label.startswith('-'): raise TypeError( _("Name '%s' must not start or end with a hyphen") % label) if not re.match(constants.DNS_LABEL_REGEX, label): raise TypeError( _("Name '%s' must be 1-63 characters long, each of " "which can only be alphanumeric or a hyphen") % label) # RFC 1123 hints that a TLD can't be all numeric. last is a TLD if # it's an FQDN. if len(labels) > 1 and re.match("^[0-9]+$", labels[-1]): raise TypeError( _("TLD '%s' must not be all numeric") % labels[-1]) except TypeError as e: msg = _("'%(data)s' not a valid PQDN or FQDN. Reason: %(reason)s") % { 'data': data, 'reason': e} return msg def _validate_dns_name_with_dns_domain(request_dns_name, dns_domain): # If a PQDN was passed, make sure the FQDN that will be generated is of # legal size higher_labels = dns_domain if dns_domain: higher_labels = '.%s' % dns_domain higher_labels_len = len(higher_labels) dns_name_len = len(request_dns_name) if not request_dns_name.endswith('.'): if dns_name_len + higher_labels_len > db_constants.FQDN_FIELD_SIZE: msg = _("The dns_name passed is a PQDN and its size is " "'%(dns_name_len)s'. The dns_domain option in " "neutron.conf is set to %(dns_domain)s, with a " "length of '%(higher_labels_len)s'. When the two are " "concatenated to form a FQDN (with a '.' at the end), " "the resulting length exceeds the maximum size " "of '%(fqdn_max_len)s'" ) % {'dns_name_len': dns_name_len, 'dns_domain': cfg.CONF.dns_domain, 'higher_labels_len': higher_labels_len, 'fqdn_max_len': db_constants.FQDN_FIELD_SIZE} return msg return # A FQDN was passed if (dns_name_len <= higher_labels_len or not request_dns_name.endswith(higher_labels)): msg = _("The dns_name passed is a FQDN. Its higher level labels " "must be equal to the dns_domain option in neutron.conf, " "that has been set to '%(dns_domain)s'. It must also " "include one or more valid DNS labels to the left " "of '%(dns_domain)s'") % {'dns_domain': cfg.CONF.dns_domain} return msg def _get_dns_domain_config(): if not cfg.CONF.dns_domain: return '' if cfg.CONF.dns_domain.endswith('.'): return cfg.CONF.dns_domain return '%s.' % cfg.CONF.dns_domain def _get_request_dns_name(dns_name): dns_domain = _get_dns_domain_config() if (dns_domain and dns_domain != constants.DNS_DOMAIN_DEFAULT): # If CONF.dns_domain is the default value 'openstacklocal', # neutron don't let the user to assign dns_name to ports return dns_name return '' def validate_dns_name(data, max_len=db_constants.FQDN_FIELD_SIZE): """Validate DNS name. This method validates dns name and also needs to have dns_domain in config because this may call a method which uses the config. :param data: The data to validate. :param max_len: An optional cap on the length of the string. :returns: None if data is valid, otherwise a human readable message indicating why validation failed. """ msg = _validate_dns_format(data, max_len) if msg: return msg request_dns_name = _get_request_dns_name(data) if request_dns_name: dns_domain = _get_dns_domain_config() msg = _validate_dns_name_with_dns_domain(request_dns_name, dns_domain) if msg: return msg def validate_fip_dns_name(data, max_len=db_constants.FQDN_FIELD_SIZE): """Validate DNS name for floating IP. :param data: The data to validate. :param max_len: An optional cap on the length of the string. :returns: None if data is valid, otherwise a human readable message indicating why validation failed. """ msg = validators.validate_string(data) if msg: return msg if not data: return if data.endswith('.'): msg = _("'%s' is a FQDN. It should be a relative domain name") % data return msg msg = _validate_dns_format(data, max_len) if msg: return msg length = len(data) if length > max_len - 3: msg = _("'%(data)s' contains %(length)s characters. Adding a " "domain name will cause it to exceed the maximum length " "of a FQDN of '%(max_len)s'") % {"data": data, "length": length, "max_len": max_len} return msg def validate_dns_domain(data, max_len=db_constants.FQDN_FIELD_SIZE): """Validate DNS domain. :param data: The data to validate. :param max_len: An optional cap on the length of the string. :returns: None if data is valid, otherwise a human readable message indicating why validation failed. """ msg = validators.validate_string(data) if msg: return msg if not data: return if not data.endswith('.'): msg = _("'%s' is not a FQDN") % data return msg msg = _validate_dns_format(data, max_len) if msg: return msg length = len(data) if length > max_len - 2: msg = _("'%(data)s' contains %(length)s characters. Adding a " "sub-domain will cause it to exceed the maximum length of a " "FQDN of '%(max_len)s'") % {"data": data, "length": length, "max_len": max_len} return msg neutron-lib-1.13.0/neutron_lib/api/validators/allowedaddresspairs.py0000666000175100017510000000650213231472055025734 0ustar zuulzuul00000000000000# Copyright 2013 VMware, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_config import cfg from webob import exc from neutron_lib._i18n import _ from neutron_lib.api import validators from neutron_lib.exceptions import allowedaddresspairs as exceptions def _validate_allowed_address_pairs(address_pairs, valid_values=None): """Validates a list of allowed address pair dicts. Validation herein requires the caller to have registered the max_allowed_address_pair oslo config option in the global CONF prior to having this validator used. :param address_pairs: A list of address pair dicts to validate. :param valid_values: Not used. :returns: None :raises: AllowedAddressPairExhausted if the address pairs requested exceeds cfg.CONF.max_allowed_address_pair. AllowedAddressPairsMissingIP if any address pair dicts are missing and IP address. DuplicateAddressPairInRequest if duplicated IPs are in the list of address pair dicts. Otherwise a HTTPBadRequest is raised if any of the address pairs are invalid. """ unique_check = {} if not isinstance(address_pairs, list): raise exc.HTTPBadRequest( _("Allowed address pairs must be a list.")) if len(address_pairs) > cfg.CONF.max_allowed_address_pair: raise exceptions.AllowedAddressPairExhausted( quota=cfg.CONF.max_allowed_address_pair) for address_pair in address_pairs: msg = validators.validate_dict(address_pair) if msg: return msg # mac_address is optional, if not set we use the mac on the port if 'mac_address' in address_pair: msg = validators.validate_mac_address(address_pair['mac_address']) if msg: raise exc.HTTPBadRequest(msg) if 'ip_address' not in address_pair: raise exceptions.AllowedAddressPairsMissingIP() mac = address_pair.get('mac_address') ip_address = address_pair['ip_address'] if (mac, ip_address) not in unique_check: unique_check[(mac, ip_address)] = None else: raise exceptions.DuplicateAddressPairInRequest( mac_address=mac, ip_address=ip_address) invalid_attrs = set(address_pair.keys()) - set(['mac_address', 'ip_address']) if invalid_attrs: msg = (_("Unrecognized attribute(s) '%s'") % ', '.join(set(address_pair.keys()) - set(['mac_address', 'ip_address']))) raise exc.HTTPBadRequest(msg) if '/' in ip_address: msg = validators.validate_subnet(ip_address) else: msg = validators.validate_ip_address(ip_address) if msg: raise exc.HTTPBadRequest(msg) neutron-lib-1.13.0/neutron_lib/api/validators/multiprovidernet.py0000666000175100017510000000321313231472055025310 0ustar zuulzuul00000000000000# Copyright (c) 2013 OpenStack Foundation. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from webob import exc from neutron_lib._i18n import _ from neutron_lib.api import converters from neutron_lib.api.definitions import provider_net as pnet from neutron_lib import constants def convert_and_validate_segments(segments, valid_values=None): for segment in segments: segment.setdefault(pnet.NETWORK_TYPE, constants.ATTR_NOT_SPECIFIED) segment.setdefault(pnet.PHYSICAL_NETWORK, constants.ATTR_NOT_SPECIFIED) segmentation_id = segment.get(pnet.SEGMENTATION_ID) if segmentation_id: segment[pnet.SEGMENTATION_ID] = converters.convert_to_int( segmentation_id) else: segment[pnet.SEGMENTATION_ID] = constants.ATTR_NOT_SPECIFIED if len(segment) != 3: msg = (_("Unrecognized attribute(s) '%s'") % ', '.join(set(segment.keys()) - set([pnet.NETWORK_TYPE, pnet.PHYSICAL_NETWORK, pnet.SEGMENTATION_ID]))) raise exc.HTTPBadRequest(msg) neutron-lib-1.13.0/neutron_lib/api/validators/availability_zone.py0000666000175100017510000000313213231472055025401 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. from oslo_serialization import jsonutils from neutron_lib._i18n import _ from neutron_lib.api import validators from neutron_lib.db import constants as db_const from neutron_lib import exceptions def convert_az_list_to_string(az_list): """Convert a list of availability zones into a string. :param az_list: A list of AZs. :returns: The az_list in string format. """ return jsonutils.dumps(az_list) def convert_az_string_to_list(az_string): """Convert an AZ list in string format into a python list. :param az_string: The AZ list in string format. :returns: The python list of AZs build from az_string. """ return jsonutils.loads(az_string) if az_string else [] def _validate_availability_zone_hints(data, valid_value=None): msg = validators.validate_list_of_unique_strings(data) if msg: return msg az_string = convert_az_list_to_string(data) if len(az_string) > db_const.AZ_HINTS_DB_LEN: msg = _("Too many availability_zone_hints specified") raise exceptions.InvalidInput(error_message=msg) neutron-lib-1.13.0/neutron_lib/api/definitions/0000775000175100017510000000000013231472430021461 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/api/definitions/trunk.py0000666000175100017510000000720013231472055023202 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.db import constants as db_const # The alias of the extension. ALIAS = 'trunk' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'Trunk Extension' # The description of the extension. DESCRIPTION = "Provides support for trunk ports" # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2016-01-01T10:00:00-00:00" # The specific resources and/or attributes for the extension (optional). TRUNK = 'trunk' TRUNKS = 'trunks' SUB_PORTS = 'sub_ports' # The resource attribute map for the extension. RESOURCE_ATTRIBUTE_MAP = { TRUNKS: { 'admin_state_up': {'allow_post': True, 'allow_put': True, 'default': True, 'convert_to': converters.convert_to_boolean, 'is_visible': True}, 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, 'default': '', 'is_visible': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': {'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'is_visible': True}, 'port_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': {'type:uuid': None}, 'is_visible': True}, 'status': {'allow_post': False, 'allow_put': False, 'is_visible': True}, SUB_PORTS: {'allow_post': True, 'allow_put': False, 'default': [], 'convert_list_to': converters.convert_kvp_list_to_dict, 'validate': {'type:subports': None}, 'enforce_policy': True, 'is_visible': True} }, } # The subresource attribute map for the extension. SUB_RESOURCE_ATTRIBUTE_MAP = None # The action map. ACTION_MAP = { TRUNK: { 'add_subports': 'PUT', 'remove_subports': 'PUT', 'get_subports': 'GET' } } # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [ "binding", ] # The list of optional extensions. OPTIONAL_EXTENSIONS = [ "provider", # needed to learn about network segmentation details. ] # TODO(armax): add support for modeling custom queries neutron-lib-1.13.0/neutron_lib/api/definitions/l2_adjacency.py0000666000175100017510000000246613231472055024366 0ustar zuulzuul00000000000000# Copyright (c) 2016 NEC Technologies Ltd. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import network L2_ADJACENCY = 'l2_adjacency' ALIAS = L2_ADJACENCY IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'L2 Adjacency' API_PREFIX = '' DESCRIPTION = 'Display L2 Adjacency for Neutron Networks.' UPDATED_TIMESTAMP = '2016-04-12T16:00:00-00:00' RESOURCE_NAME = network.RESOURCE_NAME COLLECTION_NAME = network.COLLECTION_NAME RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { L2_ADJACENCY: { 'allow_post': False, 'allow_put': False, 'is_visible': True } } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/ip_substring_port_filtering.py0000666000175100017510000000340313231472055027657 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # The alias of the extension. ALIAS = 'ip-substring-filtering' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = True # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'IP address substring filtering' # The description of the extension. DESCRIPTION = "Provides IP address substring filtering when listing ports" # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2017-11-28T09:00:00-00:00" # The resource attribute map for the extension. RESOURCE_ATTRIBUTE_MAP = { } # The subresource attribute map for the extension. SUB_RESOURCE_ATTRIBUTE_MAP = { } # The action map. ACTION_MAP = { } # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [ ] # The list of optional extensions. OPTIONAL_EXTENSIONS = [ ] neutron-lib-1.13.0/neutron_lib/api/definitions/extra_dhcp_opt.py0000666000175100017510000001130213231472055025040 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import port # Common definitions for maximum string field length DHCP_OPT_NAME_MAX_LEN = 64 VALID_BLANK_EXTRA_DHCP_OPTS = ('router', 'classless-static-route') DHCP_OPT_VALUE_MAX_LEN = 255 EXTRA_DHCP_OPT_KEY_SPECS = [ # key spec for opt_name in _VALID_BLANK_EXTRA_DHCP_OPTS {'opt_name': {'type:values': VALID_BLANK_EXTRA_DHCP_OPTS, 'required': True}, 'opt_value': {'type:string_or_none': DHCP_OPT_VALUE_MAX_LEN, 'required': True}, 'ip_version': {'convert_to': converters.convert_to_int, 'type:values': [4, 6], 'required': False}}, # key spec if opt_name not in _VALID_BLANK_EXTRA_DHCP_OPTS {'opt_name': {'type:not_empty_string': DHCP_OPT_NAME_MAX_LEN, 'required': True}, 'opt_value': {'type:not_empty_string_or_none': DHCP_OPT_VALUE_MAX_LEN, 'required': True}, 'ip_version': {'convert_to': converters.convert_to_int, 'type:values': [4, 6], 'required': False}} ] EXTRADHCPOPTS = 'extra_dhcp_opts' DHCP_OPT_CLIENT_ID = "client-id" # The alias of the extension. ALIAS = 'extra_dhcp_opt' # The label to lookup the plugin in the plugin directory. It can match the # alias, as required. LABEL = 'extra_dhcp_opt' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map (mandatory). IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension (mandatory). # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension (mandatory). NAME = 'Neutron Extra DHCP options' # A prefix for API resources. An empty prefix means that the API is going # to be exposed at the v2/ level as any other core resource (mandatory). API_PREFIX = '' # The description of the extension (mandatory). DESCRIPTION = ("Extra options configuration for DHCP. " "For example PXE boot options to DHCP clients can " "be specified (e.g. tftp-server, server-ip-address, " "bootfile-name)") # A timestamp of when the extension was introduced (mandatory). UPDATED_TIMESTAMP = "2013-03-17T12:00:00-00:00" # The specific resources and/or attributes for the extension (optional). # In case of simple extensions, with single resource, the string constants # RESOURCE_NAME and COLLECTION_NAME can be used, otherwise string literals # can be used instead. # The name of the resource introduced or being extended # (in case it is defined by another extension, or it is # a core resource). RESOURCE_NAME = port.RESOURCE_NAME # The plural for the resource introduced or being extended # (in case it is defined by another extension, or it is a # core resource). COLLECTION_NAME = port.COLLECTION_NAME # The resource attribute map for the extension. It is effectively the # bulk of the API contract alongside ACTION_MAP (mandatory). RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { EXTRADHCPOPTS: { 'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': None, 'validate': { 'type:list_of_any_key_specs_or_none': EXTRA_DHCP_OPT_KEY_SPECS } } } } # The subresource attribute map for the extension. It adds child resources # to main extension's resource. The subresource map must have a parent and # a parameters entry. If an extension does not need such a map, None can # be specified (mandatory). SUB_RESOURCE_ATTRIBUTE_MAP = {} # The action map: it associates verbs with methods to be performed on # the API resource (mandatory). ACTION_MAP = {} # The list of required extensions (mandatory). REQUIRED_EXTENSIONS = [] # The list of optional extensions (mandatory). OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/__init__.py0000666000175100017510000001150213231472055023576 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import address_scope from neutron_lib.api.definitions import agent from neutron_lib.api.definitions import allowedaddresspairs from neutron_lib.api.definitions import auto_allocated_topology from neutron_lib.api.definitions import availability_zone from neutron_lib.api.definitions import bgpvpn from neutron_lib.api.definitions import bgpvpn_routes_control from neutron_lib.api.definitions import bgpvpn_vni from neutron_lib.api.definitions import data_plane_status from neutron_lib.api.definitions import default_subnetpools from neutron_lib.api.definitions import dns from neutron_lib.api.definitions import dns_domain_ports from neutron_lib.api.definitions import dvr from neutron_lib.api.definitions import external_net from neutron_lib.api.definitions import extra_dhcp_opt from neutron_lib.api.definitions import extraroute from neutron_lib.api.definitions import fip64 from neutron_lib.api.definitions import firewall from neutron_lib.api.definitions import firewall_v2 from neutron_lib.api.definitions import firewallrouterinsertion from neutron_lib.api.definitions import flavors from neutron_lib.api.definitions import ip_allocation from neutron_lib.api.definitions import ip_substring_port_filtering from neutron_lib.api.definitions import l2_adjacency from neutron_lib.api.definitions import l3 from neutron_lib.api.definitions import l3_ext_gw_mode from neutron_lib.api.definitions import l3_ext_ha_mode from neutron_lib.api.definitions import l3_flavors from neutron_lib.api.definitions import logging from neutron_lib.api.definitions import logging_resource from neutron_lib.api.definitions import metering from neutron_lib.api.definitions import multiprovidernet from neutron_lib.api.definitions import network from neutron_lib.api.definitions import network_availability_zone from neutron_lib.api.definitions import network_ip_availability from neutron_lib.api.definitions import network_mtu from neutron_lib.api.definitions import network_mtu_writable from neutron_lib.api.definitions import pagination from neutron_lib.api.definitions import port from neutron_lib.api.definitions import port_security from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings_extended from neutron_lib.api.definitions import project_id from neutron_lib.api.definitions import provider_net from neutron_lib.api.definitions import qos from neutron_lib.api.definitions import qos_default from neutron_lib.api.definitions import qos_rule_type_details from neutron_lib.api.definitions import revisionifmatch from neutron_lib.api.definitions import router_availability_zone from neutron_lib.api.definitions import router_interface_fip from neutron_lib.api.definitions import routerservicetype from neutron_lib.api.definitions import segment from neutron_lib.api.definitions import servicetype from neutron_lib.api.definitions import sorting from neutron_lib.api.definitions import subnet from neutron_lib.api.definitions import subnet_onboard from neutron_lib.api.definitions import subnetpool from neutron_lib.api.definitions import trunk from neutron_lib.api.definitions import trunk_details from neutron_lib.api.definitions import vlantransparent _ALL_API_DEFINITIONS = { address_scope, agent, allowedaddresspairs, auto_allocated_topology, availability_zone, bgpvpn, bgpvpn_routes_control, bgpvpn_vni, data_plane_status, default_subnetpools, dns, dns_domain_ports, dvr, external_net, extra_dhcp_opt, extraroute, fip64, firewall, firewall_v2, firewallrouterinsertion, flavors, ip_allocation, ip_substring_port_filtering, l2_adjacency, l3, l3_ext_gw_mode, l3_ext_ha_mode, l3_flavors, logging, logging_resource, metering, multiprovidernet, network, network_availability_zone, network_ip_availability, network_mtu, network_mtu_writable, pagination, port, port_security, portbindings, portbindings_extended, project_id, provider_net, qos, qos_default, qos_rule_type_details, revisionifmatch, router_availability_zone, router_interface_fip, routerservicetype, segment, servicetype, sorting, subnet, subnet_onboard, subnetpool, trunk, trunk_details, vlantransparent } neutron-lib-1.13.0/neutron_lib/api/definitions/dvr.py0000666000175100017510000000313113231472055022631 0ustar zuulzuul00000000000000# Copyright (c) 2014 OpenStack Foundation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import l3 from neutron_lib import constants DISTRIBUTED = 'distributed' ALIAS = constants.L3_DISTRIBUTED_EXT_ALIAS LABEL = ALIAS IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Distributed Virtual Router' API_PREFIX = '' DESCRIPTION = 'Enables configuration of Distributed Virtual Routers.' UPDATED_TIMESTAMP = '2014-06-1T10:00:00-00:00' RESOURCE_NAME = l3.ROUTER COLLECTION_NAME = l3.ROUTERS RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { DISTRIBUTED: {'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': constants.ATTR_NOT_SPECIFIED, 'convert_to': converters.convert_to_boolean_if_not_none, 'enforce_policy': True}, } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [l3.ALIAS] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/logging_resource.py0000666000175100017510000001107413231472055025400 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import firewall from neutron_lib.db import constants as db_const # The alias of the extension. ALIAS = 'logging-resource' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'Logging Resource Extension' # A prefix for API resources. An empty prefix means that the API is going # to be exposed at the v2/ level as any other core resource. API_PREFIX = '/logging' # The description of the extension. DESCRIPTION = "The logging resource extension." # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2016-06-06T10:00:00-00:00" # The name of the resource. RESOURCE_NAME = 'logging_resource' # The plural for the resource. COLLECTION_NAME = 'logging_resources' # Attributes ENABLED = 'enabled' # Sub resource FIREWALL_LOGS = 'firewall_logs' LOGGING_RESOURCE_ID = 'logging_resource_id' FW_EVENT = 'fw_event' FIREWALL_ID = 'firewall_id' FW_EVENT_ACCEPT = 'ACCEPT' FW_EVENT_DROP = 'DROP' FW_EVENT_ALL = 'ALL' FW_EVENTS = [FW_EVENT_ACCEPT, FW_EVENT_DROP, FW_EVENT_ALL] LOG_COMMON_FIELDS = { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'is_visible': True}, LOGGING_RESOURCE_ID: {'allow_post': False, 'allow_put': False, 'is_visible': True} } RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'is_visible': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, 'default': '', 'is_visible': True}, 'description': { 'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.LONG_DESCRIPTION_FIELD_SIZE}, 'default': '', 'is_visible': True}, ENABLED: {'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': False, 'convert_to': converters.convert_to_boolean}, FIREWALL_LOGS: {'allow_post': False, 'allow_put': False, 'is_visible': True} } } SUB_RESOURCE_ATTRIBUTE_MAP = { FIREWALL_LOGS: { 'parent': {'collection_name': COLLECTION_NAME, 'member_name': RESOURCE_NAME}, 'parameters': dict((LOG_COMMON_FIELDS), **{ 'description': { 'allow_post': True, 'allow_put': True, 'validate': { 'type:string': db_const.LONG_DESCRIPTION_FIELD_SIZE}, 'default': '', 'is_visible': True}, FIREWALL_ID: { 'allow_post': True, 'allow_put': False, 'is_visible': True, 'validate': {'type:uuid': None}}, FW_EVENT: { 'allow_post': True, 'allow_put': True, 'is_visible': True, 'validate': {'type:values': FW_EVENTS}, 'default': FW_EVENT_ALL} }), }, } # The action map. ACTION_MAP = {} # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [ firewall.ALIAS, ] # The list of optional extensions. OPTIONAL_EXTENSIONS = [] neutron-lib-1.13.0/neutron_lib/api/definitions/dns.py0000666000175100017510000001113613231472055022626 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters as convert from neutron_lib.api.definitions import l3 from neutron_lib.api.definitions import network from neutron_lib.api.definitions import port from neutron_lib.api import validators from neutron_lib.api.validators import dns as dns_validator from neutron_lib.db import constants # The alias of the extension. ALIAS = 'dns-integration' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map (mandatory). IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension (mandatory). # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension (mandatory). NAME = 'DNS Integration' # A prefix for API resources. An empty prefix means that the API is going # to be exposed at the v2/ level as any other core resource (mandatory). API_PREFIX = '' # The description of the extension (mandatory). DESCRIPTION = "Provides integration with DNS." # A timestamp of when the extension was introduced (mandatory). UPDATED_TIMESTAMP = "2015-08-15T18:00:00-00:00" DNSNAME = 'dns_name' DNSDOMAIN = 'dns_domain' DNSASSIGNMENT = 'dns_assignment' validators.add_validator('dns_host_name', dns_validator.validate_dns_name) validators.add_validator('fip_dns_host_name', dns_validator.validate_fip_dns_name) validators.add_validator('dns_domain_name', dns_validator.validate_dns_domain) # The resource attribute map for the extension. It is effectively the # bulk of the API contract alongside ACTION_MAP (mandatory). RESOURCE_ATTRIBUTE_MAP = { port.COLLECTION_NAME: { DNSNAME: {'allow_post': True, 'allow_put': True, 'default': '', 'convert_to': convert.convert_string_to_case_insensitive, 'validate': {'type:dns_host_name': constants.FQDN_FIELD_SIZE}, 'is_visible': True}, DNSASSIGNMENT: {'allow_post': False, 'allow_put': False, 'is_visible': True}, }, l3.FLOATINGIPS: { DNSNAME: {'allow_post': True, 'allow_put': False, 'default': '', 'convert_to': convert.convert_string_to_case_insensitive, 'validate': {'type:fip_dns_host_name': constants.FQDN_FIELD_SIZE}, 'is_visible': True}, DNSDOMAIN: {'allow_post': True, 'allow_put': False, 'default': '', 'convert_to': convert.convert_string_to_case_insensitive, 'validate': {'type:dns_domain_name': constants.FQDN_FIELD_SIZE}, 'is_visible': True}, }, network.COLLECTION_NAME: { DNSDOMAIN: {'allow_post': True, 'allow_put': True, 'default': '', 'convert_to': convert.convert_string_to_case_insensitive, 'validate': {'type:dns_domain_name': constants.FQDN_FIELD_SIZE}, 'is_visible': True}, }, } # The subresource attribute map for the extension. It adds child resources # to main extension's resource. The subresource map must have a parent and # a parameters entry. If an extension does not need such a map, None can # be specified (mandatory). For example: SUB_RESOURCE_ATTRIBUTE_MAP = {} # The action map: it associates verbs with methods to be performed on # the API resource (mandatory). ACTION_MAP = {} # The action status: it associates response statuses with methods to be # performed on the API resource (mandatory). ACTION_STATUS = {} # The list of required extensions (mandatory). REQUIRED_EXTENSIONS = [l3.ALIAS] # The list of optional extensions (mandatory). OPTIONAL_EXTENSIONS = [] neutron-lib-1.13.0/neutron_lib/api/definitions/network.py0000666000175100017510000000540713231472055023537 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import subnet from neutron_lib import constants from neutron_lib.db import constants as db_const NAME = 'Neutron L2 Network' ALIAS = 'network' DESCRIPTION = "Layer 2 network abstraction" UPDATED_TIMESTAMP = "2012-01-01T10:00:00-00:00" RESOURCE_NAME = 'network' COLLECTION_NAME = 'networks' # Identify the attribute used by a resource to reference another resource RESOURCE_FOREIGN_KEYS = { COLLECTION_NAME: 'network_id' } RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': { 'type:string': db_const.NAME_FIELD_SIZE}, 'default': '', 'is_visible': True}, subnet.COLLECTION_NAME: {'allow_post': False, 'allow_put': False, 'default': [], 'is_visible': True}, 'admin_state_up': {'allow_post': True, 'allow_put': True, 'default': True, 'convert_to': converters.convert_to_boolean, 'is_visible': True}, 'status': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'required_by_policy': True, 'is_visible': True}, constants.SHARED: { 'allow_post': True, 'allow_put': True, 'default': False, 'convert_to': converters.convert_to_boolean, 'is_visible': True, 'required_by_policy': True, 'enforce_policy': True } } } # This is a core resource so the following are not applicable. IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/qos_rule_type_details.py0000666000175100017510000000246213231472055026443 0ustar zuulzuul00000000000000# Copyright (c) 2017 OVH SAS # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import qos as qos_apidef DRIVERS = 'drivers' ALIAS = 'qos-rule-type-details' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Details of QoS rule types' API_PREFIX = '' DESCRIPTION = ("Expose details about QoS rule types supported by loaded " "backend drivers") UPDATED_TIMESTAMP = '2017-06-22T10:00:00-00:00' RESOURCE_ATTRIBUTE_MAP = { qos_apidef.RULE_TYPES: { DRIVERS: { 'allow_post': False, 'allow_put': False, 'is_visible': True } } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [qos_apidef.ALIAS] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/servicetype.py0000666000175100017510000000314513231472055024405 0ustar zuulzuul00000000000000# Copyright 2013 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. SERVICE_ATTR = 'service_type' PLUGIN_ATTR = 'plugin' DRIVER_ATTR = 'driver' ALIAS = 'service-type' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Neutron Service Type Management' API_PREFIX = '' DESCRIPTION = ("API for retrieving service providers for " "Neutron advanced services") UPDATED_TIMESTAMP = '2013-01-20T00:00:00-00:00' RESOURCE_NAME = 'service_provider' COLLECTION_NAME = RESOURCE_NAME + 's' RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { SERVICE_ATTR: { 'allow_post': False, 'allow_put': False, 'is_visible': True }, 'name': { 'allow_post': False, 'allow_put': False, 'is_visible': True }, 'default': { 'allow_post': False, 'allow_put': False, 'is_visible': True } } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/subnet.py0000666000175100017510000001267613231472055023354 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib import constants from neutron_lib.db import constants as db_const NAME = 'Neutron L3 Subnet' ALIAS = 'subnet' DESCRIPTION = "Layer 3 subnet abstraction" UPDATED_TIMESTAMP = "2012-01-01T10:00:00-00:00" RESOURCE_NAME = 'subnet' COLLECTION_NAME = 'subnets' RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'name': {'allow_post': True, 'allow_put': True, 'default': '', 'validate': { 'type:string': db_const.NAME_FIELD_SIZE}, 'is_visible': True}, 'ip_version': {'allow_post': True, 'allow_put': False, 'convert_to': converters.convert_to_int, 'validate': {'type:values': [4, 6]}, 'is_visible': True}, 'network_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': {'type:uuid': None}, 'is_visible': True}, 'subnetpool_id': {'allow_post': True, 'allow_put': False, 'default': constants.ATTR_NOT_SPECIFIED, 'required_by_policy': False, 'validate': {'type:subnetpool_id_or_none': None}, 'is_visible': True}, 'prefixlen': {'allow_post': True, 'allow_put': False, 'validate': {'type:non_negative': None}, 'convert_to': converters.convert_to_int, 'default': constants.ATTR_NOT_SPECIFIED, 'required_by_policy': False, 'is_visible': False}, 'cidr': {'allow_post': True, 'allow_put': False, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': {'type:subnet_or_none': None}, 'required_by_policy': False, 'is_visible': True}, 'gateway_ip': {'allow_post': True, 'allow_put': True, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': {'type:ip_address_or_none': None}, 'is_visible': True}, 'allocation_pools': {'allow_post': True, 'allow_put': True, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': {'type:ip_pools': None}, 'is_visible': True}, 'dns_nameservers': {'allow_post': True, 'allow_put': True, 'convert_to': converters.convert_none_to_empty_list, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': {'type:nameservers': None}, 'is_visible': True}, 'host_routes': {'allow_post': True, 'allow_put': True, 'convert_to': converters.convert_none_to_empty_list, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': {'type:hostroutes': None}, 'is_visible': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'required_by_policy': True, 'is_visible': True}, 'enable_dhcp': {'allow_post': True, 'allow_put': True, 'default': True, 'convert_to': converters.convert_to_boolean, 'is_visible': True}, 'ipv6_ra_mode': {'allow_post': True, 'allow_put': False, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': { 'type:values': constants.IPV6_MODES}, 'is_visible': True}, 'ipv6_address_mode': {'allow_post': True, 'allow_put': False, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': { 'type:values': constants.IPV6_MODES}, 'is_visible': True}, constants.SHARED: { 'allow_post': False, 'allow_put': False, 'default': False, 'convert_to': converters.convert_to_boolean, 'is_visible': False, 'required_by_policy': True, 'enforce_policy': True } } } # This is a core resource so the following are not applicable. IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/router_availability_zone.py0000666000175100017510000000270313231472055027147 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. from neutron_lib.api.definitions import availability_zone as az from neutron_lib.api.definitions import l3 ALIAS = 'router_availability_zone' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Router Availability Zone' API_PREFIX = '' DESCRIPTION = 'Availability zone support for router.' UPDATED_TIMESTAMP = '2015-01-01T10:00:00-00:00' RESOURCE_NAME = l3.ROUTER COLLECTION_NAME = l3.ROUTERS RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { az.COLLECTION_NAME: { 'allow_post': False, 'allow_put': False, 'is_visible': True }, az.AZ_HINTS: { 'allow_post': True, 'allow_put': False, 'is_visible': True, 'validate': {'type:availability_zone_hint_list': None}, 'default': [] } } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [l3.ALIAS, az.ALIAS] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/fip64.py0000666000175100017510000000351613231472055022775 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import l3 # The alias of the extension. ALIAS = 'fip64' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = True # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'FIP64 Extension' # The description of the extension. DESCRIPTION = "FIP64 Extension" # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2016-12-14T10:00:00-00:00" # The resource attribute map for the extension. It is effectively the # bulk of the API contract alongside ACTION_MAP RESOURCE_ATTRIBUTE_MAP = {} # The subresource attribute map for the extension. SUB_RESOURCE_ATTRIBUTE_MAP = None # The action map. ACTION_MAP = {} # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [ l3.ALIAS, ] # The list of optional extensions. OPTIONAL_EXTENSIONS = [] neutron-lib-1.13.0/neutron_lib/api/definitions/provider_net.py0000666000175100017510000000744613231472055024553 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import network from neutron_lib import constants # The alias of the extension. ALIAS = 'provider' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'Provider Network' # A prefix for API resources. An empty prefix means that the API is going # to be exposed at the v2/ level as any other core resource. API_PREFIX = '' # The description of the extension. DESCRIPTION = "Expose mapping of virtual networks to physical networks" # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2012-09-07T10:00:00-00:00" # The name of the resource. RESOURCE_NAME = network.RESOURCE_NAME # The plural for the resource. COLLECTION_NAME = network.COLLECTION_NAME NETWORK_TYPE = 'provider:network_type' PHYSICAL_NETWORK = 'provider:physical_network' SEGMENTATION_ID = 'provider:segmentation_id' ATTRIBUTES = (NETWORK_TYPE, PHYSICAL_NETWORK, SEGMENTATION_ID) # Common definitions for maximum string field length NETWORK_TYPE_MAX_LEN = 32 PHYSICAL_NETWORK_MAX_LEN = 64 RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { NETWORK_TYPE: {'allow_post': True, 'allow_put': True, 'validate': {'type:string': NETWORK_TYPE_MAX_LEN}, 'default': constants.ATTR_NOT_SPECIFIED, 'enforce_policy': True, 'is_visible': True}, PHYSICAL_NETWORK: {'allow_post': True, 'allow_put': True, 'validate': {'type:string': PHYSICAL_NETWORK_MAX_LEN}, 'default': constants.ATTR_NOT_SPECIFIED, 'enforce_policy': True, 'is_visible': True}, SEGMENTATION_ID: {'allow_post': True, 'allow_put': True, 'convert_to': converters.convert_to_int, 'enforce_policy': True, 'default': constants.ATTR_NOT_SPECIFIED, 'is_visible': True}, } } # The subresource attribute map for the extension. It adds child resources # to main extension's resource. The subresource map must have a parent and # a parameters entry. If an extension does not need such a map, None can # be specified (mandatory). SUB_RESOURCE_ATTRIBUTE_MAP = None # The action map: it associates verbs with methods to be performed on # the API resource. For example: # # ACTION_MAP = { # RESOURCE_NAME: { # 'add_my_foo_bars': 'PUT', # 'remove_my_foo_bars': 'PUT', # 'get_my_foo_bars': 'GET' # } # } ACTION_MAP = { } # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [ ] # The list of optional extensions. OPTIONAL_EXTENSIONS = [ ] neutron-lib-1.13.0/neutron_lib/api/definitions/bgpvpn.py0000666000175100017510000002001413231472055023331 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import l3 from neutron_lib.db import constants as db_const # Regular expression to validate 32 bits unsigned int UINT32_REGEX = (r'(0|[1-9]\d{0,8}|[1-3]\d{9}|4[01]\d{8}|42[0-8]\d{7}' r'|429[0-3]\d{6}|4294[0-8]\d{5}|42949[0-5]\d{4}' r'|429496[0-6]\d{3}|4294967[0-1]\d{2}|42949672[0-8]\d' r'|429496729[0-5])') # Regular expression to validate 16 bits unsigned int UINT16_REGEX = (r'(0|[1-9]\d{0,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}' r'|655[0-2]\d|6553[0-5])') # Regular expression to validate 8 bits unsigned int UINT8_REGEX = (r'(0|[1-9]\d{0,1}|1\d{2}|2[0-4]\d|25[0-5])') # Regular expression to validate IPv4 address IP4_REGEX = (r'(%s\.%s\.%s\.%s)') % (UINT8_REGEX, UINT8_REGEX, UINT8_REGEX, UINT8_REGEX) # Regular expression to validate Route Target list format # Support of the Type 0, Type 1 and Type 2, cf. chapter 4.2 in RFC 4364 # Also validates Route Distinguisher list format RTRD_REGEX = (r'^(%s:%s|%s:%s|%s:%s)$') % (UINT16_REGEX, UINT32_REGEX, IP4_REGEX, UINT16_REGEX, UINT32_REGEX, UINT16_REGEX) # The alias of the extension. ALIAS = 'bgpvpn' LABEL = 'BGPVPN' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'BGPVPN Extension' # The description of the extension. DESCRIPTION = "Provides support for BGP VPN interconnections" # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2014-06-10T17:00:00-00:00" # The specific resources and/or attributes for the extension (optional). RESOURCE_NAME = 'bgpvpn' COLLECTION_NAME = 'bgpvpns' BGPVPN_L2 = 'l2' BGPVPN_L3 = 'l3' BGPVPN_RES = "bgpvpns" BGPVPN_TYPES = [BGPVPN_L3, BGPVPN_L2] NETWORK_ASSOCIATION = 'network_association' NETWORK_ASSOCIATIONS = 'network_associations' ROUTER_ASSOCIATION = 'router_association' ROUTER_ASSOCIATIONS = 'router_associations' # The resource attribute map for the extension. RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True, 'enforce_policy': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'required_by_policy': True, 'is_visible': True, 'enforce_policy': True}, 'name': {'allow_post': True, 'allow_put': True, 'default': '', 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, 'is_visible': True, 'enforce_policy': True}, 'type': {'allow_post': True, 'allow_put': False, 'default': BGPVPN_L3, 'validate': {'type:values': BGPVPN_TYPES}, 'is_visible': True, 'enforce_policy': True}, 'route_targets': {'allow_post': True, 'allow_put': True, 'default': [], 'convert_to': converters.convert_to_list, 'validate': {'type:list_of_regex_or_none': RTRD_REGEX}, 'is_visible': True, 'enforce_policy': True}, 'import_targets': {'allow_post': True, 'allow_put': True, 'default': [], 'convert_to': converters.convert_to_list, 'validate': {'type:list_of_regex_or_none': RTRD_REGEX}, 'is_visible': True, 'enforce_policy': True}, 'export_targets': {'allow_post': True, 'allow_put': True, 'default': [], 'convert_to': converters.convert_to_list, 'validate': {'type:list_of_regex_or_none': RTRD_REGEX}, 'is_visible': True, 'enforce_policy': True}, 'route_distinguishers': {'allow_post': True, 'allow_put': True, 'default': [], 'convert_to': converters.convert_to_list, 'validate': {'type:list_of_regex_or_none': RTRD_REGEX}, 'is_visible': True, 'enforce_policy': True}, 'networks': {'allow_post': False, 'allow_put': False, 'is_visible': True, 'enforce_policy': True}, 'routers': {'allow_post': False, 'allow_put': False, 'is_visible': True, 'enforce_policy': True} }, } SUB_RESOURCE_ATTRIBUTE_MAP = { NETWORK_ASSOCIATIONS: { 'parent': {'collection_name': COLLECTION_NAME, 'member_name': RESOURCE_NAME}, 'parameters': { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'required_by_policy': True, 'is_visible': True, 'enforce_policy': True}, 'network_id': {'allow_post': True, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'enforce_policy': True} } }, ROUTER_ASSOCIATIONS: { 'parent': {'collection_name': COLLECTION_NAME, 'member_name': RESOURCE_NAME}, 'parameters': { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'required_by_policy': True, 'is_visible': True, 'enforce_policy': True}, 'router_id': {'allow_post': True, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'enforce_policy': True} } } } ACTION_MAP = { } # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [l3.ALIAS] # The list of optional extensions. OPTIONAL_EXTENSIONS = [ ] neutron-lib-1.13.0/neutron_lib/api/definitions/bgpvpn_vni.py0000666000175100017510000000550613231472055024216 0ustar zuulzuul00000000000000# # Copyright 2017 Ericsson India Global Services Pvt Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # from neutron_lib.api import converters as lib_converters from neutron_lib.api.definitions import bgpvpn from neutron_lib import constants VNI = 'vni' # The alias of the extension. ALIAS = 'bgpvpn-vni' # The label to lookup the plugin in the plugin directory. It can match the # alias, as required. LABEL = ALIAS # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'BGPVPN VXLAN VNI extension' # A prefix for API resources. An empty prefix means that the API is going # to be exposed at the v2/ level as any other core resource. API_PREFIX = '' # The description of the extension. DESCRIPTION = "BGPVPN VXLAN VNI extension" # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2017-09-12T10:00:00-00:00" RESOURCE_ATTRIBUTE_MAP = { bgpvpn.COLLECTION_NAME: { VNI: {'allow_post': True, 'allow_put': False, 'convert_to': lib_converters.convert_to_int_if_not_none, 'default': None, 'validate': {'type:range_or_none': [constants.MIN_VXLAN_VNI, constants.MAX_VXLAN_VNI] }, 'is_visible': True, 'enforce_policy': True}, }, } # The subresource attribute map for the extension. It adds child resources # to main extension's resource. The subresource map must have a parent and # a parameters entry. If an extension does not need such a map, None can # be specified (mandatory). SUB_RESOURCE_ATTRIBUTE_MAP = {} # The action map: it associates verbs with methods to be performed on # the API resource. ACTION_MAP = {} # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [bgpvpn.ALIAS] # The list of optional extensions. OPTIONAL_EXTENSIONS = [] neutron-lib-1.13.0/neutron_lib/api/definitions/_dummy.py0000666000175100017510000001013213231472055023327 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # A declaration of a dummy neutron extension: this may have a number of # constants being defined, and their aim is to document as much about # the extension as possible. # The alias of the extension. ALIAS = 'dummy' # The label to lookup the plugin in the plugin directory. It can match the # alias, as required. LABEL = 'DUMMY' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map (mandatory). IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension (mandatory). # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension (mandatory). NAME = 'Foo Extension' # A prefix for API resources. An empty prefix means that the API is going # to be exposed at the v2/ level as any other core resource (mandatory). API_PREFIX = '' # The description of the extension (mandatory). DESCRIPTION = "Provides support for foo" # A timestamp of when the extension was introduced (mandatory). UPDATED_TIMESTAMP = "2000-00-01T00:00:00-00:00" # The specific resources and/or attributes for the extension (optional). # In case of simple extensions, with single resource, the string constants # RESOURCE_NAME and COLLECTION_NAME can be used, otherwise string literals # can be used instead. # The name of the resource introduced or being extended # (in case it is defined by another extension, or it is # a core resource). RESOURCE_NAME = 'foo' # The plural for the resource introduced or being extended # (in case it is defined by another extension, or it is a # core resource). COLLECTION_NAME = 'fooes' # The resource attribute map for the extension. It is effectively the # bulk of the API contract alongside ACTION_MAP (mandatory). RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, } } # The subresource attribute map for the extension. It adds child resources # to main extension's resource. The subresource map must have a parent and # a parameters entry. If an extension does not need such a map, None can # be specified (mandatory). For example: SUB_RESOURCE_ATTRIBUTE_MAP = { 'subfoo': { 'parent': { 'collection_name': COLLECTION_NAME, 'member_name': RESOURCE_NAME}, 'parameters': { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, }, }, } # The action map: it associates verbs with methods to be performed on # the API resource (mandatory). For example: # # ACTION_MAP = { # RESOURCE_NAME: { # 'add_my_foo_bars': 'PUT', # 'remove_my_foo_bars': 'PUT', # 'get_my_foo_bars': 'GET' # } # } ACTION_MAP = { } # The action status: it associates response statuses with methods to be # performed on the API resource (mandatory). For example: # # ACTION_STATUS = { # 'create': 201, # 'delete': 204 # } ACTION_STATUS = { } # The list of required extensions (mandatory). REQUIRED_EXTENSIONS = [ ] # The list of optional extensions (mandatory). OPTIONAL_EXTENSIONS = [ ] # TODO(armax): add support for modeling custom queries neutron-lib-1.13.0/neutron_lib/api/definitions/external_net.py0000666000175100017510000000311313231472055024526 0ustar zuulzuul00000000000000# Copyright (c) 2013 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import network # For backward compatibility the 'router' prefix is kept. EXTERNAL = 'router:external' ALIAS = 'external-net' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Neutron external network' API_PREFIX = '' DESCRIPTION = 'Adds external network attribute to network resource.' UPDATED_TIMESTAMP = '2013-01-14T10:00:00-00:00' RESOURCE_NAME = network.RESOURCE_NAME COLLECTION_NAME = network.COLLECTION_NAME RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { EXTERNAL: { 'allow_post': True, 'allow_put': True, 'default': False, 'is_visible': True, 'convert_to': converters.convert_to_boolean, 'enforce_policy': True, 'required_by_policy': True } } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/l3.py0000666000175100017510000001500213231472055022354 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.db import constants # The alias of the extension. ALIAS = 'router' # The label to lookup the plugin in the plugin directory. It can match the # alias, as required. LABEL = 'router' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'Neutron L3 Router' # A prefix for API resources. An empty prefix means that the API is going # to be exposed at the v2/ level as any other core resource. API_PREFIX = '' # The description of the extension. DESCRIPTION = ("Router abstraction for basic L3 forwarding " "between L2 Neutron networks and access to external " "networks via a NAT gateway.") # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2012-07-20T10:00:00-00:00" FLOATING_IP_ADDRESS = 'floating_ip_address' FLOATING_NETWORK_ID = 'floating_network_id' FLOATINGIP = 'floatingip' FLOATINGIPS = 'floatingips' ROUTERS = 'routers' ROUTER = 'router' SUBNET_ID = 'subnet_id' ROUTER_ID = 'router_id' PORT_ID = 'port_id' FIXED_IP_ADDRESS = 'fixed_ip_address' EXTERNAL_GW_INFO = 'external_gateway_info' RESOURCE_ATTRIBUTE_MAP = { ROUTERS: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': constants.NAME_FIELD_SIZE}, 'is_visible': True, 'default': ''}, 'admin_state_up': {'allow_post': True, 'allow_put': True, 'default': True, 'convert_to': converters.convert_to_boolean, 'is_visible': True}, 'status': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': { 'type:string': constants.PROJECT_ID_FIELD_SIZE}, 'is_visible': True}, EXTERNAL_GW_INFO: {'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': None, 'enforce_policy': True, 'validate': { 'type:dict_or_nodata': { 'network_id': {'type:uuid': None, 'required': True}, 'external_fixed_ips': { 'convert_list_to': converters.convert_kvp_list_to_dict, 'type:fixed_ips': None, 'default': None, 'required': False, } } }} }, FLOATINGIPS: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'floating_ip_address': {'allow_post': True, 'allow_put': False, 'validate': {'type:ip_address_or_none': None}, 'is_visible': True, 'default': None, 'enforce_policy': True}, 'subnet_id': {'allow_post': True, 'allow_put': False, 'validate': {'type:uuid_or_none': None}, 'is_visible': False, # Use False for input only attr 'default': None}, 'floating_network_id': {'allow_post': True, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True}, 'router_id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid_or_none': None}, 'is_visible': True, 'default': None}, 'port_id': {'allow_post': True, 'allow_put': True, 'validate': {'type:uuid_or_none': None}, 'is_visible': True, 'default': None, 'required_by_policy': True}, 'fixed_ip_address': {'allow_post': True, 'allow_put': True, 'validate': {'type:ip_address_or_none': None}, 'is_visible': True, 'default': None}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': { 'type:string': constants.PROJECT_ID_FIELD_SIZE}, 'is_visible': True}, 'status': {'allow_post': False, 'allow_put': False, 'is_visible': True}, }, } # The subresource attribute map for the extension. It adds child resources # to main extension's resource. The subresource map must have a parent and # a parameters entry. If an extension does not need such a map, None can # be specified (mandatory). SUB_RESOURCE_ATTRIBUTE_MAP = None # The action map: it associates verbs with methods to be performed on # the API resource. ACTION_MAP = { ROUTER: { 'add_router_interface': 'PUT', 'remove_router_interface': 'PUT' } } # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [ ] # The list of optional extensions. OPTIONAL_EXTENSIONS = [ ] neutron-lib-1.13.0/neutron_lib/api/definitions/allowedaddresspairs.py0000666000175100017510000000361413231472055026100 0ustar zuulzuul00000000000000# Copyright 2013 VMware, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import port from neutron_lib.api import validators from neutron_lib.api.validators import allowedaddresspairs as addr_validation from neutron_lib import constants validators.add_validator('allowed_address_pairs', addr_validation._validate_allowed_address_pairs) ADDRESS_PAIRS = 'allowed_address_pairs' ALIAS = 'allowed-address-pairs' LABEL = ALIAS IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Allowed Address Pairs' API_PREFIX = '' DESCRIPTION = 'Provides allowed address pairs' UPDATED_TIMESTAMP = '2013-07-23T10:00:00-00:00' RESOURCE_NAME = port.RESOURCE_NAME COLLECTION_NAME = port.COLLECTION_NAME RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { ADDRESS_PAIRS: { 'allow_post': True, 'allow_put': True, 'convert_to': converters.convert_none_to_empty_list, 'convert_list_to': converters.convert_kvp_list_to_dict, 'validate': {'type:allowed_address_pairs': None}, 'enforce_policy': True, 'default': constants.ATTR_NOT_SPECIFIED, 'is_visible': True}, } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/sorting.py0000666000175100017510000000163413231472055023531 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. ALIAS = 'sorting' IS_SHIM_EXTENSION = True IS_STANDARD_ATTR_EXTENSION = False NAME = 'Sorting support' API_PREFIX = '' DESCRIPTION = 'Extension that indicates that sorting is enabled.' UPDATED_TIMESTAMP = '2016-06-12T00:00:00-00:00' RESOURCE_ATTRIBUTE_MAP = {} SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/multiprovidernet.py0000666000175100017510000000506613231472055025463 0ustar zuulzuul00000000000000# Copyright (c) 2013 OpenStack Foundation. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import network from neutron_lib.api import validators from neutron_lib.api.validators import multiprovidernet as mp_validator from neutron_lib import constants from neutron_lib.exceptions import multiprovidernet as mp_exc def check_duplicate_segments(segments, is_partial_func=None): """Helper function checking duplicate segments. If is_partial_funcs is specified and not None, then SegmentsContainDuplicateEntry is raised if two segments are identical and non partially defined (is_partial_func(segment) == False). Otherwise SegmentsContainDuplicateEntry is raised if two segment are identical. """ if is_partial_func is not None: segments = [s for s in segments if not is_partial_func(s)] fully_specifieds = [tuple(sorted(s.items())) for s in segments] if len(set(fully_specifieds)) != len(fully_specifieds): raise mp_exc.SegmentsContainDuplicateEntry() validators.add_validator( 'network_segments', mp_validator.convert_and_validate_segments) SEGMENTS = 'segments' ALIAS = 'multi-provider' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Multi Provider Network' API_PREFIX = '' DESCRIPTION = ("Expose mapping of virtual networks to multiple physical " "networks") UPDATED_TIMESTAMP = '2013-06-27T10:00:00-00:00' RESOURCE_NAME = network.RESOURCE_NAME COLLECTION_NAME = network.COLLECTION_NAME RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { SEGMENTS: { 'allow_post': True, 'allow_put': True, 'validate': {'type:network_segments': None}, 'convert_list_to': converters.convert_kvp_list_to_dict, 'default': constants.ATTR_NOT_SPECIFIED, 'enforce_policy': True, 'is_visible': True }, } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/subnetpool.py0000666000175100017510000001013413231472055024231 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib import constants from neutron_lib.db import constants as db_const NAME = 'Neutron L3 Subnet Pool' ALIAS = 'subnetpool' DESCRIPTION = "Layer 3 subnet pool abstraction" UPDATED_TIMESTAMP = "2012-01-01T10:00:00-00:00" RESOURCE_NAME = 'subnetpool' COLLECTION_NAME = 'subnetpools' RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': {'type:not_empty_string': None}, 'is_visible': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'required_by_policy': True, 'is_visible': True}, 'prefixes': {'allow_post': True, 'allow_put': True, 'validate': {'type:subnet_list': None}, 'is_visible': True}, 'default_quota': {'allow_post': True, 'allow_put': True, 'validate': {'type:non_negative': None}, 'convert_to': converters.convert_to_int, 'default': constants.ATTR_NOT_SPECIFIED, 'is_visible': True}, 'ip_version': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'default_prefixlen': {'allow_post': True, 'allow_put': True, 'validate': {'type:non_negative': None}, 'convert_to': converters.convert_to_int, 'default': constants.ATTR_NOT_SPECIFIED, 'is_visible': True}, 'min_prefixlen': {'allow_post': True, 'allow_put': True, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': {'type:non_negative': None}, 'convert_to': converters.convert_to_int, 'is_visible': True}, 'max_prefixlen': {'allow_post': True, 'allow_put': True, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': {'type:non_negative': None}, 'convert_to': converters.convert_to_int, 'is_visible': True}, 'is_default': {'allow_post': True, 'allow_put': True, 'default': False, 'convert_to': converters.convert_to_boolean, 'is_visible': True, 'required_by_policy': True, 'enforce_policy': True}, constants.SHARED: { 'allow_post': True, 'allow_put': False, 'default': False, 'convert_to': converters.convert_to_boolean, 'is_visible': True, 'required_by_policy': True, 'enforce_policy': True } } } # This is a core resource so the following are not applicable. IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/subnet_onboard.py0000666000175100017510000000424613231472055025052 0ustar zuulzuul00000000000000# (c) Copyright 2016 Hewlett Packard Enterprise Development LP # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import subnet as subnet_def from neutron_lib.api.definitions import subnetpool as subnetpool_def import neutron_lib.constants ALIAS = "subnet_onboard" IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = "Subnet Onboard" DESCRIPTION = "Provides support for onboarding subnets into subnet pools" UPDATED_TIMESTAMP = "2017-07-27T10:00:00-00:00" ONBOARD_SUBNETS = 'onboard_network_subnets' ONBOARD_SUBNETS_SPECS = { 'id': {'type:uuid': None, 'required': True}, 'network_id': {'type:uuid': None, 'required': True}, 'ip_version': {'convert_to': converters.convert_to_int, 'type:values': [4, 6], 'required': True} } RESOURCE_ATTRIBUTE_MAP = { subnetpool_def.COLLECTION_NAME: { subnet_def.COLLECTION_NAME: { 'allow_post': True, 'allow_put': True, 'validate': { 'type:list_of_any_key_specs_or_none': ONBOARD_SUBNETS_SPECS } } } } # The subresource attribute map for the extension. This extension has only # top level resources, not child resources, so this is set to an empty dict. SUB_RESOURCE_ATTRIBUTE_MAP = { } # The action map. ACTION_MAP = { subnetpool_def.RESOURCE_NAME: { ONBOARD_SUBNETS: 'PUT' } } # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [neutron_lib.constants.SUBNET_ALLOCATION_EXT_ALIAS] # The list of optional extensions. OPTIONAL_EXTENSIONS = [ ] neutron-lib-1.13.0/neutron_lib/api/definitions/flavors.py0000666000175100017510000001314213231472055023515 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.db import constants as db_const FLAVOR = 'flavor' FLAVORS = FLAVOR + 's' SERVICE_PROFILES = 'service_profiles' NEXT_PROVIDERS = 'next_providers' ALIAS = FLAVORS IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Neutron Service Flavors' API_PREFIX = '' DESCRIPTION = 'Flavor specification for Neutron advanced services.' UPDATED_TIMESTAMP = '2015-09-17T10:00:00-00:00' RESOURCE_ATTRIBUTE_MAP = { FLAVORS: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, 'is_visible': True, 'default': ''}, 'description': {'allow_post': True, 'allow_put': True, 'validate': {'type:string_or_none': db_const.LONG_DESCRIPTION_FIELD_SIZE}, 'is_visible': True, 'default': ''}, 'service_type': {'allow_post': True, 'allow_put': False, 'validate': {'type:service_plugin_type': None}, 'is_visible': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'is_visible': True}, 'service_profiles': {'allow_post': True, 'allow_put': True, 'validate': {'type:uuid_list': None}, 'is_visible': True, 'default': []}, 'enabled': {'allow_post': True, 'allow_put': True, 'convert_to': converters.convert_to_boolean_if_not_none, 'default': True, 'is_visible': True}, }, SERVICE_PROFILES: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'description': {'allow_post': True, 'allow_put': True, 'validate': {'type:string_or_none': db_const.LONG_DESCRIPTION_FIELD_SIZE}, 'is_visible': True, 'default': ''}, 'driver': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.LONG_DESCRIPTION_FIELD_SIZE}, 'is_visible': True, 'default': ''}, 'metainfo': {'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': ''}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'is_visible': True}, 'enabled': {'allow_post': True, 'allow_put': True, 'convert_to': converters.convert_to_boolean_if_not_none, 'is_visible': True, 'default': True}, }, } SUB_RESOURCE_ATTRIBUTE_MAP = { NEXT_PROVIDERS: { 'parent': {'collection_name': FLAVORS, 'member_name': FLAVOR}, 'parameters': {'provider': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'driver': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'metainfo': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'is_visible': True}} }, SERVICE_PROFILES: { 'parent': {'collection_name': FLAVORS, 'member_name': FLAVOR}, 'parameters': {'id': {'allow_post': True, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'is_visible': True}} } } ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/port_security.py0000666000175100017510000000606613231472055024763 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import network from neutron_lib.api.definitions import port from neutron_lib import constants DEFAULT_PORT_SECURITY = True PORTSECURITY = 'port_security_enabled' # The alias of the extension. ALIAS = 'port-security' # The label to lookup the plugin in the plugin directory. It can match the # alias, as required. LABEL = 'port-security' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'Port Security' # A prefix for API resources. An empty prefix means that the API is going # to be exposed at the v2/ level as any other core resource. API_PREFIX = '' # The description of the extension. DESCRIPTION = "Provides port security" # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2012-07-23T10:00:00-00:00" RESOURCE_ATTRIBUTE_MAP = { network.COLLECTION_NAME: { PORTSECURITY: {'allow_post': True, 'allow_put': True, 'convert_to': converters.convert_to_boolean, 'enforce_policy': True, 'default': DEFAULT_PORT_SECURITY, 'is_visible': True}, }, port.COLLECTION_NAME: { PORTSECURITY: {'allow_post': True, 'allow_put': True, 'convert_to': converters.convert_to_boolean, 'default': constants.ATTR_NOT_SPECIFIED, 'enforce_policy': True, 'is_visible': True}, } } # The subresource attribute map for the extension. It adds child resources # to main extension's resource. The subresource map must have a parent and # a parameters entry. If an extension does not need such a map, None can # be specified (mandatory). SUB_RESOURCE_ATTRIBUTE_MAP = {} # The action map: it associates verbs with methods to be performed on # the API resource. ACTION_MAP = {} # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [] # The list of optional extensions. OPTIONAL_EXTENSIONS = [] neutron-lib-1.13.0/neutron_lib/api/definitions/data_plane_status.py0000666000175100017510000000507313231472055025540 0ustar zuulzuul00000000000000# Copyright (c) 2017 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import port from neutron_lib import constants VALID_VALUES = [None, constants.ACTIVE, constants.DOWN] # The alias of the extension. ALIAS = 'data-plane-status' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'Port data plane status extension' # The description of the extension. DESCRIPTION = "Expose status of underlying data plane" # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2017-01-24T10:00:00-00:00" # The name of the resource introduced or being extended. RESOURCE_NAME = port.RESOURCE_NAME # The plural for the resource introduced or being extended. COLLECTION_NAME = port.COLLECTION_NAME # The specific resources and/or attributes for the extension (optional). DATA_PLANE_STATUS = 'data_plane_status' # The resource attribute map for the extension. RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { DATA_PLANE_STATUS: {'allow_post': False, 'allow_put': True, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': {'type:values': VALID_VALUES}, 'is_visible': True, 'enforce_policy': True, } }, } # The subresource attribute map for the extension. SUB_RESOURCE_ATTRIBUTE_MAP = { } # The action map. ACTION_MAP = { } # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [ ] # The list of optional extensions. OPTIONAL_EXTENSIONS = [ ] neutron-lib-1.13.0/neutron_lib/api/definitions/segment.py0000666000175100017510000000730213231472055023504 0ustar zuulzuul00000000000000# Copyright (c) 2016 Hewlett Packard Enterprise Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import provider_net from neutron_lib.api.definitions import subnet from neutron_lib import constants from neutron_lib.db import constants as db_constants SEGMENT_ID = 'segment_id' NETWORK_TYPE = 'network_type' PHYSICAL_NETWORK = 'physical_network' SEGMENTATION_ID = 'segmentation_id' NAME_LEN = db_constants.NAME_FIELD_SIZE DESC_LEN = db_constants.DESCRIPTION_FIELD_SIZE ALIAS = 'segment' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Segment' API_PREFIX = '' DESCRIPTION = 'Segments extension.' UPDATED_TIMESTAMP = '2016-02-24T17:00:00-00:00' RESOURCE_NAME = 'segment' COLLECTION_NAME = RESOURCE_NAME + 's' RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'id': { 'allow_post': False, 'allow_put': False, 'validate': { 'type:uuid': None }, 'is_visible': True, 'primary_key': True }, 'tenant_id': { 'allow_post': True, 'allow_put': False, 'validate': { 'type:string': db_constants.PROJECT_ID_FIELD_SIZE }, 'is_visible': False}, 'network_id': { 'allow_post': True, 'allow_put': False, 'validate': { 'type:uuid': None }, 'is_visible': True }, PHYSICAL_NETWORK: { 'allow_post': True, 'allow_put': False, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': { 'type:string': provider_net.PHYSICAL_NETWORK_MAX_LEN }, 'is_visible': True }, NETWORK_TYPE: { 'allow_post': True, 'allow_put': False, 'validate': { 'type:string': provider_net.NETWORK_TYPE_MAX_LEN }, 'is_visible': True }, SEGMENTATION_ID: { 'allow_post': True, 'allow_put': False, 'default': constants.ATTR_NOT_SPECIFIED, 'convert_to': converters.convert_to_int, 'is_visible': True }, 'name': { 'allow_post': True, 'allow_put': True, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': { 'type:string_or_none': NAME_LEN }, 'is_visible': True }, 'description': { 'allow_post': True, 'allow_put': True, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': { 'type:string_or_none': DESC_LEN }, 'is_visible': True } }, subnet.COLLECTION_NAME: { SEGMENT_ID: { 'allow_post': True, 'allow_put': False, 'default': None, 'validate': { 'type:uuid_or_none': None }, 'is_visible': True } } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/pagination.py0000666000175100017510000000164613231472055024200 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. ALIAS = 'pagination' IS_SHIM_EXTENSION = True IS_STANDARD_ATTR_EXTENSION = False NAME = 'Pagination support' API_PREFIX = '' DESCRIPTION = 'Extension that indicates that pagination is enabled.' UPDATED_TIMESTAMP = '2016-06-12T00:00:00-00:00' RESOURCE_ATTRIBUTE_MAP = {} SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/port.py0000666000175100017510000000675713231472055023043 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib import constants from neutron_lib.db import constants as db_const NAME = 'Neutron Port' ALIAS = 'port' DESCRIPTION = "Network port abstraction" UPDATED_TIMESTAMP = "2012-01-01T10:00:00-00:00" RESOURCE_NAME = 'port' COLLECTION_NAME = 'ports' RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'name': {'allow_post': True, 'allow_put': True, 'default': '', 'validate': { 'type:string': db_const.NAME_FIELD_SIZE}, 'is_visible': True}, 'network_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': {'type:uuid': None}, 'is_visible': True}, 'admin_state_up': {'allow_post': True, 'allow_put': True, 'default': True, 'convert_to': converters.convert_to_boolean, 'is_visible': True}, 'mac_address': {'allow_post': True, 'allow_put': True, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': {'type:mac_address': None}, 'enforce_policy': True, 'is_visible': True}, 'fixed_ips': {'allow_post': True, 'allow_put': True, 'default': constants.ATTR_NOT_SPECIFIED, 'convert_list_to': converters.convert_kvp_list_to_dict, 'validate': {'type:fixed_ips': None}, 'enforce_policy': True, 'is_visible': True}, 'device_id': {'allow_post': True, 'allow_put': True, 'validate': { 'type:string': db_const.DEVICE_ID_FIELD_SIZE}, 'default': '', 'is_visible': True}, 'device_owner': {'allow_post': True, 'allow_put': True, 'validate': { 'type:string': db_const.DEVICE_OWNER_FIELD_SIZE}, 'default': '', 'enforce_policy': True, 'is_visible': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'required_by_policy': True, 'is_visible': True}, 'status': {'allow_post': False, 'allow_put': False, 'is_visible': True}, } } # This is a core resource so the following are not applicable. IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/firewall.py0000666000175100017510000002063313231472055023651 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import constants as api_const from neutron_lib import constants from neutron_lib.db import constants as db_const # The alias of the extension. ALIAS = 'fwaas' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'FWaaS v1' # The description of the extension. DESCRIPTION = "Provides support for firewall-as-a-service version 1" # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2016-01-01T10:00:00-00:00" # Base for the API calls API_PREFIX = '/fw' RESOURCE_ATTRIBUTE_MAP = { api_const.FIREWALL_RULES: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'is_visible': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, 'is_visible': True, 'default': ''}, 'description': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.DESCRIPTION_FIELD_SIZE}, 'is_visible': True, 'default': ''}, 'firewall_policy_id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid_or_none': None}, 'is_visible': True}, constants.SHARED: { 'allow_post': True, 'allow_put': True, 'default': False, 'convert_to': converters.convert_to_boolean, 'is_visible': True, 'required_by_policy': True, 'enforce_policy': True }, 'protocol': { 'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': None, 'convert_to': converters.convert_to_protocol, 'validate': {'type:values': api_const.FW_PROTOCOL_VALUES}}, 'ip_version': {'allow_post': True, 'allow_put': True, 'default': 4, 'convert_to': converters.convert_to_int, 'validate': {'type:values': [4, 6]}, 'is_visible': True}, 'source_ip_address': {'allow_post': True, 'allow_put': True, 'validate': {'type:ip_or_subnet_or_none': None}, 'is_visible': True, 'default': None}, 'destination_ip_address': {'allow_post': True, 'allow_put': True, 'validate': {'type:ip_or_subnet_or_none': None}, 'is_visible': True, 'default': None}, 'source_port': {'allow_post': True, 'allow_put': True, 'validate': {'type:port_range': None}, 'convert_to': converters.convert_to_string, 'default': None, 'is_visible': True}, 'destination_port': {'allow_post': True, 'allow_put': True, 'validate': {'type:port_range': None}, 'convert_to': converters.convert_to_string, 'default': None, 'is_visible': True}, 'position': {'allow_post': False, 'allow_put': False, 'default': None, 'is_visible': True}, 'action': {'allow_post': True, 'allow_put': True, 'convert_to': converters.convert_string_to_case_insensitive, 'validate': {'type:values': api_const.FW_VALID_ACTION_VALUES}, 'is_visible': True, 'default': 'deny'}, 'enabled': {'allow_post': True, 'allow_put': True, 'default': True, 'is_visible': True, 'convert_to': converters.convert_to_boolean}, }, api_const.FIREWALL_POLICIES: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'is_visible': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, 'is_visible': True, 'default': ''}, 'description': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.DESCRIPTION_FIELD_SIZE}, 'is_visible': True, 'default': ''}, constants.SHARED: { 'allow_post': True, 'allow_put': True, 'default': False, 'enforce_policy': True, 'convert_to': converters.convert_to_boolean, 'is_visible': True, 'required_by_policy': True }, 'firewall_rules': {'allow_post': True, 'allow_put': True, 'validate': {'type:uuid_list': None}, 'convert_to': converters.convert_none_to_empty_list, 'default': None, 'is_visible': True}, 'audited': {'allow_post': True, 'allow_put': True, 'default': False, 'is_visible': True, 'convert_to': converters.convert_to_boolean}, }, api_const.FIREWALLS: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'is_visible': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, 'is_visible': True, 'default': ''}, 'description': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.DESCRIPTION_FIELD_SIZE}, 'is_visible': True, 'default': ''}, 'admin_state_up': {'allow_post': True, 'allow_put': True, 'default': True, 'is_visible': True, 'convert_to': converters.convert_to_boolean}, 'status': {'allow_post': False, 'allow_put': False, 'is_visible': True}, constants.SHARED: { 'allow_post': True, 'allow_put': True, 'default': False, 'enforce_policy': True, 'convert_to': converters.convert_to_boolean, 'is_visible': False, 'required_by_policy': True }, 'firewall_policy_id': {'allow_post': True, 'allow_put': True, 'validate': {'type:uuid_or_none': None}, 'is_visible': True}, }, } # The subresource attribute map for the extension. This extension has only # top level resources, not child resources, so this is set to an empty dict. SUB_RESOURCE_ATTRIBUTE_MAP = { } # The action map. ACTION_MAP = { 'firewall_policy': {'insert_rule': 'PUT', 'remove_rule': 'PUT'}, } # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [ ] # The list of optional extensions. OPTIONAL_EXTENSIONS = [ ] neutron-lib-1.13.0/neutron_lib/api/definitions/availability_zone.py0000666000175100017510000000313313231472055025545 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. from neutron_lib.api.definitions import agent from neutron_lib.api import validators from neutron_lib.api.validators import availability_zone as az_validator validators.add_validator('availability_zone_hint_list', az_validator._validate_availability_zone_hints) AZ_HINTS = 'availability_zone_hints' ALIAS = 'availability_zone' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Availability Zone' API_PREFIX = '' DESCRIPTION = 'The availability zone extension.' UPDATED_TIMESTAMP = '2015-01-01T10:00:00-00:00' RESOURCE_NAME = 'availability_zone' COLLECTION_NAME = RESOURCE_NAME + 's' RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'name': {'is_visible': True}, 'resource': {'is_visible': True}, 'state': {'is_visible': True} }, agent.COLLECTION_NAME: { RESOURCE_NAME: { 'allow_post': False, 'allow_put': False, 'is_visible': True} } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [agent.ALIAS] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/auto_allocated_topology.py0000666000175100017510000000400413231472055026752 0ustar zuulzuul00000000000000# Copyright 2015-2016 Hewlett Packard Enterprise Development Company, LP # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import constants from neutron_lib.api.definitions import l3 from neutron_lib.api.definitions import network ALIAS = 'auto-allocated-topology' LABEL = ALIAS IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Auto Allocated Topology Services' API_PREFIX = '' DESCRIPTION = 'Auto Allocated Topology Services.' UPDATED_TIMESTAMP = '2016-01-01T00:00:00-00:00' RESOURCE_NAME = 'auto_allocated_topology' COLLECTION_NAME = 'auto_allocated_topologies' RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True}, 'tenant_id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True}, }, network.COLLECTION_NAME: { constants.IS_DEFAULT: { 'allow_post': True, 'allow_put': True, 'default': False, 'is_visible': True, 'convert_to': converters.convert_to_boolean, 'enforce_policy': True, 'required_by_policy': True}}, } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [l3.ALIAS, 'subnet_allocation', 'external-net'] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/dns_domain_ports.py0000666000175100017510000000615613231472055025412 0ustar zuulzuul00000000000000# Copyright (c) 2017 IBM # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters as convert from neutron_lib.api.definitions import dns from neutron_lib.api.definitions import port from neutron_lib.db import constants # The alias of the extension. ALIAS = 'dns-domain-ports' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map (mandatory). IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension (mandatory). # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension (mandatory). NAME = 'dns_domain for ports' # The description of the extension (mandatory). DESCRIPTION = "Allows the DNS domain to be specified for a network port." # A timestamp of when the extension was introduced (mandatory). UPDATED_TIMESTAMP = "2017-04-24T10:00:00-00:00" # The specific resources and/or attributes for the extension (optional). # In case of simple extensions, with single resource, the string constants # RESOURCE_NAME and COLLECTION_NAME can be used, otherwise string literals # can be used instead. # The name of the resource introduced or being extended # (in case it is defined by another extension, or it is # a core resource). RESOURCE_NAME = port.RESOURCE_NAME # The plural for the resource introduced or being extended # (in case it is defined by another extension, or it is a # core resource). COLLECTION_NAME = port.COLLECTION_NAME # The resource attribute map for the extension. It is effectively the # bulk of the API contract alongside ACTION_MAP (mandatory). RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { dns.DNSDOMAIN: {'allow_post': True, 'allow_put': True, 'default': '', 'convert_to': convert.convert_string_to_case_insensitive, 'validate': {'type:dns_domain_name': constants.FQDN_FIELD_SIZE}, 'is_visible': True}, }, } # The subresource attribute map for the extension. SUB_RESOURCE_ATTRIBUTE_MAP = { } # The action map ACTION_MAP = { } # The action status ACTION_STATUS = { } # The list of required extensions (mandatory). REQUIRED_EXTENSIONS = [dns.ALIAS] # The list of optional extensions (mandatory). OPTIONAL_EXTENSIONS = [ ] neutron-lib-1.13.0/neutron_lib/api/definitions/metering.py0000666000175100017510000000647713231472055023670 0ustar zuulzuul00000000000000# Copyright (C) 2013 eNovance SAS # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib import constants from neutron_lib.db import constants as db_const METERING_LABELS = 'metering_labels' METERING_LABEL_RULES = 'metering_label_rules' ALIAS = 'metering' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Neutron Metering' API_PREFIX = '' DESCRIPTION = 'Neutron Metering extension.' UPDATED_TIMESTAMP = '2013-06-12T10:00:00-00:00' RESOURCE_ATTRIBUTE_MAP = { METERING_LABELS: { 'id': { 'allow_post': False, 'allow_put': False, 'is_visible': True, 'primary_key': True }, 'name': { 'allow_post': True, 'allow_put': False, 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, 'is_visible': True, 'default': '' }, 'description': { 'allow_post': True, 'allow_put': False, 'validate': { 'type:string': db_const.LONG_DESCRIPTION_FIELD_SIZE}, 'is_visible': True, 'default': '' }, 'tenant_id': { 'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'is_visible': True }, constants.SHARED: { 'allow_post': True, 'allow_put': False, 'is_visible': True, 'default': False, 'convert_to': converters.convert_to_boolean } }, METERING_LABEL_RULES: { 'id': { 'allow_post': False, 'allow_put': False, 'is_visible': True, 'primary_key': True }, 'metering_label_id': { 'allow_post': True, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'required_by_policy': True }, 'direction': { 'allow_post': True, 'allow_put': False, 'is_visible': True, 'validate': {'type:values': ['ingress', 'egress']} }, 'excluded': { 'allow_post': True, 'allow_put': False, 'is_visible': True, 'default': False, 'convert_to': converters.convert_to_boolean }, 'remote_ip_prefix': { 'allow_post': True, 'allow_put': False, 'is_visible': True, 'required_by_policy': True, 'validate': {'type:subnet': None} }, 'tenant_id': { 'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': {'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'is_visible': True } } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/l3_ext_ha_mode.py0000666000175100017510000000270413231472055024715 0ustar zuulzuul00000000000000# Copyright (C) 2014 eNovance SAS # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import l3 from neutron_lib import constants HA_INFO = 'ha' ALIAS = constants.L3_HA_MODE_EXT_ALIAS IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'HA Router extension' API_PREFIX = '' DESCRIPTION = 'Adds HA capability to routers.' UPDATED_TIMESTAMP = '2014-04-26T00:00:00-00:00' RESOURCE_NAME = l3.ROUTER COLLECTION_NAME = l3.ROUTERS RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { HA_INFO: { 'allow_post': True, 'allow_put': True, 'default': constants.ATTR_NOT_SPECIFIED, 'is_visible': True, 'enforce_policy': True, 'convert_to': converters.convert_to_boolean_if_not_none } } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [l3.ALIAS] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/address_scope.py0000666000175100017510000000636013231472055024663 0ustar zuulzuul00000000000000# Copyright (c) 2015 Huawei Technologies Co.,LTD. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib import constants from neutron_lib.db import constants as db_constants ADDRESS_SCOPE = 'address_scope' ADDRESS_SCOPE_ID = 'address_scope_id' IPV4_ADDRESS_SCOPE = 'ipv4_%s' % ADDRESS_SCOPE IPV6_ADDRESS_SCOPE = 'ipv6_%s' % ADDRESS_SCOPE ALIAS = 'address-scope' LABEL = ALIAS IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Address scope' API_PREFIX = '' DESCRIPTION = 'Address scopes extension.' UPDATED_TIMESTAMP = '2015-07-26T10:00:00-00:00' RESOURCE_NAME = ADDRESS_SCOPE COLLECTION_NAME = RESOURCE_NAME + 's' RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'name': {'allow_post': True, 'allow_put': True, 'default': '', 'validate': {'type:string': db_constants.NAME_FIELD_SIZE}, 'is_visible': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'validate': { 'type:string': db_constants.PROJECT_ID_FIELD_SIZE}, 'required_by_policy': True, 'is_visible': True}, constants.SHARED: {'allow_post': True, 'allow_put': True, 'default': False, 'convert_to': converters.convert_to_boolean, 'is_visible': True, 'required_by_policy': True, 'enforce_policy': True}, 'ip_version': {'allow_post': True, 'allow_put': False, 'convert_to': converters.convert_to_int, 'validate': {'type:values': [4, 6]}, 'is_visible': True}, }, 'subnetpools': { ADDRESS_SCOPE_ID: {'allow_post': True, 'allow_put': True, 'default': constants.ATTR_NOT_SPECIFIED, 'validate': {'type:uuid_or_none': None}, 'is_visible': True} }, 'networks': { IPV4_ADDRESS_SCOPE: {'allow_post': False, 'allow_put': False, 'is_visible': True}, IPV6_ADDRESS_SCOPE: {'allow_post': False, 'allow_put': False, 'is_visible': True}, } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/l3_ext_gw_mode.py0000666000175100017510000000413213231472055024737 0ustar zuulzuul00000000000000# Copyright 2013 VMware, Inc. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import l3 ALIAS = 'ext-gw-mode' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Neutron L3 Configurable external gateway mode' API_PREFIX = '' DESCRIPTION = ('Extension of the router abstraction for specifying whether ' 'SNAT should occur on the external gateway') UPDATED_TIMESTAMP = '2013-03-28T10:00:00-00:00' RESOURCE_NAME = l3.ROUTER COLLECTION_NAME = l3.ROUTERS RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { l3.EXTERNAL_GW_INFO: { 'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': None, 'enforce_policy': True, 'validate': { 'type:dict_or_nodata': { 'network_id': {'type:uuid': None, 'required': True}, 'enable_snat': {'type:boolean': None, 'required': False, 'convert_to': converters.convert_to_boolean}, 'external_fixed_ips': { 'convert_list_to': converters.convert_kvp_list_to_dict, 'type:fixed_ips': None, 'default': None, 'required': False } } } } } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [l3.ALIAS] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/agent.py0000666000175100017510000000505613231472055023144 0ustar zuulzuul00000000000000# Copyright (c) 2013 OpenStack Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. from neutron_lib.api import converters from neutron_lib.db import constants ALIAS = 'agent' LABEL = ALIAS IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = ALIAS API_PREFIX = '' DESCRIPTION = 'The agent management extension.' UPDATED_TIMESTAMP = '2013-02-03T10:00:00-00:00' RESOURCE_NAME = ALIAS COLLECTION_NAME = ALIAS + 's' RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True}, 'agent_type': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'binary': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'topic': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'host': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'admin_state_up': {'allow_post': False, 'allow_put': True, 'convert_to': converters.convert_to_boolean, 'is_visible': True}, 'created_at': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'started_at': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'heartbeat_timestamp': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'alive': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'configurations': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'description': { 'allow_post': False, 'allow_put': True, 'is_visible': True, 'validate': { 'type:string_or_none': constants.DESCRIPTION_FIELD_SIZE}}, } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/project_id.py0000666000175100017510000000166113231472055024166 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. ALIAS = 'project-id' IS_SHIM_EXTENSION = True IS_STANDARD_ATTR_EXTENSION = False NAME = 'project_id field enabled' API_PREFIX = '' DESCRIPTION = 'Extension that indicates that project_id field is enabled.' UPDATED_TIMESTAMP = '2016-09-09T09:09:09-09:09' RESOURCE_ATTRIBUTE_MAP = {} SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/constants.py0000666000175100017510000000212013231472055024047 0ustar zuulzuul00000000000000# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # neutron-fwaas constants from neutron_lib import constants FIREWALL_GROUPS = 'firewall_groups' FIREWALL_POLICIES = 'firewall_policies' FIREWALL_RULES = 'firewall_rules' FIREWALLS = 'firewalls' FWAAS_ALLOW = "allow" FWAAS_DENY = "deny" FWAAS_REJECT = "reject" FW_VALID_ACTION_VALUES = [FWAAS_ALLOW, FWAAS_DENY, FWAAS_REJECT] # Firewall Protocol List FW_PROTOCOL_VALUES = list(constants.IPTABLES_PROTOCOL_MAP.keys()) + [None] # a default resource, such as auto allocated topology is_default network IS_DEFAULT = 'is_default' neutron-lib-1.13.0/neutron_lib/api/definitions/ip_allocation.py0000666000175100017510000000262013231472055024655 0ustar zuulzuul00000000000000# Copyright (c) 2016 Hewlett Packard Enterprise Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import port IP_ALLOCATION = 'ip_allocation' IP_ALLOCATION_IMMEDIATE = 'immediate' IP_ALLOCATION_DEFERRED = 'deferred' IP_ALLOCATION_NONE = 'none' ALIAS = 'ip_allocation' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'IP Allocation' API_PREFIX = '' DESCRIPTION = 'IP allocation extension.' UPDATED_TIMESTAMP = '2016-06-10T23:00:00-00:00' RESOURCE_NAME = port.RESOURCE_NAME COLLECTION_NAME = port.COLLECTION_NAME RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { IP_ALLOCATION: { 'allow_post': False, 'allow_put': False, 'is_visible': True } } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/extraroute.py0000666000175100017510000000276013231472055024247 0ustar zuulzuul00000000000000# Copyright 2013, Nachi Ueno, NTT MCL, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import l3 from neutron_lib import constants ROUTES = 'routes' ALIAS = 'extraroute' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Neutron Extra Route' API_PREFIX = '' DESCRIPTION = 'Extra routes configuration for L3 router' UPDATED_TIMESTAMP = '2013-02-01T10:00:00-00:00' RESOURCE_NAME = l3.ROUTER COLLECTION_NAME = l3.ROUTERS RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { ROUTES: { 'allow_post': False, 'allow_put': True, 'validate': {'type:hostroutes': None}, 'convert_to': converters.convert_none_to_empty_list, 'is_visible': True, 'default': constants.ATTR_NOT_SPECIFIED}, } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [l3.ALIAS] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/vlantransparent.py0000666000175100017510000000371013231472055025263 0ustar zuulzuul00000000000000# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import network from neutron_lib.api import validators from neutron_lib import constants VLANTRANSPARENT = 'vlan_transparent' def get_vlan_transparent(network): """Get the value of vlan_transparent from a network if set. :param network: The network dict to retrieve the value of vlan_transparent from. :returns: The value of vlan_transparent from the network dict if set in the dict, otherwise False is returned. """ return (network[VLANTRANSPARENT] if (VLANTRANSPARENT in network and validators.is_attr_set(network[VLANTRANSPARENT])) else False) ALIAS = 'vlan-transparent' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Vlantransparent' API_PREFIX = '' DESCRIPTION = 'Provides Vlan Transparent Networks' UPDATED_TIMESTAMP = '2015-03-23T09:00:00-00:00' RESOURCE_ATTRIBUTE_MAP = { network.COLLECTION_NAME: { VLANTRANSPARENT: { 'allow_post': True, 'allow_put': False, 'convert_to': converters.convert_to_boolean, 'default': constants.ATTR_NOT_SPECIFIED, 'is_visible': True } } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/firewall_v2.py0000666000175100017510000002412613231472055024261 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import constants as api_const from neutron_lib.api.definitions import port from neutron_lib import constants from neutron_lib.db import constants as db_const # The alias of the extension. ALIAS = 'fwaas_v2' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'FWaaS v2' # The description of the extension. DESCRIPTION = "Provides support for firewall-as-a-service version 2" # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2016-10-06T10:00:00-00:00" # Base for the API calls API_PREFIX = '/fwaas' RESOURCE_ATTRIBUTE_MAP = { api_const.FIREWALL_RULES: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': {'type:string': db_const.UUID_FIELD_SIZE}, 'is_visible': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, 'is_visible': True, 'default': ''}, 'description': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.DESCRIPTION_FIELD_SIZE}, 'is_visible': True, 'default': ''}, 'firewall_policy_id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid_or_none': None}, 'is_visible': True}, constants.SHARED: { 'allow_post': True, 'allow_put': True, 'default': False, 'is_visible': True, 'convert_to': converters.convert_to_boolean, 'required_by_policy': True, 'enforce_policy': True }, 'protocol': { 'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': None, 'convert_to': converters.convert_to_protocol, 'validate': {'type:values': api_const.FW_PROTOCOL_VALUES}}, 'ip_version': {'allow_post': True, 'allow_put': True, 'default': 4, 'convert_to': converters.convert_to_int, 'validate': {'type:values': [4, 6]}, 'is_visible': True}, 'source_ip_address': {'allow_post': True, 'allow_put': True, 'validate': {'type:ip_or_subnet_or_none': None}, 'is_visible': True, 'default': None}, 'destination_ip_address': {'allow_post': True, 'allow_put': True, 'validate': {'type:ip_or_subnet_or_none': None}, 'is_visible': True, 'default': None}, 'source_port': {'allow_post': True, 'allow_put': True, 'validate': {'type:port_range': None}, 'convert_to': converters.convert_to_string, 'default': None, 'is_visible': True}, 'destination_port': {'allow_post': True, 'allow_put': True, 'validate': {'type:port_range': None}, 'convert_to': converters.convert_to_string, 'default': None, 'is_visible': True}, 'position': {'allow_post': False, 'allow_put': False, 'default': None, 'is_visible': True}, 'action': {'allow_post': True, 'allow_put': True, 'convert_to': converters.convert_string_to_case_insensitive, 'validate': {'type:values': api_const.FW_VALID_ACTION_VALUES}, 'is_visible': True, 'default': 'deny'}, 'enabled': {'allow_post': True, 'allow_put': True, 'convert_to': converters.convert_to_boolean, 'default': True, 'is_visible': True}, 'source_firewall_group_id': {'allow_post': True, 'allow_put': True, 'validate': {'type:uuid_or_none': None}, 'is_visible': True, 'default': None}, 'destination_firewall_group_id': {'allow_post': True, 'allow_put': True, 'validate': {'type:uuid_or_none': None}, 'is_visible': True, 'default': None}, }, api_const.FIREWALL_GROUPS: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, 'is_visible': True, 'default': ''}, 'description': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.DESCRIPTION_FIELD_SIZE}, 'is_visible': True, 'default': ''}, 'admin_state_up': {'allow_post': True, 'allow_put': True, 'default': True, 'is_visible': True, 'convert_to': converters.convert_to_boolean}, 'status': {'allow_post': False, 'allow_put': False, 'is_visible': True}, constants.SHARED: { 'allow_post': True, 'allow_put': True, 'default': False, 'convert_to': converters.convert_to_boolean, 'is_visible': True, 'required_by_policy': True, 'enforce_policy': True }, port.COLLECTION_NAME: {'allow_post': True, 'allow_put': True, 'validate': {'type:uuid_list': None}, 'convert_to': converters.convert_none_to_empty_list, 'default': None, 'is_visible': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': {'type:string': db_const.UUID_FIELD_SIZE}, 'is_visible': True}, 'ingress_firewall_policy_id': {'allow_post': True, 'allow_put': True, 'validate': {'type:uuid_or_none': None}, 'default': None, 'is_visible': True}, 'egress_firewall_policy_id': {'allow_post': True, 'allow_put': True, 'validate': {'type:uuid_or_none': None}, 'default': None, 'is_visible': True}, }, api_const.FIREWALL_POLICIES: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': {'type:string': db_const.UUID_FIELD_SIZE}, 'is_visible': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, 'is_visible': True, 'default': ''}, 'description': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.DESCRIPTION_FIELD_SIZE}, 'is_visible': True, 'default': ''}, constants.SHARED: { 'allow_post': True, 'allow_put': True, 'default': False, 'convert_to': converters.convert_to_boolean, 'is_visible': True, 'required_by_policy': True, 'enforce_policy': True }, api_const.FIREWALL_RULES: {'allow_post': True, 'allow_put': True, 'validate': {'type:uuid_list': None}, 'convert_to': converters.convert_none_to_empty_list, 'default': None, 'is_visible': True}, 'audited': {'allow_post': True, 'allow_put': True, 'default': False, 'convert_to': converters.convert_to_boolean, 'is_visible': True}, }, } # The subresource attribute map for the extension. This extension has only # top level resources, not child resources, so this is set to an empty dict. SUB_RESOURCE_ATTRIBUTE_MAP = { } # The action map. ACTION_MAP = { 'firewall_policy': {'insert_rule': 'PUT', 'remove_rule': 'PUT'}, } # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [ ] # The list of optional extensions. OPTIONAL_EXTENSIONS = [ ] neutron-lib-1.13.0/neutron_lib/api/definitions/routerservicetype.py0000666000175100017510000000251013231472055025641 0ustar zuulzuul00000000000000# Copyright 2013 VMware, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import l3 SERVICE_TYPE_ID = 'service_type_id' ALIAS = 'router-service-type' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Router Service Type' API_PREFIX = '' DESCRIPTION = 'Provides router service type' UPDATED_TIMESTAMP = '2013-01-29T00:00:00-00:00' RESOURCE_ATTRIBUTE_MAP = { l3.ROUTERS: { SERVICE_TYPE_ID: { 'allow_post': True, 'allow_put': False, 'validate': { 'type:uuid_or_none': None }, 'default': None, 'is_visible': True}, } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [l3.ALIAS] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/revisionifmatch.py0000666000175100017510000000201113231472055025224 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. ALIAS = 'revision-if-match' IS_SHIM_EXTENSION = True IS_STANDARD_ATTR_EXTENSION = False NAME = 'If-Match constraints based on revision_number' API_PREFIX = '' DESCRIPTION = ("Extension indicating that If-Match based on revision_number " "is supported.") UPDATED_TIMESTAMP = '2016-12-11T00:00:00-00:00' RESOURCE_ATTRIBUTE_MAP = {} SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = ['standard-attr-revisions'] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/router_interface_fip.py0000666000175100017510000000357313231472055026246 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import l3 # The alias of the extension. ALIAS = 'router-interface-fip' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = True # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'Router interface FIP Extension' # The description of the extension. DESCRIPTION = "Router interface FIP Extension" # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2015-11-11T10:00:00-00:00" # The resource attribute map for the extension. It is effectively the # bulk of the API contract alongside ACTION_MAP RESOURCE_ATTRIBUTE_MAP = {} # The subresource attribute map for the extension. SUB_RESOURCE_ATTRIBUTE_MAP = None # The action map. ACTION_MAP = {} # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [ l3.ALIAS, ] # The list of optional extensions. OPTIONAL_EXTENSIONS = [] neutron-lib-1.13.0/neutron_lib/api/definitions/bgpvpn_routes_control.py0000666000175100017510000001315213231472055026477 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import bgpvpn from neutron_lib.db import constants as db_const # The alias of the extension. ALIAS = 'bgpvpn-routes-control' # The label to lookup the plugin in the plugin directory. It can match the # alias, as required. LABEL = ALIAS # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map (mandatory). IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension (mandatory). # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension (mandatory). NAME = 'BGPVPN Routes Control Extension' # The description of the extension (mandatory). DESCRIPTION = "Provides support for controlling routes advertised to a BGPVPN" # A timestamp of when the extension was introduced (mandatory). UPDATED_TIMESTAMP = "2017-05-20T00:00:00-00:00" # The specific resources and/or attributes for the extension (optional). # In case of simple extensions, with single resource, the string constants # RESOURCE_NAME and COLLECTION_NAME can be used, otherwise string literals # can be used instead. # The name of the resource introduced or being extended (later case) RESOURCE_NAME = bgpvpn.RESOURCE_NAME # The plural for the resource introduced or being extended (later case) COLLECTION_NAME = bgpvpn.COLLECTION_NAME LOCAL_PREF_KEY = 'local_pref' LOCAL_PREF_RANGE = [0, 2**32-1] # RFC 4271, section 4.3 (p.18) RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'ports': {'allow_post': False, 'allow_put': False, 'is_visible': True, 'enforce_policy': True}, LOCAL_PREF_KEY: { 'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': None, 'validate': {'type:range_or_none': LOCAL_PREF_RANGE}, 'enforce_policy': True} } } PORT_ASSOCIATION = 'port_association' PORT_ASSOCIATIONS = 'port_associations' ROUTES = 'routes' PREFIX_TYPE = 'prefix' BGPVPN_TYPE = 'bgpvpn' ROUTE_TYPES = [PREFIX_TYPE, BGPVPN_TYPE] ADV_FIXED_IPS = 'advertise_fixed_ips' TYPE = 'type' PREFIX = 'prefix' BGPVPN_ID = 'bgpvpn_id' ADV_EXTRA_ROUTES = 'advertise_extra_routes' LOCAL_PREF_KEY_SPEC = {'type:range': LOCAL_PREF_RANGE, 'required': False} ROUTE_SPECS = [ {'type': {'type:values': [PREFIX_TYPE], 'required': True}, 'prefix': {'type:subnet': None, 'required': True}, LOCAL_PREF_KEY: LOCAL_PREF_KEY_SPEC, }, {'type': {'type:values': [BGPVPN_TYPE], 'required': True}, 'bgpvpn_id': {'type:uuid': None, 'required': True}, LOCAL_PREF_KEY: LOCAL_PREF_KEY_SPEC, }, ] SUB_RESOURCE_ATTRIBUTE_MAP = { PORT_ASSOCIATIONS: { 'parent': { 'collection_name': COLLECTION_NAME, 'member_name': RESOURCE_NAME}, 'parameters': { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'project_id': {'allow_post': True, 'allow_put': False, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'required_by_policy': True, 'is_visible': True, 'enforce_policy': True}, 'port_id': {'allow_post': True, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'enforce_policy': True}, ROUTES: {'allow_post': True, 'allow_put': True, 'default': [], 'convert_list_to': converters.convert_kvp_list_to_dict, 'validate': { 'type:list_of_any_key_specs_or_none': ROUTE_SPECS }, 'enforce_policy': True, 'is_visible': True}, ADV_FIXED_IPS: {'allow_post': True, 'allow_put': True, 'default': True, 'convert_to': converters.convert_to_boolean, 'is_visible': True}, }, }, bgpvpn.ROUTER_ASSOCIATIONS: { 'parent': {'collection_name': COLLECTION_NAME, 'member_name': RESOURCE_NAME}, 'parameters': { ADV_EXTRA_ROUTES: {'allow_post': True, 'allow_put': True, 'default': True, 'convert_to': converters.convert_to_boolean, 'is_visible': True}, } } } ACTION_MAP = { } ACTION_STATUS = {} REQUIRED_EXTENSIONS = [ bgpvpn.ALIAS ] OPTIONAL_EXTENSIONS = [] neutron-lib-1.13.0/neutron_lib/api/definitions/network_mtu_writable.py0000666000175100017510000000522013231472055026306 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import network from neutron_lib.api.definitions import network_mtu MTU = 'mtu' # The alias of the extension. ALIAS = 'net-mtu-writable' # The label to lookup the plugin in the plugin directory. It can match the # alias, as required. LABEL = ALIAS # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'Network MTU (writable)' # A prefix for API resources. An empty prefix means that the API is going # to be exposed at the v2/ level as any other core resource. API_PREFIX = '' # The description of the extension. DESCRIPTION = ( "Provides a writable MTU attribute for a network resource.") # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2017-07-12T00:00:00-00:00" RESOURCE_ATTRIBUTE_MAP = { network.COLLECTION_NAME: { MTU: {'allow_post': True, 'allow_put': True, 'is_visible': True, 'validate': {'type:non_negative': None}, 'default': 0, 'convert_to': converters.convert_to_int}, }, } # The subresource attribute map for the extension. It adds child resources # to main extension's resource. The subresource map must have a parent and # a parameters entry. If an extension does not need such a map, None can # be specified (mandatory). SUB_RESOURCE_ATTRIBUTE_MAP = {} # The action map: it associates verbs with methods to be performed on # the API resource. ACTION_MAP = {} # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [network_mtu.ALIAS] # The list of optional extensions. OPTIONAL_EXTENSIONS = [] neutron-lib-1.13.0/neutron_lib/api/definitions/portbindings.py0000666000175100017510000002000113231472055024533 0ustar zuulzuul00000000000000# Copyright (c) 2012 OpenStack Foundation. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import port from neutron_lib import constants # The type of vnic that this port should be attached to VNIC_TYPE = 'binding:vnic_type' # The service will return the vif type for the specific port. VIF_TYPE = 'binding:vif_type' # The service may return a dictionary containing additional # information needed by the interface driver. The set of items # returned may depend on the value of VIF_TYPE. VIF_DETAILS = 'binding:vif_details' # In some cases different implementations may be run on different hosts. # The host on which the port will be allocated. HOST_ID = 'binding:host_id' # The profile will be a dictionary that enables the application running # on the specific host to pass and receive vif port specific information to # the plugin. PROFILE = 'binding:profile' # The keys below are used in the VIF_DETAILS attribute to convey # information to the VIF driver. # TODO(rkukura): Replace CAP_PORT_FILTER, which nova no longer # understands, with the new set of VIF security details to be used in # the VIF_DETAILS attribute. # # - port_filter : Boolean value indicating Neutron provides port filtering # features such as security group and anti MAC/IP spoofing # - ovs_hybrid_plug: Boolean used to inform Nova that the hybrid plugging # strategy for OVS should be used CAP_PORT_FILTER = 'port_filter' OVS_HYBRID_PLUG = 'ovs_hybrid_plug' VIF_DETAILS_VLAN = 'vlan' VIF_DETAILS_MACVTAP_SOURCE = 'macvtap_source' VIF_DETAILS_MACVTAP_MODE = 'macvtap_mode' VIF_DETAILS_PHYSICAL_INTERFACE = 'physical_interface' VIF_DETAILS_BRIDGE_NAME = 'bridge_name' # OVS bridge datapath type: String value used to define if the bridge uses # kernel or userspace datapath. OVS_DATAPATH_TYPE = 'datapath_type' # The keys below are used in the VIF_DETAILS attribute to convey # information related to the configuration of the vhost-user VIF driver. # - vhost_user_mode: String value used to declare the mode of a # vhost-user socket VHOST_USER_MODE = 'vhostuser_mode' # - server: socket created by hypervisor VHOST_USER_MODE_SERVER = 'server' # - client: socket created by vswitch VHOST_USER_MODE_CLIENT = 'client' # - vhostuser_socket String value used to declare the vhostuser socket name VHOST_USER_SOCKET = 'vhostuser_socket' # - vhost_user_ovs_plug: Boolean used to inform Nova that the ovs plug # method should be used when binding the # vhost-user vif. VHOST_USER_OVS_PLUG = 'vhostuser_ovs_plug' # VIF_TYPE: vif_types are required by Nova to determine which vif_driver to # use to attach a virtual server to the network # - vhost-user: The vhost-user interface type is a standard virtio interface # provided by qemu 2.1+. This constant defines the neutron side # of the vif binding type to provide a common definition # to enable reuse in multiple agents and drivers. VIF_TYPE_VHOST_USER = 'vhostuser' VIF_TYPE_UNBOUND = 'unbound' VIF_TYPE_BINDING_FAILED = 'binding_failed' VIF_TYPE_DISTRIBUTED = 'distributed' VIF_TYPE_OVS = 'ovs' VIF_TYPE_BRIDGE = 'bridge' VIF_TYPE_OTHER = 'other' VIF_TYPE_TAP = 'tap' # vif_type_macvtap: Tells Nova that the macvtap vif_driver should be used to # create a vif. It does not require the VNIC_TYPE_MACVTAP, # which is defined further below. E.g. Macvtap agent uses # vnic_type 'normal'. VIF_TYPE_MACVTAP = 'macvtap' # vif_type_agilio_ovs: Tells Nova that the Agilio OVS vif_driver should be # used to create a vif. In addition to the normal OVS # vif types exposed, VNIC_DIRECT and # VNIC_VIRTIO_FORWARDER are supported. VIF_TYPE_AGILIO_OVS = 'agilio_ovs' # SR-IOV VIF types VIF_TYPE_HW_VEB = 'hw_veb' VIF_TYPE_HOSTDEV_PHY = 'hostdev_physical' # VNIC_TYPE: It's used to determine which mechanism driver to use to bind a # port. It can be specified via the Neutron API. Default is normal, # used by OVS and LinuxBridge agent. VNIC_NORMAL = 'normal' VNIC_DIRECT = 'direct' VNIC_MACVTAP = 'macvtap' VNIC_BAREMETAL = 'baremetal' VNIC_DIRECT_PHYSICAL = 'direct-physical' VNIC_VIRTIO_FORWARDER = 'virtio-forwarder' VNIC_TYPES = [VNIC_NORMAL, VNIC_DIRECT, VNIC_MACVTAP, VNIC_BAREMETAL, VNIC_DIRECT_PHYSICAL, VNIC_VIRTIO_FORWARDER] # The alias of the extension. ALIAS = 'binding' # The label to lookup the plugin in the plugin directory. It can match the # alias, as required. LABEL = 'binding' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'Port Binding' # A prefix for API resources. An empty prefix means that the API is going # to be exposed at the v2/ level as any other core resource. API_PREFIX = '' # The description of the extension. DESCRIPTION = "Expose port bindings of a virtual port to external application" # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2014-02-03T10:00:00-00:00" # The name of the resource. RESOURCE_NAME = port.RESOURCE_NAME # The plural for the resource. COLLECTION_NAME = port.COLLECTION_NAME RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { VIF_TYPE: {'allow_post': False, 'allow_put': False, 'default': constants.ATTR_NOT_SPECIFIED, 'enforce_policy': True, 'is_visible': True}, VIF_DETAILS: {'allow_post': False, 'allow_put': False, 'default': constants.ATTR_NOT_SPECIFIED, 'enforce_policy': True, 'is_visible': True}, VNIC_TYPE: {'allow_post': True, 'allow_put': True, 'default': VNIC_NORMAL, 'is_visible': True, 'validate': {'type:values': VNIC_TYPES}, 'enforce_policy': True}, HOST_ID: {'allow_post': True, 'allow_put': True, 'default': constants.ATTR_NOT_SPECIFIED, 'is_visible': True, 'enforce_policy': True}, PROFILE: {'allow_post': True, 'allow_put': True, 'default': constants.ATTR_NOT_SPECIFIED, 'enforce_policy': True, 'validate': {'type:dict_or_none': None}, 'is_visible': True}, } } # The subresource attribute map for the extension. It adds child resources # to main extension's resource. The subresource map must have a parent and # a parameters entry. If an extension does not need such a map, None can # be specified (mandatory). SUB_RESOURCE_ATTRIBUTE_MAP = None # The action map: it associates verbs with methods to be performed on # the API resource. For example: # # ACTION_MAP = { # RESOURCE_NAME: { # 'add_my_foo_bars': 'PUT', # 'remove_my_foo_bars': 'PUT', # 'get_my_foo_bars': 'GET' # } # } ACTION_MAP = { } # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [ ] # The list of optional extensions. OPTIONAL_EXTENSIONS = [ ] neutron-lib-1.13.0/neutron_lib/api/definitions/logging.py0000666000175100017510000001012413231472055023464 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.db import constants as db_const # The alias of the extension. ALIAS = 'logging' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'Logging API Extension' # A prefix for API resources. An empty prefix means that the API is going # to be exposed at the v2/ level as any other core resource. API_PREFIX = '/log' # The description of the extension. DESCRIPTION = ("Provides a logging API for resources such as " "security group and firewall.") # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2017-01-01T10:00:00-00:00" LOGS = 'logs' LOG_TYPES = 'loggable_resources' ACCEPT_EVENT = 'ACCEPT' DROP_EVENT = 'DROP' ALL_EVENT = 'ALL' LOG_EVENTS = [ACCEPT_EVENT, DROP_EVENT, ALL_EVENT] # Attribute Map RESOURCE_ATTRIBUTE_MAP = { LOGS: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'project_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'is_visible': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, 'default': '', 'is_visible': True}, 'resource_type': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': { 'type:string': db_const.RESOURCE_TYPE_FIELD_SIZE}, 'is_visible': True}, 'resource_id': {'allow_post': True, 'allow_put': False, 'validate': {'type:uuid_or_none': None}, 'default': None, 'is_visible': True}, 'event': {'allow_post': True, 'allow_put': False, 'validate': {'type:values': LOG_EVENTS}, 'default': ALL_EVENT, 'is_visible': True}, 'target_id': {'allow_post': True, 'allow_put': False, 'validate': {'type:uuid_or_none': None}, 'default': None, 'is_visible': True}, 'enabled': {'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': True, 'convert_to': converters.convert_to_boolean}, }, LOG_TYPES: { 'type': {'allow_post': False, 'allow_put': False, 'is_visible': True}}, } # The subresource attribute map for the extension. This extension has only # top level resources, not child resources, so this is set to an empty dict. SUB_RESOURCE_ATTRIBUTE_MAP = {} # The action map. ACTION_MAP = {} # The list of required extensions. REQUIRED_EXTENSIONS = [] # The action status. ACTION_STATUS = {} # The list of optional extensions. OPTIONAL_EXTENSIONS = ['security-group', 'fwaas_v2'] neutron-lib-1.13.0/neutron_lib/api/definitions/l3_flavors.py0000666000175100017510000000244113231472055024113 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import l3 from neutron_lib import constants FLAVOR_ID = 'flavor_id' ALIAS = 'l3-flavors' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Router Flavor Extension' API_PREFIX = '' DESCRIPTION = 'Flavor support for routers.' UPDATED_TIMESTAMP = '2016-05-17T00:00:00-00:00' RESOURCE_NAME = l3.ROUTER COLLECTION_NAME = l3.ROUTERS RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { FLAVOR_ID: { 'allow_post': True, 'allow_put': False, 'default': constants.ATTR_NOT_SPECIFIED, 'is_visible': True, 'enforce_policy': True } } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = ['flavors', l3.ALIAS] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/base.py0000666000175100017510000000603313231472055022754 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib import constants KNOWN_ATTRIBUTES = ( 'admin_state_up', 'allocation_pools', 'cidr', 'default_prefixlen', 'default_quota', 'description', 'device_id', 'device_owner', 'dns_nameservers', 'enable_dhcp', 'fixed_ips', 'gateway_ip', 'host_routes', 'id', 'ip_version', 'ipv6_address_mode', 'ipv6_ra_mode', 'is_default', 'mac_address', 'max_prefixlen', 'min_prefixlen', 'name', 'network_id', 'port_id', 'prefixes', 'prefixlen', 'project_id', constants.SHARED, 'status', 'subnets', 'subnetpool_id', 'tenant_id' ) KNOWN_RESOURCES = ( 'networks', 'ports', 'routers', 'subnets', 'subnetpools' ) KNOWN_HTTP_ACTIONS = ( 'DELETE', 'GET', 'POST', 'PUT', ) KNOWN_ACTION_STATUSES = ( 200, 201, 202, 203, 204, 205, 206, ) KNOWN_EXTENSIONS = ( 'address-scope', 'agent', 'allowed-address-pairs', 'auto-allocated-topology', 'availability_zone', 'binding', 'data-plane-status', 'default-subnetpools', 'dhcp_agent_scheduler', 'dns-domain-ports', 'dns-integration', 'dvr', 'ext-gw-mode', 'external-net', 'extra_dhcp_opt', 'extraroute', 'flavors', 'ip-substring-filtering', 'l3-ha', 'l3_agent_scheduler', 'logging', 'metering', 'multi-provider', 'net-mtu', 'network-ip-availability', 'network_availability_zone', 'pagination', 'port-security', 'project-id', 'provider', 'qos', 'quotas', 'rbac-policies', 'router', 'router_availability_zone', 'security-group', 'service-type', 'sorting', 'standard-attr-description', 'standard-attr-revisions', 'standard-attr-timestamp', 'subnet_allocation', 'subnet_onboard', 'tag', 'trunk', 'trunk-details', # Add here list of extensions with pointers to the project repo, e.g. # 'bgp', # http://git.openstack.org/cgit/openstack/neutron-dynamic-routing # http://git.openstack.org/cgit/openstack/neutron-fwaas 'fwaas', 'fwaasrouterinsertion', 'fwaas_v2', 'bgpvpn', # https://git.openstack.org/cgit/openstack/networking-bgpvpn 'bgpvpn-routes-control', 'bgpvpn-vni', ) KNOWN_KEYWORDS = ( 'allow_post', 'allow_put', 'convert_to', 'convert_list_to', 'default', 'enforce_policy', 'is_visible', 'primary_key', 'required_by_policy', 'validate', ) neutron-lib-1.13.0/neutron_lib/api/definitions/trunk_details.py0000666000175100017510000000515613231472055024717 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import port from neutron_lib.api.definitions import trunk from neutron_lib import constants # The alias of the extension. ALIAS = 'trunk-details' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'Trunk port details' # The description of the extension. DESCRIPTION = "Expose trunk port details" # A timestamp of when the extension was last updated. UPDATED_TIMESTAMP = "2016-01-01T10:00:00-00:00" # TODO(armax): to be removed when review # https://review.openstack.org/#/c/484058/ merges TIMESTAMP = UPDATED_TIMESTAMP # The name of the resource introduced or being extended. RESOURCE_NAME = port.RESOURCE_NAME # The plural for the resource introduced or being extended. COLLECTION_NAME = port.COLLECTION_NAME # The specific resources and/or attributes for the extension (optional). TRUNK_DETAILS = 'trunk_details' # The resource attribute map for the extension. RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: {TRUNK_DETAILS: {'allow_post': False, 'allow_put': False, 'default': constants.ATTR_NOT_SPECIFIED, 'is_visible': True, 'enforce_policy': True, 'required_by_policy': True}}, } # The subresource attribute map for the extension. SUB_RESOURCE_ATTRIBUTE_MAP = None # The action map. ACTION_MAP = {} # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [trunk.ALIAS] # The list of optional extensions. OPTIONAL_EXTENSIONS = [] neutron-lib-1.13.0/neutron_lib/api/definitions/qos_default.py0000666000175100017510000000254413231472055024353 0ustar zuulzuul00000000000000# Copyright (c) 2017 Intel Corporation. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import qos as qos_apidef ALIAS = 'qos-default' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'QoS default policy' API_PREFIX = '' DESCRIPTION = 'Expose the QoS default policy per project' UPDATED_TIMESTAMP = '2017-041-06T10:00:00-00:00' RESOURCE_ATTRIBUTE_MAP = { qos_apidef.POLICIES: { 'is_default': { 'allow_post': True, 'allow_put': True, 'default': False, 'convert_to': converters.convert_to_boolean, 'is_visible': True } } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [qos_apidef.ALIAS] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/network_availability_zone.py0000666000175100017510000000275113231472055027323 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. from neutron_lib.api.definitions import availability_zone as az_def from neutron_lib.api.definitions import network ALIAS = 'network_availability_zone' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Network Availability Zone' API_PREFIX = '' DESCRIPTION = 'Availability zone support for network.' UPDATED_TIMESTAMP = '2015-01-01T10:00:00-00:00' RESOURCE_NAME = network.RESOURCE_NAME COLLECTION_NAME = network.COLLECTION_NAME RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { az_def.COLLECTION_NAME: { 'allow_post': False, 'allow_put': False, 'is_visible': True }, az_def.AZ_HINTS: { 'allow_post': True, 'allow_put': False, 'is_visible': True, 'validate': {'type:availability_zone_hint_list': None}, 'default': [] } } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [az_def.ALIAS] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/default_subnetpools.py0000666000175100017510000000311213231472055026116 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import subnet as subnet_def from neutron_lib import constants USE_DEFAULT_SUBNETPOOL = 'use_default_subnetpool' ALIAS = 'default-subnetpools' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Default Subnetpools' API_PREFIX = '' DESCRIPTION = 'Provides ability to mark and use a subnetpool as the default.' UPDATED_TIMESTAMP = '2016-02-18T18:00:00-00:00' RESOURCE_NAME = subnet_def.RESOURCE_NAME COLLECTION_NAME = subnet_def.COLLECTION_NAME RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { USE_DEFAULT_SUBNETPOOL: {'allow_post': True, 'allow_put': False, 'default': False, 'convert_to': converters.convert_to_boolean, 'is_visible': False}, }, } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [constants.SUBNET_ALLOCATION_EXT_ALIAS] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/firewallrouterinsertion.py0000666000175100017510000000441413231472055027044 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import constants as api_const from neutron_lib import constants # The alias of the extension. ALIAS = 'fwaasrouterinsertion' # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'FWaaS Router Insertion' # The description of the extension. DESCRIPTION = "Provides router insertion support for FWaaS version 1" # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2016-01-01T10:00:00-00:00" # The name of the resource RESOURCE_NAME = "firewall" # The plural for the resource COLLECTION_NAME = api_const.FIREWALLS RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'router_ids': {'allow_post': True, 'allow_put': True, 'validate': {'type:uuid_list': None}, 'is_visible': True, 'default': constants.ATTR_NOT_SPECIFIED}, } } # The subresource attribute map for the extension. This extension has only # top level resources, not child resources, so this is set to an empty dict. SUB_RESOURCE_ATTRIBUTE_MAP = { } # The action map. ACTION_MAP = { } # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [ ] # The list of optional extensions. OPTIONAL_EXTENSIONS = [ ] neutron-lib-1.13.0/neutron_lib/api/definitions/network_mtu.py0000666000175100017510000000462213231472055024422 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import network MTU = 'mtu' # The alias of the extension. ALIAS = 'net-mtu' # The label to lookup the plugin in the plugin directory. It can match the # alias, as required. LABEL = ALIAS # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # The name of the extension. NAME = 'Network MTU' # A prefix for API resources. An empty prefix means that the API is going # to be exposed at the v2/ level as any other core resource. API_PREFIX = '' # The description of the extension. DESCRIPTION = "Provides MTU attribute for a network resource." # A timestamp of when the extension was introduced. UPDATED_TIMESTAMP = "2015-03-25T10:00:00-00:00" RESOURCE_ATTRIBUTE_MAP = { network.COLLECTION_NAME: { MTU: {'allow_post': False, 'allow_put': False, 'is_visible': True}, }, } # The subresource attribute map for the extension. It adds child resources # to main extension's resource. The subresource map must have a parent and # a parameters entry. If an extension does not need such a map, None can # be specified (mandatory). SUB_RESOURCE_ATTRIBUTE_MAP = {} # The action map: it associates verbs with methods to be performed on # the API resource. ACTION_MAP = {} # The action status. ACTION_STATUS = { } # The list of required extensions. REQUIRED_EXTENSIONS = [] # The list of optional extensions. OPTIONAL_EXTENSIONS = [] neutron-lib-1.13.0/neutron_lib/api/definitions/network_ip_availability.py0000666000175100017510000000366013231472055026760 0ustar zuulzuul00000000000000# Copyright 2016 GoDaddy. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. ALIAS = 'network-ip-availability' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Network IP Availability' API_PREFIX = '' DESCRIPTION = 'Provides IP availability data for each network and subnet.' UPDATED_TIMESTAMP = '2015-09-24T00:00:00-00:00' RESOURCE_NAME = "network_ip_availability" RESOURCE_PLURAL = "network_ip_availabilities" COLLECTION_NAME = RESOURCE_PLURAL.replace('_', '-') RESOURCE_ATTRIBUTE_MAP = { RESOURCE_PLURAL: { 'network_id': { 'allow_post': False, 'allow_put': False, 'is_visible': True }, 'network_name': { 'allow_post': False, 'allow_put': False, 'is_visible': True }, 'tenant_id': { 'allow_post': False, 'allow_put': False, 'is_visible': True }, 'total_ips': { 'allow_post': False, 'allow_put': False, 'is_visible': True }, 'used_ips': { 'allow_post': False, 'allow_put': False, 'is_visible': True }, 'subnet_ip_availability': { 'allow_post': False, 'allow_put': False, 'is_visible': True } # TODO(wwriverrat) Make composite attribute for subnet_ip_availability } } SUB_RESOURCE_ATTRIBUTE_MAP = {} ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/qos.py0000666000175100017510000001226113231472055022644 0ustar zuulzuul00000000000000# Copyright (c) 2015 Red Hat Inc. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import converters from neutron_lib.api.definitions import network from neutron_lib.api.definitions import port from neutron_lib import constants from neutron_lib.db import constants as db_const from neutron_lib.services.qos import constants as qos_const BANDWIDTH_LIMIT_RULES = "bandwidth_limit_rules" RULE_TYPES = "rule_types" POLICIES = 'policies' POLICY = 'policy' DSCP_MARKING_RULES = 'dscp_marking_rules' MIN_BANDWIDTH_RULES = 'minimum_bandwidth_rules' _QOS_RULE_COMMON_FIELDS = { 'id': { 'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True }, 'tenant_id': { 'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'is_visible': True } } ALIAS = 'qos' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Quality of Service' API_PREFIX = '/' + ALIAS DESCRIPTION = 'The Quality of Service extension.' UPDATED_TIMESTAMP = '2015-06-08T10:00:00-00:00' RESOURCE_ATTRIBUTE_MAP = { POLICIES: { 'id': { 'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True }, 'name': { 'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': '', 'validate': {'type:string': db_const.NAME_FIELD_SIZE}}, constants.SHARED: { 'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': False, 'convert_to': converters.convert_to_boolean }, 'tenant_id': { 'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': {'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'is_visible': True }, 'rules': { 'allow_post': False, 'allow_put': False, 'is_visible': True } }, RULE_TYPES: { 'type': { 'allow_post': False, 'allow_put': False, 'is_visible': True } }, port.COLLECTION_NAME: { qos_const.QOS_POLICY_ID: { 'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': None, 'validate': {'type:uuid_or_none': None} } }, network.COLLECTION_NAME: { qos_const.QOS_POLICY_ID: { 'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': None, 'validate': {'type:uuid_or_none': None} } } } _PARENT = { 'collection_name': POLICIES, 'member_name': POLICY } SUB_RESOURCE_ATTRIBUTE_MAP = { BANDWIDTH_LIMIT_RULES: { 'parent': _PARENT, 'parameters': dict( _QOS_RULE_COMMON_FIELDS, **{'max_kbps': { 'allow_post': True, 'allow_put': True, 'convert_to': converters.convert_to_int, 'is_visible': True, 'validate': { 'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]} }, 'max_burst_kbps': { 'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': 0, 'convert_to': converters.convert_to_int, 'validate': { 'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]}}}), }, DSCP_MARKING_RULES: { 'parent': _PARENT, 'parameters': dict( _QOS_RULE_COMMON_FIELDS, **{'dscp_mark': { 'allow_post': True, 'allow_put': True, 'convert_to': converters.convert_to_int, 'is_visible': True, 'validate': { 'type:values': constants.VALID_DSCP_MARKS}}}) }, MIN_BANDWIDTH_RULES: { 'parent': _PARENT, 'parameters': dict( _QOS_RULE_COMMON_FIELDS, **{'min_kbps': { 'allow_post': True, 'allow_put': True, 'is_visible': True, 'convert_to': converters.convert_to_int, 'validate': { 'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]}}, 'direction': { 'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': constants.EGRESS_DIRECTION, 'validate': { 'type:values': [constants.EGRESS_DIRECTION]}}}) } } ACTION_MAP = {} REQUIRED_EXTENSIONS = [] OPTIONAL_EXTENSIONS = [] ACTION_STATUS = {} neutron-lib-1.13.0/neutron_lib/api/definitions/portbindings_extended.py0000666000175100017510000001016413231472055026424 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import port from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron_lib.db import constants as db_const # Plural of the resource COLLECTION_NAME = 'bindings' # Name of the resource RESOURCE_NAME = 'binding' # Parent PARENT_RESOURCE_NAME = port.RESOURCE_NAME PARENT_COLLECTION_NAME = port.COLLECTION_NAME # Whether or not this extension is simply signaling behavior to the user # or it actively modifies the attribute map. IS_SHIM_EXTENSION = False # Whether the extension is marking the adoption of standardattr model for # legacy resources, or introducing new standardattr attributes. False or # None if the standardattr model is adopted since the introduction of # resource extension. # If this is True, the alias for the extension should be prefixed with # 'standard-attr-'. IS_STANDARD_ATTR_EXTENSION = False # Name of the extension NAME = "Port Bindings Extended" # Extension alias ALIAS = 'binding-extended' # Extension description DESCRIPTION = "Expose port bindings of a virtual port to external application" # Action name for activating a port binding ACTIVATE_BINDING = 'activate' # Timestamp of last update of this extension UPDATED_TIMESTAMP = "2017-07-17T10:00:00-00:00" # Extension attributes HOST = 'host' VIF_TYPE = 'vif_type' VIF_DETAILS = 'vif_details' VNIC_TYPE = 'vnic_type' PROFILE = 'profile' STATUS = 'status' PROJECT_ID = 'project_id' # No attribute map, this extension defines only sub resource RESOURCE_ATTRIBUTE_MAP = {} # Attribute map of bindings SUB_RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'parent': { 'collection_name': PARENT_COLLECTION_NAME, 'member_name': PARENT_RESOURCE_NAME}, 'parameters': { HOST: {'allow_post': True, 'allow_put': True, 'is_visible': True, 'primary_key': True}, VIF_TYPE: {'allow_post': False, 'allow_put': False, 'default': constants.ATTR_NOT_SPECIFIED, 'enforce_policy': True, 'is_visible': True}, VIF_DETAILS: {'allow_post': False, 'allow_put': False, 'default': constants.ATTR_NOT_SPECIFIED, 'enforce_policy': True, 'is_visible': True}, VNIC_TYPE: {'allow_post': True, 'allow_put': True, 'default': portbindings.VNIC_NORMAL, 'is_visible': True, 'validate': {'type:values': portbindings.VNIC_TYPES}, 'enforce_policy': True}, PROFILE: {'allow_post': True, 'allow_put': True, 'default': constants.ATTR_NOT_SPECIFIED, 'enforce_policy': True, 'validate': {'type:dict_or_none': None}, 'is_visible': True}, STATUS: {'allow_post': False, 'allow_put': False, 'is_visible': True}, PROJECT_ID: {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'validate': { 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'is_visible': True}, } } } # activate is an action ACTION_MAP = { RESOURCE_NAME: { ACTIVATE_BINDING: 'PUT', }, } # No action statuses are required ACTION_STATUS = { } # The list of required extensions REQUIRED_EXTENSIONS = [ portbindings.ALIAS, ] # The list of optional extensions OPTIONAL_EXTENSIONS = [] neutron-lib-1.13.0/neutron_lib/tests/0000775000175100017510000000000013231472430017537 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/__init__.py0000666000175100017510000000000013231472055021643 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/_post_mortem_debug.py0000666000175100017510000001021513231472055023772 0ustar zuulzuul00000000000000# Copyright 2013 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import functools import traceback def get_exception_handler(debugger_name): debugger = _get_debugger(debugger_name) return functools.partial(_exception_handler, debugger) def _get_debugger(debugger_name): try: debugger = __import__(debugger_name) except ImportError: raise ValueError("can't import %s module as a post mortem debugger" % debugger_name) if 'post_mortem' in dir(debugger): return debugger else: raise ValueError("%s is not a supported post mortem debugger" % debugger_name) def _exception_handler(debugger, exc_info): """Exception handler enabling post-mortem debugging. A class extending testtools.TestCase can add this handler in setUp(): self.addOnException(post_mortem_debug.exception_handler) When an exception occurs, the user will be dropped into a debugger session in the execution environment of the failure. Frames associated with the testing framework are excluded so that the post-mortem session for an assertion failure will start at the assertion call (e.g. self.assertTrue) rather than the framework code that raises the failure exception (e.g. the assertTrue method). """ tb = exc_info[2] ignored_traceback = get_ignored_traceback(tb) if ignored_traceback: tb = FilteredTraceback(tb, ignored_traceback) traceback.print_exception(exc_info[0], exc_info[1], tb) debugger.post_mortem(tb) def get_ignored_traceback(tb): """Retrieve the first traceback of an ignored trailing chain. Given an initial traceback, find the first traceback of a trailing chain of tracebacks that should be ignored. The criteria for whether a traceback should be ignored is whether its frame's globals include the __unittest marker variable. This criteria is culled from: unittest.TestResult._is_relevant_tb_level For example: tb.tb_next => tb0.tb_next => tb1.tb_next - If no tracebacks were to be ignored, None would be returned. - If only tb1 was to be ignored, tb1 would be returned. - If tb0 and tb1 were to be ignored, tb0 would be returned. - If either of only tb or only tb0 was to be ignored, None would be returned because neither tb or tb0 would be part of a trailing chain of ignored tracebacks. """ # Turn the traceback chain into a list tb_list = [] while tb: tb_list.append(tb) tb = tb.tb_next # Find all members of an ignored trailing chain ignored_tracebacks = [] for tb in reversed(tb_list): if '__unittest' in tb.tb_frame.f_globals: ignored_tracebacks.append(tb) else: break # Return the first member of the ignored trailing chain if ignored_tracebacks: return ignored_tracebacks[-1] class FilteredTraceback(object): """Wraps a traceback to filter unwanted frames.""" def __init__(self, tb, filtered_traceback): """Constructor. :param tb: The start of the traceback chain to filter. :param filtered_traceback: The first traceback of a trailing chain that is to be filtered. """ self._tb = tb self.tb_lasti = self._tb.tb_lasti self.tb_lineno = self._tb.tb_lineno self.tb_frame = self._tb.tb_frame self._filtered_traceback = filtered_traceback @property def tb_next(self): tb_next = self._tb.tb_next if tb_next and tb_next != self._filtered_traceback: return FilteredTraceback(tb_next, self._filtered_traceback) neutron-lib-1.13.0/neutron_lib/tests/etc/0000775000175100017510000000000013231472430020312 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/etc/neutron_lib.conf0000666000175100017510000000023113231472055023502 0ustar zuulzuul00000000000000[DEFAULT] # Show debugging output in logs (sets DEBUG log level output) debug = False lock_path = $state_path/lock [database] connection = 'sqlite://' neutron-lib-1.13.0/neutron_lib/tests/etc/no_policy.json0000666000175100017510000000000413231472055023177 0ustar zuulzuul00000000000000{ } neutron-lib-1.13.0/neutron_lib/tests/etc/policy.json0000666000175100017510000000017113231472055022510 0ustar zuulzuul00000000000000{ "context_is_admin": "role:admin", "context_is_advsvc": "role:advsvc", "default": "rule:admin_or_owner" } neutron-lib-1.13.0/neutron_lib/tests/_base.py0000666000175100017510000002065613231472055021200 0ustar zuulzuul00000000000000# Copyright 2010-2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging as std_logging import os import os.path import random import fixtures import mock from oslo_config import cfg from oslo_db import options as db_options from oslo_utils import strutils import pbr.version import testtools from neutron_lib._i18n import _ from neutron_lib import constants from neutron_lib import exceptions from neutron_lib import fixture from neutron_lib.tests import _post_mortem_debug as post_mortem_debug from neutron_lib.tests import _tools as tools CONF = cfg.CONF LOG_FORMAT = "%(asctime)s %(levelname)8s [%(name)s] %(message)s" ROOTDIR = os.path.dirname(__file__) ETCDIR = os.path.join(ROOTDIR, 'etc') def etcdir(*p): return os.path.join(ETCDIR, *p) def fake_use_fatal_exceptions(*args): return True def get_rand_name(max_length=None, prefix='test'): """Return a random string. The string will start with 'prefix' and will be exactly 'max_length'. If 'max_length' is None, then exactly 8 random characters, each hexadecimal, will be added. In case len(prefix) <= len(max_length), ValueError will be raised to indicate the problem. """ if max_length: length = max_length - len(prefix) if length <= 0: raise ValueError("'max_length' must be bigger than 'len(prefix)'.") suffix = ''.join(str(random.randint(0, 9)) for i in range(length)) else: suffix = hex(random.randint(0x10000000, 0x7fffffff))[2:] return prefix + suffix def get_rand_device_name(prefix='test'): return get_rand_name( max_length=constants.DEVICE_NAME_MAX_LEN, prefix=prefix) def bool_from_env(key, strict=False, default=False): value = os.environ.get(key) return strutils.bool_from_string(value, strict=strict, default=default) def get_test_timeout(default=0): return int(os.environ.get('OS_TEST_TIMEOUT', default)) def sanitize_log_path(path): # Sanitize the string so that its log path is shell friendly return path.replace(' ', '-').replace('(', '_').replace(')', '_') class AttributeDict(dict): """Provide attribute access (dict.key) to dictionary values.""" def __getattr__(self, name): """Allow attribute access for all keys in the dict.""" if name in self: return self[name] raise AttributeError(_("Unknown attribute '%s'.") % name) class BaseTestCase(testtools.TestCase): @staticmethod def config_parse(conf=None, args=None): """Create the default configurations.""" if args is None: args = [] args += ['--config-file', etcdir('neutron_lib.conf')] if conf is None: version_info = pbr.version.VersionInfo('neutron-lib') cfg.CONF(args=args, project='neutron_lib', version='%%(prog)s %s' % version_info.release_string()) else: conf(args) def setUp(self): super(BaseTestCase, self).setUp() self.useFixture(fixture.PluginDirectoryFixture()) # Enabling 'use_fatal_exceptions' allows us to catch string # substitution format errors in exception messages. mock.patch.object(exceptions.NeutronException, 'use_fatal_exceptions', return_value=True).start() # Update the default QueuePool parameters. These can be tweaked by the # conf variables - max_pool_size, max_overflow and pool_timeout db_options.set_defaults( cfg.CONF, connection='sqlite://', max_pool_size=10, max_overflow=20, pool_timeout=10) self.useFixture(fixtures.MonkeyPatch( 'oslo_config.cfg.find_config_files', lambda project=None, prog=None, extension=None: [])) self.setup_config() # Configure this first to ensure pm debugging support for setUp() debugger = os.environ.get('OS_POST_MORTEM_DEBUGGER') if debugger: self.addOnException(post_mortem_debug.get_exception_handler( debugger)) # Make sure we see all relevant deprecation warnings when running tests self.useFixture(tools.WarningsFixture()) if bool_from_env('OS_DEBUG'): _level = std_logging.DEBUG else: _level = std_logging.INFO capture_logs = bool_from_env('OS_LOG_CAPTURE') if not capture_logs: std_logging.basicConfig(format=LOG_FORMAT, level=_level) self.log_fixture = self.useFixture( fixtures.FakeLogger( format=LOG_FORMAT, level=_level, nuke_handlers=capture_logs, )) test_timeout = get_test_timeout() if test_timeout == -1: test_timeout = 0 if test_timeout > 0: self.useFixture(fixtures.Timeout(test_timeout, gentle=True)) # If someone does use tempfile directly, ensure that it's cleaned up self.useFixture(fixtures.NestedTempfile()) self.useFixture(fixtures.TempHomeDir()) self.addCleanup(mock.patch.stopall) if bool_from_env('OS_STDOUT_CAPTURE'): stdout = self.useFixture(fixtures.StringStream('stdout')).stream self.useFixture(fixtures.MonkeyPatch('sys.stdout', stdout)) if bool_from_env('OS_STDERR_CAPTURE'): stderr = self.useFixture(fixtures.StringStream('stderr')).stream self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr)) self.addOnException(self.check_for_systemexit) self.orig_pid = os.getpid() def get_new_temp_dir(self): """Create a new temporary directory. :returns fixtures.TempDir """ return self.useFixture(fixtures.TempDir()) def get_default_temp_dir(self): """Create a default temporary directory. Returns the same directory during the whole test case. :returns fixtures.TempDir """ if not hasattr(self, '_temp_dir'): self._temp_dir = self.get_new_temp_dir() return self._temp_dir def check_for_systemexit(self, exc_info): if isinstance(exc_info[1], SystemExit): if os.getpid() != self.orig_pid: # Subprocess - let it just exit raise # This makes sys.exit(0) still a failure self.force_failure = True def assertOrderedEqual(self, expected, actual): expect_val = self.sort_dict_lists(expected) actual_val = self.sort_dict_lists(actual) self.assertEqual(expect_val, actual_val) def sort_dict_lists(self, dic): for key, value in dic.items(): if isinstance(value, list): dic[key] = sorted(value) elif isinstance(value, dict): dic[key] = self.sort_dict_lists(value) return dic def assertDictSupersetOf(self, expected_subset, actual_superset): """Checks that actual dict contains the expected dict. After checking that the arguments are of the right type, this checks that each item in expected_subset is in, and matches, what is in actual_superset. Separate tests are done, so that detailed info can be reported upon failure. """ if not isinstance(expected_subset, dict): self.fail("expected_subset (%s) is not an instance of dict" % type(expected_subset)) if not isinstance(actual_superset, dict): self.fail("actual_superset (%s) is not an instance of dict" % type(actual_superset)) for k, v in expected_subset.items(): self.assertIn(k, actual_superset) self.assertEqual(v, actual_superset[k], "Key %(key)s expected: %(exp)r, actual %(act)r" % {'key': k, 'exp': v, 'act': actual_superset[k]}) def setup_config(self, args=None): """Tests that need a non-default config can override this method.""" self.config_parse(args=args) neutron-lib-1.13.0/neutron_lib/tests/_tools.py0000666000175100017510000000325113231472055021416 0ustar zuulzuul00000000000000# Copyright (c) 2013 NEC Corporation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import platform import warnings import fixtures from neutron_lib.utils import helpers class UnorderedList(list): """A list that is equals to any permutation of itself.""" def __eq__(self, other): if not isinstance(other, list): return False return (sorted(self, key=helpers.safe_sort_key) == sorted(other, key=helpers.safe_sort_key)) def __neq__(self, other): return not self == other class WarningsFixture(fixtures.Fixture): """Filters out warnings during test runs.""" warning_types = ( DeprecationWarning, PendingDeprecationWarning, ImportWarning ) def _setUp(self): self.addCleanup(warnings.resetwarnings) for wtype in self.warning_types: warnings.filterwarnings( "always", category=wtype, module='^neutron_lib\\.') def is_bsd(): """Return True on BSD-based systems.""" system = platform.system() if system == 'Darwin': return True if 'bsd' in system.lower(): return True return False neutron-lib-1.13.0/neutron_lib/tests/unit/0000775000175100017510000000000013231472430020516 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/legacy/0000775000175100017510000000000013231472430021762 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/legacy/__init__.py0000666000175100017510000000000013231472055024066 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/test_worker.py0000666000175100017510000000302013231472055023440 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock from neutron_lib.callbacks import events from neutron_lib.callbacks import resources from neutron_lib import fixture from neutron_lib import worker from neutron_lib.tests import _base as base class _BaseWorker(worker.BaseWorker): def reset(self): pass def stop(self): pass def wait(self): pass class TestBaseWorker(base.BaseTestCase): def setUp(self): super(TestBaseWorker, self).setUp() self._reg = mock.Mock() self.useFixture(fixture.CallbackRegistryFixture( callback_manager=self._reg)) def test_worker_process_count(self): self.assertEqual(9, _BaseWorker( worker_process_count=9).worker_process_count) def test_start_callback_event(self): base_worker = _BaseWorker() base_worker.start() self._reg.notify.assert_called_once_with( resources.PROCESS, events.AFTER_INIT, base_worker.start) neutron-lib-1.13.0/neutron_lib/tests/unit/__init__.py0000666000175100017510000000000013231472055022622 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/db/0000775000175100017510000000000013231472430021103 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/db/__init__.py0000666000175100017510000000000013231472055023207 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/db/_base.py0000666000175100017510000000160013231472055022530 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ Base classes for unit tests needing DB backend. Only sqlite is supported in neutron-lib. """ from neutron_lib import fixture from neutron_lib.tests import _base as base class SqlTestCase(base.BaseTestCase): def setUp(self): super(SqlTestCase, self).setUp() self.useFixture(fixture.SqlFixture()) neutron-lib-1.13.0/neutron_lib/tests/unit/db/test_utils.py0000666000175100017510000000462513231472055023670 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_db.sqlalchemy import models import sqlalchemy as sa from sqlalchemy.ext import declarative from sqlalchemy import orm from neutron_lib.db import utils from neutron_lib import exceptions as n_exc from neutron_lib.tests import _base as base class FakePort(declarative.declarative_base(cls=models.ModelBase)): __tablename__ = 'fakeports' port_id = sa.Column(sa.String(36), primary_key=True) name = sa.Column(sa.String(64)) status = sa.Column(sa.String(16), nullable=False) class FakeRouter(declarative.declarative_base(cls=models.ModelBase)): __tablename__ = 'fakerouters' router_id = sa.Column(sa.String(36), primary_key=True) gw_port_id = sa.Column(sa.String(36), sa.ForeignKey(FakePort.port_id)) gw_port = orm.relationship(FakePort, lazy='joined') class TestUtils(base.BaseTestCase): def test_get_sort_dirs(self): sorts = [(1, True), (2, False), (3, True)] self.assertEqual(['asc', 'desc', 'asc'], utils.get_sort_dirs(sorts)) def test_get_sort_dirs_reversed(self): sorts = [(1, True), (2, False), (3, True)] self.assertEqual(['desc', 'asc', 'desc'], utils.get_sort_dirs(sorts, page_reverse=True)) def test_get_and_validate_sort_keys(self): sorts = [('name', False), ('status', True)] self.assertEqual(['name', 'status'], utils.get_and_validate_sort_keys(sorts, FakePort)) def test_get_and_validate_sort_keys_bad_key_fails(self): sorts = [('master', True)] self.assertRaises(n_exc.BadRequest, utils.get_and_validate_sort_keys, sorts, FakePort) def test_get_and_validate_sort_keys_by_relationship_fails(self): sorts = [('gw_port', True)] self.assertRaises(n_exc.BadRequest, utils.get_and_validate_sort_keys, sorts, FakeRouter) neutron-lib-1.13.0/neutron_lib/tests/unit/db/test_model_base.py0000666000175100017510000000430413231472055024614 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import sqlalchemy as sa from neutron_lib import context from neutron_lib.db import model_base from neutron_lib.tests.unit.db import _base as db_base class TestTable(model_base.BASEV2, model_base.HasProject, model_base.HasId, model_base.HasStatusDescription): name = sa.Column(sa.String(8), primary_key=True) class TestModelBase(db_base.SqlTestCase): def setUp(self): super(TestModelBase, self).setUp() self.ctx = context.Context('user', 'project') self.session = self.ctx.session def test_model_base(self): foo = TestTable(name='meh') self.assertEqual('meh', foo.name) self.assertIn('meh', str(foo)) # test foo.__repr__ cols = [k for k, _v in foo] # test foo.__iter__ and foo.next self.assertIn('name', cols) def test_get_set_tenant_id_tenant(self): foo = TestTable(tenant_id='tenant') self.assertEqual('tenant', foo.get_tenant_id()) foo.set_tenant_id('project') self.assertEqual('project', foo.get_tenant_id()) def test_get_set_tenant_id_project(self): foo = TestTable(project_id='project') self.assertEqual('project', foo.get_tenant_id()) foo.set_tenant_id('tenant') self.assertEqual('tenant', foo.get_tenant_id()) def test_project_id_attribute(self): foo = TestTable(project_id='project') self.assertEqual('project', foo.project_id) self.assertEqual('project', foo.tenant_id) def test_tenant_id_attribute(self): foo = TestTable(tenant_id='tenant') self.assertEqual('tenant', foo.project_id) self.assertEqual('tenant', foo.tenant_id) neutron-lib-1.13.0/neutron_lib/tests/unit/callbacks/0000775000175100017510000000000013231472430022435 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/callbacks/test_registry.py0000666000175100017510000001233413231472055025726 0ustar zuulzuul00000000000000# Copyright 2015 Cisco Systems Inc # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock import testtools from oslotest import base from neutron_lib.callbacks import events from neutron_lib.callbacks import registry from neutron_lib.callbacks import resources from neutron_lib import fixture @registry.has_registry_receivers class ObjectWithDecoratedCallback(object): def __init__(self): self.counter = 0 @registry.receives(resources.PORT, [events.AFTER_CREATE, events.AFTER_UPDATE]) @registry.receives(resources.NETWORK, [events.AFTER_DELETE]) def callback(self, *args, **kwargs): self.counter += 1 class MixinWithNew(object): def __new__(cls): i = super(MixinWithNew, cls).__new__(cls) i.new_called = True return i @registry.has_registry_receivers class AnotherObjectWithDecoratedCallback(ObjectWithDecoratedCallback, MixinWithNew): def __init__(self): super(AnotherObjectWithDecoratedCallback, self).__init__() self.counter2 = 0 @registry.receives(resources.NETWORK, [events.AFTER_DELETE]) def callback2(self, *args, **kwargs): self.counter2 += 1 @registry.has_registry_receivers class CallbackClassWithParameters(object): def __init__(self, dummy): pass def my_callback(): pass class CallBacksManagerTestCase(base.BaseTestCase): def test_decorated_inst_method_receives(self): i1 = ObjectWithDecoratedCallback() registry.notify(resources.PORT, events.BEFORE_CREATE, self) self.assertEqual(0, i1.counter) registry.notify(resources.PORT, events.AFTER_CREATE, self) self.assertEqual(1, i1.counter) registry.notify(resources.PORT, events.AFTER_UPDATE, self) self.assertEqual(2, i1.counter) registry.notify(resources.NETWORK, events.AFTER_UPDATE, self) self.assertEqual(2, i1.counter) registry.notify(resources.NETWORK, events.AFTER_DELETE, self) self.assertEqual(3, i1.counter) i2 = ObjectWithDecoratedCallback() self.assertEqual(0, i2.counter) registry.notify(resources.NETWORK, events.AFTER_DELETE, self) self.assertEqual(4, i1.counter) self.assertEqual(1, i2.counter) def test_object_inheriting_others_no_double_subscribe(self): with mock.patch.object(registry, 'subscribe') as sub: AnotherObjectWithDecoratedCallback() # there are 3 methods (2 in parent and one in child) and 1 # subscribes to 2 events, so we expect 4 subscribes self.assertEqual(4, len(sub.mock_calls)) def test_new_inheritance_not_broken(self): self.assertTrue(AnotherObjectWithDecoratedCallback().new_called) def test_object_new_not_broken(self): CallbackClassWithParameters('dummy') def test_no_strings_in_events_arg(self): with testtools.ExpectedException(AssertionError): registry.receives(resources.PORT, events.AFTER_CREATE) class TestCallbackRegistryDispatching(base.BaseTestCase): def setUp(self): super(TestCallbackRegistryDispatching, self).setUp() self.callback_manager = mock.Mock() self.registry_fixture = fixture.CallbackRegistryFixture( callback_manager=self.callback_manager) self.useFixture(self.registry_fixture) def test_subscribe(self): registry.subscribe(my_callback, 'my-resource', 'my-event') self.callback_manager.subscribe.assert_called_with( my_callback, 'my-resource', 'my-event') def test_unsubscribe(self): registry.unsubscribe(my_callback, 'my-resource', 'my-event') self.callback_manager.unsubscribe.assert_called_with( my_callback, 'my-resource', 'my-event') def test_unsubscribe_by_resource(self): registry.unsubscribe_by_resource(my_callback, 'my-resource') self.callback_manager.unsubscribe_by_resource.assert_called_with( my_callback, 'my-resource') def test_unsubscribe_all(self): registry.unsubscribe_all(my_callback) self.callback_manager.unsubscribe_all.assert_called_with( my_callback) def test_notify(self): registry.notify('my-resource', 'my-event', mock.ANY) self.callback_manager.notify.assert_called_with( 'my-resource', 'my-event', mock.ANY) def test_clear(self): registry.clear() self.callback_manager.clear.assert_called_with() def test_publish_payload(self): event_payload = events.EventPayload(mock.ANY) registry.publish('x', 'y', self, payload=event_payload) self.callback_manager.publish.assert_called_with( 'x', 'y', self, payload=event_payload) neutron-lib-1.13.0/neutron_lib/tests/unit/callbacks/__init__.py0000666000175100017510000000000013231472055024541 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/callbacks/test_events.py0000666000175100017510000001016013231472055025355 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock from neutron_lib.callbacks import events from oslotest import base class EventPayloadTestCase(base.BaseTestCase): def test_context(self): e = events.EventPayload(mock.ANY) self.assertEqual(mock.ANY, e.context) def test_metadata(self): meta = {'k1': 'v1', 'k2': mock.ANY} e = events.EventPayload(mock.ANY, metadata=meta) self.assertEqual(meta, e.metadata) event_meta = e.metadata event_meta['k3'] = 'v3' self.assertTrue('k3' in e.metadata) def test_request_body(self): e = events.EventPayload(mock.ANY, request_body={'k', 'v'}) self.assertEqual({'k', 'v'}, e.request_body) def test_states(self): e = events.EventPayload(mock.ANY, states=['s1', 's2']) self.assertEqual(['s1', 's2'], e.states) e.states.append('state') self.assertIn('state', e.states) def test_resource_id(self): e = events.EventPayload(mock.ANY, resource_id='id1') self.assertEqual('id1', e.resource_id) def test_has_no_states(self): e = events.EventPayload(mock.ANY) self.assertFalse(e.has_states) def test_has_states(self): e = events.EventPayload(mock.ANY, states=['s1']) self.assertTrue(e.has_states) def test_latest_state_with_states(self): body = object() states = [object(), object()] e = events.EventPayload(mock.ANY, request_body=body, states=states) self.assertEqual(states[-1], e.latest_state) def test_latest_state_without_states(self): body = object() e = events.EventPayload(mock.ANY, request_body=body) self.assertIsNone(e.latest_state) class DataStoreEventPayloadTestCase(base.BaseTestCase): def test_states(self): e = events.DBEventPayload(mock.ANY, states=['s1']) self.assertEqual(['s1'], e.states) def test_desired_state(self): desired_state = {'k': object()} e = events.DBEventPayload(mock.ANY, desired_state=desired_state) self.assertEqual(desired_state, e.desired_state) desired_state['a'] = 'A' self.assertEqual(desired_state, e.desired_state) def test_is_not_persisted(self): e = events.DBEventPayload(mock.ANY, states=['s1']) self.assertFalse(e.is_persisted) e = events.DBEventPayload(mock.ANY, resource_id='1a') self.assertFalse(e.is_persisted) def test_is_persisted(self): e = events.DBEventPayload(mock.ANY, states=['s1'], resource_id='1a') self.assertTrue(e.is_persisted) def test_is_not_to_be_committed(self): e = events.DBEventPayload(mock.ANY, states=['s1'], resource_id='1a') self.assertFalse(e.is_to_be_committed) def test_is_to_be_committed(self): e = events.DBEventPayload(mock.ANY, states=[mock.ANY], resource_id='1a', desired_state=object()) self.assertTrue(e.is_to_be_committed) def test_latest_state_with_desired_state(self): desired_state = object() e = events.DBEventPayload(mock.ANY, states=[object()], desired_state=desired_state) self.assertEqual(desired_state, e.latest_state) class APIEventPayloadTestCase(base.BaseTestCase): def test_action(self): e = events.APIEventPayload(mock.ANY, 'post.end', 'POST') self.assertEqual('POST', e.action) def test_method_name(self): e = events.APIEventPayload(mock.ANY, 'post.end', 'POST') self.assertEqual('post.end', e.method_name) neutron-lib-1.13.0/neutron_lib/tests/unit/callbacks/test_callback_exceptions.py0000666000175100017510000000406013231472055030050 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ test_callback_exceptions ---------------------------------- Tests for `neutron_lib.callback.exceptions` module. """ import functools import neutron_lib.callbacks.exceptions as ex from neutron_lib.tests.unit.exceptions import test_exceptions class TestCallbackExceptions(test_exceptions.TestExceptions): def _check_exception(self, exc_class, expected_msg, **kwargs): raise_exc_class = functools.partial(test_exceptions._raise, exc_class) e = self.assertRaises(exc_class, raise_exc_class, **kwargs) self.assertEqual(expected_msg, str(e)) def test_invalid(self): self._check_exception( ex.Invalid, "The value 'foo' for bar is not valid.", value='foo', element='bar') def test_callback_failure(self): self._check_exception( ex.CallbackFailure, 'one', errors='one') def test_callback_failure_with_list(self): self._check_exception( ex.CallbackFailure, '1,2,3', errors=[1, 2, 3]) def test_notification_error(self): '''Test that correct message is created for this error class.''' error = ex.NotificationError('abc', 'boom') self.assertEqual('Callback abc failed with "boom"', str(error)) def test_inner_exceptions(self): key_err = KeyError() n_key_err = ex.NotificationError('cb1', key_err) err = ex.CallbackFailure([key_err, n_key_err]) self.assertEqual([key_err, n_key_err.error], err.inner_exceptions) neutron-lib-1.13.0/neutron_lib/tests/unit/callbacks/test_manager.py0000666000175100017510000003131113231472055025464 0ustar zuulzuul00000000000000# Copyright 2015 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock from oslo_db import exception as db_exc from oslotest import base from neutron_lib.callbacks import events from neutron_lib.callbacks import exceptions from neutron_lib.callbacks import manager from neutron_lib.callbacks import resources class ObjectWithCallback(object): def __init__(self): self.counter = 0 def callback(self, *args, **kwargs): self.counter += 1 class GloriousObjectWithCallback(ObjectWithCallback): pass def callback_1(*args, **kwargs): callback_1.counter += 1 callback_id_1 = manager._get_id(callback_1) def callback_2(*args, **kwargs): callback_2.counter += 1 callback_id_2 = manager._get_id(callback_2) def callback_raise(*args, **kwargs): raise Exception() def callback_raise_retriable(*args, **kwargs): raise db_exc.DBDeadlock() def callback_3(resource, event, trigger, payload): callback_3.counter += 1 class CallBacksManagerTestCase(base.BaseTestCase): def setUp(self): super(CallBacksManagerTestCase, self).setUp() self.manager = manager.CallbacksManager() callback_1.counter = 0 callback_2.counter = 0 callback_3.counter = 0 def test_subscribe(self): self.manager.subscribe( callback_1, resources.PORT, events.BEFORE_CREATE) self.assertIsNotNone( self.manager._callbacks[resources.PORT][events.BEFORE_CREATE]) self.assertIn(callback_id_1, self.manager._index) self.assertEqual(self.__module__ + '.callback_1-%s' % hash(callback_1), callback_id_1) def test_subscribe_unknown(self): self.manager.subscribe( callback_1, 'my_resource', 'my-event') self.assertIsNotNone( self.manager._callbacks['my_resource']['my-event']) self.assertIn(callback_id_1, self.manager._index) def test_subscribe_is_idempotent(self): self.manager.subscribe( callback_1, resources.PORT, events.BEFORE_CREATE) self.manager.subscribe( callback_1, resources.PORT, events.BEFORE_CREATE) self.assertEqual( 1, len(self.manager._callbacks[resources.PORT][events.BEFORE_CREATE])) callbacks = self.manager._index[callback_id_1][resources.PORT] self.assertEqual(1, len(callbacks)) def test_subscribe_multiple_callbacks(self): self.manager.subscribe( callback_1, resources.PORT, events.BEFORE_CREATE) self.manager.subscribe( callback_2, resources.PORT, events.BEFORE_CREATE) self.assertEqual(2, len(self.manager._index)) self.assertEqual( 2, len(self.manager._callbacks[resources.PORT][events.BEFORE_CREATE])) def test_unsubscribe_during_iteration(self): unsub = lambda r, e, *a, **k: self.manager.unsubscribe(unsub, r, e) self.manager.subscribe(unsub, resources.PORT, events.BEFORE_CREATE) self.manager.notify(resources.PORT, events.BEFORE_CREATE, mock.ANY) self.assertNotIn(unsub, self.manager._index) def test_unsubscribe(self): self.manager.subscribe( callback_1, resources.PORT, events.BEFORE_CREATE) self.manager.unsubscribe( callback_1, resources.PORT, events.BEFORE_CREATE) self.assertNotIn( callback_id_1, self.manager._callbacks[resources.PORT][events.BEFORE_CREATE]) self.assertNotIn(callback_id_1, self.manager._index) def test_unsubscribe_unknown_callback(self): self.manager.subscribe( callback_2, resources.PORT, events.BEFORE_CREATE) self.manager.unsubscribe(callback_1, mock.ANY, mock.ANY) self.assertEqual(1, len(self.manager._index)) def test_fail_to_unsubscribe(self): self.manager.subscribe( callback_1, resources.PORT, events.BEFORE_CREATE) self.assertRaises(exceptions.Invalid, self.manager.unsubscribe, callback_1, resources.PORT, None) self.assertRaises(exceptions.Invalid, self.manager.unsubscribe, callback_1, None, events.BEFORE_CREATE) def test_unsubscribe_is_idempotent(self): self.manager.subscribe( callback_1, resources.PORT, events.BEFORE_CREATE) self.manager.unsubscribe( callback_1, resources.PORT, events.BEFORE_CREATE) self.manager.unsubscribe( callback_1, resources.PORT, events.BEFORE_CREATE) self.assertNotIn(callback_id_1, self.manager._index) self.assertNotIn(callback_id_1, self.manager._callbacks[resources.PORT] [events.BEFORE_CREATE]) def test_unsubscribe_by_resource(self): self.manager.subscribe( callback_1, resources.PORT, events.BEFORE_CREATE) self.manager.subscribe( callback_1, resources.PORT, events.BEFORE_DELETE) self.manager.subscribe( callback_2, resources.PORT, events.BEFORE_DELETE) self.manager.unsubscribe_by_resource(callback_1, resources.PORT) self.assertNotIn( callback_id_1, self.manager._callbacks[resources.PORT][events.BEFORE_CREATE]) self.assertIn( callback_id_2, self.manager._callbacks[resources.PORT][events.BEFORE_DELETE]) self.assertNotIn(callback_id_1, self.manager._index) def test_unsubscribe_all(self): self.manager.subscribe( callback_1, resources.PORT, events.BEFORE_CREATE) self.manager.subscribe( callback_1, resources.PORT, events.BEFORE_DELETE) self.manager.subscribe( callback_1, resources.ROUTER, events.BEFORE_CREATE) self.manager.unsubscribe_all(callback_1) self.assertNotIn( callback_id_1, self.manager._callbacks[resources.PORT][events.BEFORE_CREATE]) self.assertNotIn(callback_id_1, self.manager._index) def test_notify_none(self): self.manager.notify(resources.PORT, events.BEFORE_CREATE, mock.ANY) self.assertEqual(0, callback_1.counter) self.assertEqual(0, callback_2.counter) def test_feebly_referenced_callback(self): self.manager.subscribe(lambda *x, **y: None, resources.PORT, events.BEFORE_CREATE) self.manager.notify(resources.PORT, events.BEFORE_CREATE, mock.ANY) def test_notify_with_exception(self): with mock.patch.object(self.manager, '_notify_loop') as n: n.return_value = ['error'] self.assertRaises(exceptions.CallbackFailure, self.manager.notify, mock.ANY, events.BEFORE_CREATE, mock.ANY) expected_calls = [ mock.call(mock.ANY, 'before_create', mock.ANY), mock.call(mock.ANY, 'abort_create', mock.ANY) ] n.assert_has_calls(expected_calls) def test_notify_with_precommit_exception(self): with mock.patch.object(self.manager, '_notify_loop') as n: n.return_value = ['error'] self.assertRaises(exceptions.CallbackFailure, self.manager.notify, mock.ANY, events.PRECOMMIT_UPDATE, mock.ANY) expected_calls = [ mock.call(mock.ANY, 'precommit_update', mock.ANY), ] n.assert_has_calls(expected_calls) def test_notify_handle_exception(self): self.manager.subscribe( callback_raise, resources.PORT, events.BEFORE_CREATE) e = self.assertRaises(exceptions.CallbackFailure, self.manager.notify, resources.PORT, events.BEFORE_CREATE, self) self.assertIsInstance(e.errors[0], exceptions.NotificationError) def test_notify_handle_retriable_exception(self): self.manager.subscribe( callback_raise_retriable, resources.PORT, events.BEFORE_CREATE) self.assertRaises(db_exc.RetryRequest, self.manager.notify, resources.PORT, events.BEFORE_CREATE, self) def test_notify_called_once_with_no_failures(self): with mock.patch.object(self.manager, '_notify_loop') as n: n.return_value = False self.manager.notify(resources.PORT, events.BEFORE_CREATE, mock.ANY) n.assert_called_once_with( resources.PORT, events.BEFORE_CREATE, mock.ANY) def test__notify_loop_single_event(self): self.manager.subscribe( callback_1, resources.PORT, events.BEFORE_CREATE) self.manager.subscribe( callback_2, resources.PORT, events.BEFORE_CREATE) self.manager._notify_loop( resources.PORT, events.BEFORE_CREATE, mock.ANY) self.assertEqual(1, callback_1.counter) self.assertEqual(1, callback_2.counter) def test__notify_loop_multiple_events(self): self.manager.subscribe( callback_1, resources.PORT, events.BEFORE_CREATE) self.manager.subscribe( callback_1, resources.ROUTER, events.BEFORE_DELETE) self.manager.subscribe( callback_2, resources.PORT, events.BEFORE_CREATE) self.manager._notify_loop( resources.PORT, events.BEFORE_CREATE, mock.ANY) self.manager._notify_loop( resources.ROUTER, events.BEFORE_DELETE, mock.ANY) self.assertEqual(2, callback_1.counter) self.assertEqual(1, callback_2.counter) def test_clearing_subscribers(self): self.manager.subscribe( callback_1, resources.PORT, events.BEFORE_CREATE) self.manager.subscribe( callback_2, resources.PORT, events.AFTER_CREATE) self.assertEqual(2, len(self.manager._callbacks[resources.PORT])) self.assertEqual(2, len(self.manager._index)) self.manager.clear() self.assertEqual(0, len(self.manager._callbacks)) self.assertEqual(0, len(self.manager._index)) @mock.patch("neutron_lib.callbacks.manager.LOG") def test__notify_loop_skip_log_errors(self, _logger): self.manager.subscribe( callback_raise, resources.PORT, events.BEFORE_CREATE) self.manager.subscribe( callback_raise, resources.PORT, events.PRECOMMIT_CREATE) self.manager._notify_loop( resources.PORT, events.BEFORE_CREATE, mock.ANY) self.manager._notify_loop( resources.PORT, events.PRECOMMIT_CREATE, mock.ANY) self.assertFalse(_logger.exception.call_count) self.assertTrue(_logger.debug.call_count) def test_object_instances_as_subscribers(self): """Ensures that the manager doesn't think these are equivalent.""" a = GloriousObjectWithCallback() b = ObjectWithCallback() c = ObjectWithCallback() for o in (a, b, c): self.manager.subscribe( o.callback, resources.PORT, events.BEFORE_CREATE) # ensure idempotency remains for a single object self.manager.subscribe( o.callback, resources.PORT, events.BEFORE_CREATE) self.manager.notify(resources.PORT, events.BEFORE_CREATE, mock.ANY) self.assertEqual(1, a.counter) self.assertEqual(1, b.counter) self.assertEqual(1, c.counter) def test_publish_invalid_payload(self): self.assertRaises(exceptions.Invalid, self.manager.publish, resources.PORT, events.AFTER_DELETE, self, payload=object()) def test_publish_empty_payload(self): notify_payload = [] def _memo(resource, event, trigger, payload=None): notify_payload.append(payload) self.manager.subscribe(_memo, 'x', 'y') self.manager.publish('x', 'y', self) self.assertIsNone(notify_payload[0]) def test_publish_payload(self): notify_payload = [] def _memo(resource, event, trigger, payload=None): notify_payload.append(payload) self.manager.subscribe(_memo, 'x', 'y') payload = events.EventPayload(object()) self.manager.publish('x', 'y', self, payload=payload) self.assertEqual(payload, notify_payload[0]) neutron-lib-1.13.0/neutron_lib/tests/unit/plugins/0000775000175100017510000000000013231472430022177 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/plugins/__init__.py0000666000175100017510000000000013231472055024303 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/plugins/test_directory.py0000666000175100017510000000666513231472055025636 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.plugins import directory from neutron_lib.tests import _base as base def fake_plugin(): pass class DirectoryTestCase(base.BaseTestCase): def test__create_plugin_directory(self): self.assertIsNotNone(directory._create_plugin_directory()) def test__get_plugin_directory(self): self.assertIsNotNone(directory._get_plugin_directory()) def test_add_plugin(self): directory.add_plugin('foo', fake_plugin) self.assertIn('foo', directory.get_plugins()) def test_get_plugin_core_none(self): self.assertIsNone(directory.get_plugin()) def test_get_plugin_alias_none(self): self.assertIsNone(directory.get_plugin('foo')) def test_get_plugin_core(self): directory.add_plugin('CORE', fake_plugin) self.assertIsNotNone(directory.get_plugin()) def test_get_plugin_alias(self): directory.add_plugin('foo', fake_plugin) self.assertIsNotNone(directory.get_plugin('foo')) def test_get_plugins_none(self): self.assertFalse(directory.get_plugins()) def test_get_unique_plugins_none(self): self.assertFalse(directory.get_unique_plugins()) def test_get_plugins(self): directory.add_plugin('CORE', fake_plugin) self.assertIsNotNone(directory.get_plugins()) def test_get_unique_plugins(self): directory.add_plugin('foo1', fake_plugin) directory.add_plugin('foo2', fake_plugin) self.assertEqual(1, len(directory.get_unique_plugins())) def test_is_loaded(self): self.assertFalse(directory.is_loaded()) directory.add_plugin('foo1', fake_plugin) self.assertTrue(directory.is_loaded()) class PluginDirectoryTestCase(base.BaseTestCase): def setUp(self): super(PluginDirectoryTestCase, self).setUp() self.plugin_directory = directory._PluginDirectory() def test_add_plugin(self): self.plugin_directory.add_plugin('foo', 'bar') self.assertEqual(1, len(self.plugin_directory._plugins)) def test_get_plugin_not_found(self): self.assertIsNone(self.plugin_directory.get_plugin('foo')) def test_get_plugin_found(self): self.plugin_directory._plugins = {'foo': lambda *x, **y: 'bar'} plugin = self.plugin_directory.get_plugin('foo') self.assertEqual('bar', plugin()) def test_plugins(self): self.plugin_directory._plugins = {'foo': lambda *x, **y: 'bar'} self.assertIsNotNone(self.plugin_directory.plugins) def test_unique_plugins(self): self.plugin_directory._plugins = { 'foo1': fake_plugin, 'foo2': fake_plugin, } self.assertEqual(1, len(self.plugin_directory.unique_plugins)) def test_is_loaded(self): self.assertFalse(self.plugin_directory.is_loaded) self.plugin_directory._plugins = {'foo': lambda *x, **y: 'bar'} self.assertTrue(self.plugin_directory.is_loaded) neutron-lib-1.13.0/neutron_lib/tests/unit/plugins/test_utils.py0000666000175100017510000002127413231472055024763 0ustar zuulzuul00000000000000# Copyright (c) 2015 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import hashlib import mock from oslo_utils import excutils from neutron_lib import constants from neutron_lib import exceptions from neutron_lib.plugins import utils from neutron_lib.tests import _base as base LONG_NAME1 = "A_REALLY_LONG_INTERFACE_NAME1" LONG_NAME2 = "A_REALLY_LONG_INTERFACE_NAME2" SHORT_NAME = "SHORT" MOCKED_HASH = "mockedhash" class MockSHA(object): def hexdigest(self): return MOCKED_HASH class TestUtils(base.BaseTestCase): def test_is_valid_vlan_tag(self): for v in [constants.MIN_VLAN_TAG, constants.MIN_VLAN_TAG + 2, constants.MAX_VLAN_TAG, constants.MAX_VLAN_TAG - 2]: self.assertTrue(utils.is_valid_vlan_tag(v)) def test_is_valid_vlan_tag_invalid_data(self): for v in [constants.MIN_VLAN_TAG - 1, constants.MIN_VLAN_TAG - 2, constants.MAX_VLAN_TAG + 1, constants.MAX_VLAN_TAG + 2]: self.assertFalse(utils.is_valid_vlan_tag(v)) def test_verify_vlan_range(self): for v in [(constants.MIN_VLAN_TAG, constants.MIN_VLAN_TAG + 2), (constants.MIN_VLAN_TAG + 2, constants.MAX_VLAN_TAG - 2)]: self.assertIsNone(utils.verify_vlan_range(v)) def test_verify_vlan_range_invalid_range(self): for v in [(constants.MIN_VLAN_TAG, constants.MAX_VLAN_TAG + 2), (constants.MIN_VLAN_TAG + 4, constants.MIN_VLAN_TAG + 1)]: self.assertRaises(exceptions.NetworkVlanRangeError, utils.verify_vlan_range, v) def test_parse_network_vlan_range(self): self.assertEqual( ('n1', (1, 3)), utils.parse_network_vlan_range('n1:1:3')) self.assertEqual( ('n1', (1, 1111)), utils.parse_network_vlan_range('n1:1:1111')) def test_parse_network_vlan_range_invalid_range(self): self.assertRaises(exceptions.NetworkVlanRangeError, utils.parse_network_vlan_range, 'n1:1,4') def test_parse_network_vlan_range_missing_network(self): self.assertRaises(exceptions.PhysicalNetworkNameError, utils.parse_network_vlan_range, ':1:4') def test_parse_network_vlan_range_invalid_min_type(self): self.assertRaises(exceptions.NetworkVlanRangeError, utils.parse_network_vlan_range, 'n1:a:4') def test_parse_network_vlan_ranges(self): ranges = utils.parse_network_vlan_ranges(['n1:1:3', 'n2:2:4']) self.assertEqual(2, len(ranges.keys())) self.assertIn('n1', ranges.keys()) self.assertIn('n2', ranges.keys()) self.assertEqual(2, len(ranges['n1'][0])) self.assertEqual(1, ranges['n1'][0][0]) self.assertEqual(3, ranges['n1'][0][1]) self.assertEqual(2, len(ranges['n2'][0])) self.assertEqual(2, ranges['n2'][0][0]) self.assertEqual(4, ranges['n2'][0][1]) def test_is_valid_gre_id(self): for v in [constants.MIN_GRE_ID, constants.MIN_GRE_ID + 2, constants.MAX_GRE_ID, constants.MAX_GRE_ID - 2]: self.assertTrue(utils.is_valid_gre_id(v)) def test_is_valid_gre_id_invalid_id(self): for v in [constants.MIN_GRE_ID - 1, constants.MIN_GRE_ID - 2, True, 'z', 99.999, []]: self.assertFalse(utils.is_valid_gre_id(v)) def test_is_valid_vxlan_vni(self): for v in [constants.MIN_VXLAN_VNI, constants.MAX_VXLAN_VNI, constants.MIN_VXLAN_VNI + 1, constants.MAX_VXLAN_VNI - 1]: self.assertTrue(utils.is_valid_vxlan_vni(v)) def test_is_valid_vxlan_vni_invalid_values(self): for v in [constants.MIN_VXLAN_VNI - 1, constants.MAX_VXLAN_VNI + 1, True, 'a', False, {}]: self.assertFalse(utils.is_valid_vxlan_vni(v)) def test_is_valid_geneve_vni(self): for v in [constants.MIN_GENEVE_VNI, constants.MAX_GENEVE_VNI, constants.MIN_GENEVE_VNI + 1, constants.MAX_GENEVE_VNI - 1]: self.assertTrue(utils.is_valid_geneve_vni(v)) def test_is_valid_geneve_vni_invalid_values(self): for v in [constants.MIN_GENEVE_VNI - 1, constants.MAX_GENEVE_VNI + 1, True, False, (), 'True']: self.assertFalse(utils.is_valid_geneve_vni(v)) def test_verify_tunnel_range_known_tunnel_type(self): mock_fns = [mock.Mock(return_value=False) for _ in range(3)] mock_map = { constants.TYPE_GRE: mock_fns[0], constants.TYPE_VXLAN: mock_fns[1], constants.TYPE_GENEVE: mock_fns[2] } with mock.patch.dict(utils._TUNNEL_MAPPINGS, mock_map): for t in [constants.TYPE_GRE, constants.TYPE_VXLAN, constants.TYPE_GENEVE]: self.assertRaises( exceptions.NetworkTunnelRangeError, utils.verify_tunnel_range, [0, 1], t) for f in mock_fns: f.assert_called_once_with(0) def test_verify_tunnel_range_invalid_range(self): for r in [[1, 0], [0, -1], [2, 1]]: self.assertRaises( exceptions.NetworkTunnelRangeError, utils.verify_tunnel_range, r, constants.TYPE_FLAT) def test_verify_tunnel_range(self): for r in [[0, 1], [-1, 0], [1, 2]]: self.assertIsNone( utils.verify_tunnel_range(r, constants.TYPE_FLAT)) def test_delete_port_on_error(self): core_plugin = mock.Mock() with mock.patch.object(excutils, 'save_and_reraise_exception'): with mock.patch.object(utils, 'LOG'): with utils.delete_port_on_error(core_plugin, 'ctx', '1'): raise Exception() core_plugin.delete_port.assert_called_once_with( 'ctx', '1', l3_port_check=False) def test_update_port_on_error(self): core_plugin = mock.Mock() with mock.patch.object(excutils, 'save_and_reraise_exception'): with mock.patch.object(utils, 'LOG'): with utils.update_port_on_error(core_plugin, 'ctx', '1', '2'): raise Exception() core_plugin.update_port.assert_called_once_with( 'ctx', '1', {'port': '2'}) @mock.patch.object(hashlib, 'sha1', return_value=MockSHA()) def test_get_interface_name(self, mock_sha1): prefix = "pre-" prefix_long = "long_prefix" prefix_exceeds_max_dev_len = "much_too_long_prefix" hash_used = MOCKED_HASH[0:6] self.assertEqual("A_REALLY_" + hash_used, utils.get_interface_name(LONG_NAME1)) self.assertEqual("SHORT", utils.get_interface_name(SHORT_NAME)) self.assertEqual("pre-A_REA" + hash_used, utils.get_interface_name(LONG_NAME1, prefix=prefix)) self.assertEqual("pre-SHORT", utils.get_interface_name(SHORT_NAME, prefix=prefix)) # len(prefix) > max_device_len - len(hash_used) self.assertRaises(ValueError, utils.get_interface_name, SHORT_NAME, prefix_long) # len(prefix) > max_device_len self.assertRaises(ValueError, utils.get_interface_name, SHORT_NAME, prefix=prefix_exceeds_max_dev_len) def test_get_interface_uniqueness(self): prefix = "prefix-" if_prefix1 = utils.get_interface_name(LONG_NAME1, prefix=prefix) if_prefix2 = utils.get_interface_name(LONG_NAME2, prefix=prefix) self.assertNotEqual(if_prefix1, if_prefix2) @mock.patch.object(hashlib, 'sha1', return_value=MockSHA()) def test_get_interface_max_len(self, mock_sha1): self.assertEqual(constants.DEVICE_NAME_MAX_LEN, len(utils.get_interface_name(LONG_NAME1))) self.assertEqual(10, len(utils.get_interface_name(LONG_NAME1, max_len=10))) self.assertEqual(12, len(utils.get_interface_name(LONG_NAME1, prefix="pre-", max_len=12))) neutron-lib-1.13.0/neutron_lib/tests/unit/plugins/ml2/0000775000175100017510000000000013231472430022671 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/plugins/ml2/__init__.py0000666000175100017510000000000013231472055024775 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/plugins/ml2/test_api.py0000666000175100017510000000245213231472055025063 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.plugins.ml2 import api from neutron_lib.tests import _base as base class _MechanismDriver(api.MechanismDriver): bind_port = lambda s, c: c def initialize(self): pass class TestMechanismDriver(base.BaseTestCase): def test__supports_port_binding(self): self.assertTrue(_MechanismDriver()._supports_port_binding) def test_get_workers(self): self.assertEqual((), _MechanismDriver().get_workers()) def test_filter_hosts_with_segment_access(self): dummy_token = ["X"] self.assertEqual( dummy_token, _MechanismDriver().filter_hosts_with_segment_access( dummy_token, dummy_token, dummy_token, dummy_token)) neutron-lib-1.13.0/neutron_lib/tests/unit/api/0000775000175100017510000000000013231472430021267 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/api/test_attributes.py0000666000175100017510000002556513231472055025110 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_utils import uuidutils import testtools from webob import exc from neutron_lib.api import attributes from neutron_lib.api import converters from neutron_lib.api.definitions import network from neutron_lib.api.definitions import port from neutron_lib.api.definitions import subnet from neutron_lib.api.definitions import subnetpool from neutron_lib import constants from neutron_lib import context from neutron_lib import exceptions from neutron_lib.tests import _base as base class TestPopulateProjectInfo(base.BaseTestCase): def test_populate_project_info_add_project(self): attrs_in = {'tenant_id': uuidutils.generate_uuid()} attrs_out = attributes.populate_project_info(attrs_in) self.assertIn('project_id', attrs_out) self.assertEqual(attrs_in['tenant_id'], attrs_out['project_id']) self.assertEqual(2, len(attrs_out)) def test_populate_project_info_add_tenant(self): attrs_in = {'project_id': uuidutils.generate_uuid()} attrs_out = attributes.populate_project_info(attrs_in) self.assertIn('tenant_id', attrs_out) self.assertEqual(attrs_in['project_id'], attrs_out['tenant_id']) self.assertEqual(2, len(attrs_out)) def test_populate_project_info_ids_match(self): project_id = uuidutils.generate_uuid() attrs_in = {'project_id': project_id, 'tenant_id': project_id} attrs_out = attributes.populate_project_info(attrs_in) self.assertEqual(attrs_in, attrs_out) def test_populate_project_info_id_mismatch(self): attrs = { 'project_id': uuidutils.generate_uuid(), 'tenant_id': uuidutils.generate_uuid() } self.assertRaises(exc.HTTPBadRequest, attributes.populate_project_info, attrs) class TestAttributeInfo(base.BaseTestCase): class _MyException(Exception): pass _EXC_CLS = _MyException _RESOURCE_NAME = 'thing' _RESOURCE_ATTRS = {'name': {}, 'type': {}} _RESOURCE_MAP = {_RESOURCE_NAME: _RESOURCE_ATTRS} _ATTRS_INSTANCE = attributes.AttributeInfo(_RESOURCE_MAP) def test_create_from_attribute_info_instance(self): cloned_attrs = attributes.AttributeInfo( TestAttributeInfo._ATTRS_INSTANCE) self.assertEqual(TestAttributeInfo._ATTRS_INSTANCE.attributes, cloned_attrs.attributes) def test_create_from_api_def(self): self.assertEqual( port.RESOURCE_ATTRIBUTE_MAP, attributes.AttributeInfo(port.RESOURCE_ATTRIBUTE_MAP).attributes) def _test_fill_default_value(self, attr_inst, expected, res_dict, check_allow_post=True): attr_inst.fill_post_defaults( res_dict, check_allow_post=check_allow_post) self.assertEqual(expected, res_dict) def test_fill_default_value_ok(self): attr_info = { 'key': { 'allow_post': True, 'default': constants.ATTR_NOT_SPECIFIED, }, } attr_inst = attributes.AttributeInfo(attr_info) self._test_fill_default_value(attr_inst, {'key': 'X'}, {'key': 'X'}) self._test_fill_default_value( attr_inst, {'key': constants.ATTR_NOT_SPECIFIED}, {}) def test_override_no_allow_post(self): attr_info = { 'key': { 'allow_post': False, 'default': constants.ATTR_NOT_SPECIFIED, }, } attr_inst = attributes.AttributeInfo(attr_info) self._test_fill_default_value(attr_inst, {'key': 'X'}, {'key': 'X'}, check_allow_post=False) def test_fill_no_default_value_allow_post(self): attr_info = { 'key': { 'allow_post': True, }, } attr_inst = attributes.AttributeInfo(attr_info) self._test_fill_default_value(attr_inst, {'key': 'X'}, {'key': 'X'}) self.assertRaises(exceptions.InvalidInput, self._test_fill_default_value, attr_inst, {'key': 'X'}, {}) self.assertRaises(self._EXC_CLS, attr_inst.fill_post_defaults, {}, self._EXC_CLS) def test_fill_no_default_value_no_allow_post(self): attr_info = { 'key': { 'allow_post': False, }, } attr_inst = attributes.AttributeInfo(attr_info) self.assertRaises(exceptions.InvalidInput, self._test_fill_default_value, attr_inst, {'key': 'X'}, {'key': 'X'}) self._test_fill_default_value(attr_inst, {}, {}) self.assertRaises(self._EXC_CLS, attr_inst.fill_post_defaults, {'key': 'X'}, self._EXC_CLS) def _test_convert_value(self, attr_inst, expected, res_dict): attr_inst.convert_values(res_dict) self.assertEqual(expected, res_dict) def test_convert_value(self): attr_info = { 'key': { }, } attr_inst = attributes.AttributeInfo(attr_info) self._test_convert_value(attr_inst, {'key': constants.ATTR_NOT_SPECIFIED}, {'key': constants.ATTR_NOT_SPECIFIED}) self._test_convert_value(attr_inst, {'key': 'X'}, {'key': 'X'}) self._test_convert_value(attr_inst, {'other_key': 'X'}, {'other_key': 'X'}) attr_info = { 'key': { 'convert_to': converters.convert_to_int, }, } attr_inst = attributes.AttributeInfo(attr_info) self._test_convert_value(attr_inst, {'key': constants.ATTR_NOT_SPECIFIED}, {'key': constants.ATTR_NOT_SPECIFIED}) self._test_convert_value(attr_inst, {'key': 1}, {'key': '1'}) self._test_convert_value(attr_inst, {'key': 1}, {'key': 1}) self.assertRaises(exceptions.InvalidInput, self._test_convert_value, attr_inst, {'key': 1}, {'key': 'a'}) attr_info = { 'key': { 'validate': {'type:uuid': None}, }, } attr_inst = attributes.AttributeInfo(attr_info) self._test_convert_value(attr_inst, {'key': constants.ATTR_NOT_SPECIFIED}, {'key': constants.ATTR_NOT_SPECIFIED}) uuid_str = '01234567-1234-1234-1234-1234567890ab' self._test_convert_value(attr_inst, {'key': uuid_str}, {'key': uuid_str}) self.assertRaises(exceptions.InvalidInput, self._test_convert_value, attr_inst, {'key': 1}, {'key': 1}) self.assertRaises(self._EXC_CLS, attr_inst.convert_values, {'key': 1}, self._EXC_CLS) def test_populate_project_id_admin_req(self): tenant_id_1 = uuidutils.generate_uuid() tenant_id_2 = uuidutils.generate_uuid() # non-admin users can't create a res on behalf of another project ctx = context.Context(user_id=None, tenant_id=tenant_id_1) res_dict = {'tenant_id': tenant_id_2} attr_inst = attributes.AttributeInfo({}) self.assertRaises(exc.HTTPBadRequest, attr_inst.populate_project_id, ctx, res_dict, None) # but admin users can ctx.is_admin = True attr_inst.populate_project_id(ctx, res_dict, is_create=False) def test_populate_project_id_from_context(self): tenant_id = uuidutils.generate_uuid() ctx = context.Context(user_id=None, tenant_id=tenant_id) # for each create request, the tenant_id should be added to the # req body res_dict = {} attr_inst = attributes.AttributeInfo({}) attr_inst.populate_project_id(ctx, res_dict, is_create=True) self.assertEqual( {'tenant_id': ctx.tenant_id, 'project_id': ctx.tenant_id}, res_dict) def test_populate_project_id_mandatory_not_specified(self): tenant_id = uuidutils.generate_uuid() ctx = context.Context(user_id=None, tenant_id=tenant_id) # if the tenant_id is mandatory for the resource and not specified # in the request nor in the context, an exception should be raised res_dict = {} attr_info = {'tenant_id': {'allow_post': True}} ctx.tenant_id = None attr_inst = attributes.AttributeInfo(attr_info) self.assertRaises(exc.HTTPBadRequest, attr_inst.populate_project_id, ctx, res_dict, True) def test_populate_project_id_not_mandatory(self): ctx = context.Context(user_id=None) # if the tenant_id is not mandatory for the resource it should be # OK if it is not in the request. res_dict = {'name': 'test_port'} attr_inst = attributes.AttributeInfo({}) ctx.tenant_id = None attr_inst.populate_project_id(ctx, res_dict, True) def test_verify_attributes_null(self): attributes.AttributeInfo({}).verify_attributes({}) def test_verify_attributes_ok_with_project_id(self): attributes.AttributeInfo( {'tenant_id': 'foo', 'project_id': 'foo'}).verify_attributes( {'tenant_id': 'foo'}) def test_verify_attributes_ok_subset(self): attributes.AttributeInfo( {'attr1': 'foo', 'attr2': 'bar'}).verify_attributes( {'attr1': 'foo'}) def test_verify_attributes_unrecognized(self): with testtools.ExpectedException(exc.HTTPBadRequest) as bad_req: attributes.AttributeInfo( {'attr1': 'foo'}).verify_attributes( {'attr1': 'foo', 'attr2': 'bar'}) self.assertEqual(bad_req.message, "Unrecognized attribute(s) 'attr2'") class TestCoreResources(base.BaseTestCase): CORE_DEFS = [network, port, subnet, subnetpool] def test_core_resource_names(self): self.assertEqual( sorted([r.COLLECTION_NAME for r in TestCoreResources.CORE_DEFS]), sorted(attributes.RESOURCES.keys())) def test_core_resource_attrs(self): for r in TestCoreResources.CORE_DEFS: self.assertIs(r.RESOURCE_ATTRIBUTE_MAP[r.COLLECTION_NAME], attributes.RESOURCES[r.COLLECTION_NAME]) neutron-lib-1.13.0/neutron_lib/tests/unit/api/__init__.py0000666000175100017510000000000013231472055023373 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/api/test_conversions.py0000666000175100017510000002755513231472055025273 0ustar zuulzuul00000000000000# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import six import testtools from neutron_lib.api import converters from neutron_lib import constants from neutron_lib import exceptions as n_exc from neutron_lib.tests import _base as base from neutron_lib.tests import _tools as tools class TestConvertToBoolean(base.BaseTestCase): def test_convert_to_boolean_bool(self): self.assertIs(converters.convert_to_boolean(True), True) self.assertIs(converters.convert_to_boolean(False), False) def test_convert_to_boolean_int(self): self.assertIs(converters.convert_to_boolean(0), False) self.assertIs(converters.convert_to_boolean(1), True) self.assertRaises(n_exc.InvalidInput, converters.convert_to_boolean, 7) def test_convert_to_boolean_str(self): self.assertIs(converters.convert_to_boolean('True'), True) self.assertIs(converters.convert_to_boolean('true'), True) self.assertIs(converters.convert_to_boolean('False'), False) self.assertIs(converters.convert_to_boolean('false'), False) self.assertIs(converters.convert_to_boolean('0'), False) self.assertIs(converters.convert_to_boolean('1'), True) self.assertRaises(n_exc.InvalidInput, converters.convert_to_boolean, '7') def test_convert_to_boolean_if_not_none(self): self.assertIsNone(converters.convert_to_boolean_if_not_none(None)) self.assertIs(converters.convert_to_boolean_if_not_none(1), True) class TestConvertToInt(base.BaseTestCase): def test_convert_to_int_int(self): self.assertEqual(-1, converters.convert_to_int(-1)) self.assertEqual(0, converters.convert_to_int(0)) self.assertEqual(1, converters.convert_to_int(1)) def test_convert_to_int_if_not_none(self): self.assertEqual(-1, converters.convert_to_int_if_not_none(-1)) self.assertEqual(0, converters.convert_to_int_if_not_none(0)) self.assertEqual(1, converters.convert_to_int_if_not_none(1)) self.assertIsNone(converters.convert_to_int_if_not_none(None)) def test_convert_to_int_str(self): self.assertEqual(4, converters.convert_to_int('4')) self.assertEqual(6, converters.convert_to_int('6')) self.assertRaises(n_exc.InvalidInput, converters.convert_to_int, 'garbage') def test_convert_to_int_none(self): self.assertRaises(n_exc.InvalidInput, converters.convert_to_int, None) def test_convert_none_to_empty_list_none(self): self.assertEqual([], converters.convert_none_to_empty_list(None)) def test_convert_none_to_empty_dict(self): self.assertEqual({}, converters.convert_none_to_empty_dict(None)) def test_convert_none_to_empty_list_value(self): values = ['1', 3, [], [1], {}, {'a': 3}] for value in values: self.assertEqual( value, converters.convert_none_to_empty_list(value)) class TestConvertToFloat(base.BaseTestCase): # NOTE: the routine being tested here is a plugin-specific extension # module. As the plugin split proceed towards its second phase this # test should either be remove, or the validation routine moved into # neutron.api.v2.attributes def test_convert_to_float_positve_value(self): self.assertEqual( 1.111, converters.convert_to_positive_float_or_none(1.111)) self.assertEqual(1, converters.convert_to_positive_float_or_none(1)) self.assertEqual(0, converters.convert_to_positive_float_or_none(0)) def test_convert_to_float_negative_value(self): self.assertRaises(n_exc.InvalidInput, converters.convert_to_positive_float_or_none, -1.11) def test_convert_to_float_string(self): self.assertEqual(4, converters.convert_to_positive_float_or_none('4')) self.assertEqual( 4.44, converters.convert_to_positive_float_or_none('4.44')) self.assertRaises(n_exc.InvalidInput, converters.convert_to_positive_float_or_none, 'garbage') def test_convert_to_float_none_value(self): self.assertIsNone(converters.convert_to_positive_float_or_none(None)) class TestConvertKvp(base.BaseTestCase): def test_convert_kvp_list_to_dict_succeeds_for_missing_values(self): result = converters.convert_kvp_list_to_dict(['True']) self.assertEqual({}, result) def test_convert_kvp_list_to_dict_succeeds_for_multiple_values(self): result = converters.convert_kvp_list_to_dict( ['a=b', 'a=c', 'a=c', 'b=a']) expected = {'a': tools.UnorderedList(['c', 'b']), 'b': ['a']} self.assertEqual(expected, result) def test_convert_kvp_list_to_dict_succeeds_for_values(self): result = converters.convert_kvp_list_to_dict(['a=b', 'c=d']) self.assertEqual({'a': ['b'], 'c': ['d']}, result) def test_convert_kvp_str_to_list_fails_for_missing_key(self): with testtools.ExpectedException(n_exc.InvalidInput): converters.convert_kvp_str_to_list('=a') def test_convert_kvp_str_to_list_fails_for_missing_equals(self): with testtools.ExpectedException(n_exc.InvalidInput): converters.convert_kvp_str_to_list('a') def test_convert_kvp_str_to_list_succeeds_for_one_equals(self): result = converters.convert_kvp_str_to_list('a=') self.assertEqual(['a', ''], result) def test_convert_kvp_str_to_list_succeeds_for_two_equals(self): result = converters.convert_kvp_str_to_list('a=a=a') self.assertEqual(['a', 'a=a'], result) class TestConvertToList(base.BaseTestCase): def test_convert_to_empty_list(self): for item in (None, [], (), {}): self.assertEqual([], converters.convert_to_list(item)) def test_convert_to_list_string(self): for item in ('', 'foo'): self.assertEqual([item], converters.convert_to_list(item)) def test_convert_to_list_iterable(self): for item in ([None], [1, 2, 3], (1, 2, 3), set([1, 2, 3]), ['foo']): self.assertEqual(list(item), converters.convert_to_list(item)) def test_convert_to_list_non_iterable(self): for item in (True, False, 1, 1.2, object()): self.assertEqual([item], converters.convert_to_list(item)) class TestConvertIPv6AddrCanonicalFormat(base.BaseTestCase): def test_convert_ipv6_address_extended_add_with_zeroes(self): result = converters.convert_ip_to_canonical_format( u'2001:0db8:0:0:0:0:0:0001') self.assertEqual(u'2001:db8::1', result) @testtools.skipIf(tools.is_bsd(), 'bug/1484837') def test_convert_ipv6_compressed_address_OSX_skip(self): result = converters.convert_ip_to_canonical_format( u'2001:db8:0:1:1:1:1:1') self.assertEqual(u'2001:db8:0:1:1:1:1:1', result) def test_convert_ipv6_extended_addr_to_compressed(self): result = converters.convert_ip_to_canonical_format( u"Fe80:0:0:0:0:0:0:1") self.assertEqual(u'fe80::1', result) def test_convert_ipv4_address(self): result = converters.convert_ip_to_canonical_format(u"192.168.1.1") self.assertEqual(u'192.168.1.1', result) def test_convert_None_address(self): result = converters.convert_ip_to_canonical_format(None) self.assertIsNone(result) def test_convert_invalid_address(self): result = converters.convert_ip_to_canonical_format("on") self.assertEqual("on", result) class TestConvertIPv6CIDRCanonicalFormat(base.BaseTestCase): def test_convert_ipv4_address_with_CIDR(self): result = converters.convert_cidr_to_canonical_format(u'192.168.1.1/24') self.assertEqual(u'192.168.1.1/24', result) def test_convert_ipv6_extended_addr_withcidr_to_compressed(self): result = converters.convert_cidr_to_canonical_format( u'Fe80:0:0:0:0:0:0:1/64') self.assertEqual(u'fe80::1/64', result) def test_convert_non_ip_addr_with_slash(self): with testtools.ExpectedException(n_exc.InvalidInput): converters.convert_cidr_to_canonical_format( u"Dormamu/DarkSeid/Vulture") class TestConvertStringToCaseInsensitive(base.BaseTestCase): def test_convert_string_to_lower(self): result = converters.convert_string_to_case_insensitive(u"THIS Is tEsT") self.assertIsInstance(result, six.string_types) def test_assert_error_on_non_string(self): for invalid in [[], 123]: with testtools.ExpectedException(n_exc.InvalidInput): converters.convert_string_to_case_insensitive(invalid) class TestConvertProtocol(base.BaseTestCase): def test_tcp_is_valid(self): result = converters.convert_to_protocol(constants.PROTO_NAME_TCP) self.assertEqual(constants.PROTO_NAME_TCP, result) proto_num_str = str(constants.PROTO_NUM_TCP) result = converters.convert_to_protocol(proto_num_str) self.assertEqual(proto_num_str, result) def test_udp_is_valid(self): result = converters.convert_to_protocol(constants.PROTO_NAME_UDP) self.assertEqual(constants.PROTO_NAME_UDP, result) proto_num_str = str(constants.PROTO_NUM_UDP) result = converters.convert_to_protocol(proto_num_str) self.assertEqual(proto_num_str, result) def test_icmp_is_valid(self): result = converters.convert_to_protocol(constants.PROTO_NAME_ICMP) self.assertEqual(constants.PROTO_NAME_ICMP, result) proto_num_str = str(constants.PROTO_NUM_ICMP) result = converters.convert_to_protocol(proto_num_str) self.assertEqual(proto_num_str, result) def test_numeric_is_valid(self): proto_num_str = str(constants.PROTO_NUM_IGMP) result = converters.convert_to_protocol(proto_num_str) self.assertEqual(proto_num_str, result) def test_numeric_too_high(self): with testtools.ExpectedException(n_exc.InvalidInput): converters.convert_to_protocol("300") def test_numeric_too_low(self): with testtools.ExpectedException(n_exc.InvalidInput): converters.convert_to_protocol("-1") def test_unknown_string(self): with testtools.ExpectedException(n_exc.InvalidInput): converters.convert_to_protocol("Invalid") class TestConvertToString(base.BaseTestCase): def test_data_is_string(self): self.assertEqual('10000', converters.convert_to_string('10000')) def test_data_is_integer(self): self.assertEqual('10000', converters.convert_to_string(10000)) def test_data_is_integer_zero(self): self.assertEqual('0', converters.convert_to_string(0)) def test_data_is_none(self): self.assertIsNone(converters.convert_to_string(None)) def test_data_is_empty_list(self): self.assertEqual('[]', converters.convert_to_string([])) def test_data_is_list(self): self.assertEqual("[1, 2, 3]", converters.convert_to_string([1, 2, 3])) def test_data_is_empty_dict(self): self.assertEqual('{}', converters.convert_to_string({})) def test_data_is_dict(self): self.assertEqual("{'foo': 'bar'}", converters.convert_to_string({'foo': 'bar'})) neutron-lib-1.13.0/neutron_lib/tests/unit/api/test_faults.py0000666000175100017510000000164113231472055024205 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import webob.exc from neutron_lib.api import faults from neutron_lib.tests import _base as base class TestFaultMap(base.BaseTestCase): def test_extend_fault_map(self): fault_map_dict = {NotImplemented: webob.exc.HTTPServiceUnavailable} faults.FAULT_MAP.update(fault_map_dict) self.assertIn(NotImplemented, faults.FAULT_MAP) neutron-lib-1.13.0/neutron_lib/tests/unit/api/test_extensions.py0000666000175100017510000002013313231472055025103 0ustar zuulzuul00000000000000# Copyright 2016 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api import extensions from neutron_lib import fixture from neutron_lib.services import base as service_base from neutron_lib.tests import _base as base class InheritFromExtensionDescriptor(extensions.ExtensionDescriptor): """Class to inherit from ExtensionDescriptor to test its methods Because ExtensionDescriptor is an abstract class, in order to test methods we need to create something to inherit from it so we have something instantiatable. The only things defined here are those that are required because in ExtensionDescriptor they are marked as @abc.abstractmethod. """ def get_name(self): pass def get_alias(self): pass def get_description(self): pass def get_updated(self): pass def update_attributes_map_save(self, extended_attributes, extension_attrs_map=None): """Update attributes map for this extension. This is default method for extending an extension's attributes map. An extension can use this method and supplying its own resource attribute map in extension_attrs_map argument to extend all its attributes that needs to be extended. If an extension does not implement update_attributes_map, the method does nothing and just return. """ if not extension_attrs_map: return for resource, attrs in extension_attrs_map.items(): extended_attrs = extended_attributes.get(resource) if extended_attrs: attrs.update(extended_attrs) class TestExtensionDescriptor(base.BaseTestCase): def _setup_attribute_maps(self): self.extended_attributes = {'resource_one': {'one': 'first'}, 'resource_two': {'two': 'second'}} self.extension_attrs_map = {'resource_one': {'three': 'third'}} def test_update_attributes_map_works(self): self._setup_attribute_maps() extension_description = InheritFromExtensionDescriptor() extension_description.update_attributes_map(self.extended_attributes, self.extension_attrs_map) self.assertEqual(self.extension_attrs_map, {'resource_one': {'one': 'first', 'three': 'third'}}) def test_update_attributes_map_short_circuit_exit(self): self._setup_attribute_maps() extension_description = InheritFromExtensionDescriptor() extension_description.update_attributes_map(self.extended_attributes) self.assertEqual(self.extension_attrs_map, {'resource_one': {'three': 'third'}}) class DummyPlugin(service_base.ServicePluginBase): supported_extension_aliases = ['flash'] def get_plugin_type(self): return 'Flash Gordon' def get_plugin_description(self): return 'Legend!' class TestExtensionIsSupported(base.BaseTestCase): def setUp(self): super(TestExtensionIsSupported, self).setUp() self._plugin = DummyPlugin() def test_extension_exists(self): self.assertTrue(extensions.is_extension_supported(self._plugin, "flash")) def test_extension_does_not_exist(self): self.assertFalse(extensions.is_extension_supported(self._plugin, "gordon")) class TestAPIExtensionDescriptor(base.BaseTestCase): # API definition attributes; acts as an API definition module NAME = 'Test API' ALIAS = 'test-api' DESCRIPTION = 'A test API definition' UPDATED_TIMESTAMP = '2017-02-01T10:00:00-00:00' RESOURCE_ATTRIBUTE_MAP = {'ports': {}} SUB_RESOURCE_ATTRIBUTE_MAP = {'ports': {'debug': {}}} REQUIRED_EXTENSIONS = ['l3'] OPTIONAL_EXTENSIONS = ['fw'] def setUp(self): super(TestAPIExtensionDescriptor, self).setUp() self.extn = _APIDefinition() self.empty_extn = _EmptyAPIDefinition() self.useFixture(fixture.APIDefinitionFixture(self)) def test__assert_api_definition_no_defn(self): self.assertRaises(NotImplementedError, _NoAPIDefinition._assert_api_definition) def test__assert_api_definition_no_attr(self): self.assertRaises( NotImplementedError, self.extn._assert_api_definition, attr='NOPE') def test_get_name(self): self.assertEqual(self.NAME, self.extn.get_name()) def test_get_name_unset(self): self.assertRaises(NotImplementedError, _EmptyAPIDefinition.get_name) def test_get_alias(self): self.assertEqual(self.ALIAS, self.extn.get_alias()) def test_get_alias_unset(self): self.assertRaises(NotImplementedError, _EmptyAPIDefinition.get_alias) def test_get_description(self): self.assertEqual(self.DESCRIPTION, self.extn.get_description()) def test_get_description_unset(self): self.assertRaises(NotImplementedError, _EmptyAPIDefinition.get_description) def test_get_updated(self): self.assertEqual(self.UPDATED_TIMESTAMP, self.extn.get_updated()) def test_get_updated_unset(self): self.assertRaises(NotImplementedError, _EmptyAPIDefinition.get_updated) def test_get_extended_resources_v2(self): self.assertEqual( dict(list(self.RESOURCE_ATTRIBUTE_MAP.items()) + list(self.SUB_RESOURCE_ATTRIBUTE_MAP.items())), self.extn.get_extended_resources('2.0')) def test_get_extended_resources_v2_unset(self): self.assertRaises(NotImplementedError, self.empty_extn.get_extended_resources, '2.0') def test_get_extended_resources_v1(self): self.assertEqual({}, self.extn.get_extended_resources('1.0')) def test_get_extended_resources_v1_unset(self): self.assertEqual({}, self.empty_extn.get_extended_resources('1.0')) def test_get_required_extensions(self): self.assertEqual(self.REQUIRED_EXTENSIONS, self.extn.get_required_extensions()) def test_get_required_extensions_unset(self): self.assertRaises(NotImplementedError, self.empty_extn.get_required_extensions) def test_get_optional_extensions(self): self.assertEqual(self.OPTIONAL_EXTENSIONS, self.extn.get_optional_extensions()) def test_get_optional_extensions_unset(self): self.assertRaises(NotImplementedError, self.empty_extn.get_optional_extensions) def test_update_attributes_map_extensions_unset(self): self.assertRaises(NotImplementedError, self.empty_extn.update_attributes_map, {}) def test_update_attributes_map_with_ext_attrs(self): base_attrs = {'ports': {'a': 'A'}} ext_attrs = {'ports': {'b': 'B'}} self.extn.update_attributes_map(base_attrs, ext_attrs) self.assertEqual({'ports': {'a': 'A', 'b': 'B'}}, ext_attrs) def test_update_attributes_map_without_ext_attrs(self): base_attrs = {'ports': {'a': 'A'}} self.extn.update_attributes_map(base_attrs) self.assertIn('a', self.extn.get_extended_resources('2.0')['ports']) class _APIDefinition(extensions.APIExtensionDescriptor): api_definition = TestAPIExtensionDescriptor class _NoAPIDefinition(extensions.APIExtensionDescriptor): pass class _EmptyAPIDefinition(extensions.APIExtensionDescriptor): api_definition = {} neutron-lib-1.13.0/neutron_lib/tests/unit/api/validators/0000775000175100017510000000000013231472430023437 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/api/validators/__init__.py0000666000175100017510000000000013231472055025543 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/api/validators/test_dns.py0000666000175100017510000001524513231472055025650 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock from neutron_lib.api.validators import dns from neutron_lib.db import constants as db_constants from neutron_lib.tests import _base as base class TestDnsValidators(base.BaseTestCase): @mock.patch('oslo_config.cfg.CONF') def test_validate_dns_name(self, CONF): CONF.dns_domain = '' msg = dns.validate_dns_name('') self.assertIsNone(msg) CONF.dns_domain = 'example.org.' dns_name = 'host' msg = dns.validate_dns_name(dns_name) self.assertIsNone(msg) invalid_data = 'A' * 256 max_len = 255 expected = ("'%(data)s' not a valid PQDN or FQDN. Reason: " "'%(data)s' exceeds the %(maxlen)s character FQDN " "limit") % {'data': invalid_data, 'maxlen': max_len} msg = dns.validate_dns_name(invalid_data, max_len) self.assertEqual(expected, msg) invalid_data = '.hostname' expected = ("'%(data)s' not a valid PQDN or FQDN. Reason: " "Encountered an empty component") % {'data': invalid_data} msg = dns.validate_dns_name(invalid_data) self.assertEqual(expected, msg) invalid_data = 'hostname-' expected = ("'%(data)s' not a valid PQDN or FQDN. Reason: " "Name '%(data)s' must not start or end with a " "hyphen") % {'data': invalid_data} msg = dns.validate_dns_name(invalid_data) self.assertEqual(expected, msg) invalid_data = 'hostname@host' expected = ("'%(data)s' not a valid PQDN or FQDN. Reason: " "Name '%(data)s' must be 1-63 characters long, each of " "which can only be alphanumeric or a " "hyphen") % {'data': invalid_data} msg = dns.validate_dns_name(invalid_data) self.assertEqual(expected, msg) invalid_suffix = '1234' invalid_data = 'hostname.' + invalid_suffix expected = ("'%(data)s' not a valid PQDN or FQDN. Reason: " "TLD '%(suffix)s' must not be all " "numeric") % {'data': invalid_data, 'suffix': invalid_suffix} msg = dns.validate_dns_name(invalid_data) self.assertEqual(expected, msg) # len(dns_name + dns_domain) > 255 invalid_domain = 'A' * 250 + '.org.' CONF.dns_domain = invalid_domain dns_name = 'hostname' expected = ("The dns_name passed is a PQDN and its size is " "'%(dns_name_len)s'. The dns_domain option in " "neutron.conf is set to %(dns_domain)s, with a " "length of '%(higher_labels_len)s'. When the two are " "concatenated to form a FQDN (with a '.' at the end), " "the resulting length exceeds the maximum size " "of '%(fqdn_max_len)s'" ) % {'dns_name_len': len(dns_name), 'dns_domain': invalid_domain, 'higher_labels_len': len(invalid_domain) + 1, 'fqdn_max_len': db_constants.FQDN_FIELD_SIZE} msg = dns.validate_dns_name(dns_name) self.assertEqual(expected, msg) dns_name = 'host.' dns_domain = 'example.com.' CONF.dns_domain = dns_domain expected = ("The dns_name passed is a FQDN. Its higher level labels " "must be equal to the dns_domain option in neutron.conf, " "that has been set to '%(dns_domain)s'. It must also " "include one or more valid DNS labels to the left " "of '%(dns_domain)s'") % {'dns_domain': dns_domain} msg = dns.validate_dns_name(dns_name) self.assertEqual(expected, msg) def test_validate_fip_dns_name(self): # Don't run tests duplicated to validate_dns_name() msg = dns.validate_fip_dns_name('') self.assertIsNone(msg) msg = dns.validate_fip_dns_name('host') self.assertIsNone(msg) invalid_data = 1234 expected = "'%s' is not a valid string" % invalid_data msg = dns.validate_fip_dns_name(invalid_data) self.assertEqual(expected, msg) invalid_data = 'host.' expected = ("'%s' is a FQDN. It should be a relative domain " "name") % invalid_data msg = dns.validate_fip_dns_name(invalid_data) self.assertEqual(expected, msg) length = 10 invalid_data = 'a' * length max_len = 12 expected = ("'%(data)s' contains %(length)s characters. Adding a " "domain name will cause it to exceed the maximum length " "of a FQDN of '%(max_len)s'") % {"data": invalid_data, "length": length, "max_len": max_len} msg = dns.validate_fip_dns_name(invalid_data, max_len) self.assertEqual(expected, msg) def test_validate_dns_domain(self): # Don't run tests duplicated to validate_dns_name() msg = dns.validate_dns_domain('') self.assertIsNone(msg) msg = dns.validate_dns_domain('example.com.') self.assertIsNone(msg) invalid_data = 1234 expected = "'%s' is not a valid string" % invalid_data msg = dns.validate_dns_domain(invalid_data) self.assertEqual(expected, msg) invalid_data = 'example.com' expected = "'%s' is not a FQDN" % invalid_data msg = dns.validate_dns_domain(invalid_data) self.assertEqual(expected, msg) length = 9 invalid_data = 'a' * length + '.' max_len = 11 expected = ("'%(data)s' contains %(length)s characters. Adding a " "sub-domain will cause it to exceed the maximum length " "of a FQDN of '%(max_len)s'") % {"data": invalid_data, "length": length + 1, "max_len": max_len} msg = dns.validate_dns_domain(invalid_data, max_len) self.assertEqual(expected, msg) neutron-lib-1.13.0/neutron_lib/tests/unit/api/validators/test_allowedaddresspairs.py0000666000175100017510000000767713231472055031132 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock from oslo_config import cfg from webob import exc from neutron_lib.api.validators import allowedaddresspairs as validator from neutron_lib.exceptions import allowedaddresspairs as addr_exc from neutron_lib.tests import _base as base class TestAllowedAddressPairs(base.BaseTestCase): def test__validate_allowed_address_pairs_not_a_list(self): for d in [{}, set(), 'abc', True, 1]: self.assertRaisesRegex( exc.HTTPBadRequest, 'must be a list', validator._validate_allowed_address_pairs, d) @mock.patch.object(cfg, 'CONF') def test__validate_allowed_address_pairs_exhausted(self, mock_conf): mock_conf.max_allowed_address_pair = 1 self.assertRaises( addr_exc.AllowedAddressPairExhausted, validator._validate_allowed_address_pairs, [{}, {}]) @mock.patch.object(cfg, 'CONF') def test__validate_allowed_address_pairs_invalid_mac(self, mock_conf): mock_conf.max_allowed_address_pair = 3 self.assertRaisesRegex( exc.HTTPBadRequest, 'is not a valid MAC address', validator._validate_allowed_address_pairs, [{'mac_address': 1}]) @mock.patch.object(cfg, 'CONF') def test__validate_allowed_address_pairs_missing_ip(self, mock_conf): mock_conf.max_allowed_address_pair = 3 self.assertRaises( addr_exc.AllowedAddressPairsMissingIP, validator._validate_allowed_address_pairs, [{'ip_adress': '192.168.1.11'}]) @mock.patch.object(cfg, 'CONF') def test__validate_allowed_address_pairs_duplicate(self, mock_conf): mock_conf.max_allowed_address_pair = 3 self.assertRaises( addr_exc.DuplicateAddressPairInRequest, validator._validate_allowed_address_pairs, [{'ip_address': '192.168.1.11'}, {'ip_address': '192.168.1.11'}]) @mock.patch.object(cfg, 'CONF') def test__validate_allowed_address_pairs_invalid_attrs(self, mock_conf): mock_conf.max_allowed_address_pair = 3 self.assertRaisesRegex( exc.HTTPBadRequest, 'Unrecognized attribute', validator._validate_allowed_address_pairs, [{'ip_address': '192.168.1.11'}, {'ip_address': '192.168.1.12', 'idk': True}]) @mock.patch.object(cfg, 'CONF') def test__validate_allowed_address_pairs_invalid_subnet(self, mock_conf): mock_conf.max_allowed_address_pair = 3 self.assertRaisesRegex( exc.HTTPBadRequest, 'is not a valid IP subnet', validator._validate_allowed_address_pairs, [{'ip_address': '192.168.1.11'}, {'ip_address': '192.168.1.0/a'}]) @mock.patch.object(cfg, 'CONF') def test__validate_allowed_address_pairs_invalid_ip_address( self, mock_conf): mock_conf.max_allowed_address_pair = 3 self.assertRaisesRegex( exc.HTTPBadRequest, 'is not a valid IP address', validator._validate_allowed_address_pairs, [{'ip_address': '192.168.1.a'}, {'ip_address': '192.168.1.2'}]) @mock.patch.object(cfg, 'CONF') def test__validate_allowed_address_pairs_good_data(self, mock_conf): mock_conf.max_allowed_address_pair = 3 self.assertIsNone(validator._validate_allowed_address_pairs( [{'ip_address': '192.1.1.11'}, {'ip_address': '19.1.1.11'}])) neutron-lib-1.13.0/neutron_lib/tests/unit/api/validators/test_availability_zone.py0000666000175100017510000000317113231472055030564 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock from neutron_lib.api.validators import availability_zone as az_validator from neutron_lib.db import constants as db_const from neutron_lib import exceptions from neutron_lib.tests import _base as base class TestAvailabilityZoneValidator(base.BaseTestCase): @mock.patch.object(az_validator.validators, 'validate_list_of_unique_strings', return_value='bad') def test__validate_availability_zone_hints_unique_strings( self, mock_unique_strs): self.assertEqual( 'bad', az_validator._validate_availability_zone_hints(['a', 'a'])) def test__validate_availability_zone_hints_excessive_len(self): self.assertRaisesRegex( exceptions.InvalidInput, 'Too many availability_zone_hints', az_validator._validate_availability_zone_hints, ['a' * (db_const.AZ_HINTS_DB_LEN + 1)]) def test__validate_availability_zone_hints_valid_input(self): self.assertIsNone( az_validator._validate_availability_zone_hints(['a', 'b', 'c'])) neutron-lib-1.13.0/neutron_lib/tests/unit/api/validators/test_multiprovidernet.py0000666000175100017510000000357613231472055030504 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from webob import exc from neutron_lib.api.definitions import provider_net from neutron_lib.api.validators import multiprovidernet as mp_validator from neutron_lib import constants from neutron_lib.tests import _base as base def _build_segment(net_type=constants.ATTR_NOT_SPECIFIED, phy_net=constants.ATTR_NOT_SPECIFIED, seg_id=constants.ATTR_NOT_SPECIFIED): return { provider_net.NETWORK_TYPE: net_type, provider_net.PHYSICAL_NETWORK: phy_net, provider_net.SEGMENTATION_ID: seg_id } class TestMultiprovidernetValidators(base.BaseTestCase): def test_convert_and_validate_segments_default_values(self): segs = [{}] mp_validator.convert_and_validate_segments(segs) self.assertEqual( [_build_segment()], segs) def test_convert_and_validate_segments_seg_id_to_int(self): segs = [_build_segment(seg_id="9")] mp_validator.convert_and_validate_segments(segs) self.assertEqual(_build_segment(seg_id=9), segs[0]) def test_convert_and_validate_segments_invalid_key(self): segs = [_build_segment(seg_id=2)] segs[0]['some_key'] = 'some_value' self.assertRaises(exc.HTTPBadRequest, mp_validator.convert_and_validate_segments, segs) neutron-lib-1.13.0/neutron_lib/tests/unit/api/validators/test_validators.py0000666000175100017510000014200313231472055027225 0ustar zuulzuul00000000000000# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import string import mock import netaddr from neutron_lib._i18n import _ from neutron_lib.api import converters from neutron_lib.api.definitions import extra_dhcp_opt from neutron_lib.api import validators from neutron_lib import constants from neutron_lib import exceptions as n_exc from neutron_lib import fixture from neutron_lib.plugins import directory from neutron_lib.tests import _base as base def dummy_validator(data, valid_values=None): pass class TestAttributeValidation(base.BaseTestCase): def _construct_dict_and_constraints(self): """Constructs a test dictionary and a definition of constraints. :return: A (dictionary, constraint) tuple """ constraints = {'key1': {'type:values': ['val1', 'val2'], 'required': True}, 'key2': {'type:string': None, 'required': False}, 'key3': {'type:dict': {'k4': {'type:string': None, 'required': True}}, 'required': True}} dictionary = {'key1': 'val1', 'key2': 'a string value', 'key3': {'k4': 'a string value'}} return dictionary, constraints def test_type_prefixing(self): validators.add_validator('type:prefixed_type', dummy_validator) validators.add_validator('unprefixed_type', dummy_validator) self.assertEqual(dummy_validator, validators.get_validator('type:prefixed_type')) self.assertEqual(dummy_validator, validators.get_validator('prefixed_type')) self.assertEqual(dummy_validator, validators.get_validator('type:unprefixed_type')) self.assertEqual(dummy_validator, validators.get_validator('unprefixed_type')) def test_adding_validator(self): validators.add_validator('new_type', dummy_validator) self.assertIn('type:new_type', validators.validators) self.assertEqual(dummy_validator, validators.validators['type:new_type']) def test_get_validator_default(self): self.assertEqual(dummy_validator, validators.get_validator('nope', default=dummy_validator)) def test_fail_adding_duplicate_validator(self): self.assertRaises(KeyError, validators.add_validator, 'dict', lambda x: x) def test_success_adding_duplicate_validator(self): validators.add_validator('dummy', dummy_validator) validators.add_validator('dummy', dummy_validator) self.assertEqual(dummy_validator, validators.get_validator('dummy')) def test_is_attr_set(self): data = constants.ATTR_NOT_SPECIFIED self.assertIs(validators.is_attr_set(data), False) data = None self.assertIs(validators.is_attr_set(data), False) data = "I'm set" self.assertIs(validators.is_attr_set(data), True) def test_validate_values(self): # Check that validation is not performed if valid_values is not set msg = validators.validate_values(4) self.assertIsNone(msg) # Check that value is within valid_values msg = validators.validate_values(4, [4, 6]) self.assertIsNone(msg) # Check that value is within valid_values msg = validators.validate_values(4, (4, 6)) self.assertIsNone(msg) # Check that value is within valid_values with strings msg = validators.validate_values("1", ["2", "1", "4", "5"]) self.assertIsNone(msg) # Check that value is not compatible for comparison response = "'valid_values' does not support membership operations" self.assertRaisesRegex(TypeError, response, validators.validate_values, data=None, valid_values=True) def test_validate_values_display(self): # Check that value is NOT within valid_values and report values msg = validators.validate_values(7, [4, 6], valid_values_display="[4, 6]") self.assertEqual("7 is not in [4, 6]", msg) # Check that value is NOT within valid_values and report values msg = validators.validate_values(7, (4, 6), valid_values_display="(4, 6)") self.assertEqual("7 is not in (4, 6)", msg) # Check values with a range function showing a custom string msg = validators.validate_values(8, range(8), valid_values_display="[0..7]") self.assertEqual("8 is not in [0..7]", msg) # Check that value is not within valid_values and custom string msg = validators.validate_values(1, [2, 3, 4, 5], valid_values_display="[2, 3, 4, 5]") self.assertEqual("1 is not in [2, 3, 4, 5]", msg) # Check that value is not within valid_values and custom string msg = validators.validate_values("1", ["2", "3", "4", "5"], valid_values_display="'valid_values" "_to_show'") self.assertEqual("1 is not in 'valid_values_to_show'", msg) # Check that value is not comparable to valid_values and got Exception data = 1 valid_values = '[2, 3, 4, 5]' response = "'data' of type '%s' and 'valid_values'of type" \ " '%s' are not compatible for comparison" % ( type(data), type(valid_values)) self.assertRaisesRegex(TypeError, response, validators.validate_values, data, valid_values, valid_values_display="[2, 3, 4, 5]") def test_validate_not_empty_string(self): msg = validators.validate_not_empty_string(' ', None) self.assertEqual(u"' ' Blank strings are not permitted", msg) msg = validators.validate_not_empty_string(123, None) self.assertEqual(u"'123' is not a valid string", msg) def test_validate_not_empty_string_or_none(self): msg = validators.validate_not_empty_string_or_none(' ', None) self.assertEqual(u"' ' Blank strings are not permitted", msg) msg = validators.validate_not_empty_string_or_none(None, None) self.assertIsNone(msg) def test_validate_string_or_none(self): msg = validators.validate_string_or_none('test', None) self.assertIsNone(msg) msg = validators.validate_string_or_none(None, None) self.assertIsNone(msg) def test_validate_string(self): msg = validators.validate_string(None, None) self.assertEqual("'None' is not a valid string", msg) # 0 == len(data) == max_len msg = validators.validate_string("", 0) self.assertIsNone(msg) # 0 == len(data) < max_len msg = validators.validate_string("", 9) self.assertIsNone(msg) # 0 < len(data) < max_len msg = validators.validate_string("123456789", 10) self.assertIsNone(msg) # 0 < len(data) == max_len msg = validators.validate_string("123456789", 9) self.assertIsNone(msg) # 0 < max_len < len(data) msg = validators.validate_string("1234567890", 9) self.assertEqual("'1234567890' exceeds maximum length of 9", msg) msg = validators.validate_string("123456789", None) self.assertIsNone(msg) def test_validate_list_of_unique_strings(self): data = "TEST" msg = validators.validate_list_of_unique_strings(data, None) self.assertEqual("'TEST' is not a list", msg) data = ["TEST01", "TEST02", "TEST01"] msg = validators.validate_list_of_unique_strings(data, None) self.assertEqual( "Duplicate items in the list: 'TEST01'", msg) data = ["12345678", "123456789"] msg = validators.validate_list_of_unique_strings(data, 8) self.assertEqual("'123456789' exceeds maximum length of 8", msg) data = ["TEST01", "TEST02", "TEST03"] msg = validators.validate_list_of_unique_strings(data, None) self.assertIsNone(msg) def test_validate_boolean(self): msg = validators.validate_boolean(True) self.assertIsNone(msg) msg = validators.validate_boolean(0) self.assertIsNone(msg) msg = validators.validate_boolean("false") self.assertIsNone(msg) msg = validators.validate_boolean("fasle") self.assertEqual("'fasle' is not a valid boolean value", msg) def test_validate_integer(self): msg = validators.validate_integer(1) self.assertIsNone(msg) msg = validators.validate_integer(0.1) self.assertEqual("'0.1' is not an integer", msg) msg = validators.validate_integer("1") self.assertIsNone(msg) msg = validators.validate_integer("0.1") self.assertEqual("'0.1' is not an integer", msg) msg = validators.validate_integer(True) self.assertEqual("'True' is not an integer:boolean", msg) msg = validators.validate_integer(False) self.assertEqual("'False' is not an integer:boolean", msg) msg = validators.validate_integer(float('Inf')) self.assertEqual("'inf' is not an integer", msg) msg = validators.validate_integer(None) self.assertEqual("'None' is not an integer", msg) def test_validate_integer_values(self): msg = validators.validate_integer(2, [2, 3, 4, 5]) self.assertIsNone(msg) msg = validators.validate_integer(1, [2, 3, 4, 5]) self.assertEqual("1 is not in valid_values", msg) def test_validate_no_whitespace(self): data = 'no_white_space' result = validators.validate_no_whitespace(data) self.assertEqual(data, result) self.assertRaises(n_exc.InvalidInput, validators.validate_no_whitespace, 'i have whitespace') self.assertRaises(n_exc.InvalidInput, validators.validate_no_whitespace, 'i\thave\twhitespace') for ws in string.whitespace: self.assertRaises(n_exc.InvalidInput, validators.validate_no_whitespace, '%swhitespace-at-head' % ws) self.assertRaises(n_exc.InvalidInput, validators.validate_no_whitespace, 'whitespace-at-tail%s' % ws) def test_validate_range(self): msg = validators.validate_range(1, [1, 9]) self.assertIsNone(msg) msg = validators.validate_range(5, [1, 9]) self.assertIsNone(msg) msg = validators.validate_range(9, [1, 9]) self.assertIsNone(msg) msg = validators.validate_range(1, (1, 9)) self.assertIsNone(msg) msg = validators.validate_range(5, (1, 9)) self.assertIsNone(msg) msg = validators.validate_range(9, (1, 9)) self.assertIsNone(msg) msg = validators.validate_range(0, [1, 9]) self.assertEqual("'0' is too small - must be at least '1'", msg) msg = validators.validate_range(10, (1, 9)) self.assertEqual("'10' is too large - must be no larger than '9'", msg) msg = validators.validate_range("bogus", (1, 9)) self.assertEqual("'bogus' is not an integer", msg) msg = validators.validate_range(10, (validators.UNLIMITED, validators.UNLIMITED)) self.assertIsNone(msg) msg = validators.validate_range(10, (1, validators.UNLIMITED)) self.assertIsNone(msg) msg = validators.validate_range(1, (validators.UNLIMITED, 9)) self.assertIsNone(msg) msg = validators.validate_range(-1, (0, validators.UNLIMITED)) self.assertEqual("'-1' is too small - must be at least '0'", msg) msg = validators.validate_range(10, (validators.UNLIMITED, 9)) self.assertEqual("'10' is too large - must be no larger than '9'", msg) @mock.patch("neutron_lib.api.validators.validate_range") def test_validate_range_or_none(self, mock_validate_range): msg = validators.validate_range_or_none(None, [1, 9]) self.assertFalse(mock_validate_range.called) self.assertIsNone(msg) validators.validate_range_or_none(1, [1, 9]) mock_validate_range.assert_called_once_with(1, [1, 9]) def _test_validate_mac_address(self, validator, allow_none=False): mac_addr = "ff:16:3e:4f:00:00" msg = validator(mac_addr) self.assertIsNone(msg) mac_addr = "ffa:16:3e:4f:00:00" msg = validator(mac_addr) err_msg = "'%s' is not a valid MAC address" self.assertEqual(err_msg % mac_addr, msg) for invalid_mac_addr in constants.INVALID_MAC_ADDRESSES: msg = validator(invalid_mac_addr) self.assertEqual(err_msg % invalid_mac_addr, msg) mac_addr = "123" msg = validator(mac_addr) self.assertEqual(err_msg % mac_addr, msg) mac_addr = None msg = validator(mac_addr) if allow_none: self.assertIsNone(msg) else: self.assertEqual(err_msg % mac_addr, msg) mac_addr = "ff:16:3e:4f:00:00\r" msg = validator(mac_addr) self.assertEqual(err_msg % mac_addr, msg) def test_validate_mac_address(self): self._test_validate_mac_address(validators.validate_mac_address) def test_validate_mac_address_or_none(self): self._test_validate_mac_address( validators.validate_mac_address_or_none, allow_none=True) def test_validate_ip_address(self): ip_addr = '1.1.1.1' msg = validators.validate_ip_address(ip_addr) self.assertIsNone(msg) ip_addr = '1111.1.1.1' msg = validators.validate_ip_address(ip_addr) self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) # Depending on platform to run UTs, this case might or might not be # an equivalent to test_validate_ip_address_bsd. ip_addr = '1' * 59 msg = validators.validate_ip_address(ip_addr) self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) ip_addr = '1.1.1.1 has whitespace' msg = validators.validate_ip_address(ip_addr) self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) ip_addr = '111.1.1.1\twhitespace' msg = validators.validate_ip_address(ip_addr) self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) ip_addr = '111.1.1.1\nwhitespace' msg = validators.validate_ip_address(ip_addr) self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) for ws in string.whitespace: ip_addr = '%s111.1.1.1' % ws msg = validators.validate_ip_address(ip_addr) self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) for ws in string.whitespace: ip_addr = '111.1.1.1%s' % ws msg = validators.validate_ip_address(ip_addr) self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) def test_validate_ip_address_with_leading_zero(self): ip_addr = '1.1.1.01' expected_msg = ("'%(data)s' is not an accepted IP address, " "'%(ip)s' is recommended") msg = validators.validate_ip_address(ip_addr) self.assertEqual(expected_msg % {"data": ip_addr, "ip": '1.1.1.1'}, msg) ip_addr = '1.1.1.011' msg = validators.validate_ip_address(ip_addr) self.assertEqual(expected_msg % {"data": ip_addr, "ip": '1.1.1.11'}, msg) ip_addr = '1.1.1.09' msg = validators.validate_ip_address(ip_addr) self.assertEqual(expected_msg % {"data": ip_addr, "ip": '1.1.1.9'}, msg) ip_addr = "fe80:0:0:0:0:0:0:0001" msg = validators.validate_ip_address(ip_addr) self.assertIsNone(msg) def test_validate_ip_address_bsd(self): # NOTE(yamamoto): On NetBSD and OS X, netaddr.IPAddress() accepts # '1' * 59 as a valid address. The behaviour is inherited from # libc behaviour there. This test ensures that our validator reject # such addresses on such platforms by mocking netaddr to emulate # the behaviour. ip_addr = '1' * 59 with mock.patch('netaddr.IPAddress') as ip_address_cls: msg = validators.validate_ip_address(ip_addr) ip_address_cls.assert_called_once_with(ip_addr, flags=netaddr.core.ZEROFILL) self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) def test_validate_ip_pools(self): pools = [[{'end': '10.0.0.254'}], [{'start': '10.0.0.254'}], [{'start': '1000.0.0.254', 'end': '1.1.1.1'}], [{'start': '10.0.0.2', 'end': '10.0.0.254', 'forza': 'juve'}], [{'start': '10.0.0.2', 'end': '10.0.0.254'}, {'end': '10.0.0.254'}], [None], None] for pool in pools: msg = validators.validate_ip_pools(pool) self.assertIsNotNone(msg) pools = [[{'end': '10.0.0.254', 'start': '10.0.0.2'}, {'start': '11.0.0.2', 'end': '11.1.1.1'}], [{'start': '11.0.0.2', 'end': '11.0.0.100'}]] for pool in pools: msg = validators.validate_ip_pools(pool) self.assertIsNone(msg) invalid_ip = '10.0.0.2\r' pools = [[{'end': '10.0.0.254', 'start': invalid_ip}]] for pool in pools: msg = validators.validate_ip_pools(pool) self.assertEqual("'%s' is not a valid IP address" % invalid_ip, msg) def test_validate_fixed_ips(self): fixed_ips = [ {'data': [{'subnet_id': '00000000-ffff-ffff-ffff-000000000000', 'ip_address': '1111.1.1.1'}], 'error_msg': "'1111.1.1.1' is not a valid IP address"}, {'data': [{'subnet_id': 'invalid', 'ip_address': '1.1.1.1'}], 'error_msg': "'invalid' is not a valid UUID"}, {'data': None, 'error_msg': "Invalid data format for fixed IP: 'None'"}, {'data': "1.1.1.1", 'error_msg': "Invalid data format for fixed IP: '1.1.1.1'"}, {'data': ['00000000-ffff-ffff-ffff-000000000000', '1.1.1.1'], 'error_msg': "Invalid data format for fixed IP: " "'00000000-ffff-ffff-ffff-000000000000'"}, {'data': [['00000000-ffff-ffff-ffff-000000000000', '1.1.1.1']], 'error_msg': "Invalid data format for fixed IP: " "'['00000000-ffff-ffff-ffff-000000000000', " "'1.1.1.1']'"}, {'data': [{'subnet_id': '00000000-0fff-ffff-ffff-000000000000', 'ip_address': '1.1.1.1'}, {'subnet_id': '00000000-ffff-ffff-ffff-000000000000', 'ip_address': '1.1.1.1'}], 'error_msg': "Duplicate IP address '1.1.1.1'"}] for fixed in fixed_ips: msg = validators.validate_fixed_ips(fixed['data']) self.assertEqual(fixed['error_msg'], msg) fixed_ips = [[{'subnet_id': '00000000-ffff-ffff-ffff-000000000000', 'ip_address': '1.1.1.1'}], [{'subnet_id': '00000000-0fff-ffff-ffff-000000000000', 'ip_address': '1.1.1.1'}, {'subnet_id': '00000000-ffff-ffff-ffff-000000000000', 'ip_address': '1.1.1.2'}]] for fixed in fixed_ips: msg = validators.validate_fixed_ips(fixed) self.assertIsNone(msg) def test_validate_nameservers(self): ns_pools = [['1.1.1.2', '1.1.1.2'], ['www.hostname.com', 'www.hostname.com'], ['1000.0.0.1'], ['www.hostname.com'], ['www.great.marathons.to.travel'], ['valid'], ['77.hostname.com'], ['1' * 59], ['www.internal.hostname.com'], None] for ns in ns_pools: msg = validators.validate_nameservers(ns, None) self.assertIsNotNone(msg) ns_pools = [['100.0.0.2'], ['1.1.1.1', '1.1.1.2']] for ns in ns_pools: msg = validators.validate_nameservers(ns, None) self.assertIsNone(msg) def test_validate_hostroutes(self): hostroute_pools = [[{'destination': '100.0.0.0/24'}], [{'nexthop': '10.0.2.20'}], [{'nexthop': '10.0.2.20', 'forza': 'juve', 'destination': '100.0.0.0/8'}], [{'nexthop': '1110.0.2.20', 'destination': '100.0.0.0/8'}], [{'nexthop': '10.0.2.20', 'destination': '100.0.0.0'}], [{'nexthop': '10.0.2.20', 'destination': '100.0.0.0/8'}, {'nexthop': '10.0.2.20', 'destination': '100.0.0.0/8'}], [None], None] for host_routes in hostroute_pools: msg = validators.validate_hostroutes(host_routes, None) self.assertIsNotNone(msg) hostroute_pools = [[{'destination': '100.0.0.0/24', 'nexthop': '10.0.2.20'}], [{'nexthop': '10.0.2.20', 'destination': '100.0.0.0/8'}, {'nexthop': '10.0.2.20', 'destination': '101.0.0.0/8'}]] for host_routes in hostroute_pools: msg = validators.validate_hostroutes(host_routes, None) self.assertIsNone(msg) def test_validate_ip_address_or_none(self): ip_addr = None msg = validators.validate_ip_address_or_none(ip_addr) self.assertIsNone(msg) ip_addr = '1.1.1.1' msg = validators.validate_ip_address_or_none(ip_addr) self.assertIsNone(msg) ip_addr = '1111.1.1.1' msg = validators.validate_ip_address_or_none(ip_addr) self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) def test_uuid_pattern(self): data = 'garbage' msg = validators.validate_regex(data, constants.UUID_PATTERN) self.assertIsNotNone(msg) data = '00000000-ffff-ffff-ffff-000000000000' msg = validators.validate_regex(data, constants.UUID_PATTERN) self.assertIsNone(msg) def test_mac_pattern(self): # Valid - 3 octets base_mac = "fa:16:3e:00:00:00" msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) self.assertIsNone(msg) # Valid - 4 octets base_mac = "fa:16:3e:4f:00:00" msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) self.assertIsNone(msg) # Invalid - not unicast base_mac = "01:16:3e:4f:00:00" msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) self.assertIsNotNone(msg) # Invalid - invalid format base_mac = "a:16:3e:4f:00:00" msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) self.assertIsNotNone(msg) # Invalid - invalid format base_mac = "ffa:16:3e:4f:00:00" msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) self.assertIsNotNone(msg) # Invalid - invalid format base_mac = "01163e4f0000" msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) self.assertIsNotNone(msg) # Invalid - invalid format base_mac = "01-16-3e-4f-00-00" msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) self.assertIsNotNone(msg) # Invalid - invalid format base_mac = "00:16:3:f:00:00" msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) self.assertIsNotNone(msg) # Invalid - invalid format base_mac = "12:3:4:5:67:89ab" msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) self.assertIsNotNone(msg) def _test_validate_subnet(self, validator, allow_none=False): # Valid - IPv4 cidr = "10.0.2.0/24" msg = validator(cidr, None) self.assertIsNone(msg) # Valid - IPv6 without final octets cidr = "fe80::/24" msg = validator(cidr, None) self.assertIsNone(msg) # Valid - IPv6 with final octets cidr = "fe80::/24" msg = validator(cidr, None) self.assertIsNone(msg) # Valid - uncompressed ipv6 address cidr = "fe80:0:0:0:0:0:0:0/128" msg = validator(cidr, None) self.assertIsNone(msg) # Valid - ipv6 address with multiple consecutive zero cidr = "2001:0db8:0:0:1::1/128" msg = validator(cidr, None) self.assertIsNone(msg) # Valid - ipv6 address with multiple consecutive zero cidr = "2001:0db8::1:0:0:1/128" msg = validator(cidr, None) self.assertIsNone(msg) # Valid - ipv6 address with multiple consecutive zero cidr = "2001::0:1:0:0:1100/120" msg = validator(cidr, None) self.assertIsNone(msg) # Invalid - abbreviated ipv4 address cidr = "10/24" msg = validator(cidr, None) error = _("'%(data)s' isn't a recognized IP subnet cidr," " '%(cidr)s' is recommended") % {"data": cidr, "cidr": "10.0.0.0/24"} self.assertEqual(error, msg) # Invalid - IPv4 missing mask cidr = "10.0.2.0" msg = validator(cidr, None) error = _("'%(data)s' isn't a recognized IP subnet cidr," " '%(cidr)s' is recommended") % {"data": cidr, "cidr": "10.0.2.0/32"} self.assertEqual(error, msg) # Valid - IPv4 with non-zero masked bits is ok for i in range(1, 255): cidr = "192.168.1.%s/24" % i msg = validator(cidr, None) self.assertIsNone(msg) # Invalid - IPv6 without final octets, missing mask cidr = "fe80::" msg = validator(cidr, None) error = _("'%(data)s' isn't a recognized IP subnet cidr," " '%(cidr)s' is recommended") % {"data": cidr, "cidr": "fe80::/128"} self.assertEqual(error, msg) # Invalid - IPv6 with final octets, missing mask cidr = "fe80::0" msg = validator(cidr, None) error = _("'%(data)s' isn't a recognized IP subnet cidr," " '%(cidr)s' is recommended") % {"data": cidr, "cidr": "fe80::/128"} self.assertEqual(error, msg) # Invalid - Address format error cidr = 'invalid' msg = validator(cidr, None) error = "'%s' is not a valid IP subnet" % cidr self.assertEqual(error, msg) cidr = None msg = validator(cidr, None) if allow_none: self.assertIsNone(msg) else: error = "'%s' is not a valid IP subnet" % cidr self.assertEqual(error, msg) # Invalid - IPv4 with trailing CR cidr = "10.0.2.0/24\r" msg = validator(cidr, None) error = "'%s' is not a valid IP subnet" % cidr self.assertEqual(error, msg) def test_validate_subnet(self): self._test_validate_subnet(validators.validate_subnet) def test_validate_subnet_or_none(self): self._test_validate_subnet(validators.validate_subnet_or_none, allow_none=True) def test_validate_subnet_list(self): msg = validators.validate_subnet_list('abc') self.assertEqual(u"'abc' is not a list", msg) msg = validators.validate_subnet_list(['10.1.0.0/24', '10.2.0.0/24', '10.1.0.0/24']) self.assertEqual(u"Duplicate items in the list: '10.1.0.0/24'", msg) msg = validators.validate_subnet_list(['10.1.0.0/24', '10.2.0.0']) self.assertEqual(u"'10.2.0.0' isn't a recognized IP subnet cidr, " u"'10.2.0.0/32' is recommended", msg) def _test_validate_regex(self, validator, allow_none=False): pattern = '[hc]at' data = None msg = validator(data, pattern) if allow_none: self.assertIsNone(msg) else: self.assertEqual("'None' is not a valid input", msg) data = 'bat' msg = validator(data, pattern) self.assertEqual("'%s' is not a valid input" % data, msg) data = 'hat' msg = validator(data, pattern) self.assertIsNone(msg) data = 'cat' msg = validator(data, pattern) self.assertIsNone(msg) def test_validate_regex(self): self._test_validate_regex(validators.validate_regex) def test_validate_regex_or_none(self): self._test_validate_regex(validators.validate_regex_or_none, allow_none=True) def test_validate_list_of_regex_or_none(self): pattern = '[hc]at|^$' list_of_regex = ['hat', 'cat', ''] msg = validators.validate_list_of_regex_or_none(list_of_regex, pattern) self.assertIsNone(msg) list_of_regex = ['bat', 'hat', 'cat', ''] msg = validators.validate_list_of_regex_or_none(list_of_regex, pattern) self.assertEqual("'bat' is not a valid input", msg) empty_list = [] msg = validators.validate_list_of_regex_or_none(empty_list, pattern) def test_validate_subnetpool_id(self): msg = validators.validate_subnetpool_id(constants.IPV6_PD_POOL_ID) self.assertIsNone(msg) msg = validators.validate_subnetpool_id( '00000000-ffff-ffff-ffff-000000000000') self.assertIsNone(msg) def test_validate_subnetpool_id_or_none(self): msg = validators.validate_subnetpool_id_or_none(None) self.assertIsNone(msg) msg = validators.validate_subnetpool_id_or_none( '00000000-ffff-ffff-ffff-000000000000') self.assertIsNone(msg) def test_validate_uuid(self): invalid_uuids = [None, 123, '123', 't5069610-744b-42a7-8bd8-ceac1a229cd4', 'e5069610-744bb-42a7-8bd8-ceac1a229cd4'] for uuid in invalid_uuids: msg = validators.validate_uuid(uuid) error = "'%s' is not a valid UUID" % uuid self.assertEqual(error, msg) msg = validators.validate_uuid('00000000-ffff-ffff-ffff-000000000000') self.assertIsNone(msg) def test_validate_uuid_list(self): bad_uuid_list = ['00000000-ffff-ffff-ffff-000000000000', '00000000-ffff-ffff-ffff-000000000001', '123'] msg = validators.validate_uuid_list(bad_uuid_list, valid_values='parameter not used') error = "'%s' is not a valid UUID" % bad_uuid_list[2] self.assertEqual(error, msg) good_uuid_list = ['00000000-ffff-ffff-ffff-000000000000', '00000000-ffff-ffff-ffff-000000000001'] msg = validators.validate_uuid_list(good_uuid_list, valid_values='parameter not used') self.assertIsNone(msg) def test__validate_list_of_items(self): # check not a list items = [None, 123, 'e5069610-744b-42a7-8bd8-ceac1a229cd4', '12345678123456781234567812345678', {'uuid': 'e5069610-744b-42a7-8bd8-ceac1a229cd4'}] for item in items: msg = validators._validate_list_of_items(mock.Mock(), item) error = "'%s' is not a list" % item self.assertEqual(error, msg) # check duplicate items in a list duplicate_items = ['e5069610-744b-42a7-8bd8-ceac1a229cd4', 'f3eeab00-8367-4524-b662-55e64d4cacb5', 'e5069610-744b-42a7-8bd8-ceac1a229cd4'] msg = validators._validate_list_of_items(mock.Mock(), duplicate_items) error = ("Duplicate items in the list: " "'e5069610-744b-42a7-8bd8-ceac1a229cd4'") self.assertEqual(error, msg) # check valid lists valid_lists = [[], [1, 2, 3], ['a', 'b', 'c']] for list_obj in valid_lists: msg = validators._validate_list_of_items( mock.Mock(return_value=None), list_obj) self.assertIsNone(msg) def test_validate_dict_type(self): for value in (None, True, '1', []): self.assertEqual("'%s' is not a dictionary" % value, validators.validate_dict(value)) def test_validate_dict_without_constraints(self): msg = validators.validate_dict({}) self.assertIsNone(msg) # Validate a dictionary without constraints. msg = validators.validate_dict({'key': 'value'}) self.assertIsNone(msg) def test_validate_a_valid_dict_with_constraints(self): dictionary, constraints = self._construct_dict_and_constraints() msg = validators.validate_dict(dictionary, constraints) self.assertIsNone(msg, 'Validation of a valid dictionary failed.') def test_validate_dict_with_invalid_validator(self): dictionary, constraints = self._construct_dict_and_constraints() constraints['key1'] = {'type:unsupported': None, 'required': True} msg = validators.validate_dict(dictionary, constraints) self.assertEqual("Validator 'type:unsupported' does not exist", msg) def test_validate_dict_not_required_keys(self): dictionary, constraints = self._construct_dict_and_constraints() del dictionary['key2'] msg = validators.validate_dict(dictionary, constraints) self.assertIsNone(msg, 'Field that was not required by the specs was' 'required by the validator.') def test_validate_dict_required_keys(self): dictionary, constraints = self._construct_dict_and_constraints() del dictionary['key1'] msg = validators.validate_dict(dictionary, constraints) self.assertIn('Expected keys:', msg) def test_validate_dict_wrong_values(self): dictionary, constraints = self._construct_dict_and_constraints() dictionary['key1'] = 'UNSUPPORTED' msg = validators.validate_dict(dictionary, constraints) self.assertIsNotNone(msg) def test_validate_dict_unexpected_keys(self): dictionary, constraints = self._construct_dict_and_constraints() dictionary['unexpected_key'] = 'val' msg = validators.validate_dict(dictionary, constraints) self.assertIn('Unexpected keys supplied:', msg) def test_validate_dict_convert_boolean(self): dictionary, constraints = self._construct_dict_and_constraints() constraints['key_bool'] = { 'type:boolean': None, 'required': False, 'convert_to': converters.convert_to_boolean} dictionary['key_bool'] = 'true' msg = validators.validate_dict(dictionary, constraints) self.assertIsNone(msg) # Explicitly comparing with literal 'True' as assertTrue # succeeds also for 'true' self.assertIs(True, dictionary['key_bool']) def test_subdictionary(self): dictionary, constraints = self._construct_dict_and_constraints() del dictionary['key3']['k4'] dictionary['key3']['k5'] = 'a string value' msg = validators.validate_dict(dictionary, constraints) self.assertIn('Expected keys:', msg) def test_validate_dict_or_none(self): dictionary, constraints = self._construct_dict_and_constraints() # Check whether None is a valid value. msg = validators.validate_dict_or_none(None, constraints) self.assertIsNone(msg, 'Validation of a None dictionary failed.') # Check validation of a regular dictionary. msg = validators.validate_dict_or_none(dictionary, constraints) self.assertIsNone(msg, 'Validation of a valid dictionary failed.') def test_validate_dict_or_empty(self): dictionary, constraints = self._construct_dict_and_constraints() # Check whether an empty dictionary is valid. msg = validators.validate_dict_or_empty({}, constraints) self.assertIsNone(msg, 'Validation of a None dictionary failed.') # Check validation of a regular dictionary. msg = validators.validate_dict_or_empty(dictionary, constraints) self.assertIsNone(msg, 'Validation of a valid dictionary failed.') def test_validate_dict_or_nodata(self): dictionary, constraints = self._construct_dict_and_constraints() # Check whether no data is a valid value. msg = validators.validate_dict_or_nodata(None, constraints) self.assertIsNone(msg, 'Validation of None for no-data failed.') msg = validators.validate_dict_or_nodata({}, constraints) self.assertIsNone(msg, 'Validation of empty dict for no-data failed.') # Check validation of a regular dictionary. msg = validators.validate_dict_or_nodata(dictionary, constraints) self.assertIsNone(msg, 'Validation of a valid dictionary failed.') def test_validate_non_negative(self): msg = validators.validate_non_negative('abc') self.assertEqual("'abc' is not an integer", msg) for value in (-1, '-2'): self.assertEqual("'%s' should be non-negative" % value, validators.validate_non_negative(value)) for value in (0, 1, '2', True, False): msg = validators.validate_non_negative(value) self.assertIsNone(msg) def test_validate_subports_invalid_body(self): self.assertIsNotNone(validators.validate_subports(None)) def test_validate_subports_invalid_subport_object(self): self.assertIsNotNone(validators.validate_subports(['foo_port'])) def test_validate_subports_invalid_port_uuid(self): body = [{'port_id': 'foo_port'}] self.assertIsNotNone(validators.validate_subports(body)) def test_validate_subports_invalid_missing_port_id(self): body = [{'poort_id': 'foo_port'}] self.assertIsNotNone(validators.validate_subports(body)) def test_validate_subports_invalid_duplicate_port_ids(self): body = [ {'port_id': '00000000-ffff-ffff-ffff-000000000000'}, {'port_id': '00000000-ffff-ffff-ffff-000000000000'} ] self.assertIsNotNone(validators.validate_subports(body)) def test_validate_subports_invalid_incomplete_segmentation_details(self): body = [ {'port_id': '00000000-ffff-ffff-ffff-000000000000', 'segmentation_id': '3'} ] self.assertIsNotNone(validators.validate_subports(body)) def test_validate_subports_invalid_unknown_paramenter(self): body = [ {'port_id': '00000000-ffff-ffff-ffff-000000000000', 'segmentation_id': '3', 'segmeNAtion_type': 'vlan'} ] self.assertIsNotNone(validators.validate_subports(body)) def test_validate_subports_invalid_duplicate_segmentation_id(self): body = [ {'port_id': '00000000-ffff-ffff-ffff-000000000000', 'segmentation_id': 0, 'segmentation_type': 'vlan'}, {'port_id': '11111111-ffff-ffff-ffff-000000000000', 'segmentation_id': 0, 'segmentation_type': 'vlan'} ] self.assertIsNotNone(validators.validate_subports(body)) def test_validate_subports_with_segmentation_id_0(self): body = [ {'port_id': '00000000-ffff-ffff-ffff-000000000000', 'segmentation_id': '0', 'segmentation_type': 'vlan'} ] self.assertIsNone(validators.validate_subports(body)) def test_validate_subports_inherit_segmentation_details(self): body = [ {'port_id': '00000000-ffff-ffff-ffff-000000000000', 'segmentation_type': 'inherit'} ] self.assertIsNone(validators.validate_subports(body)) def test_validate_subports_valid_unique_segmentation_id(self): body = [ {'port_id': '00000000-ffff-ffff-ffff-000000000000', 'segmentation_id': '3', 'segmentation_type': 'vlan'}, {'port_id': '11111111-ffff-ffff-ffff-000000000000', 'segmentation_id': '3', 'segmentation_type': 'vxlan'} ] self.assertIsNone(validators.validate_subports(body)) def test_validate_subports_valid_empty_body(self): self.assertIsNone(validators.validate_subports([])) def test_validate_subports_valid_suports_with_segmentation_details(self): body = [ {'port_id': '00000000-ffff-ffff-ffff-000000000000', 'segmentation_id': '3', 'segmentation_type': 'vlan'}, {'port_id': '11111111-ffff-ffff-ffff-000000000000', 'segmentation_id': '5', 'segmentation_type': 'vlan'} ] self.assertIsNone(validators.validate_subports(body)) def test_validate_subports_valid_subports(self): body = [ {'port_id': '00000000-ffff-ffff-ffff-000000000000'}, {'port_id': '11111111-ffff-ffff-ffff-000000000000'}, ] self.assertIsNone(validators.validate_subports(body)) class TestValidateIPSubnetNone(base.BaseTestCase): def test_validate_none(self): self.assertIsNone(validators.validate_ip_or_subnet_or_none(None)) def test_validate_ipv4(self): testdata = "172.0.0.1" self.assertIsNone(validators.validate_ip_or_subnet_or_none(testdata)) def test_validate_ipv4_subnet(self): testdata = "172.0.0.1/24" self.assertIsNone(validators.validate_ip_or_subnet_or_none(testdata)) def test_validate_ipv6(self): testdata = "2001:0db8:0a0b:12f0:0000:0000:0000:0001" self.assertIsNone(validators.validate_ip_or_subnet_or_none(testdata)) def test_validate_ipv6_subnet(self): testdata = "::1/128" self.assertIsNone(validators.validate_ip_or_subnet_or_none(testdata)) def test_validate_ipv4_invalid(self): testdata = "300.0.0.1" self.assertEqual(("'300.0.0.1' is neither a valid IP address, nor is " "it a valid IP subnet"), validators.validate_ip_or_subnet_or_none(testdata)) def test_validate_ipv4_subnet_invalid(self): testdata = "172.0.0.1/45" self.assertEqual(("'172.0.0.1/45' is neither a valid IP address, nor " "is it a valid IP subnet"), validators.validate_ip_or_subnet_or_none(testdata)) def test_validate_ipv6_invalid(self): testdata = "xxxx:0db8:0a0b:12f0:0000:0000:0000:0001" self.assertEqual(("'xxxx:0db8:0a0b:12f0:0000:0000:0000:0001' is " "neither a valid IP address, nor is it a valid IP " "subnet"), validators.validate_ip_or_subnet_or_none(testdata)) def test_validate_ipv6_subnet_invalid(self): testdata = "::1/2048" self.assertEqual(("'::1/2048' is neither a valid IP address, nor is " "it a valid IP subnet"), validators.validate_ip_or_subnet_or_none(testdata)) class TestPortRangeValidation(base.BaseTestCase): def test_valid_port(self): result = validators.validate_port_range_or_none("80") self.assertIsNone(result) def test_valid_port_integer(self): result = validators.validate_port_range_or_none(80) self.assertIsNone(result) def test_valid_range(self): # NOTE(huntxu): This case would fail when ports are compared as # strings, since '9' > '1111'. result = validators.validate_port_range_or_none("9:1111") self.assertIsNone(result) def test_port_too_high(self): result = validators.validate_port_range_or_none("99999") self.assertEqual(u"Invalid port: 99999", result) def test_port_too_low(self): result = validators.validate_port_range_or_none("-1") self.assertEqual(u"Invalid port: -1", result) def test_range_too_high(self): result = validators.validate_port_range_or_none("80:99999") self.assertEqual(u"Invalid port: 99999", result) def test_range_too_low(self): result = validators.validate_port_range_or_none("-1:8888") self.assertEqual(u"Invalid port: -1", result) def test_range_wrong_way(self): # NOTE(huntxu): This case would fail when ports are compared as # strings, since '1111' < '9'. result = validators.validate_port_range_or_none("1111:9") self.assertEqual(u"First port in a port range must be lower than the " "second port", result) def test_range_invalid(self): result = validators.validate_port_range_or_none("DEAD:BEEF") self.assertEqual(u"Invalid port: DEAD", result) def test_range_bad_input(self): result = validators.validate_port_range_or_none(['a', 'b', 'c']) self.assertEqual(u"Invalid port: ['a', 'b', 'c']", result) def test_range_colon(self): result = validators.validate_port_range_or_none(":") self.assertEqual(u"Port range must be two integers separated by a " "colon", result) def test_too_many_colons(self): result = validators.validate_port_range_or_none("80:888:8888") self.assertEqual(u"Port range must be two integers separated by a " "colon", result) class TestAnyKeySpecs(base.BaseTestCase): def test_data_is_none(self): self.assertIsNone( validators.validate_any_key_specs_or_none(None, key_specs={})) def test_data_is_not_list(self): for t in [dict(), set(), 'abc', 1, True]: self.assertRaises( n_exc.InvalidInput, validators.validate_any_key_specs_or_none, t, key_specs={}) def test_data_invalid_keys(self): data = [{'opt_name': 'a', 'opt_value': 'A'}, {'opt_name': 'b', 'opt_valuee': 'B'}] self.assertRaisesRegex( n_exc.InvalidInput, "No valid key specs", validators.validate_any_key_specs_or_none, data, key_specs=extra_dhcp_opt.EXTRA_DHCP_OPT_KEY_SPECS) def test_data_optional_key(self): data = [{'opt_name': 'a', 'opt_value': 'A'}, {'opt_name': 'b', 'opt_value': 'B', 'ip_version': '4'}] self.assertIsNone( validators.validate_any_key_specs_or_none( data, key_specs=extra_dhcp_opt.EXTRA_DHCP_OPT_KEY_SPECS)) def test_data_optional_key_invalid(self): data = [{'opt_name': 'a', 'opt_value': 'A'}, {'opt_name': 'b', 'opt_value': 'B', 'ip_version': '3'}] self.assertRaisesRegex( n_exc.InvalidInput, "No valid key specs", validators.validate_any_key_specs_or_none, data, key_specs=extra_dhcp_opt.EXTRA_DHCP_OPT_KEY_SPECS) def test_data_conditional_spec(self): data = [{'opt_name': 'router', 'opt_value': None}, {'opt_name': 'b', 'opt_value': 'B', 'ip_version': '4'}] self.assertIsNone( validators.validate_any_key_specs_or_none( data, key_specs=extra_dhcp_opt.EXTRA_DHCP_OPT_KEY_SPECS)) class TestServicePluginType(base.BaseTestCase): def setUp(self): super(TestServicePluginType, self).setUp() self._plugins = directory._PluginDirectory() self._plugins.add_plugin('stype', mock.Mock()) self.useFixture(fixture.PluginDirectoryFixture( plugin_directory=self._plugins)) def test_valid_plugin_type(self): self.assertIsNone(validators.validate_service_plugin_type('stype')) def test_invalid_plugin_type(self): self.assertRaisesRegex( n_exc.InvalidServiceType, 'Invalid service type', validators.validate_service_plugin_type, 'ntype') neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/0000775000175100017510000000000013231472430023602 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_metering.py0000666000175100017510000000205013231472055027027 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import metering from neutron_lib.tests.unit.api.definitions import base class MeteringDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = metering extension_resources = (metering.METERING_LABEL_RULES, metering.METERING_LABELS) extension_attributes = ('remote_ip_prefix', 'excluded', 'metering_label_id', 'direction') neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_firewallrouterinsertion.py0000666000175100017510000000157113231472055032225 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import firewallrouterinsertion from neutron_lib.tests.unit.api.definitions import base class FirewallDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = firewallrouterinsertion extension_resources = ('firewalls',) extension_attributes = ('router_ids',) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_bgpvpn.py0000666000175100017510000000464513231472055026525 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import bgpvpn from neutron_lib.api import validators from neutron_lib.tests.unit.api.definitions import base class BgpvpnDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = bgpvpn extension_resources = (bgpvpn.COLLECTION_NAME,) extension_attributes = ('type', 'route_targets', 'import_targets', 'export_targets', 'route_distinguishers', 'networks', 'routers', 'router_id', 'network_id') extension_subresources = ('network_associations', 'router_associations') def _data_for_invalid_rtdt(self): values = [[':1'], ['1:'], ['42'], ['65536:123456'], ['123.456.789.123:65535'], ['4294967296:65535'], ['1.1.1.1:655351'], ['4294967295:65536'], [''], ] for value in values: yield value def _data_for_valid_rtdt(self): values = [['1:1'], ['1:4294967295'], ['65535:0'], ['65535:4294967295'], ['1.1.1.1:1'], ['1.1.1.1:65535'], ['4294967295:0'], ['65536:65535'], ['4294967295:65535'], ] for value in values: yield value def test_valid_rtrd(self): for rtrd in self._data_for_valid_rtdt(): msg = validators.validate_list_of_regex_or_none( rtrd, bgpvpn.RTRD_REGEX) self.assertIsNone(msg) def test_invalid_rtrd(self): for rtrd in self._data_for_invalid_rtdt(): msg = validators.validate_list_of_regex_or_none( rtrd, bgpvpn.RTRD_REGEX) self.assertIsNotNone(msg) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_port.py0000666000175100017510000000143113231472055026203 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import port from neutron_lib.tests.unit.api.definitions import base class PortDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = port extension_attributes = () neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_portbindings.py0000666000175100017510000000211613231472055027722 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import portbindings from neutron_lib.tests.unit.api.definitions import base class PortbindingsDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = portbindings extension_resources = (portbindings.COLLECTION_NAME,) extension_attributes = (portbindings.VIF_TYPE, portbindings.VIF_DETAILS, portbindings.VNIC_TYPE, portbindings.HOST_ID, portbindings.PROFILE) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_qos_rule_type_details.py0000666000175100017510000000174613231472055031627 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import qos_rule_type_details from neutron_lib.tests.unit.api.definitions import base from neutron_lib.tests.unit.api.definitions import test_qos class QosRuleTypeDetailsTestCase(base.DefinitionBaseTestCase): extension_module = qos_rule_type_details extension_resources = test_qos.QoSDefinitionTestCase.extension_resources extension_attributes = (qos_rule_type_details.DRIVERS,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/__init__.py0000666000175100017510000000000013231472055025706 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_firewall_v2.py0000666000175100017510000000300013231472055027425 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import firewall_v2 from neutron_lib import constants from neutron_lib.tests.unit.api.definitions import base class FirewallDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = firewall_v2 extension_resources = ('firewall_groups', 'firewall_policies', 'firewall_rules') extension_attributes = ('action', 'admin_state_up', 'audited', 'destination_ip_address', 'destination_port', 'egress_firewall_policy_id', 'enabled', 'firewall_policy_id', 'firewall_rules', 'ingress_firewall_policy_id', 'ip_version', 'ports', 'position', 'protocol', constants.SHARED, 'source_ip_address', 'source_port', 'source_firewall_group_id', 'destination_firewall_group_id') neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_l2_adjancency.py0000666000175100017510000000154713231472055027723 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import l2_adjacency from neutron_lib.tests.unit.api.definitions import base class L2AdjacencyDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = l2_adjacency extension_resources = () extension_attributes = (l2_adjacency.L2_ADJACENCY,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_network.py0000666000175100017510000000144213231472055026712 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import network from neutron_lib.tests.unit.api.definitions import base class NetworkDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = network extension_attributes = () neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_data_plane_status.py0000666000175100017510000000167413231472055030723 0ustar zuulzuul00000000000000# Copyright (c) 2017 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import data_plane_status as dps from neutron_lib.tests.unit.api.definitions import base class DataPlaneStatusDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = dps extension_resources = (dps.COLLECTION_NAME,) extension_attributes = (dps.DATA_PLANE_STATUS,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_provider_net.py0000666000175100017510000000156513231472055027727 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import provider_net from neutron_lib.tests.unit.api.definitions import base class ProviderNetTestCase(base.DefinitionBaseTestCase): extension_module = provider_net extension_resources = (provider_net.COLLECTION_NAME,) extension_attributes = provider_net.ATTRIBUTES neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_dns_domain_ports.py0000666000175100017510000000165013231472055030564 0ustar zuulzuul00000000000000# Copyright (c) 2017 IBM # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import dns from neutron_lib.api.definitions import dns_domain_ports from neutron_lib.tests.unit.api.definitions import base class DnsDomainPortsDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = dns_domain_ports extension_attributes = (dns.DNSDOMAIN,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_servicetype.py0000666000175100017510000000161313231472055027563 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import servicetype from neutron_lib.tests.unit.api.definitions import base class ServiceTypeDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = servicetype extension_resources = (servicetype.COLLECTION_NAME,) extension_attributes = ('default', servicetype.SERVICE_ATTR,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_network_ip_availability.py0000666000175100017510000000201713231472055032133 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import network_ip_availability from neutron_lib.tests.unit.api.definitions import base class NetworkIPAvailabilityDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = network_ip_availability extension_resources = (network_ip_availability.RESOURCE_PLURAL,) extension_attributes = ('total_ips', 'used_ips', 'subnet_ip_availability', 'network_name',) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_network_mtu.py0000666000175100017510000000146313231472055027602 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import network_mtu from neutron_lib.tests.unit.api.definitions import base class NetworkMtuDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = network_mtu extension_attributes = ('mtu',) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_router_interface_fip.py0000666000175100017510000000154413231472055031422 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import router_interface_fip from neutron_lib.tests.unit.api.definitions import base class RouterInterfaceFipDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = router_interface_fip extension_resources = () extension_attributes = () neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_flavors.py0000666000175100017510000000214513231472055026676 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import flavors from neutron_lib.tests.unit.api.definitions import base class FlavorsDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = flavors extension_resources = (flavors.FLAVORS, flavors.SERVICE_PROFILES,) extension_subresources = (flavors.NEXT_PROVIDERS, flavors.SERVICE_PROFILES,) extension_attributes = ('enabled', 'provider', 'metainfo', 'driver', flavors.SERVICE_PROFILES, 'service_type',) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_extraroute.py0000666000175100017510000000147513231472055027431 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import extraroute from neutron_lib.tests.unit.api.definitions import base class ExtrarouteDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = extraroute extension_attributes = (extraroute.ROUTES,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_ip_substring_filtering.py0000666000175100017510000000147113231472055031776 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import ip_substring_port_filtering from neutron_lib.tests.unit.api.definitions import base class IPSubstringFilteringDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = ip_substring_port_filtering neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_default_subnetpools.py0000666000175100017510000000161513231472055031304 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import default_subnetpools from neutron_lib.tests.unit.api.definitions import base class DefaultSubnetPoolsDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = default_subnetpools extension_resources = () extension_attributes = (default_subnetpools.USE_DEFAULT_SUBNETPOOL,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_fip64.py0000666000175100017510000000147113231472055026153 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import fip64 from neutron_lib.tests.unit.api.definitions import base class Fip64DefinitionTestCase(base.DefinitionBaseTestCase): extension_module = fip64 extension_resources = () extension_attributes = () neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_port_security.py0000666000175100017510000000151313231472055030133 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import port_security from neutron_lib.tests.unit.api.definitions import base class PortSecurityDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = port_security extension_attributes = ('port_security_enabled',) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_address_scope.py0000666000175100017510000000177613231472055030051 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import address_scope from neutron_lib.tests.unit.api.definitions import base class AddressScopeDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = address_scope extension_resources = (address_scope.COLLECTION_NAME,) extension_attributes = ('ipv6_address_scope', 'ipv4_address_scope', 'address_scope_id',) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_trunk_details.py0000666000175100017510000000161113231472055030067 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import trunk_details from neutron_lib.tests.unit.api.definitions import base class TrunkDetailsDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = trunk_details extension_resource = (trunk_details.COLLECTION_NAME,) extension_attributes = (trunk_details.TRUNK_DETAILS,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_l3_flavors.py0000666000175100017510000000153413231472055027275 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import l3_flavors from neutron_lib.tests.unit.api.definitions import base class L3FlavorsDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = l3_flavors extension_resources = () extension_attributes = (l3_flavors.FLAVOR_ID,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_network_mtu_writable.py0000666000175100017510000000150513231472055031470 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import network_mtu_writable from neutron_lib.tests.unit.api.definitions import base class NetworkMtuDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = network_mtu_writable extension_attributes = ('mtu',) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_logging_resource.py0000666000175100017510000000230113231472055030551 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import logging_resource from neutron_lib.tests.unit.api.definitions import base class LoggingResourceDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = logging_resource extension_resources = (logging_resource.COLLECTION_NAME,) extension_subresources = (logging_resource.FIREWALL_LOGS,) extension_attributes = (logging_resource.ENABLED, logging_resource.FIREWALL_LOGS, logging_resource.LOGGING_RESOURCE_ID, logging_resource.FW_EVENT, logging_resource.FIREWALL_ID,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_dns.py0000666000175100017510000000163313231472055026007 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import dns from neutron_lib.api.definitions import l3 from neutron_lib.tests.unit.api.definitions import base class DnsDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = dns extension_resources = (l3.FLOATINGIPS,) extension_attributes = (dns.DNSNAME, dns.DNSDOMAIN, dns.DNSASSIGNMENT,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_revisionifmatch.py0000666000175100017510000000143413231472055030414 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import revisionifmatch from neutron_lib.tests.unit.api.definitions import base class RevisionIfMatchDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = revisionifmatch neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_network_availability_zone.py0000666000175100017510000000175113231472055032502 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import availability_zone from neutron_lib.api.definitions import network_availability_zone from neutron_lib.tests.unit.api.definitions import base class NetworkAvailabilityZoneDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = network_availability_zone extension_attributes = (availability_zone.AZ_HINTS, availability_zone.COLLECTION_NAME) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_subnet_onboard.py0000666000175100017510000000146613231472055030233 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import subnet_onboard from neutron_lib.tests.unit.api.definitions import base class OnboardSubnetDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = subnet_onboard extension_attributes = () neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_qos_default.py0000666000175100017510000000165413231472055027534 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import qos_default from neutron_lib.tests.unit.api.definitions import base from neutron_lib.tests.unit.api.definitions import test_qos class QoSDefaultTestCase(base.DefinitionBaseTestCase): extension_module = qos_default extension_resources = test_qos.QoSDefinitionTestCase.extension_resources extension_attributes = () neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_portbindings_extended.py0000666000175100017510000000217313231472055031605 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import portbindings_extended as pbe from neutron_lib.tests.unit.api.definitions import base class PortbindingsExtendedDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = pbe extension_attributes = (pbe.VIF_TYPE, pbe.VIF_DETAILS, pbe.VNIC_TYPE, pbe.HOST, pbe.PROFILE, pbe.STATUS, pbe.PROJECT_ID) extension_subresources = (pbe.COLLECTION_NAME,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_vlantransparent.py0000666000175100017510000000230013231472055030435 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import vlantransparent from neutron_lib.tests.unit.api.definitions import base class VlantransparentDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = vlantransparent extension_resources = () extension_attributes = (vlantransparent.VLANTRANSPARENT,) def test_get_vlan_transparent(self): self.assertTrue(vlantransparent.get_vlan_transparent( {vlantransparent.VLANTRANSPARENT: True, 'vlan': '1'})) def test_get_vlan_transparent_not_set(self): self.assertFalse(vlantransparent.get_vlan_transparent( {'vlanxtx': True, 'vlan': '1'})) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/ip_allocation.py0000666000175100017510000000155413231472055027003 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import ip_allocation from neutron_lib.tests.unit.api.definitions import base class IPAllocationDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = ip_allocation extension_resources = () extension_attributes = (ip_allocation.IP_ALLOCATION,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_pagination.py0000666000175100017510000000141513231472055027352 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import pagination from neutron_lib.tests.unit.api.definitions import base class PaginationDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = pagination neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_auto_allocated_topology.py0000666000175100017510000000164513231472055032142 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import auto_allocated_topology from neutron_lib.tests.unit.api.definitions import base class AutoTopologyDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = auto_allocated_topology extension_resources = (auto_allocated_topology.COLLECTION_NAME,) extension_attributes = () neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_bgpvpn_vni.py0000666000175100017510000000172213231472055027372 0ustar zuulzuul00000000000000# # Copyright 2017 Ericsson India Global Services Pvt Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # from neutron_lib.api.definitions import bgpvpn from neutron_lib.api.definitions import bgpvpn_vni from neutron_lib.tests.unit.api.definitions import base class BgpvpnDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = bgpvpn_vni extension_resources = (bgpvpn.COLLECTION_NAME,) extension_attributes = (bgpvpn_vni.VNI,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_l3_ext_ha_mode.py0000666000175100017510000000155013231472055030073 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import l3_ext_ha_mode from neutron_lib.tests.unit.api.definitions import base class L3ExtHAModeDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = l3_ext_ha_mode extension_resources = () extension_attributes = (l3_ext_ha_mode.HA_INFO,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_qos.py0000666000175100017510000000222113231472055026017 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import qos from neutron_lib.tests.unit.api.definitions import base class QoSDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = qos extension_resources = (qos.POLICIES, qos.RULE_TYPES) extension_subresources = (qos.BANDWIDTH_LIMIT_RULES, qos.DSCP_MARKING_RULES, qos.MIN_BANDWIDTH_RULES) extension_attributes = ('direction', 'max_burst_kbps', 'type', 'dscp_mark', 'min_kbps', 'rules', 'max_kbps', 'qos_policy_id') neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_allowedaddresspairs.py0000666000175100017510000000160513231472055031256 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import allowedaddresspairs from neutron_lib.tests.unit.api.definitions import base class AllowedAddressPairsDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = allowedaddresspairs extension_resources = () extension_attributes = (allowedaddresspairs.ADDRESS_PAIRS,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_trunk.py0000666000175100017510000000152613231472055026367 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import trunk from neutron_lib.tests.unit.api.definitions import base class TrunkDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = trunk extension_resources = (trunk.TRUNKS,) extension_attributes = (trunk.SUB_PORTS,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_sorting.py0000666000175100017510000000140413231472055026704 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import sorting from neutron_lib.tests.unit.api.definitions import base class SortingDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = sorting neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_routerservicetype.py0000666000175100017510000000154213231472055031025 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import routerservicetype from neutron_lib.tests.unit.api.definitions import base class RouterServiceTyepDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = routerservicetype extension_attributes = (routerservicetype.SERVICE_TYPE_ID,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_subnetpool.py0000666000175100017510000000145313231472055027415 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import subnetpool from neutron_lib.tests.unit.api.definitions import base class SubnetPoolDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = subnetpool extension_attributes = () neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_bgpvpn_routes_control.py0000666000175100017510000000214613231472055031660 0ustar zuulzuul00000000000000# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import bgpvpn from neutron_lib.api.definitions import bgpvpn_routes_control from neutron_lib.tests.unit.api.definitions import base class BgpvpnRoutesControlDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = bgpvpn_routes_control extension_resources = (bgpvpn.COLLECTION_NAME,) extension_attributes = ('ports', 'routes', 'advertise_fixed_ips', 'advertise_extra_routes', 'local_pref') extension_subresources = ('port_associations', 'router_associations') neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test__dummy.py0000666000175100017510000000153613231472055026517 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import _dummy from neutron_lib.tests.unit.api.definitions import base class _DummyDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = _dummy extension_resources = (_dummy.COLLECTION_NAME,) extension_subresources = ('subfoo',) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_project_id.py0000666000175100017510000000141413231472055027342 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import project_id from neutron_lib.tests.unit.api.definitions import base class ProjectIdDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = project_id neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/base.py0000666000175100017510000002075713231472055025106 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import imp import os from neutron_lib.api import definitions from neutron_lib.api.definitions import base from neutron_lib.api import validators from neutron_lib import constants from neutron_lib.tests import _base as test_base def assert_bool(tester, attribute, attribute_dict, keyword, value): tester.assertIsInstance( value, bool, '%s must be a boolean for %s.' % (keyword, attribute)) def assert_converter(tester, attribute, attribute_dict, keyword, value): if ('default' not in attribute_dict or attribute_dict['default'] is constants.ATTR_NOT_SPECIFIED): return try: attribute_dict['convert_to'](attribute_dict['default']) except KeyError: try: attribute_dict['convert_list_to'](attribute_dict['default']) except KeyError: if validators.is_attr_set(value) and not isinstance( value, (str, list)): tester.fail("Default value '%s' cannot be converted for " "attribute %s." % (value, attribute)) def assert_true(tester, attribute, attribute_dict, keyword, value): tester.assertTrue( value, '%s must be True for %s.' % (keyword, attribute)) def assert_validator(tester, attribute, attribute_dict, keyword, value): tester.assertIn(list(value)[0], validators.validators, '%s is not a known validator for %s.' % (value, attribute)) ASSERT_FUNCTIONS = { 'allow_post': assert_bool, 'allow_put': assert_bool, 'convert_to': assert_converter, 'convert_list_to': assert_converter, 'default': assert_converter, 'enforce_policy': assert_bool, 'is_visible': assert_bool, 'primary_key': assert_true, 'required_by_policy': assert_bool, 'validate': assert_validator, } class DefinitionBaseTestCase(test_base.BaseTestCase): extension_module = None extension_resources = () extension_subresources = () extension_attributes = () def setUp(self): super(DefinitionBaseTestCase, self).setUp() if not self.extension_module: self.fail("Missing extension module definition.") self.alias = self.extension_module.ALIAS self.is_shim_extension = self.extension_module.IS_SHIM_EXTENSION self.is_standard_attr_extension = ( self.extension_module.IS_STANDARD_ATTR_EXTENSION) self.name = self.extension_module.NAME self.description = self.extension_module.DESCRIPTION self.resource_map = self.extension_module.RESOURCE_ATTRIBUTE_MAP self.subresource_map = self.extension_module.SUB_RESOURCE_ATTRIBUTE_MAP self.action_map = self.extension_module.ACTION_MAP self.action_status = self.extension_module.ACTION_STATUS self.required_extensions = self.extension_module.REQUIRED_EXTENSIONS self.optional_extensions = self.extension_module.OPTIONAL_EXTENSIONS def test_shim_extension(self): if self.is_shim_extension is True: self.assertFalse(self.extension_resources) self.assertFalse(self.extension_attributes) self.assertFalse(self.resource_map) self.assertFalse(self.action_map) self.assertFalse(self.action_status) def test_is_standard_attr_extension(self): if self.is_standard_attr_extension: self.assertIn('standard-attr-', self.alias) else: self.skipTest('API definition is not related to standardattr.') def test_resource_map(self): if (not self.resource_map and not self.subresource_map and not self.is_shim_extension): self.fail('Missing resource and subresource map, ' 'what is this extension doing?') elif self.is_shim_extension: self.skipTest('Shim extension with no API changes.') for resource in self.resource_map: self.assertIn( resource, base.KNOWN_RESOURCES + self.extension_resources, 'Resource is unknown, check for typos.') self.assertParams(self.resource_map[resource]) def assertParams(self, resource): for attribute in resource.keys(): self.assertIn( attribute, base.KNOWN_ATTRIBUTES + self.extension_attributes, 'Attribute is unknown, check for typos.') for keyword in resource[attribute]: self.assertIn(keyword, base.KNOWN_KEYWORDS, 'Keyword is unknown, check for typos.') value = resource[attribute][keyword] assert_f = ASSERT_FUNCTIONS[keyword] assert_f(self, attribute, resource[attribute], keyword, value) def test_subresource_map(self): if not self.subresource_map: self.skipTest('API extension has no subresource map.') for subresource in self.subresource_map: self.assertIn( subresource, self.extension_subresources, 'Sub-resource is unknown, check for typos.') for attribute in self.subresource_map[subresource]: self.assertIn(attribute, ('parent', 'parameters')) self.assertIn( self.subresource_map[subresource]['parent']['collection_name'], base.KNOWN_RESOURCES + self.extension_resources, 'Sub-resource parent is unknown, check for typos.') self.assertIn('member_name', self.subresource_map[subresource]['parent'], 'Incorrect parent definition, check for typos.') self.assertParams(self.subresource_map[subresource]['parameters']) def test_action_map(self): self.assertIsInstance(self.action_map, dict) if not self.action_map: self.skipTest('API definition has no action map.') for key in self.action_map: for action in self.action_map[key].values(): self.assertIn(action, base.KNOWN_HTTP_ACTIONS, 'HTTP verb is unknown, check for typos.') def test_action_status(self): if not self.action_status: self.skipTest('API definition has no action status.') for status in self.action_status.values(): self.assertIn(status, base.KNOWN_ACTION_STATUSES, 'HTTP status is unknown, check for typos.') def test_required_extensions(self): self.assertIsInstance(self.required_extensions, list) if not self.required_extensions: self.skipTest('API definition has no required extensions.') for ext in self.required_extensions: self.assertIn(ext, base.KNOWN_EXTENSIONS, 'Required extension is unknown, check for typos.') def test_optional_extensions(self): self.assertIsInstance(self.optional_extensions, list) if not self.optional_extensions: self.skipTest('API definition has no optional extensions.') for ext in self.optional_extensions: self.assertIn(ext, base.KNOWN_EXTENSIONS, 'Optional extension is unknown, check for typos.') def test_all_api_definitions_list(self): # ensure _ALL_API_DEFINITIONS contains all public api-defs ext_aliases = [] api_def_path = 'neutron_lib/api/definitions' for f in sorted(os.listdir(api_def_path)): mod_name, file_ext = os.path.splitext(os.path.split(f)[-1]) ext_path = os.path.join(api_def_path, f) if file_ext.lower() == '.py' and not mod_name.startswith('_'): mod = imp.load_source(mod_name, ext_path) ext_alias = getattr(mod, 'ALIAS', None) if not ext_alias: continue ext_aliases.append(ext_alias) self.assertEqual(sorted(ext_aliases), sorted([d.ALIAS for d in definitions._ALL_API_DEFINITIONS])) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_l3.py0000666000175100017510000000216313231472055025540 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import l3 from neutron_lib.tests.unit.api.definitions import base class L3DefinitionTestCase(base.DefinitionBaseTestCase): extension_module = l3 extension_resources = (l3.ROUTERS, l3.FLOATINGIPS,) extension_attributes = (l3.FLOATING_IP_ADDRESS, l3.FLOATING_NETWORK_ID, l3.ROUTER_ID, l3.PORT_ID, l3.FIXED_IP_ADDRESS, l3.SUBNET_ID, l3.EXTERNAL_GW_INFO) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_availability_zone.py0000666000175100017510000000211313231472055030722 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import agent from neutron_lib.api.definitions import availability_zone from neutron_lib.tests.unit.api.definitions import base class AvailabilityZoneDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = availability_zone extension_resources = (availability_zone.COLLECTION_NAME, agent.COLLECTION_NAME,) extension_attributes = (availability_zone.AZ_HINTS, 'resource', availability_zone.RESOURCE_NAME, 'state',) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_logging.py0000666000175100017510000000201513231472055026644 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import logging as log_api from neutron_lib.tests.unit.api.definitions import base EXTENSION_ATTRIBUTES = ( 'event', 'target_id', 'resource_type', 'enabled', 'resource_id', 'type', ) class LoggingApiTestCase(base.DefinitionBaseTestCase): extension_module = log_api extension_attributes = EXTENSION_ATTRIBUTES extension_resources = (log_api.LOGS, log_api.LOG_TYPES,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_router_availability_zone.py0000666000175100017510000000164513231472055032333 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import availability_zone as az from neutron_lib.api.definitions import router_availability_zone from neutron_lib.tests.unit.api.definitions import base class RouterAZDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = router_availability_zone extension_attributes = (az.AZ_HINTS, az.COLLECTION_NAME,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_dvr.py0000666000175100017510000000150313231472055026012 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import dvr from neutron_lib.tests.unit.api.definitions import base class DvrDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = dvr extension_resources = () extension_attributes = (dvr.DISTRIBUTED,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_external_net.py0000666000175100017510000000154313231472055027713 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import external_net from neutron_lib.tests.unit.api.definitions import base class ExternalNetDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = external_net extension_resources = () extension_attributes = (external_net.EXTERNAL,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_segment.py0000666000175100017510000000177113231472055026670 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import segment from neutron_lib.tests.unit.api.definitions import base class SegmentDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = segment extension_resources = (segment.COLLECTION_NAME,) extension_attributes = ('network_id', segment.PHYSICAL_NETWORK, segment.NETWORK_TYPE, segment.SEGMENTATION_ID, segment.SEGMENT_ID,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_extra_dhcp_opt.py0000666000175100017510000000161613231472055030227 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import extra_dhcp_opt from neutron_lib.tests.unit.api.definitions import base class ExtraDHCPOptDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = extra_dhcp_opt extension_resources = (extra_dhcp_opt.COLLECTION_NAME,) extension_attributes = (extra_dhcp_opt.EXTRADHCPOPTS,) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_firewall.py0000666000175100017510000000226413231472055027031 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import firewall from neutron_lib.tests.unit.api.definitions import base class FirewallDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = firewall extension_resources = ('firewalls', 'firewall_policies', 'firewall_rules') extension_attributes = ('action', 'admin_state_up', 'audited', 'destination_ip_address', 'destination_port', 'enabled', 'firewall_policy_id', 'firewall_rules', 'ip_version', 'position', 'protocol', 'source_ip_address', 'source_port') neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_multiprovidernet.py0000666000175100017510000000403213231472055030633 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import multiprovidernet from neutron_lib.api.definitions import provider_net from neutron_lib.exceptions import multiprovidernet as mp_exc from neutron_lib.tests.unit.api.definitions import base from neutron_lib.tests.unit.api.validators import test_multiprovidernet \ as test_mpnet class MultiProviderNetworkDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = multiprovidernet extension_attributes = (multiprovidernet.SEGMENTS,) def test_check_duplicate_segments_with_dups(self): self.assertRaises(mp_exc.SegmentsContainDuplicateEntry, multiprovidernet.check_duplicate_segments, [test_mpnet._build_segment('nt0', 'pn0', 2), test_mpnet._build_segment('nt0', 'pn0', 2)]) def test_check_duplicate_segments_with_dups_and_partial(self): def _seg_partial(seg): return seg[provider_net.PHYSICAL_NETWORK] == 'pn0' self.assertIsNone( multiprovidernet.check_duplicate_segments( [test_mpnet._build_segment('nt0', 'pn0', 2), test_mpnet._build_segment('nt1', 'pn1', 2)], is_partial_func=_seg_partial)) def test_check_duplicate_segments_no_dups(self): self.assertIsNone( multiprovidernet.check_duplicate_segments( [test_mpnet._build_segment('nt0', 'pn0', 2), test_mpnet._build_segment('nt0', 'pn0', 3)])) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_subnet.py0000666000175100017510000000143713231472055026525 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import subnet from neutron_lib.tests.unit.api.definitions import base class SubnetDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = subnet extension_attributes = () neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_agent.py0000666000175100017510000000202613231472055026316 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import agent from neutron_lib.tests.unit.api.definitions import base class AgentDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = agent extension_resources = (agent.COLLECTION_NAME,) extension_attributes = ('topic', 'agent_type', 'created_at', 'configurations', 'heartbeat_timestamp', 'binary', 'started_at', 'host', 'alive',) neutron-lib-1.13.0/neutron_lib/tests/unit/api/definitions/test_l3_ext_gw_mode.py0000666000175100017510000000152613231472055030123 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib.api.definitions import l3_ext_gw_mode from neutron_lib.tests.unit.api.definitions import base class L3ExtendedGatewayModeDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = l3_ext_gw_mode extension_attributes = ('external_gateway_info',) neutron-lib-1.13.0/neutron_lib/tests/unit/utils/0000775000175100017510000000000013231472430021656 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/utils/__init__.py0000666000175100017510000000000013231472055023762 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/utils/test_runtime.py0000666000175100017510000000370613231472055024765 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import mock from neutron_lib.tests import _base as base from neutron_lib.utils import runtime class _DummyDriver(object): driver = mock.sentinel.dummy_driver class TestRunTime(base.BaseTestCase): @mock.patch.object(runtime, 'LOG') def test_load_class_by_alias_or_classname_no_name(self, mock_log): self.assertRaises( ImportError, runtime.load_class_by_alias_or_classname, 'ns', None) @mock.patch.object(runtime.driver, 'DriverManager', return_value=_DummyDriver) @mock.patch.object(runtime, 'LOG') def test_load_class_by_alias_or_classname_dummy_driver( self, mock_log, mock_driver): self.assertEqual(_DummyDriver.driver, runtime.load_class_by_alias_or_classname('ns', 'n')) @mock.patch.object(runtime, 'LOG') def test_load_class_by_alias_or_classname_bad_classname(self, mock_log): self.assertRaises( ImportError, runtime.load_class_by_alias_or_classname, 'ns', '_NoClass') @mock.patch.object(runtime.importutils, 'import_class', return_value=mock.sentinel.dummy_class) @mock.patch.object(runtime, 'LOG') def test_load_class_by_alias_or_classname_with_classname( self, mock_log, mock_import): self.assertEqual( mock.sentinel.dummy_class, runtime.load_class_by_alias_or_classname('ns', 'n')) neutron-lib-1.13.0/neutron_lib/tests/unit/utils/test_host.py0000666000175100017510000000226613231472055024257 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import multiprocessing import mock from neutron_lib.tests import _base as base from neutron_lib.utils import host class TestCpuCount(base.BaseTestCase): @mock.patch.object(multiprocessing, 'cpu_count', return_value=7) def test_cpu_count(self, mock_cpu_count): self.assertEqual(7, host.cpu_count()) mock_cpu_count.assert_called_once_with() @mock.patch.object(multiprocessing, 'cpu_count', side_effect=NotImplementedError()) def test_cpu_count_not_implemented(self, mock_cpu_count): self.assertEqual(1, host.cpu_count()) mock_cpu_count.assert_called_once_with() neutron-lib-1.13.0/neutron_lib/tests/unit/utils/test_helpers.py0000666000175100017510000002017713231472055024745 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import collections import re import six import testtools from neutron_lib.tests import _base as base from neutron_lib.utils import helpers class TestParseMappings(base.BaseTestCase): def parse(self, mapping_list, unique_values=True, unique_keys=True): return helpers.parse_mappings(mapping_list, unique_values, unique_keys) def test_parse_mappings_fails_for_missing_separator(self): with testtools.ExpectedException(ValueError): self.parse(['key']) def test_parse_mappings_fails_for_missing_key(self): with testtools.ExpectedException(ValueError): self.parse([':val']) def test_parse_mappings_fails_for_missing_value(self): with testtools.ExpectedException(ValueError): self.parse(['key:']) def test_parse_mappings_fails_for_extra_separator(self): with testtools.ExpectedException(ValueError): self.parse(['key:val:junk']) def test_parse_mappings_fails_for_duplicate_key(self): with testtools.ExpectedException(ValueError): self.parse(['key:val1', 'key:val2']) def test_parse_mappings_fails_for_duplicate_value(self): with testtools.ExpectedException(ValueError): self.parse(['key1:val', 'key2:val']) def test_parse_mappings_succeeds_for_one_mapping(self): self.assertEqual({'key': 'val'}, self.parse(['key:val'])) def test_parse_mappings_succeeds_for_n_mappings(self): self.assertEqual({'key1': 'val1', 'key2': 'val2'}, self.parse(['key1:val1', 'key2:val2'])) def test_parse_mappings_succeeds_for_duplicate_value(self): self.assertEqual({'key1': 'val', 'key2': 'val'}, self.parse(['key1:val', 'key2:val'], False)) def test_parse_mappings_succeeds_for_no_mappings(self): self.assertEqual({}, self.parse([''])) def test_parse_mappings_succeeds_for_nonuniq_key(self): self.assertEqual({'key': ['val1', 'val2']}, self.parse(['key:val1', 'key:val2', 'key:val2'], unique_keys=False)) def test_parse_mappings_succeeds_for_nonuniq_key_duplicate_value(self): self.assertEqual({'key': ['val']}, self.parse(['key:val', 'key:val', 'key:val'], unique_keys=False)) class TestCompareElements(base.BaseTestCase): def test_compare_elements(self): self.assertFalse(helpers.compare_elements([], ['napoli'])) self.assertFalse(helpers.compare_elements(None, ['napoli'])) self.assertFalse(helpers.compare_elements(['napoli'], [])) self.assertFalse(helpers.compare_elements(['napoli'], None)) self.assertFalse(helpers.compare_elements(['napoli', 'juve'], ['juve'])) self.assertTrue(helpers.compare_elements(['napoli', 'juve'], ['napoli', 'juve'])) self.assertTrue(helpers.compare_elements(['napoli', 'juve'], ['juve', 'napoli'])) class TestDictUtils(base.BaseTestCase): def test_dict2str(self): dic = {"key1": "value1", "key2": "value2", "key3": "value3"} expected = "key1=value1,key2=value2,key3=value3" self.assertEqual(expected, helpers.dict2str(dic)) def test_str2dict(self): string = "key1=value1,key2=value2,key3=value3" expected = {"key1": "value1", "key2": "value2", "key3": "value3"} self.assertEqual(expected, helpers.str2dict(string)) def test_dict_str_conversion(self): dic = {"key1": "value1", "key2": "value2"} self.assertEqual(dic, helpers.str2dict(helpers.dict2str(dic))) def test_diff_list_of_dict(self): old_list = [{"key1": "value1"}, {"key2": "value2"}, {"key3": "value3"}] new_list = [{"key1": "value1"}, {"key2": "value2"}, {"key4": "value4"}] added, removed = helpers.diff_list_of_dict(old_list, new_list) self.assertEqual(added, [dict(key4="value4")]) self.assertEqual(removed, [dict(key3="value3")]) class TestDict2Tuples(base.BaseTestCase): def test_dict(self): input_dict = {'foo': 'bar', '42': 'baz', 'aaa': 'zzz'} expected = (('42', 'baz'), ('aaa', 'zzz'), ('foo', 'bar')) output_tuple = helpers.dict2tuple(input_dict) self.assertEqual(expected, output_tuple) class TestCamelize(base.BaseTestCase): def test_camelize(self): data = {'bandwidth_limit': 'BandwidthLimit', 'test': 'Test', 'some__more__dashes': 'SomeMoreDashes', 'a_penguin_walks_into_a_bar': 'APenguinWalksIntoABar'} for s, expected in data.items(): self.assertEqual(expected, helpers.camelize(s)) class TestRoundVal(base.BaseTestCase): def test_round_val_ok(self): for expected, value in ((0, 0), (0, 0.1), (1, 0.5), (1, 1.49), (2, 1.5)): self.assertEqual(expected, helpers.round_val(value)) class TestGetRandomString(base.BaseTestCase): def test_get_random_string(self): length = 127 random_string = helpers.get_random_string(length) self.assertEqual(length, len(random_string)) regex = re.compile('^[0-9a-fA-F]+$') self.assertIsNotNone(regex.match(random_string)) def requires_py2(testcase): return testtools.skipUnless(six.PY2, "requires python 2.x")(testcase) def requires_py3(testcase): return testtools.skipUnless(six.PY3, "requires python 3.x")(testcase) class TestSafeDecodeUtf8(base.BaseTestCase): @requires_py2 def test_py2_does_nothing(self): s = 'test-py2' self.assertIs(s, helpers.safe_decode_utf8(s)) @requires_py3 def test_py3_decoded_valid_bytes(self): s = bytes('test-py2', 'utf-8') decoded_str = helpers.safe_decode_utf8(s) self.assertIsInstance(decoded_str, six.text_type) self.assertEqual(s, decoded_str.encode('utf-8')) @requires_py3 def test_py3_decoded_invalid_bytes(self): s = bytes('test-py2', 'utf_16') decoded_str = helpers.safe_decode_utf8(s) self.assertIsInstance(decoded_str, six.text_type) class TestSafeSortKey(base.BaseTestCase): def test_safe_sort_key(self): data1 = {'k1': 'v1', 'k2': 'v2'} data2 = {'k2': 'v2', 'k1': 'v1'} self.assertEqual(helpers.safe_sort_key(data1), helpers.safe_sort_key(data2)) def _create_dict_from_list(self, list_data): d = collections.defaultdict(list) for k, v in list_data: d[k].append(v) return d def test_safe_sort_key_mapping_ne(self): list1 = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)] data1 = self._create_dict_from_list(list1) list2 = [('yellow', 3), ('blue', 4), ('yellow', 1), ('blue', 2), ('red', 1)] data2 = self._create_dict_from_list(list2) self.assertNotEqual(helpers.safe_sort_key(data1), helpers.safe_sort_key(data2)) def test_safe_sort_key_mapping(self): list1 = [('yellow', 1), ('blue', 2), ('red', 1)] data1 = self._create_dict_from_list(list1) list2 = [('blue', 2), ('red', 1), ('yellow', 1)] data2 = self._create_dict_from_list(list2) self.assertEqual(helpers.safe_sort_key(data1), helpers.safe_sort_key(data2)) neutron-lib-1.13.0/neutron_lib/tests/unit/utils/test_net.py0000666000175100017510000000375713231472055024076 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import random import socket import mock from neutron_lib import constants from neutron_lib.tests import _base as base from neutron_lib.utils import net class TestGetHostname(base.BaseTestCase): @mock.patch.object(socket, 'gethostname', return_value='fake-host-name') def test_get_hostname(self, mock_gethostname): self.assertEqual('fake-host-name', net.get_hostname()) mock_gethostname.assert_called_once_with() class TestGetRandomMac(base.BaseTestCase): @mock.patch.object(random, 'getrandbits', return_value=0xa2) def test_first_4_octets_unchanged(self, mock_rnd): mac = net.get_random_mac(['aa', 'bb', '00', 'dd', 'ee', 'ff']) self.assertEqual('aa:bb:00:dd:a2:a2', mac) mock_rnd.assert_called_with(8) @mock.patch.object(random, 'getrandbits', return_value=0xa2) def test_first_4th_octet_generated(self, mock_rnd): mac = net.get_random_mac(['aa', 'bb', 'cc', '00', 'ee', 'ff']) self.assertEqual('aa:bb:cc:a2:a2:a2', mac) mock_rnd.assert_called_with(8) class TestPortDeviceOwner(base.BaseTestCase): def test_is_port_trusted(self): self.assertTrue(net.is_port_trusted( {'device_owner': constants.DEVICE_OWNER_NETWORK_PREFIX + 'dev'})) def test_is_port_not_trusted(self): self.assertFalse(net.is_port_trusted( {'device_owner': constants.DEVICE_OWNER_COMPUTE_PREFIX + 'dev'})) neutron-lib-1.13.0/neutron_lib/tests/unit/utils/test_file.py0000666000175100017510000000532713231472055024222 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import errno import os.path import stat import mock from neutron_lib.tests import _base as base from neutron_lib.utils import file class TestEnsureDir(base.BaseTestCase): @mock.patch('os.makedirs') def test_ensure_dir_no_fail_if_exists(self, makedirs): error = OSError() error.errno = errno.EEXIST makedirs.side_effect = error file.ensure_dir("/etc/create/concurrently") @mock.patch('os.makedirs') def test_ensure_dir_oserr(self, makedirs): error = OSError() error.errno = errno.EPERM makedirs.side_effect = error self.assertRaises(OSError, file.ensure_dir, "/etc/create/directory") makedirs.assert_called_once_with("/etc/create/directory", 0o755) @mock.patch('os.makedirs') def test_ensure_dir_calls_makedirs(self, makedirs): file.ensure_dir("/etc/create/directory") makedirs.assert_called_once_with("/etc/create/directory", 0o755) class TestReplaceFile(base.BaseTestCase): def setUp(self): super(TestReplaceFile, self).setUp() temp_dir = self.get_default_temp_dir().path self.file_name = os.path.join(temp_dir, "new_file") self.data = "data to copy" def _verify_result(self, file_mode): self.assertTrue(os.path.exists(self.file_name)) with open(self.file_name) as f: content = f.read() self.assertEqual(self.data, content) mode = os.stat(self.file_name).st_mode self.assertEqual(file_mode, stat.S_IMODE(mode)) def test_replace_file_default_mode(self): file_mode = 0o644 file.replace_file(self.file_name, self.data) self._verify_result(file_mode) def test_replace_file_custom_mode(self): file_mode = 0o722 file.replace_file(self.file_name, self.data, file_mode) self._verify_result(file_mode) def test_replace_file_custom_mode_twice(self): file_mode = 0o722 file.replace_file(self.file_name, self.data, file_mode) self.data = "new data to copy" file_mode = 0o777 file.replace_file(self.file_name, self.data, file_mode) self._verify_result(file_mode) neutron-lib-1.13.0/neutron_lib/tests/unit/test__policy.py0000666000175100017510000000474013231472055023577 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import mock from neutron_lib import _policy as policy from neutron_lib import context from neutron_lib.tests import _base as base class TestPolicyEnforcer(base.BaseTestCase): def setUp(self): super(TestPolicyEnforcer, self).setUp() # Isolate one _ROLE_ENFORCER per test case mock.patch.object(policy, '_ROLE_ENFORCER', None).start() def test_init_reset(self): self.assertIsNone(policy._ROLE_ENFORCER) policy.init() self.assertIsNotNone(policy._ROLE_ENFORCER) def test_check_user_is_not_admin(self): ctx = context.Context('me', 'my_project') self.assertFalse(policy.check_is_admin(ctx)) def test_check_user_elevated_is_admin(self): ctx = context.Context('me', 'my_project', roles=['user']).elevated() self.assertTrue(policy.check_is_admin(ctx)) def test_check_is_admin_no_roles_no_admin(self): policy.init(policy_file='no_policy.json') ctx = context.Context('me', 'my_project', roles=['user']).elevated() # With no admin role, elevated() should not work. self.assertFalse(policy.check_is_admin(ctx)) def test_check_is_advsvc_role(self): ctx = context.Context('me', 'my_project', roles=['advsvc']) self.assertTrue(policy.check_is_advsvc(ctx)) def test_check_is_not_advsvc_user(self): ctx = context.Context('me', 'my_project', roles=['user']) self.assertFalse(policy.check_is_advsvc(ctx)) def test_check_is_not_advsvc_admin(self): ctx = context.Context('me', 'my_project').elevated() self.assertTrue(policy.check_is_admin(ctx)) self.assertFalse(policy.check_is_advsvc(ctx)) def test_check_is_advsvc_no_roles_no_advsvc(self): policy.init(policy_file='no_policy.json') ctx = context.Context('me', 'my_project', roles=['advsvc']) # No advsvc role in the policy file, so cannot assume the role. self.assertFalse(policy.check_is_advsvc(ctx)) neutron-lib-1.13.0/neutron_lib/tests/unit/hacking/0000775000175100017510000000000013231472430022122 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/hacking/__init__.py0000666000175100017510000000000013231472055024226 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/hacking/test_checks.py0000666000175100017510000002316113231472055025003 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import testtools from neutron_lib.hacking import checks from neutron_lib.hacking import translation_checks as tc from neutron_lib.tests import _base as base class HackingTestCase(base.BaseTestCase): def assertLinePasses(self, func, *args): with testtools.ExpectedException(StopIteration): next(func(*args)) def assertLineFails(self, func, *args): self.assertIsInstance(next(func(*args)), tuple) def _get_factory_checks(self, factory): check_fns = [] def _reg(check_fn): self.assertTrue(hasattr(check_fn, '__call__')) self.assertFalse(check_fn in check_fns) check_fns.append(check_fn) factory(_reg) return check_fns def test_factory(self): self.assertTrue(len(self._get_factory_checks(checks.factory)) > 0) def test_neutron_lib_factory(self): lib_checks = self._get_factory_checks(checks._neutron_lib_factory) other_checks = self._get_factory_checks(checks.factory) self.assertTrue(len(lib_checks) > 0) if other_checks: for other_check in other_checks: # lib checks are superset of all checks self.assertTrue(other_check in lib_checks) def test_use_jsonutils(self): def __get_msg(fun): msg = ("N521: jsonutils.%(fun)s must be used instead of " "json.%(fun)s" % {'fun': fun}) return [(0, msg)] for method in ('dump', 'dumps', 'load', 'loads'): self.assertEqual( __get_msg(method), list(checks.use_jsonutils("json.%s(" % method, "./neutron/common/rpc.py"))) self.assertEqual( 0, len(list(checks.use_jsonutils("jsonx.%s(" % method, "./neutron/common/rpc.py")))) self.assertEqual( 0, len(list(checks.use_jsonutils("json.%sx(" % method, "./neutron/common/rpc.py")))) self.assertEqual( 0, len(list(checks.use_jsonutils( "json.%s" % method, "./neutron/plugins/ml2/drivers/openvswitch/agent/xenapi/" "etc/xapi.d/plugins/netwrap")))) def test_check_contextlib_nested(self): f = checks.check_no_contextlib_nested self.assertLineFails(f, 'with contextlib.nested():', '') self.assertLineFails(f, ' with contextlib.nested():', '') self.assertLinePasses(f, '# with contextlib.nested():', '') self.assertLinePasses(f, 'print("with contextlib.nested():")', '') def test_check_python3_xrange(self): f = checks.check_python3_xrange self.assertLineFails(f, 'a = xrange(1000)') self.assertLineFails(f, 'b =xrange ( 42 )') self.assertLineFails(f, 'c = xrange(1, 10, 2)') self.assertLinePasses(f, 'd = range(1000)') self.assertLinePasses(f, 'e = six.moves.range(1337)') def test_no_basestring(self): f = checks.check_no_basestring self.assertLineFails(f, 'isinstance(x, basestring)') self.assertLinePasses(f, 'isinstance(x, BaseString)') def test_check_python3_iteritems(self): f = checks.check_python3_no_iteritems self.assertLineFails(f, "d.iteritems()") self.assertLinePasses(f, "six.iteritems(d)") def test_no_mutable_default_args(self): self.assertEqual(1, len(list(checks.no_mutable_default_args( " def fake_suds_context(calls={}):")))) self.assertEqual(1, len(list(checks.no_mutable_default_args( "def get_info_from_bdm(virt_type, bdm, mapping=[])")))) self.assertEqual(0, len(list(checks.no_mutable_default_args( "defined = []")))) self.assertEqual(0, len(list(checks.no_mutable_default_args( "defined, undefined = [], {}")))) def test_check_neutron_namespace_imports(self): f = checks.check_neutron_namespace_imports self.assertLinePasses(f, 'from neutron_lib import constants') self.assertLinePasses(f, 'import neutron_lib.constants') self.assertLineFails(f, 'from neutron.common import rpc') self.assertLineFails(f, 'from neutron import context') self.assertLineFails(f, 'import neutron.common.config') def test_no_log_translations(self): for log in tc._all_log_levels: for hint in tc._all_hints: bad = 'LOG.%s(%s("Bad"))' % (log, hint) self.assertEqual( 1, len(list(tc.no_translate_logs(bad, 'f')))) # Catch abuses when used with a variable and not a literal bad = 'LOG.%s(%s(msg))' % (log, hint) self.assertEqual( 1, len(list(tc.no_translate_logs(bad, 'f')))) # Do not do validations in tests ok = 'LOG.%s(_("OK - unit tests"))' % log self.assertEqual( 0, len(list(tc.no_translate_logs(ok, 'f/tests/f')))) def test_check_log_warn_deprecated(self): bad = "LOG.warn('i am deprecated!')" good = "LOG.warning('zlatan is the best')" f = tc.check_log_warn_deprecated self.assertLineFails(f, bad, '') self.assertLinePasses(f, good, '') def test_check_localized_exception_messages(self): f = tc.check_raised_localized_exceptions self.assertLineFails(f, " raise KeyError('Error text')", '') self.assertLineFails(f, ' raise KeyError("Error text")', '') self.assertLinePasses(f, ' raise KeyError(_("Error text"))', '') self.assertLinePasses(f, ' raise KeyError(_ERR("Error text"))', '') self.assertLinePasses(f, " raise KeyError(translated_msg)", '') self.assertLinePasses(f, '# raise KeyError("Not translated")', '') self.assertLinePasses(f, 'print("raise KeyError("Not ' 'translated")")', '') def test_check_localized_exception_message_skip_tests(self): f = tc.check_raised_localized_exceptions self.assertLinePasses(f, "raise KeyError('Error text')", 'neutron_lib/tests/unit/mytest.py') def test_check_eventlet_imports(self): f = checks.check_no_eventlet_imports self.assertLineFails(f, "import eventlet") self.assertLineFails(f, "import eventlet.timeout") self.assertLineFails(f, "from eventlet import timeout") self.assertLineFails(f, "from eventlet.timeout import Timeout") self.assertLineFails(f, "from eventlet.timeout import (Timeout, X)") self.assertLinePasses(f, "import is.not.eventlet") self.assertLinePasses(f, "from is.not.eventlet") self.assertLinePasses(f, "from mymod import eventlet") self.assertLinePasses(f, "from mymod.eventlet import amod") self.assertLinePasses(f, 'print("eventlet not here")') self.assertLinePasses(f, 'print("eventlet.timeout")') self.assertLinePasses(f, "from mymod.timeout import (eventlet, X)") def test_assert_equal_none(self): self.assertEqual(len(list(checks.assert_equal_none( "self.assertEqual(A, None)"))), 1) self.assertEqual(len(list(checks.assert_equal_none( "self.assertEqual(A, None) # Comment"))), 1) self.assertEqual(len(list(checks.assert_equal_none( "self.assertEqual(None, A)"))), 1) self.assertEqual(len(list(checks.assert_equal_none( "self.assertEqual(None, A) # Comment"))), 1) self.assertEqual(len(list(checks.assert_equal_none( "self.assertEqual((None, None), A)"))), 0) self.assertEqual(len(list(checks.assert_equal_none( "self.assertEqual((None, None), A) # Comment"))), 0) self.assertEqual(len(list(checks.assert_equal_none( "self.assertEqual(A, (None, None))"))), 0) self.assertEqual(len(list(checks.assert_equal_none( "self.assertEqual(A, (None, None)) # Comment"))), 0) self.assertEqual(len(list(checks.assert_equal_none( "assertIsNot(A, None)"))), 1) self.assertEqual(len(list(checks.assert_equal_none( "assertIsNot(A, None) # Comment"))), 1) self.assertEqual(len(list(checks.assert_equal_none( "assertIsNot(None, A)"))), 1) self.assertEqual(len(list(checks.assert_equal_none( "assertIsNot(None, A) # Comment"))), 1) self.assertEqual(len(list(checks.assert_equal_none( "assertIsNot((None, None), A)"))), 0) self.assertEqual(len(list(checks.assert_equal_none( "assertIsNot((None, None), A) # Comment"))), 0) self.assertEqual(len(list(checks.assert_equal_none( "assertIsNot(A, (None, None))"))), 0) self.assertEqual(len(list(checks.assert_equal_none( "assertIsNot(A, (None, None)) # Comment"))), 0) self.assertEqual( len(list(checks.assert_equal_none("self.assertIsNone(A)"))), 0) self.assertEqual( len(list(checks.assert_equal_none("self.assertIsNotNone(A)"))), 0) neutron-lib-1.13.0/neutron_lib/tests/unit/clients/0000775000175100017510000000000013231472430022157 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/clients/__init__.py0000666000175100017510000000000013231472055024263 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/clients/test_placement.py0000666000175100017510000001342313231472055025550 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import mock from keystoneauth1 import exceptions as ks_exc from oslo_utils import uuidutils from neutron_lib._i18n import _ from neutron_lib.clients import placement from neutron_lib.exceptions import placement as n_exc from neutron_lib import fixture from neutron_lib.tests import _base as base RESOURCE_PROVIDER_UUID = uuidutils.generate_uuid() RESOURCE_CLASS_NAME = 'resource_class_name' class TestPlacementAPIClient(base.BaseTestCase): def setUp(self): super(TestPlacementAPIClient, self).setUp() config = mock.Mock() config.region_name = 'region_name' self.openstack_api_version = 'version 1.1' self.placement_api_client = placement.PlacementAPIClient( config, self.openstack_api_version) self.placement_fixture = self.useFixture( fixture.PlacementAPIClientFixture(self.placement_api_client)) def test_create_resource_provider(self): self.placement_api_client.create_resource_provider( RESOURCE_PROVIDER_UUID) self.placement_fixture.mock_post.assert_called_once_with( '/resource_providers', RESOURCE_PROVIDER_UUID) def test_delete_resource_provider(self): self.placement_api_client.delete_resource_provider( RESOURCE_PROVIDER_UUID) self.placement_fixture.mock_delete.assert_called_once_with( '/resource_providers/%s' % RESOURCE_PROVIDER_UUID) def test_create_inventory(self): inventory = mock.ANY self.placement_api_client.create_inventory(RESOURCE_PROVIDER_UUID, inventory) self.placement_fixture.mock_post.assert_called_once_with( '/resource_providers/%s/inventories' % RESOURCE_PROVIDER_UUID, inventory) def test_get_inventory(self): self.placement_api_client.get_inventory(RESOURCE_PROVIDER_UUID, RESOURCE_CLASS_NAME) self.placement_fixture.mock_get.assert_called_once_with( '/resource_providers/%(rp_uuid)s/inventories/%(rc_name)s' % {'rp_uuid': RESOURCE_PROVIDER_UUID, 'rc_name': RESOURCE_CLASS_NAME}) def test_get_inventory_no_resource_provider(self): _exception = ks_exc.NotFound() _exception.details = "No resource provider with uuid" self.placement_fixture.mock_get.side_effect = _exception self.assertRaises(n_exc.PlacementResourceProviderNotFound, self.placement_api_client.get_inventory, RESOURCE_PROVIDER_UUID, RESOURCE_CLASS_NAME) def test_get_inventory_no_inventory(self): _exception = ks_exc.NotFound() _exception.details = _("No inventory of class") self.placement_fixture.mock_get.side_effect = _exception self.assertRaises(n_exc.PlacementInventoryNotFound, self.placement_api_client.get_inventory, RESOURCE_PROVIDER_UUID, RESOURCE_CLASS_NAME) def test_get_inventory_not_found(self): _exception = ks_exc.NotFound() _exception.details = "Any other exception explanation" self.placement_fixture.mock_get.side_effect = _exception self.assertRaises(ks_exc.NotFound, self.placement_api_client.get_inventory, RESOURCE_PROVIDER_UUID, RESOURCE_CLASS_NAME) def test_update_inventory(self): inventory = mock.ANY self.placement_api_client.update_inventory( RESOURCE_PROVIDER_UUID, inventory, RESOURCE_CLASS_NAME) self.placement_fixture.mock_put.assert_called_once_with( '/resource_providers/%(rp_uuid)s/inventories/%(rc_name)s' % {'rp_uuid': RESOURCE_PROVIDER_UUID, 'rc_name': RESOURCE_CLASS_NAME}, inventory) def test_update_inventory_conflict_exception(self): inventory = mock.ANY self.placement_fixture.mock_put.side_effect = ks_exc.Conflict() self.assertRaises(n_exc.PlacementInventoryUpdateConflict, self.placement_api_client.update_inventory, RESOURCE_PROVIDER_UUID, inventory, RESOURCE_CLASS_NAME) def test_associate_aggregates(self): headers = {'OpenStack-API-Version': self.openstack_api_version} self.placement_api_client.associate_aggregates(RESOURCE_PROVIDER_UUID, mock.ANY) self.placement_fixture.mock_put.assert_called_once_with( '/resource_providers/%s/aggregates' % RESOURCE_PROVIDER_UUID, mock.ANY, headers=headers) def test_list_aggregates(self): headers = {'OpenStack-API-Version': self.openstack_api_version} self.placement_api_client.list_aggregates(RESOURCE_PROVIDER_UUID) self.placement_fixture.mock_get.assert_called_once_with( '/resource_providers/%s/aggregates' % RESOURCE_PROVIDER_UUID, headers=headers) def test_list_aggregates_no_resource_provider(self): self.placement_fixture.mock_get.side_effect = ks_exc.NotFound() self.assertRaises(n_exc.PlacementAggregateNotFound, self.placement_api_client.list_aggregates, RESOURCE_PROVIDER_UUID) neutron-lib-1.13.0/neutron_lib/tests/unit/test_neutron_lib.py0000666000175100017510000000172413231472055024460 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import copy from neutron_lib import constants from neutron_lib.tests import _base as base class TestNeutronLib(base.BaseTestCase): def test_sentinel_constant(self): foo = constants.Sentinel() bar = copy.deepcopy(foo) self.assertEqual(id(foo), id(bar)) def test_sentinel_copy(self): singleton = constants.Sentinel() self.assertEqual(copy.deepcopy(singleton), copy.copy(singleton)) neutron-lib-1.13.0/neutron_lib/tests/unit/exceptions/0000775000175100017510000000000013231472430022677 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/exceptions/__init__.py0000666000175100017510000000000013231472055025003 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/exceptions/test_exceptions.py0000666000175100017510000002443713231472055026510 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ test_exceptions ---------------------------------- Tests for `neutron_lib.exception` module. """ import functools from neutron_lib._i18n import _ import neutron_lib.exceptions as ne from neutron_lib.tests import _base as base def _raise(exc_class, **kwargs): raise exc_class(**kwargs) class TestExceptions(base.BaseTestCase): def _check_nexc(self, exc_class, expected_msg, **kwargs): raise_exc_class = functools.partial(_raise, exc_class) e = self.assertRaises(exc_class, raise_exc_class, **kwargs) self.assertEqual(expected_msg, str(e)) def test_base(self): self._check_nexc( ne.NeutronException, _('An unknown exception occurred.')) def test_not_found(self): self._check_nexc( ne.NotFound, _('An unknown exception occurred.')) def test_conflict(self): self._check_nexc( ne.Conflict, _('An unknown exception occurred.')) def test_bad_request(self): self._check_nexc( ne.BadRequest, _('Bad A request: B.'), resource='A', msg='B') def test_bad_request_misused(self): try: self._check_nexc( ne.BadRequest, _('Bad A request: B.'), resource='A', msg='B') except AttributeError: pass def test_not_authorized(self): self._check_nexc( ne.NotAuthorized, _("Not authorized.")) def test_service_unavailable(self): self._check_nexc( ne.ServiceUnavailable, _("The service is unavailable.")) def test_admin_required(self): self._check_nexc( ne.AdminRequired, _("User does not have admin privileges: hoser."), reason="hoser") def test_object_not_found(self): self._check_nexc( ne.ObjectNotFound, _("Object fallout tato not found."), id="fallout tato") def test_network_not_found(self): self._check_nexc( ne.NetworkNotFound, _("Network spam could not be found."), net_id="spam") def test_subnet_not_found(self): self._check_nexc( ne.SubnetNotFound, _("Subnet root could not be found."), subnet_id="root") def test_port_not_found(self): self._check_nexc( ne.PortNotFound, _("Port harbor could not be found."), port_id="harbor") def test_port_not_found_on_network(self): self._check_nexc( ne.PortNotFoundOnNetwork, _("Port serial could not be found on network USB."), port_id="serial", net_id="USB") def test_device_not_found_error(self): self._check_nexc( ne.DeviceNotFoundError, _("Device 'device' does not exist."), device_name="device") def test_in_use(self): self._check_nexc( ne.InUse, _("The resource is in use.")) def test_network_in_use(self): self._check_nexc( ne.NetworkInUse, _("Unable to complete operation on network foo. " "There are one or more ports still in use on the network."), net_id="foo") def test_subnet_in_use(self): self._check_nexc( ne.SubnetInUse, _("Unable to complete operation on subnet garbage: not full."), subnet_id="garbage", reason="not full") def test_subnet_in_use_no_reason(self): self._check_nexc( ne.SubnetInUse, _("Unable to complete operation on subnet garbage: " "One or more ports have an IP allocation from this subnet."), subnet_id="garbage") def test_subnet_pool_in_use(self): self._check_nexc( ne.SubnetPoolInUse, _("Unable to complete operation on subnet pool ymca. because."), subnet_pool_id="ymca", reason="because") def test_subnet_pool_in_use_no_reason(self): self._check_nexc( ne.SubnetPoolInUse, _("Unable to complete operation on subnet pool ymca. " "Two or more concurrent subnets allocated."), subnet_pool_id="ymca") def test_port_in_use(self): self._check_nexc( ne.PortInUse, _("Unable to complete operation on port a for network c. " "Port already has an attached device b."), port_id='a', device_id='b', net_id='c') def test_service_port_in_use(self): self._check_nexc( ne.ServicePortInUse, _("Port harbor cannot be deleted directly via the " "port API: docking."), port_id='harbor', reason='docking') def test_port_bound(self): self._check_nexc( ne.PortBound, _("Unable to complete operation on port bigmac, " "port is already bound, port type: ketchup, " "old_mac onions, new_mac salt."), port_id='bigmac', vif_type='ketchup', old_mac='onions', new_mac='salt') def test_mac_address_in_use(self): self._check_nexc( ne.MacAddressInUse, _("Unable to complete operation for network nutters. " "The mac address grill is in use."), net_id='nutters', mac='grill') def test_invalid_ip_for_network(self): self._check_nexc( ne.InvalidIpForNetwork, _("IP address shazam! is not a valid IP " "for any of the subnets on the specified network."), ip_address='shazam!') def test_invalid_ip_for_subnet(self): self._check_nexc( ne.InvalidIpForSubnet, _("IP address 300.400.500.600 is not a valid IP " "for the specified subnet."), ip_address='300.400.500.600') def test_ip_address_in_use(self): self._check_nexc( ne.IpAddressInUse, _("Unable to complete operation for network boredom. " "The IP address crazytown is in use."), net_id='boredom', ip_address='crazytown') def test_vlan_id_in_use(self): self._check_nexc( ne.VlanIdInUse, _("Unable to create the network. The VLAN virtual on physical " "network phys is in use."), vlan_id='virtual', physical_network='phys') def test_tunnel_id_in_use(self): self._check_nexc( ne.TunnelIdInUse, _("Unable to create the network. The tunnel ID sewer is in use."), tunnel_id='sewer') def test_resource_exhausted(self): self._check_nexc( ne.ResourceExhausted, _("The service is unavailable.")) def test_no_network_available(self): self._check_nexc( ne.NoNetworkAvailable, _("Unable to create the network. " "No tenant network is available for allocation.")) def test_subnet_mismatch_for_port(self): self._check_nexc( ne.SubnetMismatchForPort, _("Subnet on port porter does not match " "the requested subnet submit."), port_id='porter', subnet_id='submit') def test_invalid(self): try: raise ne.Invalid("hello world") except ne.Invalid as e: self.assertEqual(e.msg, "hello world") def test_invalid_input(self): self._check_nexc( ne.InvalidInput, _("Invalid input for operation: warp core breach."), error_message='warp core breach') def test_ip_address_generation_failure(self): self._check_nexc( ne.IpAddressGenerationFailure, _("No more IP addresses available on network nuke."), net_id='nuke') def test_preexisting_device_failure(self): self._check_nexc( ne.PreexistingDeviceFailure, _("Creation failed. hal9000 already exists."), dev_name='hal9000') def test_over_quota(self): self._check_nexc( ne.OverQuota, _("Quota exceeded for resources: tube socks."), overs='tube socks') def test_invalid_content_type(self): self._check_nexc( ne.InvalidContentType, _("Invalid content type porn."), content_type='porn') def test_external_ip_address_exhausted(self): self._check_nexc( ne.ExternalIpAddressExhausted, _("Unable to find any IP address on external network darpanet."), net_id='darpanet') def test_too_many_external_networks(self): self._check_nexc( ne.TooManyExternalNetworks, _("More than one external network exists.")) def test_invalid_configuration_option(self): self._check_nexc( ne.InvalidConfigurationOption, _("An invalid value was provided for which muppet: big bird."), opt_name='which muppet', opt_value='big bird') def test_network_tunnel_range_error(self): self._check_nexc( ne.NetworkTunnelRangeError, _("Invalid network tunnel range: 'rats' - present."), tunnel_range='rats', error='present') def test_network_tunnel_range_error_tuple(self): self._check_nexc( ne.NetworkTunnelRangeError, _("Invalid network tunnel range: '3:4' - present."), tunnel_range=(3, 4), error='present') def test_policy_init_error(self): self._check_nexc( ne.PolicyInitError, _("Failed to initialize policy policy because reason."), policy='policy', reason='reason') def test_policy_check_error(self): self._check_nexc( ne.PolicyCheckError, _("Failed to check policy policy because reason."), policy='policy', reason='reason') neutron-lib-1.13.0/neutron_lib/tests/unit/services/0000775000175100017510000000000013231472430022341 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/services/__init__.py0000666000175100017510000000000013231472055024445 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/services/test_base.py0000666000175100017510000000503313231472055024672 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import abc from neutron_lib.services import base from neutron_lib.tests import _base as test_base class _Worker(base.WorkerBase): pass class Test_WorkerSupportServiceMixin(test_base.BaseTestCase): def setUp(self): super(Test_WorkerSupportServiceMixin, self).setUp() self.worker = _Worker() def test_allocate_workers(self): self.assertEqual([], self.worker.get_workers()) def test_add_worker(self): workers = [object(), object()] for w in workers: self.worker.add_worker(w) self.assertSequenceEqual(workers, self.worker.get_workers()) def test_add_workers(self): workers = [object(), object(), object()] self.worker.add_workers(workers) self.assertSequenceEqual(workers, self.worker.get_workers()) class TestPluginInterface(test_base.BaseTestCase): class ServicePluginStub(base.ServicePluginBase): def get_plugin_type(self): pass def get_plugin_description(self): pass def test_issubclass_hook(self): class A(TestPluginInterface.ServicePluginStub): def f(self): pass class B(base.ServicePluginBase): @abc.abstractmethod def f(self): pass self.assertTrue(issubclass(A, B)) def test_issubclass_hook_class_without_abstract_methods(self): class A(object): def f(self): pass class B(base.ServicePluginBase): def f(self): pass self.assertFalse(issubclass(A, B)) def test_issubclass_hook_not_all_methods_implemented(self): class A(TestPluginInterface.ServicePluginStub): def f(self): pass class B(base.ServicePluginBase): @abc.abstractmethod def f(self): pass @abc.abstractmethod def g(self): pass self.assertFalse(issubclass(A, B)) neutron-lib-1.13.0/neutron_lib/tests/unit/services/qos/0000775000175100017510000000000013231472430023143 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/services/qos/__init__.py0000666000175100017510000000000013231472055025247 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/tests/unit/services/qos/test_base.py0000666000175100017510000000552713231472055025504 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock from neutron_lib.api.definitions import portbindings from neutron_lib.services.qos import base as qos_base from neutron_lib.services.qos import constants as qos_consts from neutron_lib.tests import _base SUPPORTED_RULES = { qos_consts.RULE_TYPE_MINIMUM_BANDWIDTH: { "min_kbps": {'type:values': None}, 'direction': {'type:values': ['egress']} } } def _make_rule(rule_type='fake-rule-type', params=None): mock_rule = mock.MagicMock() mock_rule.rule_type = rule_type params = params or {} mock_rule.get = params.get return mock_rule def _make_driver(name='fake-driver', vif_types=[portbindings.VIF_TYPE_OVS], vnic_types=[portbindings.VNIC_NORMAL], supported_rules=SUPPORTED_RULES, requires_rpc_notifications=False): return qos_base.DriverBase( name, vif_types, vnic_types, supported_rules, requires_rpc_notifications=requires_rpc_notifications) class TestDriverBase(_base.BaseTestCase): def test_is_loaded(self): self.assertTrue(_make_driver().is_loaded()) def test_is_vif_type_compatible(self): self.assertTrue( _make_driver().is_vif_type_compatible( portbindings.VIF_TYPE_OVS)) self.assertFalse( _make_driver().is_vif_type_compatible( portbindings.VIF_TYPE_BRIDGE)) def test_is_vnic_compatible(self): self.assertTrue( _make_driver().is_vnic_compatible(portbindings.VNIC_NORMAL)) self.assertFalse( _make_driver().is_vnic_compatible(portbindings.VNIC_BAREMETAL)) def test_is_rule_supported_with_unsupported_rule(self): self.assertFalse(_make_driver().is_rule_supported(_make_rule())) def test_is_rule_supported(self): self.assertTrue( _make_driver().is_rule_supported( _make_rule( rule_type=qos_consts.RULE_TYPE_MINIMUM_BANDWIDTH, params={'min_kbps': None, 'direction': 'egress'}))) self.assertFalse( _make_driver().is_rule_supported( _make_rule( rule_type=qos_consts.RULE_TYPE_MINIMUM_BANDWIDTH, params={'min_kbps': None, 'direction': 'ingress'}))) neutron-lib-1.13.0/neutron_lib/tests/unit/test_context.py0000666000175100017510000002323013231472055023620 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock from oslo_context import context as oslo_context from testtools import matchers from neutron_lib import context from neutron_lib.tests import _base class TestNeutronContext(_base.BaseTestCase): def setUp(self): super(TestNeutronContext, self).setUp() db_api = 'neutron_lib.db.api.get_writer_session' self._db_api_session_patcher = mock.patch(db_api) self.db_api_session = self._db_api_session_patcher.start() def test_neutron_context_create(self): ctx = context.Context('user_id', 'tenant_id') self.assertEqual('user_id', ctx.user_id) self.assertEqual('tenant_id', ctx.project_id) self.assertEqual('tenant_id', ctx.tenant_id) request_id = ctx.request_id if isinstance(request_id, bytes): request_id = request_id.decode('utf-8') self.assertThat(request_id, matchers.StartsWith('req-')) self.assertEqual('user_id', ctx.user) self.assertEqual('tenant_id', ctx.tenant) self.assertIsNone(ctx.user_name) self.assertIsNone(ctx.tenant_name) self.assertIsNone(ctx.project_name) self.assertIsNone(ctx.auth_token) def test_neutron_context_getter_setter(self): ctx = context.Context('Anakin', 'Skywalker') self.assertEqual('Anakin', ctx.user_id) self.assertEqual('Skywalker', ctx.tenant_id) ctx.user_id = 'Darth' ctx.tenant_id = 'Vader' self.assertEqual('Darth', ctx.user_id) self.assertEqual('Vader', ctx.tenant_id) def test_neutron_context_create_with_name(self): ctx = context.Context('user_id', 'tenant_id', tenant_name='tenant_name', user_name='user_name') # Check name is set self.assertEqual('user_name', ctx.user_name) self.assertEqual('tenant_name', ctx.tenant_name) self.assertEqual('tenant_name', ctx.project_name) # Check user/tenant contains its ID even if user/tenant_name is passed self.assertEqual('user_id', ctx.user) self.assertEqual('tenant_id', ctx.tenant) def test_neutron_context_create_with_request_id(self): ctx = context.Context('user_id', 'tenant_id', request_id='req_id_xxx') self.assertEqual('req_id_xxx', ctx.request_id) def test_neutron_context_create_with_timestamp(self): now = "Right Now!" ctx = context.Context('user_id', 'tenant_id', timestamp=now) self.assertEqual(now, ctx.timestamp) def test_neutron_context_create_is_advsvc(self): ctx = context.Context('user_id', 'tenant_id', is_advsvc=True) self.assertFalse(ctx.is_admin) self.assertTrue(ctx.is_advsvc) def test_neutron_context_create_with_auth_token(self): ctx = context.Context('user_id', 'tenant_id', auth_token='auth_token_xxx') self.assertEqual('auth_token_xxx', ctx.auth_token) def test_neutron_context_from_dict(self): owner = {'user_id': 'Luke', 'tenant_id': 'Skywalker'} ctx = context.Context.from_dict(owner) self.assertEqual(owner['user_id'], ctx.user_id) self.assertEqual(owner['tenant_id'], ctx.tenant_id) def test_neutron_context_to_dict(self): ctx = context.Context('user_id', 'tenant_id') ctx_dict = ctx.to_dict() self.assertEqual('user_id', ctx_dict['user_id']) self.assertEqual('tenant_id', ctx_dict['project_id']) self.assertEqual(ctx.request_id, ctx_dict['request_id']) self.assertEqual('user_id', ctx_dict['user']) self.assertEqual('tenant_id', ctx_dict['tenant']) self.assertIsNone(ctx_dict['user_name']) self.assertIsNone(ctx_dict['tenant_name']) self.assertIsNone(ctx_dict['project_name']) self.assertIsNone(ctx_dict['auth_token']) def test_neutron_context_to_dict_with_name(self): ctx = context.Context('user_id', 'tenant_id', tenant_name='tenant_name', user_name='user_name') ctx_dict = ctx.to_dict() self.assertEqual('user_name', ctx_dict['user_name']) self.assertEqual('tenant_name', ctx_dict['tenant_name']) self.assertEqual('tenant_name', ctx_dict['project_name']) def test_neutron_context_to_dict_with_auth_token(self): ctx = context.Context('user_id', 'tenant_id', auth_token='auth_token_xxx') ctx_dict = ctx.to_dict() self.assertEqual('auth_token_xxx', ctx_dict['auth_token']) def test_neutron_context_admin_to_dict(self): self.db_api_session.return_value = 'fakesession' ctx = context.get_admin_context() ctx_dict = ctx.to_dict() self.assertIsNone(ctx_dict['user_id']) self.assertIsNone(ctx_dict['tenant_id']) self.assertIsNone(ctx_dict['auth_token']) self.assertTrue(ctx_dict['is_admin']) self.assertIsNotNone(ctx.session) self.assertNotIn('session', ctx_dict) def test_neutron_context_admin_without_session_to_dict(self): ctx = context.get_admin_context_without_session() ctx_dict = ctx.to_dict() self.assertIsNone(ctx_dict['user_id']) self.assertIsNone(ctx_dict['tenant_id']) self.assertIsNone(ctx_dict['auth_token']) self.assertFalse(hasattr(ctx, 'session')) def test_neutron_context_elevated_retains_request_id(self): ctx = context.Context('user_id', 'tenant_id') self.assertFalse(ctx.is_admin) req_id_before = ctx.request_id elevated_ctx = ctx.elevated() self.assertTrue(elevated_ctx.is_admin) self.assertEqual(req_id_before, elevated_ctx.request_id) def test_neutron_context_elevated_idempotent(self): ctx = context.Context('user_id', 'tenant_id') self.assertFalse(ctx.is_admin) elevated_ctx = ctx.elevated() self.assertTrue(elevated_ctx.is_admin) elevated2_ctx = elevated_ctx.elevated() self.assertTrue(elevated2_ctx.is_admin) def test_neutron_context_overwrite(self): ctx1 = context.Context('user_id', 'tenant_id') self.assertEqual(ctx1.request_id, oslo_context.get_current().request_id) # If overwrite is not specified, request_id should be updated. ctx2 = context.Context('user_id', 'tenant_id') self.assertNotEqual(ctx2.request_id, ctx1.request_id) self.assertEqual(ctx2.request_id, oslo_context.get_current().request_id) # If overwrite is specified, request_id should be kept. ctx3 = context.Context('user_id', 'tenant_id', overwrite=False) self.assertNotEqual(ctx3.request_id, ctx2.request_id) self.assertEqual(ctx2.request_id, oslo_context.get_current().request_id) def test_neutron_context_get_admin_context_not_update_local_store(self): ctx = context.Context('user_id', 'tenant_id') req_id_before = oslo_context.get_current().request_id self.assertEqual(ctx.request_id, req_id_before) ctx_admin = context.get_admin_context() self.assertEqual(req_id_before, oslo_context.get_current().request_id) self.assertNotEqual(req_id_before, ctx_admin.request_id) def test_to_policy_values(self): values = { 'user_id': 'user_id', 'tenant_id': 'tenant_id', 'is_admin': 'is_admin', 'tenant_name': 'tenant_name', 'user_name': 'user_name', 'domain': 'domain', 'user_domain': 'user_domain', 'project_domain': 'project_domain', 'user_name': 'user_name', } additional_values = { 'user': 'user_id', 'tenant': 'tenant_id', 'project_id': 'tenant_id', 'project_name': 'tenant_name', } ctx = context.Context(**values) # apply dict() to get a real dictionary, needed for newer oslo.context # that returns _DeprecatedPolicyValues object instead policy_values = dict(ctx.to_policy_values()) self.assertDictSupersetOf(values, policy_values) self.assertDictSupersetOf(additional_values, policy_values) @mock.patch.object(context.ContextBaseWithSession, 'session') def test_superclass_session(self, mocked_session): ctx = context.Context('user_id', 'tenant_id') # make sure context uses parent class session that is mocked self.assertEqual(mocked_session, ctx.session) def test_session_cached(self): ctx = context.Context('user_id', 'tenant_id') session1 = ctx.session session2 = ctx.session self.assertIs(session1, session2) def test_add_get_remove_constraint(self): ctx = context.Context('user_id', 'tenant_id') self.assertIsNone(ctx.get_transaction_constraint()) ctx.set_transaction_constraint('networks', 'net_id', 44) constraint = ctx.get_transaction_constraint() self.assertEqual(44, constraint.if_revision_match) self.assertEqual('networks', constraint.resource) self.assertEqual('net_id', constraint.resource_id) ctx.clear_transaction_constraint() self.assertIsNone(ctx.get_transaction_constraint()) neutron-lib-1.13.0/neutron_lib/tests/unit/test_fixture.py0000666000175100017510000001315713231472055023631 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock from oslo_config import cfg from oslo_db import options from oslotest import base from neutron_lib.api import attributes from neutron_lib.api.definitions import port from neutron_lib.callbacks import registry from neutron_lib.clients import placement from neutron_lib.db import model_base from neutron_lib import fixture from neutron_lib.plugins import directory from neutron_lib.tests.unit.api import test_attributes class PluginDirectoryFixtureTestCase(base.BaseTestCase): def setUp(self): super(PluginDirectoryFixtureTestCase, self).setUp() self.directory = mock.Mock() self.useFixture(fixture.PluginDirectoryFixture( plugin_directory=self.directory)) def test_fixture(self): directory.add_plugin('foo', 'foo') self.assertTrue(self.directory.add_plugin.called) class CallbackRegistryFixtureTestCase(base.BaseTestCase): def setUp(self): super(CallbackRegistryFixtureTestCase, self).setUp() self.manager = mock.Mock() self.useFixture(fixture.CallbackRegistryFixture( callback_manager=self.manager)) def test_fixture(self): registry.notify('a', 'b', self) self.assertTrue(self.manager.notify.called) class SqlFixtureTestCase(base.BaseTestCase): def setUp(self): super(SqlFixtureTestCase, self).setUp() options.set_defaults( cfg.CONF, connection='sqlite://') self.useFixture(fixture.SqlFixture()) def test_fixture(self): self.assertIsNotNone(model_base.BASEV2.metadata.sorted_tables) class APIDefinitionFixtureTestCase(base.BaseTestCase): def _test_all_api_definitions_fixture(self, global_cleanup=True): apis = fixture.APIDefinitionFixture.all_api_definitions_fixture() apis.backup_global_resources = global_cleanup apis.setUp() asserteq = self.assertNotEqual if global_cleanup else self.assertEqual asserteq({}, apis._orig_resources) for r in test_attributes.TestCoreResources.CORE_DEFS: attributes.RESOURCES[r.COLLECTION_NAME]['_test_'] = {} r.RESOURCE_ATTRIBUTE_MAP['_test_'] = {} apis.cleanUp() for r in test_attributes.TestCoreResources.CORE_DEFS: self.assertNotIn('_test_', r.RESOURCE_ATTRIBUTE_MAP) global_assert = (self.assertNotIn if global_cleanup else self.assertIn) global_assert('_test_', attributes.RESOURCES[r.COLLECTION_NAME]) # cleanup if not global_cleanup: del attributes.RESOURCES[r.COLLECTION_NAME]['_test_'] def test_all_api_definitions_fixture_no_global_backup(self): self._test_all_api_definitions_fixture(global_cleanup=False) def test_all_api_definitions_fixture_with_global_backup(self): self._test_all_api_definitions_fixture(global_cleanup=True) def test_global_resources_reference_updated(self): resources_ref = attributes.RESOURCES apis = fixture.APIDefinitionFixture() apis.setUp() attributes.RESOURCES['test_resource'] = {} self.assertIn('test_resource', resources_ref) attributes.RESOURCES[port.COLLECTION_NAME]['test_port_attr'] = {} self.assertIn('test_port_attr', attributes.RESOURCES[port.COLLECTION_NAME]) apis.cleanUp() self.assertNotIn('test_port_attr', attributes.RESOURCES[port.COLLECTION_NAME]) self.assertNotIn('test_resource', resources_ref) def test_api_def_reference_updated(self): api_def_ref = port.RESOURCE_ATTRIBUTE_MAP apis = fixture.APIDefinitionFixture() apis.setUp() port.RESOURCE_ATTRIBUTE_MAP[port.COLLECTION_NAME]['test_attr'] = {} self.assertIn('test_attr', api_def_ref[port.COLLECTION_NAME]) apis.cleanUp() self.assertNotIn('test_attr', port.RESOURCE_ATTRIBUTE_MAP[port.COLLECTION_NAME]) self.assertNotIn('test_attr', api_def_ref[port.COLLECTION_NAME]) class PlacementAPIClientFixtureTestCase(base.BaseTestCase): def _create_client_and_fixture(self): placement_client = placement.PlacementAPIClient(mock.Mock()) placement_fixture = self.useFixture( fixture.PlacementAPIClientFixture(placement_client)) return placement_client, placement_fixture def test_post(self): p_client, p_fixture = self._create_client_and_fixture() p_client.create_resource_provider('resource') p_fixture.mock_post.assert_called_once() def test_put(self): p_client, p_fixture = self._create_client_and_fixture() p_client.update_inventory('resource', mock.ANY, 'class_name') p_fixture.mock_put.assert_called_once() def test_delete(self): p_client, p_fixture = self._create_client_and_fixture() p_client.delete_resource_provider('resource') p_fixture.mock_delete.assert_called_once() def test_get(self): p_client, p_fixture = self._create_client_and_fixture() p_client.list_aggregates('resource') p_fixture.mock_get.assert_called_once() neutron-lib-1.13.0/neutron_lib/utils/0000775000175100017510000000000013231472430017535 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/utils/__init__.py0000666000175100017510000000000013231472055021641 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/utils/runtime.py0000666000175100017510000000376113231472055021606 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import sys from oslo_concurrency import lockutils from oslo_log import log as logging from oslo_utils import importutils from stevedore import driver from neutron_lib._i18n import _ LOG = logging.getLogger(__name__) SYNCHRONIZED_PREFIX = 'neutron-' # common synchronization decorator synchronized = lockutils.synchronized_with_prefix(SYNCHRONIZED_PREFIX) def load_class_by_alias_or_classname(namespace, name): """Load a class using stevedore alias or the class name. :param namespace: The namespace where the alias is defined. :param name: The alias or class name of the class to be loaded. :returns: Class if it can be loaded. :raises ImportError: if class cannot be loaded. """ if not name: LOG.error("Alias or class name is not set") raise ImportError(_("Class not found.")) try: # Try to resolve class by alias mgr = driver.DriverManager( namespace, name, warn_on_missing_entrypoint=False) class_to_load = mgr.driver except RuntimeError: e1_info = sys.exc_info() # Fallback to class name try: class_to_load = importutils.import_class(name) except (ImportError, ValueError): LOG.error("Error loading class by alias", exc_info=e1_info) LOG.error("Error loading class by class name", exc_info=True) raise ImportError(_("Class not found.")) return class_to_load neutron-lib-1.13.0/neutron_lib/utils/file.py0000666000175100017510000000407613231472055021042 0ustar zuulzuul00000000000000# Copyright 2011, VMware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import errno import os import tempfile from debtcollector import removals @removals.remove( message="use ensure_tree(path, 0o755) from oslo_utils.fileutils", version="Ocata", removal_version="Queens") def ensure_dir(dir_path): """Ensure a directory with 755 permissions mode. :param dir_path: The directory path to ensure. :returns: None. :raises OSError: If the underlying call to makedirs raises an OSError other than EEXIST. """ try: os.makedirs(dir_path, 0o755) except OSError as e: # If the directory already existed, don't raise the error. if e.errno != errno.EEXIST: raise def replace_file(file_name, data, file_mode=0o644): """Replaces the contents of file_name with data in a safe manner. First write to a temp file and then rename. Since POSIX renames are atomic, the file is unlikely to be corrupted by competing writes. We create the tempfile on the same device to ensure that it can be renamed. :param file_name: Path to the file to replace. :param data: The data to write to the file. :param file_mode: The mode to use for the replaced file. :returns: None. """ base_dir = os.path.dirname(os.path.abspath(file_name)) with tempfile.NamedTemporaryFile('w+', dir=base_dir, delete=False) as tmp_file: tmp_file.write(data) os.chmod(tmp_file.name, file_mode) os.rename(tmp_file.name, file_name) neutron-lib-1.13.0/neutron_lib/utils/net.py0000666000175100017510000000362413231472055020707 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import random import socket from neutron_lib import constants def get_hostname(): """Get the hostname of the system. :returns: The hostname of the system. """ return socket.gethostname() def get_random_mac(base_mac): """Get a random MAC address string of the specified base format. The first 3 octets will remain unchanged. If the 4th octet is not 00, it will also be used. The others will be randomly generated. :param base_mac: Base MAC address represented by an array of 6 strings/int :returns: The MAC address string. """ mac = [int(base_mac[0], 16), int(base_mac[1], 16), int(base_mac[2], 16), random.getrandbits(8), random.getrandbits(8), random.getrandbits(8)] if base_mac[3] != '00': mac[3] = int(base_mac[3], 16) return ':'.join(["%02x" % x for x in mac]) def is_port_trusted(port): """Used to determine if port can be trusted not to attack network. Trust is currently based on the device_owner field starting with 'network:' since we restrict who can use that in the default policy.json file. :param port: The port dict to inspect the 'device_owner' for. :returns: True if the port dict's 'device_owner' value starts with the networking prefix. False otherwise. """ return port['device_owner'].startswith( constants.DEVICE_OWNER_NETWORK_PREFIX) neutron-lib-1.13.0/neutron_lib/utils/host.py0000666000175100017510000000157113231472055021075 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import multiprocessing def cpu_count(): """Get the system CPU count. :returns: The number of CPUs on the system as an int. If there's an issue fetching the CPU count on the system, a default value of 1 is returned. """ try: return multiprocessing.cpu_count() except NotImplementedError: return 1 neutron-lib-1.13.0/neutron_lib/utils/helpers.py0000666000175100017510000001324413231472055021562 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import collections import decimal import random import six from neutron_lib._i18n import _ def parse_mappings(mapping_list, unique_values=True, unique_keys=True): """Parse a list of mapping strings into a dictionary. :param mapping_list: A list of strings of the form ':'. :param unique_values: Values must be unique if True. :param unique_keys: Keys must be unique if True, else implies that keys and values are not unique. :returns: A dict mapping keys to values or to list of values. :raises ValueError: Upon malformed data or duplicate keys. """ mappings = {} for mapping in mapping_list: mapping = mapping.strip() if not mapping: continue split_result = mapping.split(':') if len(split_result) != 2: raise ValueError(_("Invalid mapping: '%s'") % mapping) key = split_result[0].strip() if not key: raise ValueError(_("Missing key in mapping: '%s'") % mapping) value = split_result[1].strip() if not value: raise ValueError(_("Missing value in mapping: '%s'") % mapping) if unique_keys: if key in mappings: raise ValueError(_("Key %(key)s in mapping: '%(mapping)s' not " "unique") % {'key': key, 'mapping': mapping}) if unique_values and value in mappings.values(): raise ValueError(_("Value %(value)s in mapping: '%(mapping)s' " "not unique") % {'value': value, 'mapping': mapping}) mappings[key] = value else: mappings.setdefault(key, []) if value not in mappings[key]: mappings[key].append(value) return mappings def compare_elements(a, b): """Compare elements if a and b have same elements. This method doesn't consider ordering. :param a: The first item to compare. :param b: The second item to compare. :returns: True if a and b have the same elements, False otherwise. """ return set(a or []) == set(b or []) def safe_sort_key(value): """Return value hash or build one for dictionaries. :param value: The value to build a hash for. :returns: The value sorted. """ if isinstance(value, collections.Mapping): return sorted(value.items()) return value def dict2str(dic): """Build a str representation of a dict. :param dic: The dict to build a str representation for. :returns: The dict in str representation that is a k=v command list for each item in dic. """ return ','.join("%s=%s" % (key, val) for key, val in sorted(dic.items())) def str2dict(string): """Parse a str representation of a dict into its dict form. This is the inverse of dict2str() :param string: The string to parse. :returns: A dict constructed from the str representation in string. """ res_dict = {} for keyvalue in string.split(','): (key, value) = keyvalue.split('=', 1) res_dict[key] = value return res_dict def dict2tuple(d): """Build a tuple from a dict. :param d: The dict to coherence into a tuple. :returns: The dict d in tuple form. """ items = list(d.items()) items.sort() return tuple(items) def diff_list_of_dict(old_list, new_list): """Given 2 lists of dicts, return a tuple containing the diff. :param old_list: The old list of dicts to diff. :param new_list: The new list of dicts to diff. :returns: A tuple where the first item is a list of the added dicts in the diff and the second item is the removed dicts. """ new_set = set([dict2str(l) for l in new_list]) old_set = set([dict2str(l) for l in old_list]) added = new_set - old_set removed = old_set - new_set return [str2dict(a) for a in added], [str2dict(r) for r in removed] def get_random_string(length): """Get a random hex string of the specified length. :param length: The length for the hex string. :returns: A random hex string of the said length. """ return "{0:0{1}x}".format(random.getrandbits(length * 4), length) def camelize(s): """Camelize a str that uses _ as a camelize token. :param s: The str to camelize that contains a _ at each index where a new camelized word starts. :returns: The camelized str. """ return ''.join(s.replace('_', ' ').title().split()) def round_val(val): """Round the value. :param val: The value to round. :returns: The value rounded using the half round up scheme. """ # we rely on decimal module since it behaves consistently across Python # versions (2.x vs. 3.x) return int(decimal.Decimal(val).quantize(decimal.Decimal('1'), rounding=decimal.ROUND_HALF_UP)) def safe_decode_utf8(s): """Safe decode a str from UTF. :param s: The str to decode. :returns: The decoded str. """ if six.PY3 and isinstance(s, bytes): return s.decode('utf-8', 'surrogateescape') return s neutron-lib-1.13.0/neutron_lib/agent/0000775000175100017510000000000013231472430017473 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/agent/__init__.py0000666000175100017510000000000013231472055021577 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/agent/extension.py0000666000175100017510000000344613231472055022075 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import abc import six @six.add_metaclass(abc.ABCMeta) class AgentExtension(object): """Define stable abstract interface for agent extensions. An agent extension extends the agent core functionality. """ @abc.abstractmethod def initialize(self, connection, driver_type): """Perform agent core resource extension initialization. :param connection: RPC connection that can be reused by the extension to define its RPC endpoints :param driver_type: String that defines the agent type to the extension. Can be used to choose the right backend implementation. Called after all extensions have been loaded. No resource (port, policy, router, etc.) handling will be called before this method. """ def consume_api(self, agent_api): """Consume the AgentAPI instance from the AgentExtensionsManager. Allows an extension to gain access to resources internal to the neutron agent and otherwise unavailable to the extension. Examples of such resources include bridges, ports, and routers. :param agent_api: An instance of an agent-specific API. """ neutron-lib-1.13.0/neutron_lib/agent/topics.py0000666000175100017510000000407113231472055021355 0ustar zuulzuul00000000000000# Copyright (c) 2012 OpenStack Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. from neutron_lib.api.definitions import network from neutron_lib.api.definitions import port from neutron_lib.api.definitions import subnet NETWORK = network.RESOURCE_NAME SUBNET = subnet.RESOURCE_NAME PORT = port.RESOURCE_NAME SECURITY_GROUP = 'security_group' L2POPULATION = 'l2population' DVR = 'dvr' RESOURCES = 'resources' CREATE = 'create' DELETE = 'delete' UPDATE = 'update' AGENT = 'q-agent-notifier' PLUGIN = 'q-plugin' SERVER_RESOURCE_VERSIONS = 'q-server-resource-versions' L3PLUGIN = 'q-l3-plugin' REPORTS = 'q-reports-plugin' DHCP = 'q-dhcp-notifer' METERING_PLUGIN = 'q-metering-plugin' L3_AGENT = 'l3_agent' DHCP_AGENT = 'dhcp_agent' METERING_AGENT = 'metering_agent' RESOURCE_TOPIC_PATTERN = "neutron-vo-%(resource_type)s-%(version)s" def get_topic_name(prefix, table, operation, host=None): """Create a topic name. The topic name needs to be synced between the agent and the plugin. The plugin will send a fanout message to all of the listening agents so that the agents in turn can perform their updates accordingly. :param prefix: Common prefix for the plugin/agent message queues. :param table: The table in question (NETWORK, SUBNET, PORT). :param operation: The operation that invokes notification (CREATE, DELETE, UPDATE) :param host: Add host to the topic :returns: The topic name. """ if host: return '%s-%s-%s.%s' % (prefix, table, operation, host) return '%s-%s-%s' % (prefix, table, operation) neutron-lib-1.13.0/neutron_lib/agent/l2_extension.py0000666000175100017510000000346013231472055022466 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import abc import six from neutron_lib.agent import extension @six.add_metaclass(abc.ABCMeta) class L2AgentExtension(extension.AgentExtension): """Define stable abstract interface for l2 agent extensions. An agent extension extends the agent core functionality. """ def initialize(self, connection, driver_type): """Initialize agent extension. :param connection: RPC connection that can be reused by the extension to define its RPC endpoints :param driver_type: String that defines the agent type to the extension. Can be used to choose the right backend implementation. """ @abc.abstractmethod def handle_port(self, context, data): """Handle a port add/update event. This can be called on either create or update, depending on the code flow. Thus, it's this function's responsibility to check what actually changed. :param context: RPC context. :param data: Port data. """ @abc.abstractmethod def delete_port(self, context, data): """Handle a port delete event. :param context: RPC context. :param data: Port data. """ neutron-lib-1.13.0/neutron_lib/agent/constants.py0000666000175100017510000000235713231472055022075 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. ################################### # Agent extension related constants ################################### # Extension driver type for Open vSwitch mech driver OVS_EXTENSION_DRIVER = 'ovs' # Extension driver type for Linux Bridge mech driver LB_EXTENSION_DRIVER = 'linuxbridge' # Extension driver type for macvtap mech driver MACVTAP_EXTENSION_DRIVER = 'macvtap' # Extension driver type for SR-IOV mech driver SRIOV_EXTENSION_DRIVER = 'sriov' # Agent states as detected by server, used to reply on agent's state report # agent has just been registered AGENT_NEW = 'new' # agent is alive AGENT_ALIVE = 'alive' # agent has just returned to alive after being dead AGENT_REVIVED = 'revived' neutron-lib-1.13.0/neutron_lib/agent/l3_extension.py0000666000175100017510000000335113231472055022466 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import abc import six from neutron_lib.agent import extension @six.add_metaclass(abc.ABCMeta) class L3AgentExtension(extension.AgentExtension): """Define stable abstract interface for l3 agent extensions. An agent extension extends the agent core functionality. """ @abc.abstractmethod def add_router(self, context, data): """Handle a router add event. Called on router create. :param context: RPC context. :param data: Router data. """ @abc.abstractmethod def update_router(self, context, data): """Handle a router update event. Called on router update. :param context: RPC context. :param data: Router data. """ @abc.abstractmethod def delete_router(self, context, data): """Handle a router delete event. :param context: RPC context. :param data: Router data. """ @abc.abstractmethod def ha_state_change(self, context, data): """Change router state from agent extension. Called on HA router state change. :param context: rpc context :param data: dict of router_id and new state """ neutron-lib-1.13.0/neutron_lib/hacking/0000775000175100017510000000000013231472430020001 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/hacking/checks.py0000666000175100017510000002422413231472055021624 0ustar zuulzuul00000000000000# Copyright (c) 2014 OpenStack Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import re from neutron_lib.hacking import translation_checks # Guidelines for writing new hacking checks # # - Use only for Neutron specific tests. OpenStack general tests # should be submitted to the common 'hacking' module. # - Pick numbers in the range N5xx. Find the current test with # the highest allocated number and then pick the next value. # - Keep the test method code in the source file ordered based # on the N5xx value. # - List the new rule in the top level HACKING.rst file # - Add test cases for each new rule to # neutron_lib/tests/unit/hacking/test_checks.py mutable_default_args = re.compile(r"^\s*def .+\((.+=\{\}|.+=\[\])") namespace_imports_dot = re.compile(r"import[\s]+([\w]+)[.][^\s]+") namespace_imports_from_dot = re.compile(r"from[\s]+([\w]+)[.]") namespace_imports_from_root = re.compile(r"from[\s]+([\w]+)[\s]+import[\s]+") contextlib_nested = re.compile(r"^\s*with (contextlib\.)?nested\(") assert_equal_none_re = re.compile( r"assertEqual\(.*?,\s+None\)(( |\t)*#.*)?$|assertEqual\(None,") assert_is_none_re = re.compile( r"assertIs(Not)?\(.*,\s+None\)(( |\t)*#.*)?$|assertIs(Not)?\(None,") def use_jsonutils(logical_line, filename): """N521 - jsonutils must be used instead of json. :param logical_line: The logical line to check. :param filename: The file name where the logical line exists. :returns: None if the logical line passes the check, otherwise a tuple is yielded that contains the offending index in logical line and a message describe the check validation failure. """ msg = "N521: jsonutils.%(fun)s must be used instead of json.%(fun)s" # Some files in the tree are not meant to be run from inside Neutron # itself, so we should not complain about them not using jsonutils json_check_skipped_patterns = [ "neutron/plugins/ml2/drivers/openvswitch/agent/xenapi/etc/xapi.d/" "plugins/netwrap", ] for pattern in json_check_skipped_patterns: if pattern in filename: return if "json." in logical_line: json_funcs = ['dumps(', 'dump(', 'loads(', 'load('] for f in json_funcs: pos = logical_line.find('json.%s' % f) if pos != -1: yield (pos, msg % {'fun': f[:-1]}) def _check_imports(regex, submatch, logical_line): m = re.match(regex, logical_line) if m and m.group(1) == submatch: return True def _check_namespace_imports(failure_code, namespace, new_ns, logical_line, message_override=None): if message_override is not None: msg_o = "%s: %s" % (failure_code, message_override) else: msg_o = None if _check_imports(namespace_imports_from_dot, namespace, logical_line): msg = ("%s: '%s' must be used instead of '%s'.") % ( failure_code, logical_line.replace('%s.' % namespace, new_ns), logical_line) return (0, msg_o or msg) elif _check_imports(namespace_imports_from_root, namespace, logical_line): msg = ("%s: '%s' must be used instead of '%s'.") % ( failure_code, logical_line.replace( 'from %s import ' % namespace, 'import %s' % new_ns), logical_line) return (0, msg_o or msg) elif _check_imports(namespace_imports_dot, namespace, logical_line): msg = ("%s: '%s' must be used instead of '%s'.") % ( failure_code, logical_line.replace('import', 'from').replace('.', ' import '), logical_line) return (0, msg_o or msg) def check_no_contextlib_nested(logical_line, filename): """N524 - Use of contextlib.nested is deprecated. :param logical_line: The logical line to check. :param filename: The file name where the logical line exists. :returns: None if the logical line passes the check, otherwise a tuple is yielded that contains the offending index in logical line and a message describe the check validation failure. """ msg = ("N524: contextlib.nested is deprecated. With Python 2.7 and later " "the with-statement supports multiple nested objects. See https://" "docs.python.org/2/library/contextlib.html#contextlib.nested for " "more information.") if contextlib_nested.match(logical_line): yield(0, msg) def check_python3_xrange(logical_line): """N525 - Do not use xrange. :param logical_line: The logical line to check. :returns: None if the logical line passes the check, otherwise a tuple is yielded that contains the offending index in logical line and a message describe the check validation failure. """ if re.search(r"\bxrange\s*\(", logical_line): yield(0, "N525: Do not use xrange. Use range, or six.moves.range for " "large loops.") def check_no_basestring(logical_line): """N526 - basestring is not Python3-compatible. :param logical_line: The logical line to check. :returns: None if the logical line passes the check, otherwise a tuple is yielded that contains the offending index in logical line and a message describe the check validation failure. """ if re.search(r"\bbasestring\b", logical_line): msg = ("N526: basestring is not Python3-compatible, use " "six.string_types instead.") yield(0, msg) def check_python3_no_iteritems(logical_line): """N527 - Use dict.items() instead of dict.iteritems(). :param logical_line: The logical line to check. :returns: None if the logical line passes the check, otherwise a tuple is yielded that contains the offending index in logical line and a message describe the check validation failure. """ if re.search(r".*\.iteritems\(\)", logical_line): msg = ("N527: Use dict.items() instead of dict.iteritems() to be " "compatible with both Python 2 and Python 3. In Python 2, " "dict.items() may be inefficient for very large dictionaries. " "If you can prove that you need the optimization of an " "iterator for Python 2, then you can use six.iteritems(dict).") yield(0, msg) def no_mutable_default_args(logical_line): """N529 - Method's default argument shouldn't be mutable. :param logical_line: The logical line to check. :returns: None if the logical line passes the check, otherwise a tuple is yielded that contains the offending index in logical line and a message describe the check validation failure. """ msg = "N529: Method's default argument shouldn't be mutable!" if mutable_default_args.match(logical_line): yield (0, msg) # Chances are that most projects will need to put an ignore on this rule # until they can fully migrate to the lib. def check_neutron_namespace_imports(logical_line): """N530 - Direct neutron imports not allowed. :param logical_line: The logical line to check. :returns: None if the logical line passes the check, otherwise a tuple is yielded that contains the offending index in logical line and a message describe the check validation failure. """ x = _check_namespace_imports( 'N530', 'neutron', 'neutron_lib.', logical_line, message_override="direct neutron imports not allowed") if x is not None: yield x def check_no_eventlet_imports(logical_line): """N535 - Usage of Python eventlet module not allowed. :param logical_line: The logical line to check. :returns: None if the logical line passes the check, otherwise a tuple is yielded that contains the offending index in logical line and a message describe the check validation failure. """ if re.match(r'(import|from)\s+[(]?eventlet', logical_line): msg = 'N535: Usage of Python eventlet module not allowed' yield logical_line.index('eventlet'), msg def assert_equal_none(logical_line): """N536 - Use assertIsNone.""" if assert_equal_none_re.search(logical_line): msg = ("N536: Use assertIsNone rather than assertEqual " "to check for None values") yield logical_line.index('assert'), msg if assert_is_none_re.search(logical_line): msg = ("N536: Use assertIsNone or assertIsNotNone rather than " "assertIs or assertIsNone to check for None values.") yield logical_line.index('assert'), msg def factory(register): """Hacking check factory for neutron-lib adopter compliant checks. Hacking check factory for use with tox.ini. This factory registers all neutron-lib adopter checks consumers should seek to comply with. :param register: The function to register the check functions with. :returns: None. """ register(use_jsonutils) register(check_no_contextlib_nested) register(check_python3_xrange) register(check_no_basestring) register(check_python3_no_iteritems) register(no_mutable_default_args) register(check_neutron_namespace_imports) register(translation_checks.no_translate_logs) register(translation_checks.check_log_warn_deprecated) register(translation_checks.check_raised_localized_exceptions) register(assert_equal_none) def _neutron_lib_factory(register): """Hacking check factory for neutron-lib internal project checks. Hacking check factory for use with tox.ini. This factory registers all checks that are run with the neutron-lib project itself. :param register: The function to register the check functions with. :returns: None. """ factory(register) # neutron-lib project specific checks below register(check_no_eventlet_imports) neutron-lib-1.13.0/neutron_lib/hacking/__init__.py0000666000175100017510000000000013231472055022105 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/hacking/translation_checks.py0000666000175100017510000000665713231472055024254 0ustar zuulzuul00000000000000# Copyright (c) 2014 OpenStack Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import re _all_log_levels = {'critical', 'error', 'exception', 'info', 'warning', 'debug'} _all_hints = {'_LC', '_LE', '_LI', '_', '_LW'} _log_warn = re.compile( r"(.)*LOG\.(warn)\(\s*('|\")") _log_translation_hint = re.compile( r".*LOG\.(%(levels)s)\(\s*(%(hints)s)\(" % { 'levels': '|'.join(_all_log_levels), 'hints': '|'.join(_all_hints), }) def _translation_checks_not_enforced(filename): # Do not do these validations on tests return any(pat in filename for pat in ["/tests/", "rally-jobs/plugins/"]) def check_log_warn_deprecated(logical_line, filename): """N532 - Use LOG.warning due to compatibility with py3. :param logical_line: The logical line to check. :param filename: The file name where the logical line exists. :returns: None if the logical line passes the check, otherwise a tuple is yielded that contains the offending index in logical line and a message describe the check validation failure. """ msg = "N532: Use LOG.warning due to compatibility with py3" if _log_warn.match(logical_line): yield (0, msg) def check_raised_localized_exceptions(logical_line, filename): """N534 - Untranslated exception message. :param logical_line: The logical line to check. :param filename: The file name where the logical line exists. :returns: None if the logical line passes the check, otherwise a tuple is yielded that contains the offending index in logical line and a message describe the check validation failure. """ if _translation_checks_not_enforced(filename): return logical_line = logical_line.strip() raised_search = re.compile( r"raise (?:\w*)\((.*)\)").match(logical_line) if raised_search: exception_msg = raised_search.groups()[0] if exception_msg.startswith("\"") or exception_msg.startswith("\'"): msg = "N534: Untranslated exception message." yield (logical_line.index(exception_msg), msg) def no_translate_logs(logical_line, filename): """N537 - Don't translate logs. Check for 'LOG.*(_(' and 'LOG.*(_Lx(' Translators don't provide translations for log messages, and operators asked not to translate them. * This check assumes that 'LOG' is a logger. :param logical_line: The logical line to check. :param filename: The file name where the logical line exists. :returns: None if the logical line passes the check, otherwise a tuple is yielded that contains the offending index in logical line and a message describe the check validation failure. """ if _translation_checks_not_enforced(filename): return msg = "N537: Log messages should not be translated!" match = _log_translation_hint.match(logical_line) if match: yield (logical_line.index(match.group()), msg) neutron-lib-1.13.0/neutron_lib/context.py0000666000175100017510000001463213231472055020446 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Context: context for security/db session.""" import collections import copy import datetime from oslo_context import context as oslo_context from oslo_db.sqlalchemy import enginefacade from neutron_lib import _policy as policy from neutron_lib.db import api as db_api class ContextBase(oslo_context.RequestContext): """Security context and request information. Represents the user taking a given action within the system. """ def __init__(self, user_id=None, tenant_id=None, is_admin=None, timestamp=None, tenant_name=None, user_name=None, is_advsvc=None, **kwargs): # NOTE(jamielennox): We maintain this argument in order for tests that # pass arguments positionally. kwargs.setdefault('project_id', tenant_id) # prefer project_name, as that's what's going to be set by # keystone. Fall back to tenant_name if for some reason it's blank. kwargs.setdefault('project_name', tenant_name) super(ContextBase, self).__init__( is_admin=is_admin, user_id=user_id, **kwargs) self.user_name = user_name if not timestamp: timestamp = datetime.datetime.utcnow() self.timestamp = timestamp self.is_advsvc = is_advsvc if self.is_advsvc is None: self.is_advsvc = self.is_admin or policy.check_is_advsvc(self) if self.is_admin is None: self.is_admin = policy.check_is_admin(self) @property def tenant_id(self): return self.project_id @tenant_id.setter def tenant_id(self, tenant_id): self.project_id = tenant_id @property def tenant_name(self): return self.project_name @tenant_name.setter def tenant_name(self, tenant_name): self.project_name = tenant_name def to_dict(self): context = super(ContextBase, self).to_dict() context.update({ 'user_id': self.user_id, 'tenant_id': self.project_id, 'project_id': self.project_id, 'timestamp': str(self.timestamp), 'tenant_name': self.project_name, 'project_name': self.project_name, 'user_name': self.user_name, }) return context def to_policy_values(self): values = super(ContextBase, self).to_policy_values() values['tenant_id'] = self.project_id values['is_admin'] = self.is_admin # NOTE(jamielennox): These are almost certainly unused and non-standard # but kept for backwards compatibility. Remove them in Pike # (oslo.context from Ocata release already issues deprecation warnings # for non-standard keys). values['user'] = self.user_id values['tenant'] = self.project_id values['domain'] = self.domain_id values['user_domain'] = self.user_domain_id values['project_domain'] = self.project_domain_id values['tenant_name'] = self.project_name values['project_name'] = self.project_name values['user_name'] = self.user_name return values @classmethod def from_dict(cls, values): return cls(user_id=values.get('user_id', values.get('user')), tenant_id=values.get('tenant_id', values.get('project_id')), is_admin=values.get('is_admin'), roles=values.get('roles'), timestamp=values.get('timestamp'), request_id=values.get('request_id'), tenant_name=values.get('tenant_name'), user_name=values.get('user_name'), auth_token=values.get('auth_token')) def elevated(self): """Return a version of this context with admin flag set.""" context = copy.copy(self) context.is_admin = True if 'admin' not in [x.lower() for x in context.roles]: context.roles = context.roles + ["admin"] return context @enginefacade.transaction_context_provider class ContextBaseWithSession(ContextBase): pass _TransactionConstraint = collections.namedtuple( 'TransactionConstraint', ['if_revision_match', 'resource', 'resource_id']) class Context(ContextBaseWithSession): def __init__(self, *args, **kwargs): super(Context, self).__init__(*args, **kwargs) self._session = None self._txn_constraint = None @property def session(self): # TODO(akamyshnikova): checking for session attribute won't be needed # when reader and writer will be used if hasattr(super(Context, self), 'session'): return super(Context, self).session if self._session is None: self._session = db_api.get_writer_session() return self._session def set_transaction_constraint(self, resource, resource_id, rev_number): """Set a revision constraint to enforce before resource_id is changed. :param resource: Collection name of resource (e.g. ports or networks) :param resource_id: The primary key ID of the individual resource that should have its revision number matched before allowing the transaction to proceed. :param rev_number: The revision_number that the resource should be at. """ self._txn_constraint = _TransactionConstraint( if_revision_match=rev_number, resource=resource, resource_id=resource_id) def clear_transaction_constraint(self): self._txn_constraint = None def get_transaction_constraint(self): return self._txn_constraint def get_admin_context(): return Context(user_id=None, tenant_id=None, is_admin=True, overwrite=False) def get_admin_context_without_session(): return ContextBase(user_id=None, tenant_id=None, is_admin=True) neutron-lib-1.13.0/neutron_lib/_i18n.py0000666000175100017510000000171313231472055017674 0ustar zuulzuul00000000000000# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # # INTERNAL INTERFACE: PLEASE NOTE THE LEADING _ ON THIS FILE. THIS IS # NOT A LIBRARY INTERFACE. IF YOU WISH TO USE OSLO_I18N, please refer # to https://docs.openstack.org/oslo.i18n/latest/user/usage.html import oslo_i18n _translators = oslo_i18n.TranslatorFactory(domain='neutron_lib') # The translation function using the well-known name "_" _ = _translators.primary neutron-lib-1.13.0/neutron_lib/clients/0000775000175100017510000000000013231472430020036 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/clients/__init__.py0000666000175100017510000000000013231472055022142 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/clients/placement.py0000666000175100017510000002062513231472055022372 0ustar zuulzuul00000000000000# Copyright (c) 2016 IBM # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import functools from keystoneauth1 import exceptions as ks_exc from keystoneauth1 import loading as keystone from oslo_log import log as logging from neutron_lib._i18n import _ from neutron_lib.exceptions import placement as n_exc LOG = logging.getLogger(__name__) API_VERSION_REQUEST_HEADER = 'OpenStack-API-Version' PLACEMENT_API_WITH_AGGREGATES = 'placement 1.1' def _check_placement_api_available(f): """Check if the placement API is available. :param f: Function to execute. :returns: The returned value of the function f. :raises PlacementEndpointNotFound: If the placement API endpoint configured is not found. """ @functools.wraps(f) def wrapper(self, *a, **k): try: if not self._client: self._client = self._create_client() return f(self, *a, **k) except ks_exc.EndpointNotFound: LOG.warning('Please enable the placement service.') except ks_exc.MissingAuthPlugin: LOG.warning('No authentication information found for placement ' 'API. Please enable the placement service.') except ks_exc.Unauthorized: LOG.warning('Placement service credentials do not work. ' 'Please enable the placement service.') except ks_exc.DiscoveryFailure: LOG.warning('Discovering suitable URL for placement API failed.') except ks_exc.ConnectFailure: LOG.warning('Placement API service is not responding.') return wrapper class PlacementAPIClient(object): """Client class for placement ReST API.""" def __init__(self, conf, openstack_api_version=PLACEMENT_API_WITH_AGGREGATES): self._openstack_api_version = openstack_api_version self._conf = conf self._ks_filter = {'service_type': 'placement', 'region_name': self._conf.placement.region_name} self._client = None def _create_client(self): """Create the HTTP session accessing the placement service.""" # Flush _resource_providers and aggregates so we start from a # clean slate. self._resource_providers = {} self._provider_aggregate_map = {} auth_plugin = keystone.load_auth_from_conf_options( self._conf, 'placement') return keystone.load_session_from_conf_options( self._conf, 'placement', auth=auth_plugin, additional_headers={'accept': 'application/json'}) def _get(self, url, **kwargs): return self._client.get(url, endpoint_filter=self._ks_filter, **kwargs) def _post(self, url, data, **kwargs): return self._client.post(url, json=data, endpoint_filter=self._ks_filter, **kwargs) def _put(self, url, data, **kwargs): return self._client.put(url, json=data, endpoint_filter=self._ks_filter, **kwargs) def _delete(self, url, **kwargs): return self._client.delete(url, endpoint_filter=self._ks_filter, **kwargs) @_check_placement_api_available def create_resource_provider(self, resource_provider): """Create a resource provider. :param resource_provider: The resource provider. A dict with the name (required) and the uuid (required). """ url = '/resource_providers' self._post(url, resource_provider) @_check_placement_api_available def delete_resource_provider(self, resource_provider_uuid): """Delete a resource provider. :param resource_provider_uuid: UUID of the resource provider. """ url = '/resource_providers/%s' % resource_provider_uuid self._delete(url) @_check_placement_api_available def create_inventory(self, resource_provider_uuid, inventory): """Create an inventory. :param resource_provider_uuid: UUID of the resource provider. :param inventory: The inventory. A dict with resource_class (required), total (required), reserved (required), min_unit (required), max_unit (required), step_size (required) and allocation_ratio (required). """ url = '/resource_providers/%s/inventories' % resource_provider_uuid self._post(url, inventory) @_check_placement_api_available def get_inventory(self, resource_provider_uuid, resource_class): """Get resource provider inventory. :param resource_provider_uuid: UUID of the resource provider. :param resource_class: Resource class name of the inventory to be returned. :raises PlacementInventoryNotFound: For failure to find inventory for a resource provider. """ url = '/resource_providers/%s/inventories/%s' % ( resource_provider_uuid, resource_class) try: return self._get(url).json() except ks_exc.NotFound as e: if "No resource provider with uuid" in e.details: raise n_exc.PlacementResourceProviderNotFound( resource_provider=resource_provider_uuid) elif _("No inventory of class") in e.details: raise n_exc.PlacementInventoryNotFound( resource_provider=resource_provider_uuid, resource_class=resource_class) else: raise @_check_placement_api_available def update_inventory(self, resource_provider_uuid, inventory, resource_class): """Update an inventory. :param resource_provider_uuid: UUID of the resource provider. :param inventory: The inventory, in a dictionary. :param resource_class: The resource class of the inventory to update. :raises PlacementInventoryUpdateConflict: For failure to update inventory due to outdated resource_provider_generation. """ url = '/resource_providers/%s/inventories/%s' % ( resource_provider_uuid, resource_class) try: self._put(url, inventory) except ks_exc.Conflict: raise n_exc.PlacementInventoryUpdateConflict( resource_provider=resource_provider_uuid, resource_class=resource_class) @_check_placement_api_available def associate_aggregates(self, resource_provider_uuid, aggregates): """Associate a list of aggregates with a resource provider. :param resource_provider_uuid: UUID of the resource provider. :param aggregates: aggregates to be associated to the resource provider. """ url = '/resource_providers/%s/aggregates' % resource_provider_uuid self._put(url, aggregates, headers={API_VERSION_REQUEST_HEADER: self._openstack_api_version}) @_check_placement_api_available def list_aggregates(self, resource_provider_uuid): """List resource provider aggregates. :param resource_provider_uuid: UUID of the resource provider. :raises PlacementAggregateNotFound: For failure to the aggregates of a resource provider. """ url = '/resource_providers/%s/aggregates' % resource_provider_uuid try: return self._get( url, headers={API_VERSION_REQUEST_HEADER: self._openstack_api_version}).json() except ks_exc.NotFound: raise n_exc.PlacementAggregateNotFound( resource_provider=resource_provider_uuid) neutron-lib-1.13.0/neutron_lib/constants.py0000666000175100017510000002672113231472055021000 0ustar zuulzuul00000000000000# Copyright (c) 2012 OpenStack Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. # TODO(salv-orlando): Verify if a single set of operational # status constants is achievable NET_STATUS_ACTIVE = 'ACTIVE' NET_STATUS_BUILD = 'BUILD' NET_STATUS_DOWN = 'DOWN' NET_STATUS_ERROR = 'ERROR' PORT_STATUS_ACTIVE = 'ACTIVE' PORT_STATUS_BUILD = 'BUILD' PORT_STATUS_DOWN = 'DOWN' PORT_STATUS_ERROR = 'ERROR' PORT_STATUS_NOTAPPLICABLE = 'N/A' FLOATINGIP_STATUS_ACTIVE = 'ACTIVE' FLOATINGIP_STATUS_DOWN = 'DOWN' FLOATINGIP_STATUS_ERROR = 'ERROR' # Service operation status constants ACTIVE = "ACTIVE" DOWN = "DOWN" CREATED = "CREATED" PENDING_CREATE = "PENDING_CREATE" PENDING_UPDATE = "PENDING_UPDATE" PENDING_DELETE = "PENDING_DELETE" INACTIVE = "INACTIVE" ERROR = "ERROR" DEVICE_OWNER_COMPUTE_PREFIX = "compute:" DEVICE_OWNER_NETWORK_PREFIX = "network:" DEVICE_OWNER_NEUTRON_PREFIX = "neutron:" DEVICE_OWNER_BAREMETAL_PREFIX = "baremetal:" DEVICE_OWNER_ROUTER_HA_INTF = (DEVICE_OWNER_NETWORK_PREFIX + "router_ha_interface") DEVICE_OWNER_HA_REPLICATED_INT = (DEVICE_OWNER_NETWORK_PREFIX + "ha_router_replicated_interface") DEVICE_OWNER_ROUTER_INTF = DEVICE_OWNER_NETWORK_PREFIX + "router_interface" DEVICE_OWNER_ROUTER_GW = DEVICE_OWNER_NETWORK_PREFIX + "router_gateway" DEVICE_OWNER_FLOATINGIP = DEVICE_OWNER_NETWORK_PREFIX + "floatingip" DEVICE_OWNER_DHCP = DEVICE_OWNER_NETWORK_PREFIX + "dhcp" DEVICE_OWNER_DVR_INTERFACE = (DEVICE_OWNER_NETWORK_PREFIX + "router_interface_distributed") DEVICE_OWNER_AGENT_GW = (DEVICE_OWNER_NETWORK_PREFIX + "floatingip_agent_gateway") DEVICE_OWNER_ROUTER_SNAT = (DEVICE_OWNER_NETWORK_PREFIX + "router_centralized_snat") DEVICE_OWNER_LOADBALANCER = DEVICE_OWNER_NEUTRON_PREFIX + "LOADBALANCER" DEVICE_OWNER_LOADBALANCERV2 = DEVICE_OWNER_NEUTRON_PREFIX + "LOADBALANCERV2" DEVICE_OWNER_PREFIXES = (DEVICE_OWNER_NETWORK_PREFIX, DEVICE_OWNER_NEUTRON_PREFIX) # Collection used to identify devices owned by router interfaces. # DEVICE_OWNER_ROUTER_HA_INTF is a special case and so is not included. ROUTER_INTERFACE_OWNERS = (DEVICE_OWNER_ROUTER_INTF, DEVICE_OWNER_HA_REPLICATED_INT, DEVICE_OWNER_DVR_INTERFACE) ROUTER_INTERFACE_OWNERS_SNAT = (DEVICE_OWNER_ROUTER_INTF, DEVICE_OWNER_HA_REPLICATED_INT, DEVICE_OWNER_DVR_INTERFACE, DEVICE_OWNER_ROUTER_SNAT) DEVICE_ID_RESERVED_DHCP_PORT = 'reserved_dhcp_port' FLOATINGIP_KEY = '_floatingips' INTERFACE_KEY = '_interfaces' HA_INTERFACE_KEY = '_ha_interface' IPv4 = 'IPv4' IPv6 = 'IPv6' IP_VERSION_4 = 4 IP_VERSION_6 = 6 IPv4_BITS = 32 IPv6_BITS = 128 INVALID_MAC_ADDRESSES = ['00:00:00:00:00:00', 'FF:FF:FF:FF:FF:FF'] IPv4_ANY = '0.0.0.0/0' IPv6_ANY = '::/0' IP_ANY = {IP_VERSION_4: IPv4_ANY, IP_VERSION_6: IPv6_ANY} IPv6_LLA_PREFIX = 'fe80::/64' DHCP_RESPONSE_PORT = 68 FLOODING_ENTRY = ('00:00:00:00:00:00', '0.0.0.0') AGENT_TYPE_DHCP = 'DHCP agent' AGENT_TYPE_OVS = 'Open vSwitch agent' AGENT_TYPE_LINUXBRIDGE = 'Linux bridge agent' AGENT_TYPE_OFA = 'OFA driver agent' AGENT_TYPE_L3 = 'L3 agent' AGENT_TYPE_LOADBALANCER = 'Loadbalancer agent' AGENT_TYPE_METERING = 'Metering agent' AGENT_TYPE_METADATA = 'Metadata agent' AGENT_TYPE_NIC_SWITCH = 'NIC Switch agent' AGENT_TYPE_MACVTAP = 'Macvtap agent' L2_AGENT_TOPIC = 'N/A' L3_AGENT_MODE_DVR = 'dvr' L3_AGENT_MODE_DVR_SNAT = 'dvr_snat' L3_AGENT_MODE_LEGACY = 'legacy' L3_AGENT_MODE = 'agent_mode' L3_AGENT_MODE_DVR_NO_EXTERNAL = 'dvr_no_external' DVR_SNAT_BOUND = 'dvr_snat_bound' PORT_BINDING_EXT_ALIAS = 'binding' L3_AGENT_SCHEDULER_EXT_ALIAS = 'l3_agent_scheduler' DHCP_AGENT_SCHEDULER_EXT_ALIAS = 'dhcp_agent_scheduler' LBAAS_AGENT_SCHEDULER_EXT_ALIAS = 'lbaas_agent_scheduler' L3_DISTRIBUTED_EXT_ALIAS = 'dvr' L3_HA_MODE_EXT_ALIAS = 'l3-ha' SUBNET_ALLOCATION_EXT_ALIAS = 'subnet_allocation' # Protocol names and numbers for Security Groups/Firewalls PROTO_NAME_AH = 'ah' PROTO_NAME_DCCP = 'dccp' PROTO_NAME_EGP = 'egp' PROTO_NAME_ESP = 'esp' PROTO_NAME_GRE = 'gre' PROTO_NAME_ICMP = 'icmp' PROTO_NAME_IGMP = 'igmp' PROTO_NAME_IPIP = 'ipip' PROTO_NAME_IPV6_ENCAP = 'ipv6-encap' PROTO_NAME_IPV6_FRAG = 'ipv6-frag' PROTO_NAME_IPV6_ICMP = 'ipv6-icmp' # For backward-compatibility of security group rule API, we keep the old value # for IPv6 ICMP. It should be clean up in the future. PROTO_NAME_IPV6_ICMP_LEGACY = 'icmpv6' PROTO_NAME_IPV6_NONXT = 'ipv6-nonxt' PROTO_NAME_IPV6_OPTS = 'ipv6-opts' PROTO_NAME_IPV6_ROUTE = 'ipv6-route' PROTO_NAME_OSPF = 'ospf' PROTO_NAME_PGM = 'pgm' PROTO_NAME_RSVP = 'rsvp' PROTO_NAME_SCTP = 'sctp' PROTO_NAME_TCP = 'tcp' PROTO_NAME_UDP = 'udp' PROTO_NAME_UDPLITE = 'udplite' PROTO_NAME_VRRP = 'vrrp' PROTO_NUM_AH = 51 PROTO_NUM_DCCP = 33 PROTO_NUM_EGP = 8 PROTO_NUM_ESP = 50 PROTO_NUM_GRE = 47 PROTO_NUM_ICMP = 1 PROTO_NUM_IGMP = 2 PROTO_NUM_IPIP = 4 PROTO_NUM_IPV6_ENCAP = 41 PROTO_NUM_IPV6_FRAG = 44 PROTO_NUM_IPV6_ICMP = 58 PROTO_NUM_IPV6_NONXT = 59 PROTO_NUM_IPV6_OPTS = 60 PROTO_NUM_IPV6_ROUTE = 43 PROTO_NUM_OSPF = 89 PROTO_NUM_PGM = 113 PROTO_NUM_RSVP = 46 PROTO_NUM_SCTP = 132 PROTO_NUM_TCP = 6 PROTO_NUM_UDP = 17 PROTO_NUM_UDPLITE = 136 PROTO_NUM_VRRP = 112 IP_PROTOCOL_MAP = {PROTO_NAME_AH: PROTO_NUM_AH, PROTO_NAME_DCCP: PROTO_NUM_DCCP, PROTO_NAME_EGP: PROTO_NUM_EGP, PROTO_NAME_ESP: PROTO_NUM_ESP, PROTO_NAME_GRE: PROTO_NUM_GRE, PROTO_NAME_ICMP: PROTO_NUM_ICMP, PROTO_NAME_IGMP: PROTO_NUM_IGMP, PROTO_NAME_IPIP: PROTO_NUM_IPIP, PROTO_NAME_IPV6_ENCAP: PROTO_NUM_IPV6_ENCAP, PROTO_NAME_IPV6_FRAG: PROTO_NUM_IPV6_FRAG, PROTO_NAME_IPV6_ICMP: PROTO_NUM_IPV6_ICMP, # For backward-compatibility of security group rule API PROTO_NAME_IPV6_ICMP_LEGACY: PROTO_NUM_IPV6_ICMP, PROTO_NAME_IPV6_NONXT: PROTO_NUM_IPV6_NONXT, PROTO_NAME_IPV6_OPTS: PROTO_NUM_IPV6_OPTS, PROTO_NAME_IPV6_ROUTE: PROTO_NUM_IPV6_ROUTE, PROTO_NAME_OSPF: PROTO_NUM_OSPF, PROTO_NAME_PGM: PROTO_NUM_PGM, PROTO_NAME_RSVP: PROTO_NUM_RSVP, PROTO_NAME_SCTP: PROTO_NUM_SCTP, PROTO_NAME_TCP: PROTO_NUM_TCP, PROTO_NAME_UDP: PROTO_NUM_UDP, PROTO_NAME_UDPLITE: PROTO_NUM_UDPLITE, PROTO_NAME_VRRP: PROTO_NUM_VRRP} # Note that this differs from IP_PROTOCOL_MAP because iptables refers to IPv6 # ICMP as 'icmp6' whereas it is 'ipv6-icmp' in IP_PROTOCOL_MAP. IPTABLES_PROTOCOL_MAP = {PROTO_NAME_DCCP: 'dccp', PROTO_NAME_ICMP: 'icmp', PROTO_NAME_IPV6_ICMP: 'icmp6', PROTO_NAME_SCTP: 'sctp', PROTO_NAME_TCP: 'tcp', PROTO_NAME_UDP: 'udp'} # IP header length IP_HEADER_LENGTH = { 4: 20, 6: 40, } # ICMPv6 types: # Destination Unreachable (1) ICMPV6_TYPE_DEST_UNREACH = 1 # Packet Too Big (2) ICMPV6_TYPE_PKT_TOOBIG = 2 # Time Exceeded (3) ICMPV6_TYPE_TIME_EXCEED = 3 # Parameter Problem (4) ICMPV6_TYPE_PARAMPROB = 4 # Echo Request (128) ICMPV6_TYPE_ECHO_REQUEST = 128 # Echo Reply (129) ICMPV6_TYPE_ECHO_REPLY = 129 # Multicast Listener Query (130) ICMPV6_TYPE_MLD_QUERY = 130 # Multicast Listener Report (131) ICMPV6_TYPE_MLD_REPORT = 131 # Multicast Listener Done (132) ICMPV6_TYPE_MLD_DONE = 132 # Router Solicitation (133) ICMPV6_TYPE_RS = 133 # Router Advertisement (134) ICMPV6_TYPE_RA = 134 # Neighbor Solicitation (135) ICMPV6_TYPE_NS = 135 # Neighbor Advertisement (136) ICMPV6_TYPE_NA = 136 # Multicast Listener v2 Report (143) ICMPV6_TYPE_MLD2_REPORT = 143 # List of ICMPv6 types that should be allowed from the unspecified address for # Duplicate Address Detection: ICMPV6_ALLOWED_UNSPEC_ADDR_TYPES = [ICMPV6_TYPE_MLD_REPORT, ICMPV6_TYPE_NS, ICMPV6_TYPE_MLD2_REPORT] # Human-readable ID to which the subnetpool ID should be set to # indicate that IPv6 Prefix Delegation is enabled for a given subnetpool IPV6_PD_POOL_ID = 'prefix_delegation' # Device names start with "tap" TAP_DEVICE_PREFIX = 'tap' # Device names start with "macvtap" MACVTAP_DEVICE_PREFIX = 'macvtap' # Linux interface max length DEVICE_NAME_MAX_LEN = 15 # Time format ISO8601_TIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%f' DHCPV6_STATEFUL = 'dhcpv6-stateful' DHCPV6_STATELESS = 'dhcpv6-stateless' IPV6_SLAAC = 'slaac' IPV6_MODES = [DHCPV6_STATEFUL, DHCPV6_STATELESS, IPV6_SLAAC] ACTIVE_PENDING_STATUSES = ( ACTIVE, PENDING_CREATE, PENDING_UPDATE ) # Network Type constants TYPE_FLAT = 'flat' TYPE_GENEVE = 'geneve' TYPE_GRE = 'gre' TYPE_LOCAL = 'local' TYPE_VXLAN = 'vxlan' TYPE_VLAN = 'vlan' TYPE_NONE = 'none' # Values for network_type # For VLAN Network MIN_VLAN_TAG = 1 MAX_VLAN_TAG = 4094 # For Geneve Tunnel MIN_GENEVE_VNI = 1 MAX_GENEVE_VNI = 2 ** 24 - 1 # For GRE Tunnel MIN_GRE_ID = 1 MAX_GRE_ID = 2 ** 32 - 1 # For VXLAN Tunnel MIN_VXLAN_VNI = 1 MAX_VXLAN_VNI = 2 ** 24 - 1 VXLAN_UDP_PORT = 4789 # Overlay (tunnel) protocol overhead GENEVE_ENCAP_MIN_OVERHEAD = 30 GRE_ENCAP_OVERHEAD = 22 VXLAN_ENCAP_OVERHEAD = 30 # For DNS extension DNS_DOMAIN_DEFAULT = 'openstacklocal.' DNS_LABEL_MAX_LEN = 63 DNS_LABEL_REGEX = "^[a-z0-9-]{1,%d}$" % DNS_LABEL_MAX_LEN VALID_DSCP_MARKS = [0, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 46, 48, 56] INGRESS_DIRECTION = 'ingress' EGRESS_DIRECTION = 'egress' VALID_DIRECTIONS = (INGRESS_DIRECTION, EGRESS_DIRECTION) PROVISIONAL_IPV6_PD_PREFIX = '::/64' class Sentinel(object): """A constant object that does not change even when copied.""" def __deepcopy__(self, memo): # Always return the same object because this is essentially a constant. return self def __copy__(self): # called via copy.copy(x) return self ############################# # Attribute related constants ############################# ATTR_NOT_SPECIFIED = Sentinel() HEX_ELEM = '[0-9A-Fa-f]' UUID_PATTERN = '-'.join([HEX_ELEM + '{8}', HEX_ELEM + '{4}', HEX_ELEM + '{4}', HEX_ELEM + '{4}', HEX_ELEM + '{12}']) SHARED = 'shared' ########################## # Device related constants ########################## # vhost-user device names start with "vhu" VHOST_USER_DEVICE_PREFIX = 'vhu' # The vswitch side of a veth pair for a nova iptables filter setup VETH_DEVICE_PREFIX = 'qvo' # prefix for SNAT interface in DVR SNAT_INT_DEV_PREFIX = 'sg-' ########################## # Plugin related constants ########################## # Plugin constants that are universally used across all neutron repos. # The alias for the core plugin. # TODO(boden): remove and replace consumer usage with plugins/constants.py CORE = 'CORE' # The alias for the L3 plugin. L3 = 'L3_ROUTER_NAT' neutron-lib-1.13.0/neutron_lib/exceptions/0000775000175100017510000000000013231472430020556 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/exceptions/__init__.py0000666000175100017510000004463513231472055022710 0ustar zuulzuul00000000000000# Copyright 2011 VMware, Inc, 2015 A10 Networks, Inc # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ Neutron base exception handling. """ from oslo_utils import excutils import six from neutron_lib._i18n import _ class NeutronException(Exception): """Base Neutron Exception. To correctly use this class, inherit from it and define a 'message' property. That message will get printf'd with the keyword arguments provided to the constructor. """ message = _("An unknown exception occurred.") def __init__(self, **kwargs): try: super(NeutronException, self).__init__(self.message % kwargs) self.msg = self.message % kwargs except Exception: with excutils.save_and_reraise_exception() as ctxt: if not self.use_fatal_exceptions(): ctxt.reraise = False # at least get the core message out if something happened super(NeutronException, self).__init__(self.message) if six.PY2: def __unicode__(self): return unicode(self.msg) def __str__(self): return self.msg def use_fatal_exceptions(self): """Is the instance using fatal exceptions. :returns: Always returns False. """ return False class BadRequest(NeutronException): """An exception indicating a generic bad request for a said resource. A generic exception indicating a bad request for a specified resource. :param resource: The resource requested. :param msg: A message indicating why the request is bad. """ message = _('Bad %(resource)s request: %(msg)s.') class NotFound(NeutronException): """A generic not found exception.""" pass class Conflict(NeutronException): """A generic conflict exception.""" pass class NotAuthorized(NeutronException): """A generic not authorized exception.""" message = _("Not authorized.") class ServiceUnavailable(NeutronException): """A generic service unavailable exception.""" message = _("The service is unavailable.") class AdminRequired(NotAuthorized): """A not authorized exception indicating an admin is required. A specialization of the NotAuthorized exception that indicates and admin is required to carry out the operation or access a resource. :param reason: A message indicating additional details on why admin is required for the operation access. """ message = _("User does not have admin privileges: %(reason)s.") class ObjectNotFound(NotFound): """A not found exception indicating an identifiable object isn't found. A specialization of the NotFound exception indicating an object with a said ID doesn't exist. :param id: The ID of the (not found) object. """ message = _("Object %(id)s not found.") class NetworkNotFound(NotFound): """An exception indicating a network was not found. A specialization of the NotFound exception indicating a requested network could not be found. :param net_id: The UUID of the (not found) network requested. """ message = _("Network %(net_id)s could not be found.") class SubnetNotFound(NotFound): """An exception for a requested subnet that's not found. A specialization of the NotFound exception indicating a requested subnet could not be found. :param subnet_id: The UUID of the (not found) subnet that was requested. """ message = _("Subnet %(subnet_id)s could not be found.") class PortNotFound(NotFound): """An exception for a requested port that's not found. A specialization of the NotFound exception indicating a requested port could not be found. :param port_id: The UUID of the (not found) port that was requested. """ message = _("Port %(port_id)s could not be found.") class PortNotFoundOnNetwork(NotFound): """An exception for a requested port on a network that's not found. A specialization of the NotFound exception that indicates a specified port on a specified network doesn't exist. :param port_id: The UUID of the (not found) port that was requested. :param net_id: The UUID of the network that was requested for the port. """ message = _("Port %(port_id)s could not be found " "on network %(net_id)s.") class DeviceNotFoundError(NotFound): """An exception for a requested device that's not found. A specialization of the NotFound exception indicating a requested device could not be found. :param device_name: The name of the (not found) device that was requested. """ message = _("Device '%(device_name)s' does not exist.") class InUse(NeutronException): """A generic exception indicating a resource is already in use.""" message = _("The resource is in use.") class NetworkInUse(InUse): """An operational error indicating the network still has ports in use. A specialization of the InUse exception indicating a network operation was requested, but failed because there are still ports in use on the said network. :param net_id: The UUID of the network requested. """ message = _("Unable to complete operation on network %(net_id)s. " "There are one or more ports still in use on the network.") class SubnetInUse(InUse): """An operational error indicating a subnet is still in use. A specialization of the InUse exception indicating an operation failed on a subnet because the subnet is still in use. :param subnet_id: The UUID of the subnet requested. :param reason: Details on why the operation failed. If None, a default reason is used indicating one or more ports still have IP allocations on the subnet. """ message = _("Unable to complete operation on subnet %(subnet_id)s: " "%(reason)s.") def __init__(self, **kwargs): if 'reason' not in kwargs: kwargs['reason'] = _("One or more ports have an IP allocation " "from this subnet") super(SubnetInUse, self).__init__(**kwargs) class SubnetPoolInUse(InUse): """An operational error indicating a subnet pool is still in use. A specialization of the InUse exception indicating an operation failed on a subnet pool because it's still in use. :param subnet_pool_id: The UUID of the subnet pool requested. :param reason: Details on why the operation failed. If None a default reason is used indicating two or more concurrent subnets are allocated. """ message = _("Unable to complete operation on subnet pool " "%(subnet_pool_id)s. %(reason)s.") def __init__(self, **kwargs): if 'reason' not in kwargs: kwargs['reason'] = _("Two or more concurrent subnets allocated") super(SubnetPoolInUse, self).__init__(**kwargs) class PortInUse(InUse): """An operational error indicating a requested port is already attached. A specialization of the InUse exception indicating an operation failed on a port because it already has an attached device. :param port_id: The UUID of the port requested. :param net_id: The UUID of the requested port's network. :param device_id: The UUID of the device already attached to the port. """ message = _("Unable to complete operation on port %(port_id)s " "for network %(net_id)s. Port already has an attached " "device %(device_id)s.") class ServicePortInUse(InUse): """An error indicating a service port can't be deleted. A specialization of the InUse exception indicating a requested service port can't be deleted via the APIs. :param port_id: The UUID of the port requested. :param reason: Details on why the operation failed. """ message = _("Port %(port_id)s cannot be deleted directly via the " "port API: %(reason)s.") class PortBound(InUse): """An operational error indicating a port is already bound. A specialization of the InUse exception indicating an operation can't complete because the port is already bound. :param port_id: The UUID of the port requested. :param vif_type: The VIF type associated with the bound port. :param old_mac: The old MAC address of the port. :param net_mac: The new MAC address of the port. """ message = _("Unable to complete operation on port %(port_id)s, " "port is already bound, port type: %(vif_type)s, " "old_mac %(old_mac)s, new_mac %(new_mac)s.") class MacAddressInUse(InUse): """An network operational error indicating a MAC address is already in use. A specialization of the InUse exception indicating an operation failed on a network because a specified MAC address is already in use on that network. :param net_id: The UUID of the network. :param mac: The requested MAC address that's already in use. """ message = _("Unable to complete operation for network %(net_id)s. " "The mac address %(mac)s is in use.") class InvalidIpForNetwork(BadRequest): """An exception indicating an invalid IP was specified for a network. A specialization of the BadRequest exception indicating a specified IP address is invalid for a network. :param ip_address: The IP address that's invalid on the network. """ message = _("IP address %(ip_address)s is not a valid IP " "for any of the subnets on the specified network.") class InvalidIpForSubnet(BadRequest): """An exception indicating an invalid IP was specified for a subnet. A specialization of the BadRequest exception indicating a specified IP address is invalid for a subnet. :param ip_address: The IP address that's invalid on the subnet. """ message = _("IP address %(ip_address)s is not a valid IP " "for the specified subnet.") class IpAddressInUse(InUse): """An network operational error indicating an IP address is already in use. A specialization of the InUse exception indicating an operation can't complete because an IP address is in use. :param net_id: The UUID of the network. :param ip_address: The IP address that's already in use on the network. """ message = _("Unable to complete operation for network %(net_id)s. " "The IP address %(ip_address)s is in use.") class VlanIdInUse(InUse): """An exception indicating VLAN creation failed because it's already in use. A specialization of the InUse exception indicating network creation failed because a specified VLAN is already in use on the physical network. :param vlan_id: The LVAN ID. :param physical_network: The physical network. """ message = _("Unable to create the network. " "The VLAN %(vlan_id)s on physical network " "%(physical_network)s is in use.") class TunnelIdInUse(InUse): """A network creation failure due to tunnel ID already in use. A specialization of the InUse exception indicating network creation failed because a said tunnel ID is already in use. :param tunnel_id: The ID of the tunnel that's already in use. """ message = _("Unable to create the network. " "The tunnel ID %(tunnel_id)s is in use.") class ResourceExhausted(ServiceUnavailable): """A service unavailable error indicating a resource is exhausted.""" pass class NoNetworkAvailable(ResourceExhausted): """A failure to create a network due to no tenant networks for allocation. A specialization of the ResourceExhausted exception indicating network creation failed because no tenant network are available for allocation. """ message = _("Unable to create the network. " "No tenant network is available for allocation.") class SubnetMismatchForPort(BadRequest): """A bad request error indicating a specified subnet isn't on a port. A specialization of the BadRequest exception indicating a subnet on a port doesn't match a specified subnet. :param port_id: The UUID of the port. :param subnet_id: The UUID of the requested subnet. """ message = _("Subnet on port %(port_id)s does not match " "the requested subnet %(subnet_id)s.") class Invalid(NeutronException): """A generic base class for invalid errors.""" def __init__(self, message=None): self.message = message super(Invalid, self).__init__() class InvalidInput(BadRequest): """A bad request due to invalid input. A specialization of the BadRequest error indicating bad input was specified. :param error_message: Details on the operation that failed due to bad input. """ message = _("Invalid input for operation: %(error_message)s.") class IpAddressGenerationFailure(Conflict): """A conflict error due to no more IP addresses on a said network. :param net_id: The UUID of the network that has no more IP addresses. """ message = _("No more IP addresses available on network %(net_id)s.") class PreexistingDeviceFailure(NeutronException): """A creation error due to an already existing device. An exception indication creation failed due to an already existing device. :param dev_name: The device name that already exists. """ message = _("Creation failed. %(dev_name)s already exists.") class OverQuota(Conflict): """A error due to exceeding quota limits. A specialization of the Conflict exception indicating quota has been exceeded. :param overs: The resources that have exceeded quota. """ message = _("Quota exceeded for resources: %(overs)s.") class InvalidContentType(NeutronException): """An error due to invalid content type. :param content_type: The invalid content type. """ message = _("Invalid content type %(content_type)s.") class ExternalIpAddressExhausted(BadRequest): """An error due to not finding IP addresses on an external network. A specialization of the BadRequest exception indicating no IP addresses can be found on a network. :param net_id: The UUID of the network. """ message = _("Unable to find any IP address on external " "network %(net_id)s.") class TooManyExternalNetworks(NeutronException): """An error due to more than one external networks existing.""" message = _("More than one external network exists.") class InvalidConfigurationOption(NeutronException): """An error due to an invalid configuration option value. :param opt_name: The name of the configuration option that has an invalid value. :param opt_value: The value that's invalid for the configuration option. """ message = _("An invalid value was provided for %(opt_name)s: " "%(opt_value)s.") class NetworkTunnelRangeError(NeutronException): """An error due to an invalid network tunnel range. An exception indicating an invalid network tunnel range was specified. :param tunnel_range: The invalid tunnel range. If specified in the start:end' format, they will be converted automatically. :param error: Additional details on why the range is invalid. """ message = _("Invalid network tunnel range: " "'%(tunnel_range)s' - %(error)s.") def __init__(self, **kwargs): # Convert tunnel_range tuple to 'start:end' format for display if isinstance(kwargs['tunnel_range'], tuple): kwargs['tunnel_range'] = "%d:%d" % kwargs['tunnel_range'] super(NetworkTunnelRangeError, self).__init__(**kwargs) class PolicyInitError(NeutronException): """An error due to policy initialization failure. :param policy: The policy that failed to initialize. :param reason: Details on why the policy failed to initialize. """ message = _("Failed to initialize policy %(policy)s because %(reason)s.") class PolicyCheckError(NeutronException): """An error due to a policy check failure. :param policy: The policy that failed to check. :param reason: Additional details on the failure. """ message = _("Failed to check policy %(policy)s because %(reason)s.") class MultipleExceptions(Exception): """Container for multiple exceptions encountered. The API layer of Neutron will automatically unpack, translate, filter, and combine the inner exceptions in any exception derived from this class. """ def __init__(self, exceptions, *args, **kwargs): """Create a new instance wrapping the exceptions. :param exceptions: The inner exceptions this instance is composed of. :param args: Passed onto parent constructor. :param kwargs: Passed onto parent constructor. """ super(MultipleExceptions, self).__init__(*args, **kwargs) self.inner_exceptions = exceptions class HostMacAddressGenerationFailure(ServiceUnavailable): """MAC address generation failure for a host. :param host: The host MAC address generation failed for. """ message = _("Unable to generate unique mac for host %(host)s.") class NetworkMacAddressGenerationFailure(ServiceUnavailable): """An error related to MAC address generation on a network. :param net_id: The ID of the network MAC address generation failed on. """ message = _("Unable to generate unique mac on network %(net_id)s.") class InvalidServiceType(InvalidInput): """An error due to an invalid service type. :param service_type: The service type that's invalid. """ message = _("Invalid service type: %(service_type)s.") class NetworkVlanRangeError(NeutronException): message = _("Invalid network VLAN range: '%(vlan_range)s' - '%(error)s'.") def __init__(self, **kwargs): # Convert vlan_range tuple to 'start:end' format for display if isinstance(kwargs['vlan_range'], tuple): kwargs['vlan_range'] = "%d:%d" % kwargs['vlan_range'] super(NetworkVlanRangeError, self).__init__(**kwargs) class PhysicalNetworkNameError(NeutronException): message = _("Empty physical network name.") neutron-lib-1.13.0/neutron_lib/exceptions/dvr.py0000666000175100017510000000154613231472055021736 0ustar zuulzuul00000000000000# Copyright (c) 2014 OpenStack Foundation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class DVRMacAddressNotFound(exceptions.NotFound): message = _("Distributed Virtual Router Mac Address for " "host %(host)s does not exist.") neutron-lib-1.13.0/neutron_lib/exceptions/dns.py0000666000175100017510000000240513231472055021722 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class DNSDomainNotFound(exceptions.NotFound): message = _("Domain %(dns_domain)s not found in the external DNS service") class DuplicateRecordSet(exceptions.Conflict): message = _("Name %(dns_name)s is duplicated in the external DNS service") class ExternalDNSDriverNotFound(exceptions.NotFound): message = _("External DNS driver %(driver)s could not be found.") class InvalidPTRZoneConfiguration(exceptions.Conflict): message = _("Value of %(parameter)s has to be multiple of %(number)s, " "with maximum value of %(maximum)s and minimum value of " "%(minimum)s") neutron-lib-1.13.0/neutron_lib/exceptions/placement.py0000666000175100017510000000273413231472055023113 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class PlacementEndpointNotFound(exceptions.NotFound): message = _("Placement API endpoint not found.") class PlacementResourceProviderNotFound(exceptions.NotFound): message = _("Placement resource provider not found %(resource_provider)s.") class PlacementInventoryNotFound(exceptions.NotFound): message = _("Placement inventory not found for resource provider " "%(resource_provider)s, resource class %(resource_class)s.") class PlacementInventoryUpdateConflict(exceptions.Conflict): message = _("Placement inventory update conflict for resource provider " "%(resource_provider)s, resource class %(resource_class)s.") class PlacementAggregateNotFound(exceptions.NotFound): message = _("Aggregate not found for resource provider " "%(resource_provider)s.") neutron-lib-1.13.0/neutron_lib/exceptions/external_net.py0000666000175100017510000000160613231472055023630 0ustar zuulzuul00000000000000# Copyright (c) 2013 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class ExternalNetworkInUse(exceptions.InUse): message = _("External network %(net_id)s cannot be updated to be made " "non-external, since it has existing gateway ports.") neutron-lib-1.13.0/neutron_lib/exceptions/l3.py0000666000175100017510000000525413231472055021461 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions # L3 Exceptions class RouterNotFound(exceptions.NotFound): message = _("Router %(router_id)s could not be found") class RouterInUse(exceptions.InUse): message = _("Router %(router_id)s %(reason)s") def __init__(self, **kwargs): if 'reason' not in kwargs: kwargs['reason'] = "still has ports" super(RouterInUse, self).__init__(**kwargs) class RouterInterfaceNotFound(exceptions.NotFound): message = _("Router %(router_id)s does not have " "an interface with id %(port_id)s") class RouterInterfaceNotFoundForSubnet(exceptions.NotFound): message = _("Router %(router_id)s has no interface " "on subnet %(subnet_id)s") class RouterInterfaceInUseByFloatingIP(exceptions.InUse): message = _("Router interface for subnet %(subnet_id)s on router " "%(router_id)s cannot be deleted, as it is required " "by one or more floating IPs.") class FloatingIPNotFound(exceptions.NotFound): message = _("Floating IP %(floatingip_id)s could not be found") class ExternalGatewayForFloatingIPNotFound(exceptions.NotFound): message = _("External network %(external_network_id)s is not reachable " "from subnet %(subnet_id)s. Therefore, cannot associate " "Port %(port_id)s with a Floating IP.") class FloatingIPPortAlreadyAssociated(exceptions.InUse): message = _("Cannot associate floating IP %(floating_ip_address)s " "(%(fip_id)s) with port %(port_id)s " "using fixed IP %(fixed_ip)s, as that fixed IP already " "has a floating IP on external network %(net_id)s.") class RouterExternalGatewayInUseByFloatingIp(exceptions.InUse): message = _("Gateway cannot be updated for router %(router_id)s, since a " "gateway to external network %(net_id)s is required by one or " "more floating IPs.") class RouterInterfaceAttachmentConflict(exceptions.Conflict): message = _("Error %(reason)s while attempting the operation.") neutron-lib-1.13.0/neutron_lib/exceptions/allowedaddresspairs.py0000666000175100017510000000252413231472055025174 0ustar zuulzuul00000000000000# Copyright 2013 VMware, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class AllowedAddressPairsMissingIP(exceptions.InvalidInput): message = _("AllowedAddressPair must contain ip_address") class AddressPairAndPortSecurityRequired(exceptions.Conflict): message = _("Port Security must be enabled in order to have allowed " "address pairs on a port.") class DuplicateAddressPairInRequest(exceptions.InvalidInput): message = _("Request contains duplicate address pair: " "mac_address %(mac_address)s ip_address %(ip_address)s.") class AllowedAddressPairExhausted(exceptions.BadRequest): message = _("The number of allowed address pair " "exceeds the maximum %(quota)s.") neutron-lib-1.13.0/neutron_lib/exceptions/multiprovidernet.py0000666000175100017510000000170713231472055024556 0ustar zuulzuul00000000000000# Copyright (c) 2013 OpenStack Foundation. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class SegmentsSetInConjunctionWithProviders(exceptions.InvalidInput): message = _("Segments and provider values cannot both be set.") class SegmentsContainDuplicateEntry(exceptions.InvalidInput): message = _("Duplicate segment entry in request.") neutron-lib-1.13.0/neutron_lib/exceptions/flavors.py0000666000175100017510000000362213231472055022614 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class FlavorNotFound(exceptions.NotFound): message = _("Flavor %(flavor_id)s could not be found.") class FlavorInUse(exceptions.InUse): message = _("Flavor %(flavor_id)s is used by some service instance.") class ServiceProfileNotFound(exceptions.NotFound): message = _("Service Profile %(sp_id)s could not be found.") class ServiceProfileInUse(exceptions.InUse): message = _("Service Profile %(sp_id)s is used by some service instance.") class FlavorServiceProfileBindingExists(exceptions.Conflict): message = _("Service Profile %(sp_id)s is already associated " "with flavor %(fl_id)s.") class FlavorServiceProfileBindingNotFound(exceptions.NotFound): message = _("Service Profile %(sp_id)s is not associated " "with flavor %(fl_id)s.") class ServiceProfileDriverNotFound(exceptions.NotFound): message = _("Service Profile driver %(driver)s could not be found.") class ServiceProfileEmpty(exceptions.InvalidInput): message = _("Service Profile needs either a driver or metainfo.") class FlavorDisabled(exceptions.ServiceUnavailable): message = _("Flavor is not enabled.") class ServiceProfileDisabled(exceptions.ServiceUnavailable): message = _("Service Profile is not enabled.") neutron-lib-1.13.0/neutron_lib/exceptions/port_security.py0000666000175100017510000000207613231472055024055 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class PortSecurityPortHasSecurityGroup(exceptions.InUse): message = _("Port has security group associated. Cannot disable port " "security or IP address until security group is removed.") class PortSecurityAndIPRequiredForSecurityGroups(exceptions.InvalidInput): message = _("Port security must be enabled and port must have an IP " "address in order to use security groups.") neutron-lib-1.13.0/neutron_lib/exceptions/availability_zone.py0000666000175100017510000000135213231472055024643 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class AvailabilityZoneNotFound(exceptions.NotFound): message = _("AvailabilityZone %(availability_zone)s could not be found.") neutron-lib-1.13.0/neutron_lib/exceptions/metering.py0000666000175100017510000000226013231472055022747 0ustar zuulzuul00000000000000# Copyright (C) 2013 eNovance SAS # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class MeteringLabelNotFound(exceptions.NotFound): message = _("Metering label '%(label_id)s' does not exist.") class DuplicateMeteringRuleInPost(exceptions.InUse): message = _("Duplicate Metering Rule in POST.") class MeteringLabelRuleNotFound(exceptions.NotFound): message = _("Metering label rule '%(rule_id)s' does not exist.") class MeteringLabelRuleOverlaps(exceptions.Conflict): message = _("Metering label rule with remote_ip_prefix " "'%(remote_ip_prefix)s' overlaps another.") neutron-lib-1.13.0/neutron_lib/exceptions/l3_ext_ha_mode.py0000666000175100017510000000331013231472055024004 0ustar zuulzuul00000000000000# Copyright (C) 2014 eNovance SAS # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class MaxVRIDAllocationTriesReached(exceptions.NeutronException): message = _("Failed to allocate a VRID in the network %(network_id)s " "for the router %(router_id)s after %(max_tries)s tries.") class NoVRIDAvailable(exceptions.Conflict): message = _("No more Virtual Router Identifier (VRID) available when " "creating router %(router_id)s. The limit of number " "of HA Routers per tenant is 254.") class HANetworkConcurrentDeletion(exceptions.Conflict): message = _("Network for tenant %(tenant_id)s concurrently deleted.") class HANetworkCIDRNotValid(exceptions.NeutronException): message = _("The HA Network CIDR specified in the configuration file " "isn't valid; %(cidr)s.") class HAMaximumAgentsNumberNotValid(exceptions.NeutronException): message = _("max_l3_agents_per_router %(max_agents)s config parameter " "is not valid as it cannot be negative. It must be 1 or " "greater. Alternatively, it can be 0 to mean unlimited.") neutron-lib-1.13.0/neutron_lib/exceptions/address_scope.py0000666000175100017510000000224013231472055023751 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class AddressScopeNotFound(exceptions.NotFound): message = _("Address scope %(address_scope_id)s could not be found.") class AddressScopeInUse(exceptions.InUse): message = _("Unable to complete operation on " "address scope %(address_scope_id)s. There are one or more " "subnet pools in use on the address scope.") class AddressScopeUpdateError(exceptions.BadRequest): message = _("Unable to update address scope %(address_scope_id)s : " "%(reason)s.") neutron-lib-1.13.0/neutron_lib/exceptions/agent.py0000666000175100017510000000211113231472055022226 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class AgentNotFound(exceptions.NotFound): message = _("Agent %(id)s could not be found.") class AgentNotFoundByTypeHost(exceptions.NotFound): message = _("Agent with agent_type=%(agent_type)s and host=%(host)s " "could not be found.") class MultipleAgentFoundByTypeHost(exceptions.Conflict): message = _("Multiple agents with agent_type=%(agent_type)s and " "host=%(host)s found.") neutron-lib-1.13.0/neutron_lib/exceptions/extraroute.py0000666000175100017510000000234213231472055023340 0ustar zuulzuul00000000000000# Copyright 2013, Nachi Ueno, NTT MCL, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class InvalidRoutes(exceptions.InvalidInput): message = _("Invalid format for routes: %(routes)s, %(reason)s") class RouterInterfaceInUseByRoute(exceptions.InUse): message = _("Router interface for subnet %(subnet_id)s on router " "%(router_id)s cannot be deleted, as it is required " "by one or more routes.") class RoutesExhausted(exceptions.BadRequest): message = _("Unable to complete operation for %(router_id)s. " "The number of routes exceeds the maximum %(quota)s.") neutron-lib-1.13.0/neutron_lib/exceptions/vlantransparent.py0000666000175100017510000000160613231472055024362 0ustar zuulzuul00000000000000# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class VlanTransparencyDriverError(exceptions.NeutronException): """Vlan Transparency not supported by all mechanism drivers.""" message = _("Backend does not support VLAN Transparency.") neutron-lib-1.13.0/neutron_lib/exceptions/firewall_v2.py0000666000175100017510000001420413231472055023352 0ustar zuulzuul00000000000000# Copyright (c) 2016 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class FirewallGroupNotFound(exceptions.NotFound): message = _("Firewall group %(firewall_id)s could not be found.") class FirewallGroupInUse(exceptions.InUse): message = _("Firewall group %(firewall_id)s is still active.") class FirewallGroupInPendingState(exceptions.Conflict): message = _("Operation cannot be performed since associated firewall " "group %(firewall_id)s is in %(pending_state)s.") class FirewallGroupPortInvalid(exceptions.Conflict): message = _("Port %(port_id)s of firewall group is invalid.") class FirewallGroupPortInvalidProject(exceptions.Conflict): message = _("Operation cannot be performed as port %(port_id)s " "is in an invalid project %(project_id)s.") class FirewallGroupPortInUse(exceptions.InUse): message = _("Port(s) %(port_ids)s provided already associated with " "other firewall group(s).") class FirewallPolicyNotFound(exceptions.NotFound): message = _("Firewall policy %(firewall_policy_id)s could not be found.") class FirewallPolicyInUse(exceptions.InUse): message = _("Firewall policy %(firewall_policy_id)s is being used.") class FirewallPolicyConflict(exceptions.NotFound): """FWaaS exception raised for firewall policy conflict Raised when user tries to use another project's unshared policy. """ message = _("Operation cannot be performed since firewall policy " "%(firewall_policy_id)s for your project could not be found. " "Please confirm if the firewall policy exists and is shared.") class FirewallRuleSharingConflict(exceptions.NotFound): """FWaaS exception for sharing policies Raised when shared policy uses unshared rules. """ message = _("Operation cannot be performed since firewall policy " "%(firewall_policy_id)s could not find the firewall rule " "%(firewall_rule_id)s. Please confirm if the firewall rule " "exists and is shared.") class FirewallPolicySharingConflict(exceptions.Conflict): """FWaaS exception raised for sharing policies Raised if policy is 'shared' but its associated rules are not. """ message = _("Operation cannot be performed. Before sharing firewall " "policy %(firewall_policy_id)s, share associated firewall " "rule %(firewall_rule_id)s.") class FirewallRuleNotFound(exceptions.NotFound): message = _("Firewall rule %(firewall_rule_id)s could not be found.") class FirewallRuleInUse(exceptions.InUse): message = _("Firewall rule %(firewall_rule_id)s is being used.") class FirewallRuleNotAssociatedWithPolicy(exceptions.InvalidInput): message = _("Firewall rule %(firewall_rule_id)s is not associated " "with firewall policy %(firewall_policy_id)s.") class FirewallRuleInvalidProtocol(exceptions.InvalidInput): message = _("Protocol %(protocol)s is not supported. " "Only protocol values %(values)s and their integer " "representation (0 to 255) are supported.") class FirewallRuleInvalidAction(exceptions.InvalidInput): message = _("Action %(action)s is not supported. " "Only action values %(values)s are supported.") class FirewallRuleInvalidICMPParameter(exceptions.InvalidInput): message = _("%(param)s are not allowed when protocol " "is set to ICMP.") class FirewallRuleWithPortWithoutProtocolInvalid(exceptions.InvalidInput): message = _("Source/destination port requires a protocol.") class FirewallRuleInvalidPortValue(exceptions.InvalidInput): message = _("Invalid value for port %(port)s.") class FirewallRuleInfoMissing(exceptions.InvalidInput): message = _("Missing rule info argument for insert/remove " "rule operation.") class FirewallIpAddressConflict(exceptions.InvalidInput): message = _("Invalid input - IP addresses do not agree with IP Version.") class FirewallInternalDriverError(exceptions.NeutronException): """FWaaS exception for all driver errors On any failure or exception in the driver, driver should log it and raise this exception to the agent """ message = _("%(driver)s: Internal driver error.") class FirewallRuleConflict(exceptions.Conflict): """FWaaS rule conflict exception Occurs when admin policy tries to use another project's rule that is not shared. """ message = _("Operation cannot be performed since firewall rule " "%(firewall_rule_id)s is not shared and belongs to " "another project %(project_id)s.") class FirewallRuleAlreadyAssociated(exceptions.Conflict): """FWaaS exception for an already associated rule Occurs when there is an attempt to assign a rule to a policy that the rule is already associated with. """ message = _("Operation cannot be performed since firewall rule " "%(firewall_rule_id)s is already associated with firewall " "policy %(firewall_policy_id)s.") class FirewallGroupCannotRemoveDefault(exceptions.InUse): message = _("Deleting default firewall group not allowed.") class FirewallGroupCannotUpdateDefault(exceptions.InUse): message = _("Updating default firewall group not allowed.") class FirewallGroupDefaultAlreadyExists(exceptions.InUse): """Default firewall group conflict exception Occurs when a user creates firewall group named 'default'. """ message = _("Default firewall group already exists. 'default' is the " "reserved name for firewall group.") neutron-lib-1.13.0/neutron_lib/exceptions/firewall_v1.py0000666000175100017510000001150713231472055023354 0ustar zuulzuul00000000000000# Copyright 2013 Big Switch Networks, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron_lib._i18n import _ from neutron_lib import exceptions class FirewallNotFound(exceptions.NotFound): message = _("Firewall %(firewall_id)s could not be found.") class FirewallInUse(exceptions.InUse): message = _("Firewall %(firewall_id)s is still active.") class FirewallInPendingState(exceptions.Conflict): message = _("Operation cannot be performed since associated firewall " "%(firewall_id)s is in %(pending_state)s.") class FirewallPolicyNotFound(exceptions.NotFound): message = _("Firewall policy %(firewall_policy_id)s could not be found.") class FirewallPolicyInUse(exceptions.InUse): message = _("Firewall policy %(firewall_policy_id)s is being used.") class FirewallPolicyConflict(exceptions.Conflict): """FWaaS exception raised for firewall policy conflict Raised when user tries to use another project's unshared policy. """ message = _("Operation cannot be performed since firewall policy " "%(firewall_policy_id)s is not shared and does not belong to " "your project.") class FirewallRuleSharingConflict(exceptions.Conflict): """FWaaS exception raised for conflict with shared rules Raised if shared policy is created/updated with unshared rules. """ message = _("Operation cannot be performed since firewall policy " "%(firewall_policy_id)s is shared but firewall rule " "%(firewall_rule_id)s is not shared.") class FirewallPolicySharingConflict(exceptions.Conflict): """FWaaS exception raised for shared policies Raised if policy is shared without sharing its rules. """ message = _("Operation cannot be performed. Before sharing firewall " "policy %(firewall_policy_id)s, share associated firewall " "rule %(firewall_rule_id)s.") class FirewallRuleNotFound(exceptions.NotFound): message = _("Firewall rule %(firewall_rule_id)s could not be found.") class FirewallRuleInUse(exceptions.InUse): message = _("Firewall rule %(firewall_rule_id)s is being used.") class FirewallRuleNotAssociatedWithPolicy(exceptions.InvalidInput): message = _("Firewall rule %(firewall_rule_id)s is not associated " "with firewall policy %(firewall_policy_id)s.") class FirewallRuleInvalidProtocol(exceptions.InvalidInput): message = _("Firewall rule protocol %(protocol)s is not supported. " "Only protocol values %(values)s and their integer " "representation (0 to 255) are supported.") class FirewallRuleInvalidAction(exceptions.InvalidInput): message = _("Firewall rule action %(action)s is not supported. " "Only action values %(values)s are supported.") class FirewallRuleInvalidICMPParameter(exceptions.InvalidInput): message = _("%(param)s are not allowed when protocol " "is set to ICMP.") class FirewallRuleWithPortWithoutProtocolInvalid(exceptions.InvalidInput): message = _("Source/destination port requires a protocol.") class FirewallRuleInvalidPortValue(exceptions.InvalidInput): message = _("Invalid value for port %(port)s.") class FirewallRuleInfoMissing(exceptions.InvalidInput): message = _("Missing rule info argument for insert/remove " "rule operation.") class FirewallIpAddressConflict(exceptions.InvalidInput): message = _("Invalid input - IP addresses do not agree with IP Version.") class FirewallInternalDriverError(exceptions.NeutronException): """FWaaS exception for all driver errors On any failure or exception in the driver, driver should log it and raise this exception to the agent. """ message = _("%(driver)s: Internal driver error.") class FirewallRuleConflict(exceptions.Conflict): """FWaaS rule conflict exception Occurs when admin policy tries to use another project's rule that is not shared. """ message = _("Operation cannot be performed since firewall rule " "%(firewall_rule_id)s is not shared and belongs to " "another project %(project_id)s.") class FirewallRouterInUse(exceptions.InUse): message = _("Router(s) %(router_ids)s provided already associated with " "other firewall(s).") neutron-lib-1.13.0/neutron_lib/services/0000775000175100017510000000000013231472430020220 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/services/__init__.py0000666000175100017510000000000013231472055022324 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/services/qos/0000775000175100017510000000000013231472430021022 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/services/qos/__init__.py0000666000175100017510000000000013231472055023126 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/services/qos/constants.py0000666000175100017510000000357413231472055023426 0ustar zuulzuul00000000000000# Copyright (c) 2015 Red Hat Inc. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. RULE_TYPE_BANDWIDTH_LIMIT = 'bandwidth_limit' RULE_TYPE_DSCP_MARKING = 'dscp_marking' RULE_TYPE_MINIMUM_BANDWIDTH = 'minimum_bandwidth' VALID_RULE_TYPES = [RULE_TYPE_BANDWIDTH_LIMIT, RULE_TYPE_DSCP_MARKING, RULE_TYPE_MINIMUM_BANDWIDTH, ] # Names of rules' attributes MAX_KBPS = "max_kbps" MAX_BURST = "max_burst_kbps" MIN_KBPS = "min_kbps" DIRECTION = "direction" DSCP_MARK = "dscp_mark" QOS_POLICY_ID = 'qos_policy_id' QOS_PLUGIN = 'qos_plugin' # NOTE(slaweq): Value used to calculate burst value for egress bandwidth limit # if burst is not given by user. In such case burst value will be calculated # as 80% of bw_limit to ensure that at least limits for TCP traffic will work # fine. DEFAULT_BURST_RATE = 0.8 # Method names for QoSDriver PRECOMMIT_POSTFIX = '_precommit' CREATE_POLICY = 'create_policy' CREATE_POLICY_PRECOMMIT = CREATE_POLICY + PRECOMMIT_POSTFIX UPDATE_POLICY = 'update_policy' UPDATE_POLICY_PRECOMMIT = UPDATE_POLICY + PRECOMMIT_POSTFIX DELETE_POLICY = 'delete_policy' DELETE_POLICY_PRECOMMIT = DELETE_POLICY + PRECOMMIT_POSTFIX QOS_CALL_METHODS = ( CREATE_POLICY, CREATE_POLICY_PRECOMMIT, UPDATE_POLICY, UPDATE_POLICY_PRECOMMIT, DELETE_POLICY, DELETE_POLICY_PRECOMMIT, ) neutron-lib-1.13.0/neutron_lib/services/qos/base.py0000666000175100017510000001443713231472055022324 0ustar zuulzuul00000000000000# Copyright 2016 Hewlett Packard Enterprise Development Company, LP # Copyright 2016 Red Hat Inc. # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_log import log as logging from neutron_lib.api import validators as lib_validators from neutron_lib.callbacks import events from neutron_lib.callbacks import registry from neutron_lib.services.qos import constants LOG = logging.getLogger(__name__) @registry.has_registry_receivers class DriverBase(object): def __init__(self, name, vif_types, vnic_types, supported_rules, requires_rpc_notifications=False): """Instantiate a qos driver. :param name: driver name. :param vif_types: list of interfaces (VIFs) supported. :param vnic_types: list of vnic types supported. :param supported_rules: dict of supported rules. :param requires_rpc_notifications: indicates if this driver expects rpc push notifications to be sent from the driver. """ self.name = name self.vif_types = vif_types self.vnic_types = vnic_types self.supported_rules = supported_rules self.requires_rpc_notifications = requires_rpc_notifications @registry.receives(constants.QOS_PLUGIN, [events.AFTER_INIT]) def _register(self, resource, event, trigger, **kwargs): if self.is_loaded: # trigger is the QosServiceDriverManager trigger.register_driver(self) def is_loaded(self): """True if the driver is active for the Neutron Server. Implement this property to determine if your driver is actively configured for this Neutron Server deployment. """ return True def is_vif_type_compatible(self, vif_type): """True if the driver is compatible with the VIF type.""" return vif_type in self.vif_types def is_vnic_compatible(self, vnic_type): """True if the driver is compatible with the specific VNIC type.""" return vnic_type in self.vnic_types def is_rule_supported(self, rule): supported_parameters = self.supported_rules.get(rule.rule_type) if not supported_parameters: LOG.debug("Rule type %(rule_type)s is not supported by " "%(driver_name)s", {'rule_type': rule.rule_type, 'driver_name': self.name}) return False for parameter, validators in supported_parameters.items(): parameter_value = rule.get(parameter) for validator_type, validator_data in validators.items(): validator_function = lib_validators.get_validator( validator_type) validate_result = validator_function(parameter_value, validator_data) # NOTE(slaweq): validator functions returns None if data is # valid or string with reason why data is not valid if validate_result: LOG.debug("Parameter %(parameter)s=%(value)s in " "rule type %(rule_type)s is not " "supported by %(driver_name)s. " "Validate result: %(validate_result)s", {'parameter': parameter, 'value': parameter_value, 'rule_type': rule.rule_type, 'driver_name': self.name, 'validate_result': validate_result}) return False return True def create_policy(self, context, policy): """Create policy invocation. This method can be implemented by the specific driver subclass to update the backend where necessary with the specific policy information. :param context: current running context information :param policy: a QoSPolicy object being created, which will have no rules. """ def create_policy_precommit(self, context, policy): """Create policy precommit. This method can be implemented by the specific driver subclass to handle the precommit event of a policy that is being created. :param context: current running context information :param policy: a QoSPolicy object being created, which will have no rules. """ def update_policy(self, context, policy): """Update policy invocation. This method can be implemented by the specific driver subclass to update the backend where necessary. :param context: current running context information :param policy: a QoSPolicy object being updated. """ def update_policy_precommit(self, context, policy): """Update policy precommit. This method can be implemented by the specific driver subclass to handle update precommit event of a policy that is being updated. :param context: current running context information :param policy: a QoSPolicy object being updated. """ def delete_policy(self, context, policy): """Delete policy invocation. This method can be implemented by the specific driver subclass to delete the backend policy where necessary. :param context: current running context information :param policy: a QoSPolicy object being deleted """ def delete_policy_precommit(self, context, policy): """Delete policy precommit. This method can be implemented by the specific driver subclass to handle delete precommit event of a policy that is being deleted. :param context: current running context information :param policy: a QoSPolicy object being deleted """ neutron-lib-1.13.0/neutron_lib/services/base.py0000666000175100017510000000512213231472055021511 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import abc import six class WorkerBase(object): @property def _workers(self): try: return self.__workers except AttributeError: self.__workers = [] return self.__workers def get_workers(self): """Returns a collection NeutronWorker instances needed by this service. """ return list(self._workers) def add_worker(self, worker): """Adds NeutronWorker needed for this service If a object needs to define workers thread/processes outside of API/RPC workers then it will call this method to register worker. Should be called on initialization stage before running services """ self._workers.append(worker) def add_workers(self, workers): """Adds NeutronWorker list needed for this service The same as add_worker but adds a list of workers """ self._workers.extend(workers) @six.add_metaclass(abc.ABCMeta) class ServicePluginBase(WorkerBase): """Define base interface for any Advanced Service plugin.""" supported_extension_aliases = [] @classmethod def __subclasshook__(cls, klass): """Checking plugin class. The __subclasshook__ method is a class method that will be called every time a class is tested using issubclass(klass, ServicePluginBase). In that case, it will check that every method marked with the abstractmethod decorator is provided by the plugin class. """ if not cls.__abstractmethods__: return NotImplemented for method in cls.__abstractmethods__: if any(method in base.__dict__ for base in klass.__mro__): continue return NotImplemented return True @abc.abstractmethod def get_plugin_type(self): """Return one of predefined service types. """ pass @abc.abstractmethod def get_plugin_description(self): """Return string description of the plugin.""" pass neutron-lib-1.13.0/neutron_lib/objects/0000775000175100017510000000000013231472430020026 5ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/objects/exceptions.py0000666000175100017510000000512213231472055022566 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_utils import reflection from neutron_lib._i18n import _ from neutron_lib import exceptions class NeutronObjectUpdateForbidden(exceptions.NeutronException): message = _("Unable to update the following object fields: %(fields)s") class NeutronDbObjectDuplicateEntry(exceptions.Conflict): message = _("Failed to create a duplicate %(object_type)s: " "for attribute(s) %(attributes)s with value(s) %(values)s") def __init__(self, object_class, db_exception): super(NeutronDbObjectDuplicateEntry, self).__init__( object_type=reflection.get_class_name(object_class, fully_qualified=False), attributes=db_exception.columns, values=db_exception.value) class NeutronDbObjectNotFoundByModel(exceptions.NotFound): message = _("NeutronDbObject not found by model %(model)s.") class NeutronPrimaryKeyMissing(exceptions.BadRequest): message = _("For class %(object_type)s missing primary keys: " "%(missing_keys)s") def __init__(self, object_class, missing_keys): super(NeutronPrimaryKeyMissing, self).__init__( object_type=reflection.get_class_name(object_class, fully_qualified=False), missing_keys=missing_keys ) class NeutronRangeConstrainedIntegerInvalidLimit(exceptions.NeutronException): message = _("Incorrect range limits specified: " "start = %(start)s, end = %(end)s") class NeutronSyntheticFieldMultipleForeignKeys(exceptions.NeutronException): message = _("Synthetic field %(field)s shouldn't have more than one " "foreign key") class NeutronSyntheticFieldsForeignKeysNotFound(exceptions.NeutronException): message = _("%(child)s does not define a foreign key for %(parent)s") class NeutronObjectValidatorException(exceptions.NeutronException): message = _("Synthetic field(s) %(fields)s undefined, misspelled, or " "otherwise invalid") neutron-lib-1.13.0/neutron_lib/objects/__init__.py0000666000175100017510000000000013231472055022132 0ustar zuulzuul00000000000000neutron-lib-1.13.0/neutron_lib/version.py0000666000175100017510000000126213231472055020442 0ustar zuulzuul00000000000000# Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import pbr.version version_info = pbr.version.VersionInfo('neutron-lib') neutron-lib-1.13.0/neutron_lib/_policy.py0000666000175100017510000000427313231472055020420 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_config import cfg from oslo_policy import policy _ROLE_ENFORCER = None _ADMIN_CTX_POLICY = 'context_is_admin' _ADVSVC_CTX_POLICY = 'context_is_advsvc' def init(conf=cfg.CONF, policy_file=None): """Initialize the global enforcer if not already initialized. Initialize the global enforcer (and load its rules) if not already initialized; otherwise this is a no-op. :param conf: The configuration to initialize the global enforcer with. Defaults to oslo_config.cfg.CONF. :param policy_file: The policy file to initialize the global enforcer with. :returns: None. """ global _ROLE_ENFORCER if not _ROLE_ENFORCER: _ROLE_ENFORCER = policy.Enforcer(conf, policy_file=policy_file) _ROLE_ENFORCER.load_rules(True) def _check_rule(context, rule): init() # the target is user-self credentials = context.to_policy_values() if rule not in _ROLE_ENFORCER.rules: return False return _ROLE_ENFORCER.enforce(rule, credentials, credentials) def check_is_admin(context): """Verify context has admin rights according to the global policy settings. :param context: The context object. :returns: True if the context has admin rights (as per the global enforcer) and False otherwise. """ return _check_rule(context, _ADMIN_CTX_POLICY) def check_is_advsvc(context): """Verify context has advsvc rights according to global policy settings. :param context: The context object. :returns: True if the context has advsvc rights (as per the global enforcer) and False otherwise. """ return _check_rule(context, _ADVSVC_CTX_POLICY) neutron-lib-1.13.0/neutron_lib/worker.py0000666000175100017510000000512013231472055020263 0ustar zuulzuul00000000000000# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_service import service from neutron_lib.callbacks import events from neutron_lib.callbacks import registry from neutron_lib.callbacks import resources class BaseWorker(service.ServiceBase): """Partial implementation of the ServiceBase ABC. Subclasses will still need to add the other abstract methods defined in service.ServiceBase. See oslo_service for more details. If a plugin needs to handle synchronization with the Neutron database and do this only once instead of in every API worker, for instance, it would define a BaseWorker class and the plugin would have get_workers return an array of BaseWorker instances. For example: .. code-block:: python class MyPlugin(...): def get_workers(self): return [MyPluginWorker()] class MyPluginWorker(BaseWorker): def start(self): super(MyPluginWorker, self).start() do_sync() """ # default class value for case when super().__init__ is not called _default_process_count = 1 def __init__(self, worker_process_count=_default_process_count): """Initialize a worker instance. :param worker_process_count: Defines how many processes to spawn for worker: 0 - spawn 1 new worker thread, 1..N - spawn N new worker processes """ self._worker_process_count = worker_process_count @property def worker_process_count(self): """The worker's process count. :returns: The number of processes to spawn for this worker. """ return self._worker_process_count def start(self): """Start the worker. If worker_process_count is greater than 0, a callback notification is sent. Subclasses should call this method before doing their own start() work. :returns: None """ if self.worker_process_count > 0: registry.notify(resources.PROCESS, events.AFTER_INIT, self.start) neutron-lib-1.13.0/HACKING.rst0000666000175100017510000000165613231472055015670 0ustar zuulzuul00000000000000neutron-lib Style Commandments ============================== - Step 1: Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/ - Step 2: Read on Neutron Library Specific Commandments ------------------------------------- - [N521] Validate that jsonutils module is used instead of json - [N524] Prevent use of deprecated contextlib.nested. - [N525] Python 3: Do not use xrange. - [N526] Python 3: do not use basestring. - [N527] Python 3: do not use dict.iteritems. - [N529] Method's default argument shouldn't be mutable - [N530] No importing of neutron; should be ignored in neutron itself - [N532] Validate that LOG.warning is used instead of LOG.warn. The latter is deprecated. - [N534] Exception messages should be translated - [N535] Usage of Python eventlet module not allowed - [N536] Use assertIsNone/assertIsNotNone rather than assertEqual/assertIs to check None values. - [N537] Don't translate logs. neutron-lib-1.13.0/README.rst0000666000175100017510000000113213231472055015546 0ustar zuulzuul00000000000000======================== Team and repository tags ======================== .. image:: https://governance.openstack.org/tc/badges/neutron-lib.svg :target: https://governance.openstack.org/tc/reference/tags/index.html .. Change things from this point on =============================== neutron-lib =============================== Neutron shared routines and utilities * Free software: Apache license * Documentation: https://docs.openstack.org/neutron-lib/latest/ * Source: http://git.openstack.org/cgit/openstack/neutron-lib * Bugs: http://bugs.launchpad.net/neutron Features -------- * TODO neutron-lib-1.13.0/.testr.conf0000666000175100017510000000056613231472055016157 0ustar zuulzuul00000000000000[DEFAULT] test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ ${PYTHON:-python} -m subunit.run discover -t ./ \ ${OS_TEST_PATH:-./neutron_lib/tests/unit} $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE test_list_option=--list neutron-lib-1.13.0/releasenotes/0000775000175100017510000000000013231472430016546 5ustar zuulzuul00000000000000neutron-lib-1.13.0/releasenotes/notes/0000775000175100017510000000000013231472430017676 5ustar zuulzuul00000000000000neutron-lib-1.13.0/releasenotes/notes/add-vnic-virtio-forwarder-portbinding-f7f87dfbef456ed1.yaml0000666000175100017510000000053313231472055032554 0ustar zuulzuul00000000000000--- features: - The ``VNIC_VIRTIO_FORWARDER`` VNIC type has been added to portbindings. This VNIC type is intended to request a low-latency virtio port inside the instance, likely backed by hardware acceleration. Currently the Agilio OVS external plugin provides support for this, with support from other vendors following soon. neutron-lib-1.13.0/releasenotes/notes/agent_extensions-2b497ff33c6dc3e8.yaml0000666000175100017510000000016513231472055026455 0ustar zuulzuul00000000000000--- features: - Neutron agent extension abstract classes are moved from ``neutron.agent`` to ``neutron_lib.agent`` neutron-lib-1.13.0/releasenotes/notes/.placeholder0000666000175100017510000000000013231472055022154 0ustar zuulzuul00000000000000neutron-lib-1.13.0/releasenotes/notes/rehome-plugin-utils-39e3f839c0538de9.yaml0000666000175100017510000000043013231472055026655 0ustar zuulzuul00000000000000--- features: - The publically consumed API's from ``neutron.plugins.common.utils`` are now available in ``neutron_lib.plugins.utils``. - The ``NetworkVlanRangeError`` and ``PhysicalNetworkNameError`` exception classes are now available in ``neutron_lib.exceptions``. neutron-lib-1.13.0/releasenotes/notes/fwaas_converters_validators-c310900b4386146e.yaml0000666000175100017510000000027013231472055030355 0ustar zuulzuul00000000000000--- features: - Added the converter ``convert_string_to_case_insensitive``. - Added the converter ``convert_to_protocol``. - Added the validator ``validate_port_range_or_none``. neutron-lib-1.13.0/releasenotes/notes/remove-hacking-check-n523-014d163a5ae23adb.yaml0000666000175100017510000000016613231472055027501 0ustar zuulzuul00000000000000--- other: - The deprecated ``N523`` hacking check that ensures proper oslo namespace imports has been removed. neutron-lib-1.13.0/releasenotes/notes/rehome-shared-const-d847b2e190122425.yaml0000666000175100017510000000013513231472055026424 0ustar zuulzuul00000000000000--- features: - The ``SHARED`` constant is now available in ``neutron_lib.constants``. neutron-lib-1.13.0/releasenotes/notes/rehome-ml2-mechdriver-cc86d3a2fe4c2822.yaml0000666000175100017510000000022513231472055027156 0ustar zuulzuul00000000000000--- features: - The ML2 ``MechanismDriver`` class from ``neutron.plugins.ml2.driver_api`` is now available in ``neutron_lib.plugins.ml2.api``. neutron-lib-1.13.0/releasenotes/notes/trunk-api-08bfdcdd80f7e666.yaml0000666000175100017510000000007113231472055025067 0ustar zuulzuul00000000000000--- features: - API reference for the trunk extension. neutron-lib-1.13.0/releasenotes/notes/add-directory-is-loaded-e9da5b65824dddad.yaml0000666000175100017510000000024413231472055027621 0ustar zuulzuul00000000000000--- features: - | Introduced neutron_lib.plugins.directory.is_loaded(). This can be used in lieu of len(plugins()) or bool(plugins()) or plugins() alone. neutron-lib-1.13.0/releasenotes/notes/rehome-core-api-defs-390735ff3bd5d2ab.yaml0000666000175100017510000000022513231472055026754 0ustar zuulzuul00000000000000--- features: - The ``network``, ``port``, ``subnet`` and ``subnetpool`` API definitions are now available in ``neutron_lib.api.definitions``. neutron-lib-1.13.0/releasenotes/notes/rehome-revisionifmatch-apidef-574ac0a930cdaf3f.yaml0000666000175100017510000000022013231472055031023 0ustar zuulzuul00000000000000--- features: - The ``revision-if-match`` extension's API definition is now available in ``neutron_lib.api.definitions.revisionifmatch``. neutron-lib-1.13.0/releasenotes/notes/rehome-svctype-apidef-9002b2e2bcbeec8e.yaml0000666000175100017510000000020713231472055027412 0ustar zuulzuul00000000000000--- features: - The ``service-type`` extension's API definition is now available in ``neutron_lib.api.definitions.servicetype``. neutron-lib-1.13.0/releasenotes/notes/add-ipinip-protocol-ab9287f9b698f34c.yaml0000666000175100017510000000021313231472055026702 0ustar zuulzuul00000000000000--- features: - | Adds the IP-in-IP protocol under the name ``ipip`` to the list of protocols supported in security group rules. neutron-lib-1.13.0/releasenotes/notes/rehome-az-apidef-1e63cbd2359994fa.yaml0000666000175100017510000000074613231472055026140 0ustar zuulzuul00000000000000--- features: - The ``availability_zone`` extension's API definition is now available in ``neutron_lib.api.definitions.availability_zone``. - A new API validation type ``type:availability_zone_hint_list`` has been added and validates a list of availability zone hints. - Exceptions for the ``availability_zone`` are now available in ``neutron_lib.exceptions.availability_zone``. - The constant ``AZ_HINTS_DB_LEN`` has been added to ``neutron_lib.db.constants``. neutron-lib-1.13.0/releasenotes/notes/rehome-ipv6pdprefix-const-d3b39992df4adef8.yaml0000666000175100017510000000016113231472055030210 0ustar zuulzuul00000000000000--- features: - The ``PROVISIONAL_IPV6_PD_PREFIX`` constant is now available in ``neutron_lib.constants``. neutron-lib-1.13.0/releasenotes/notes/expose-and-enhance-callback-api-714cce65a3c44fe7.yaml0000666000175100017510000000133313231472055031032 0ustar zuulzuul00000000000000--- features: - Neutron's callback API found in ``neutron.callbacks.*`` is now exposed in ``neutron_lib.callbacks.*``. In addition, a set of event payload objects are now available for use in transporting event payload data in a standardized way. - A test fixture is provided for isolating the global callback manager in ``neutron_lib.callbacks.registry``. For more details see the comments in ``neutron_lib.fixture.CallbackRegistryFixture``. deprecations: - The use of ``neutron_lib.callbacks.registry.notify()`` and ``neutron_lib.callbacks.manager.CallbacksManager.notify()`` is deprecated in favor of their ``publish()`` counterparts and will be removed in the "Queens" release time-frame. neutron-lib-1.13.0/releasenotes/notes/ipv6_address_usage-ef3d65ad5aa5798b.yaml0000666000175100017510000000030413231472055026726 0ustar zuulzuul00000000000000--- features: - | A converter ``convert_ip_to_canonical_format`` has been added to neutron-lib which allows IPv6 addresses to be stored and displayed in canonical format.neutron-lib-1.13.0/releasenotes/notes/rehome-dftsnetpool-apidef-4de5d75d2a63dec9.yaml0000666000175100017510000000024013231472055030213 0ustar zuulzuul00000000000000--- features: - The API definition for neutron extension ``default-subnetpools`` is now available in ``neutron_lib.api.definitions.default_subnetpools``. neutron-lib-1.13.0/releasenotes/notes/rehome-externalnet-apidef-d377f87da900eabe.yaml0000666000175100017510000000036613231472055030212 0ustar zuulzuul00000000000000--- features: - The ``external-net`` API extension's API definition is now available in ``neutron_lib.api.definitions.external_net``. - External network related exceptions are now available in ``neutron_lib.exceptions.external_net``. neutron-lib-1.13.0/releasenotes/notes/rehome-ml2-driverapi-363db4b8fa42f8f1.yaml0000666000175100017510000000017213231472055027020 0ustar zuulzuul00000000000000--- features: - The public APIs from ``neutron.plugins.ml2.driver_api`` are now in ``neutron_lib.plugins.ml2.api``. neutron-lib-1.13.0/releasenotes/notes/rehome-projid-apidef-a433b1b003f27a20.yaml0000666000175100017510000000021013231472055026654 0ustar zuulzuul00000000000000--- features: - The ``project-id`` API extension's API definition is now available in ``neutron_lib.api.definitions.project_id``. neutron-lib-1.13.0/releasenotes/notes/rehome-qos-apidef-0dbe094b8b21a580.yaml0000666000175100017510000000020213231472055026270 0ustar zuulzuul00000000000000--- features: - The API definition for neutron's ``qos`` extension is now available in ``neutron_lib.api.definitions.qos``. neutron-lib-1.13.0/releasenotes/notes/rehome-worker-b7e9c7f477bdb926.yaml0000666000175100017510000000022313231472055025671 0ustar zuulzuul00000000000000--- features: - The ``NeutronWorker`` class from the ``neutron.worker`` module is now available as ``BaseWorker`` in ``neutron_lib.worker``. neutron-lib-1.13.0/releasenotes/notes/subnet-onboard-api-definition-f4918ff1f1d12c97.yaml0000666000175100017510000000011313231472055030630 0ustar zuulzuul00000000000000--- features: - Adds ``subnet_onboard`` API definition to neutron-lib. neutron-lib-1.13.0/releasenotes/notes/new-hacking-check-no-log-translations-4a430a38aeb06452.yaml0000666000175100017510000000117113231472055032063 0ustar zuulzuul00000000000000--- features: - | New ``N537`` hacking check is introduced that enforces no logging message translations, in any logging level. The check is enabled by default. Also, the ``N533`` hacking check is now removed because it is covered by ``N537``. upgrade: - | Library consumers may need to adopt their code to new requirements of ``N537`` hacking check, removing translation markers from all logging messages. If for some reason it doesn't fit the project, consumers can disable the new hacking check using ``ignore`` statement in ``flake8`` section of their ``tox.ini`` file, or by other means. neutron-lib-1.13.0/releasenotes/notes/add-vif-type-agilio-ovs-6bee5b2557aca10e.yaml0000666000175100017510000000027413231472055027476 0ustar zuulzuul00000000000000--- features: - A VIF type for Agilio OVS (``VIF_TYPE_AGILIO_OVS``) has been added to portbindings. This links the external Neutron plugin to the external OS-VIF plugin in Nova. neutron-lib-1.13.0/releasenotes/notes/directory-fixture-083c5c5f365670d6.yaml0000666000175100017510000000107013231472055026340 0ustar zuulzuul00000000000000--- features: - | Introduced neutron_lib.fixture, and added fixture for plugin directory ``PluginDirectoryFixture``. An example below: .. code-block:: python from neutron_lib.plugins import directory from neutron_lib import fixture def setup_test_directory_instance(self): """Give a private copy of the directory to each test.""" self._plugin_directory = directory._PluginDirectory() self.useFixture(fixture.PluginDirectoryFixture( plugin_directory=self._plugin_directory)) neutron-lib-1.13.0/releasenotes/notes/rehome-plugin-constants-ebf350dfd989957a.yaml0000666000175100017510000000026013231472055027672 0ustar zuulzuul00000000000000--- features: - Many of the constants from ``neutron.plugins.common.constants`` are now available in ``neutron_lib.plugins.constants`` and ``neutron_lib.constants``. neutron-lib-1.13.0/releasenotes/notes/add-validator-pkg-a6565a2d4fbfa1d8.yaml0000666000175100017510000000043713231472055026440 0ustar zuulzuul00000000000000--- features: - A new ``neutron_lib.validators`` package is now available where the existing definitions from the ``validators`` module are now in ``neutron_lib.validators.__init__`` and subsequent per-component validators can be created in their own validators sub-module.neutron-lib-1.13.0/releasenotes/notes/logging-api-ref-fafb884367ca60a2.yaml0000666000175100017510000000013313231472055026030 0ustar zuulzuul00000000000000--- features: - API reference for the logging extension for ``security_group`` resource. neutron-lib-1.13.0/releasenotes/notes/rehome-ipalloc-apidef-dee59cfffd903b7a.yaml0000666000175100017510000000021213231472055027440 0ustar zuulzuul00000000000000--- features: - The ``ip_allocation`` extension's API definition is now available in ``neutron_lib.api.definitions.ip_allocation``. neutron-lib-1.13.0/releasenotes/notes/rehome-allowedaddrpairs-apidef-cd342b9a57a2dfdf.yaml0000666000175100017510000000055113231472055031250 0ustar zuulzuul00000000000000--- features: - The ``allowed-address-pairs`` API definition is now available in ``neutron_lib.api.definitions.allowedaddresspairs``. - The address pair validation is now available via the ``type:allowed_address_pairs`` validation type. - Address pair API definition exceptions are available in ``neutron_lib.exceptions.allowedaddresspairs``. neutron-lib-1.13.0/releasenotes/notes/move-get-random-mac-98f47d81cb34483d.yaml0000666000175100017510000000025013231472055026476 0ustar zuulzuul00000000000000--- features: - The ``get_random_mac`` utility function from ``neutron.common.utils`` is now in ``neutron_lib.utils.net`` with the same name, ``get_random_mac``. neutron-lib-1.13.0/releasenotes/notes/bgpvpn-api-def-22c7072575316ddd.yaml0000666000175100017510000000020513231472055025436 0ustar zuulzuul00000000000000--- features: - API definition for the ``networking-bgpvpn`` extension. - Adds new validator ``validate_list_of_regex_or_none``. neutron-lib-1.13.0/releasenotes/notes/add-action-status-3dbfe2490a0d231a.yaml0000666000175100017510000000017513231472055026372 0ustar zuulzuul00000000000000--- features: - The ``ACTION_STATUS`` is added to API definitions for neutron extension has specific ``action_status``.neutron-lib-1.13.0/releasenotes/notes/new-validator-range-or-none-dc8d557ec1f2622a.yaml0000666000175100017510000000006513231472055030306 0ustar zuulzuul00000000000000--- features: - Added validator ``range_or_none``. neutron-lib-1.13.0/releasenotes/notes/l3-apidef-exceptions-ee57b9df1c7443d4.yaml0000666000175100017510000000020113231472055027011 0ustar zuulzuul00000000000000--- features: - The exception classes from ``neutron.extensions.l3`` have been rehomed into ``neutron_lib.exceptions.l3``. neutron-lib-1.13.0/releasenotes/notes/plugin-directory-55861f4098813ba6.yaml0000666000175100017510000000066413231472055026103 0ustar zuulzuul00000000000000--- features: - | Introduced neutron_lib.plugins.directory to get references for loaded plugins in a neutron server process. For example: .. code-block:: python from neutron_lib import constants from neutron_lib.plugins import directory core_plugin = directory.get_plugin() l3_plugin = directory.get_plugin(constants.L3) For more examples, see: https://review.openstack.org/#/c/386845/ neutron-lib-1.13.0/releasenotes/notes/portbindings-apidef-3d7893bcb94d7f61.yaml0000666000175100017510000000026213231472055026752 0ustar zuulzuul00000000000000--- features: - The API definition and associated constants have been rehomed from ``neutron.extensions.portbindings`` to ``neutron_lib.api.definitions.portbindings``. neutron-lib-1.13.0/releasenotes/notes/moved-netmtu-extension-5999348000adcfaf.yaml0000666000175100017510000000017613231472055027452 0ustar zuulzuul00000000000000--- features: - The ``net-mtu`` extension API definition has been added as ``neutron_lib.api.definitions.network_mtu``. neutron-lib-1.13.0/releasenotes/notes/dns-api-def-bc24a58f56c5fbfb.yaml0000666000175100017510000000040413231472055025313 0ustar zuulzuul00000000000000--- features: - The ``DNS Integration`` extension API definition has been added as ``neutron_lib.api.definitions.dns``. - The ``validate_dns_name``, ``validate_fip_dns_name``, and ``validate_dns_domain`` are now available as neutron-lib validators.neutron-lib-1.13.0/releasenotes/notes/rehome-segment-apidef-a5f81adb834328f8.yaml0000666000175100017510000000017613231472055027163 0ustar zuulzuul00000000000000--- features: - The ``segment`` extension's API definition is now available in ``neutron_lib.api.definitions.segment``. neutron-lib-1.13.0/releasenotes/notes/bgpvpn-api-ref-f0294d9ddec726a0.yaml0000666000175100017510000000011113231472055025674 0ustar zuulzuul00000000000000--- features: - API reference for the ``networking-bgpvpn`` extension. neutron-lib-1.13.0/releasenotes/notes/introduce-logging-api-031d00eb84d5d061.yaml0000666000175100017510000000013413231472055027070 0ustar zuulzuul00000000000000--- features: - API definition for the logging extension for ``security_group`` resource. neutron-lib-1.13.0/releasenotes/notes/migrate-public-to-shared-0c67b32f9c37c751.yaml0000666000175100017510000000030013231472055027510 0ustar zuulzuul00000000000000--- upgrade: - | FWaaS has renamed the ``public`` attribute to ``shared`` to be in-sync with Openstack nomenclature based on the functionality the ``shared`` attribute provides. neutron-lib-1.13.0/releasenotes/notes/rehome-ml2-api-extaliases-4db48e113893c7a5.yaml0000666000175100017510000000025613231472055027611 0ustar zuulzuul00000000000000--- features: - The ``ExtensionDriver`` class in ``neutron_lib.plugins.ml2.api`` now contains the ``extension_aliases`` property to match neutron's implementation. neutron-lib-1.13.0/releasenotes/notes/rehome-autotopology-apidef-4a77e8ba0c783f7e.yaml0000666000175100017510000000024613231472055030350 0ustar zuulzuul00000000000000--- features: - The neutron ``auto-allocated-topology`` extension's API definition is now available as ``neutron_lib.api.definitions.auto_allocated_topology``. neutron-lib-1.13.0/releasenotes/notes/rehome-netipavail-apidef-d03558ac48b71333.yaml0000666000175100017510000000023613231472055027500 0ustar zuulzuul00000000000000--- features: - The ``network-ip-availability`` extension's API definition is now available in ``neutron_lib.api.definitions.network_ip_availability``. neutron-lib-1.13.0/releasenotes/notes/service-plugin-base-a42c2241a2fe0d26.yaml0000666000175100017510000000023113231472055026621 0ustar zuulzuul00000000000000--- features: - The class ``neutron.services.service_base.ServicePluginBase`` is now available as ``neutron_lib.services.base.ServicePluginBase``. neutron-lib-1.13.0/releasenotes/notes/events_l3_flavors-053714858ced693d.yaml0000666000175100017510000000022613231472055026315 0ustar zuulzuul00000000000000--- features: - This adds two new events ``PRECOMMIT_ADD_ASSOCIATION``, ``PRECOMMIT_DELETE_ASSOCIATIONS`` and a resource ``ROUTER_CONTROLLER``. neutron-lib-1.13.0/releasenotes/notes/rehome-port-dev-util-ea6f4a5c4da42f6c.yaml0000666000175100017510000000017713231472055027216 0ustar zuulzuul00000000000000--- features: - The ``neutron.common.utils`` function ``is_port_trusted`` is now available in ``neutron_lib.utils.net``. neutron-lib-1.13.0/releasenotes/notes/separate-hacking-factories-6fc36b38de95662a.yaml0000666000175100017510000000037013231472055030202 0ustar zuulzuul00000000000000--- features: - The hacking check factory ``incubating_factory`` has been added to ``neutron_lib.hacking.checks`` allowing adopters to test compliance on incubating hacking checks. See the usage documentation for additional details. neutron-lib-1.13.0/releasenotes/notes/rehome-flavors-apidef-ef84b2c1c7eaeed7.yaml0000666000175100017510000000101113231472055027460 0ustar zuulzuul00000000000000--- features: - The ``flavors`` API definition is now available in ``neutron_lib.api.definitions.flavors``. - A new ``type:service_plugin_type`` validator has been added that allows a service plugin to be validated at runtime by checking the ``neutron_lib.plugins.directory``. - Exceptions related to the ``flavor`` API have been added to ``neutron_lib.exceptions.flavors`` except for ``InvalidFlavorServiceType`` which is now a generic ``InvalidServiceType`` in ``neutron_lib.exceptions``. neutron-lib-1.13.0/releasenotes/notes/add-extension-supported-be6f7069856d2891.yaml0000666000175100017510000000031113231472055027450 0ustar zuulzuul00000000000000--- features: - | Rehome the validation for checking if an extension is supported by the plugin. The method ``is_extension_supported`` will now be part of ``neutron_lib.api.extensions``. neutron-lib-1.13.0/releasenotes/notes/rehome-metering-apidef-d9a0e70cbecc2bcc.yaml0000666000175100017510000000033513231472055027666 0ustar zuulzuul00000000000000--- features: - The ``metering`` extension's API is now available in ``neutron_lib.api.definitions.metering``. - Exceptions for the ``metering`` extension are available in ``neutron_lib.exceptions.metering``. neutron-lib-1.13.0/releasenotes/notes/rehome-routersvctype-apidef-1d9d712fd5383eb5.yaml0000666000175100017510000000022413231472055030450 0ustar zuulzuul00000000000000--- features: - The ``router-service-type`` extension's API definition is now available in ``neutron_lib.api.definitions.routerservicetype``. neutron-lib-1.13.0/releasenotes/notes/rehome-l3exthamode-apidef-9b3ef0956edb3883.yaml0000666000175100017510000000037113231472055027743 0ustar zuulzuul00000000000000--- features: - The ``l3-ha`` extension's API definition is now available in ``neutron_lib.api.definitions.l3_ext_ha_mode``. - Exceptions related to the ``l3-ha`` extension are available in ``neutron_lib.api.exceptions.l3_ext_ha_mode``. neutron-lib-1.13.0/releasenotes/notes/transaction_constraint-d3f93c2ced4a74c6.yaml0000666000175100017510000000066713231472055027751 0ustar zuulzuul00000000000000--- features: - | Contexts may now have transaction constraints set on them to be enforced by the revision plugin in Neutron for generalized compare-and-swap updates. Calling ``set_transaction_constraint`` on the context before performing a resource mutation will setup the constraint. This is also exposed to users via the HTTP API with ``if-match`` headers and the API layer sets the constraint on the context. neutron-lib-1.13.0/releasenotes/notes/rehome-dvr-related-leftover-constants-2cf329794166b3f2.yaml0000666000175100017510000000033613231472055032201 0ustar zuulzuul00000000000000--- features: - Moving the leftover DVR related constants from ``neutron.common.constants``. The constants ``L3_AGENT_MODE_DVR_NO_EXTERNAL`` and ``DVR_SNAT_BOUND`` are now available in ``neutron_lib.constants``. neutron-lib-1.13.0/releasenotes/notes/one-hacking-factory-01053e8e3d88c3d5.yaml0000666000175100017510000000034013231472055026552 0ustar zuulzuul00000000000000--- other: - The hacking check factory function ``neutron_lib.hacking.checks.incubating_factory`` has been removed. All consumers should use ``neutron_lib.hacking.checks.factory`` as per the ``usage`` dev-ref. neutron-lib-1.13.0/releasenotes/notes/extension_descriptor-04025e86249cc94c.yaml0000666000175100017510000000016513231472055027123 0ustar zuulzuul00000000000000--- features: - The ExtensionDescriptor class moved from neutron.api.extensions to neutron_lib.api.extensions. neutron-lib-1.13.0/releasenotes/notes/deprecate-api-utils-4f86288591c95679.yaml0000666000175100017510000000032713231472055026407 0ustar zuulzuul00000000000000--- deprecations: - The function ``neutron_lib.api.utils.populate_project_info`` has moved to ``neutron_lib.api.attributes.populate_project_info``. It will be removed from the old location in the future. neutron-lib-1.13.0/releasenotes/notes/rehome-psec-apidef-bd9344ec1e6066b4.yaml0000666000175100017510000000037513231472055026446 0ustar zuulzuul00000000000000--- features: - The ``port security`` extension API definition has been rehomed from ``neutron`` to ``neutron_lib.api.definitions.port_security``. The related exceptions can be found in the ``neutron_lib.exceptions.port_security`` module. neutron-lib-1.13.0/releasenotes/notes/add_fwg_group-9252d07f1011613d.yaml0000666000175100017510000000056413231472055025364 0ustar zuulzuul00000000000000--- features: - | Updated fwaas API extension definition to include previously missing ability to specify remote firewall groups for ingress and egress traffic. When a firewall group rule specifies a remote group, for example an ingress rule in fwgA specifies a remote group of fwgB, that means only packets from fwgB could match this ingress rule. neutron-lib-1.13.0/releasenotes/notes/add-vni-to-bgpvpn-7531df9fa4f8955b.yaml0000666000175100017510000000026613231472055026265 0ustar zuulzuul00000000000000--- features: - | The ``bgpvpn-vni`` API extension adds the ``vni`` optional attribute to ``bgpvpn`` objects to control the VXLAN VNI when VXLAN encapsulation is used. neutron-lib-1.13.0/releasenotes/notes/rehome-multiprovidernet-apidef-367e57772e931758.yaml0000666000175100017510000000054313231472055030654 0ustar zuulzuul00000000000000--- features: - The ``multi-provider`` extension's API definition is available in ``neutron_lib.api.defintions.multiprovidernet``. - Exceptions for the ``multi-provider`` extension can be found in ``neutron_lib.exceptions.multiprovidernet``. - The validation type ``type:network_segments`` is now available for API attribute validation. neutron-lib-1.13.0/releasenotes/notes/add-ip-substring-filtering-extension-06bb0c1f738ee330.yaml0000666000175100017510000000023413231472055032140 0ustar zuulzuul00000000000000--- features: - | Add ``ip-substring-filtering`` API extension. This extension provides the ability to filter ports with an IP address substring. neutron-lib-1.13.0/releasenotes/notes/rehome-l3flavors-apidef-da5e9b5d46df5cc7.yaml0000666000175100017510000000020413231472055027647 0ustar zuulzuul00000000000000--- features: - The ``l3-flavors`` extension's API definition is now available in ``neutron_lib.api.definitions.l3_flavors``. neutron-lib-1.13.0/releasenotes/notes/flush_on_subtransaction-99ef11dfb56b706d.yaml0000666000175100017510000000046513231472055030036 0ustar zuulzuul00000000000000--- fixes: - The oslo.db context manager returned by ``db.api.get_context_manager()`` will be configured with flush_on_subtransaction=True to more closely match the behavior of the previous session.begin(subtransactions=True) pattern we used everywhere before. See bug 1664643 for more details. neutron-lib-1.13.0/releasenotes/notes/public-service-classes-e52d7c79a075b799.yaml0000666000175100017510000000074513231472055027323 0ustar zuulzuul00000000000000--- features: - The ``neutron_lib.api.extensions.ExtensionDescriptor`` class's ``get_plugin_interface`` method now formally only supports ``neutron_lib.services.base.ServicePluginBase``. This change reflects the existing usage by consumers as almost all are returning instances of ``ServicePluginBase`` already. - The class ``WorkerBase`` is now available and provides the same functionality that's provided by ``neutron.worker.WorkerSupportServiceMixin``. neutron-lib-1.13.0/releasenotes/notes/rehome-placement-api-client-a9ac5d96ca8570aa.yaml0000666000175100017510000000035213231472055030414 0ustar zuulzuul00000000000000--- features: - The neutron placement API client is now available as ``neutron_lib.clients.placement``. - A new fixture for testing placement API calls has been added as ``neutron_lib.fixtures.PlacementAPIClientFixture``. neutron-lib-1.13.0/releasenotes/notes/policy-redux-25c26836219fd02d.yaml0000666000175100017510000000051513231472055025270 0ustar zuulzuul00000000000000--- deprecations: - | ``policy.refresh()`` and ``policy.reset()`` have been removed. The library policy module is not meant for public consumption, and it should be considered in practice a private component of the library. If you use it, you will do so at your own risk, as it has been marked as a private module. neutron-lib-1.13.0/releasenotes/notes/l3-agent-extensions-ha-state-change-837140efe4187a99.yaml0000666000175100017510000000015213231472055031416 0ustar zuulzuul00000000000000--- features: - | A new abstract method ``ha_state_change`` has been added to ``L3AgentExtension``. neutron-lib-1.13.0/releasenotes/notes/rehome-dvr-apidef-a6aa415152457c9a.yaml0000666000175100017510000000054313231472055026214 0ustar zuulzuul00000000000000--- features: - The API definition for the ``dvr`` extension is now available in ``neutron_lib.api.defintions.dvr``. - The two ``MacAddressGenerationFailure`` exceptions are now available as ``HostMacAddressGenerationFailure`` and ``NetworkMacAddressGenerationFailure`` for host and network MAC address generation errors respectively. neutron-lib-1.13.0/releasenotes/notes/rehome-vlantransp-apidef-1cd7d3ace9042686.yaml0000666000175100017510000000044613231472055027705 0ustar zuulzuul00000000000000--- features: - The ``vlan-transparent`` extension's API definition is now available in ``neutron_lib.api.definitions.vlantransparent``. - The ``get_vlan_transparent`` function from the ``vlan-transparent`` extension is available in ``neutron_lib.api.definitions.vlantransparent``. ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000neutron-lib-1.13.0/releasenotes/notes/subnet-onboard-allow-create-update-subnets-74a4be6e9e97bbb6.yamlneutron-lib-1.13.0/releasenotes/notes/subnet-onboard-allow-create-update-subnets-74a4be6e9e97bbb6.ya0000666000175100017510000000014713231472055033071 0ustar zuulzuul00000000000000--- features: - The ``subnet_onboard`` API definition now supports creating and updating subnets neutron-lib-1.13.0/releasenotes/notes/context-manager-23538670cd9c701f.yaml0000666000175100017510000000033613231472055025745 0ustar zuulzuul00000000000000--- features: - | ``neutron_lib.db`` has a public module ``api`` that provides accessor functions for transactional context manager services. - | ``neutron_lib.fixture`` has a new ``SqlFixture`` available. neutron-lib-1.13.0/releasenotes/notes/validator_ip_or_subnet_or_none-0175f906a9113954.yaml0000666000175100017510000000010013231472055030752 0ustar zuulzuul00000000000000--- features: - Added validator validate_ip_or_subnet_or_none neutron-lib-1.13.0/releasenotes/notes/rehome-rbac-policy-callbacks-24fa12ad1ab4c443.yaml0000666000175100017510000000017613231472055030441 0ustar zuulzuul00000000000000--- features: - The ``rbac-policy`` callback resource now available as ``neutron_lib.callbacks.resources.RBAC_POLICY``. neutron-lib-1.13.0/releasenotes/notes/rehome-address-scope-apidef-f4e8bb74be61729a.yaml0000666000175100017510000000022213231472055030326 0ustar zuulzuul00000000000000--- features: - The neutron ``address-scope`` extension's API definition is now available as ``neutron_lib.api.definitions.address_scope``. neutron-lib-1.13.0/releasenotes/notes/rehome-pagination-apidef-9aebf1c7a6bcb58b.yaml0000666000175100017510000000021013231472055030130 0ustar zuulzuul00000000000000--- features: - The ``pagination`` API extension's API definition is now available in ``neutron_lib.api.definitions.pagination``. neutron-lib-1.13.0/releasenotes/notes/cidr_for_canonical_format-4e7925d76a27a19d.yaml0000666000175100017510000000032713231472055030106 0ustar zuulzuul00000000000000--- features: - | A new converter is added to facilitate converting IPv6 CIDRs to canonical format. This way IPv6 CIDRs can be specified in multiple formats but would be handled in their canonical format. neutron-lib-1.13.0/releasenotes/notes/dns-domain-ports-ext-39a069119e79e59b.yaml0000666000175100017510000000021413231472055026656 0ustar zuulzuul00000000000000--- features: - The ``dns-domain-ports`` extension API definition has been added as ``neutron_lib.api.definitions.dns_domain_ports``. neutron-lib-1.13.0/releasenotes/notes/rehome-agent-apidef-7a2dde6a9810f55c.yaml0000666000175100017510000000020213231472055026662 0ustar zuulzuul00000000000000--- features: - The neutron ``agent`` extension's API definition is now available as ``neutron_lib.api.definitions.agent``. neutron-lib-1.13.0/releasenotes/notes/portbindings-extended-3a89560ee63824e1.yaml0000666000175100017510000000015213231472055027151 0ustar zuulzuul00000000000000--- features: - | API reference for ``extended port bindings`` extension for ``port`` resource. neutron-lib-1.13.0/releasenotes/notes/rehome-runtime-utils-acb4451326cbe4d9.yaml0000666000175100017510000000042113231472055027151 0ustar zuulzuul00000000000000--- features: - The ``load_class_by_alias_or_classname`` function from ``neutron.common.utils`` is now available in ``neutron_lib.utils.runtime``. - The ``synchronized`` decorator from ``neutron.common.utils`` is now available in ``neutron_lib.utils.runtime``. neutron-lib-1.13.0/releasenotes/notes/extension-fixture-b7fd61384f1a4d1d.yaml0000666000175100017510000000117713231472055026570 0ustar zuulzuul00000000000000--- features: - A new fixture for testing with neutron-lib API definitions has been added as ``neutron_lib.fixtures.APIDefinitionFixture``. This fixture can be used anytime extension plugins are being tested that modify resource attribute maps and ensures the single global API definition attribute map is copied and restored. - The ``neutron_lib.api.extensions.APIExtensionDescriptor`` class now defines update_attributes_map that uses the API definitions attribute map if none is given. This is the default behavior in most all extensions today and thus is collapsed into the base class for convenience. neutron-lib-1.13.0/releasenotes/notes/fwaas-exceptions-e580766205b466d4.yaml0000666000175100017510000000061313231472055026052 0ustar zuulzuul00000000000000--- features: - | The exception classes have migrated from neutron_fwaas to neutron_lib as mentioned below: * ``neutron_fwaas.extensions.firewall`` -> ``neutron_lib.exceptions.firewall_v1`` * ``neutron_fwaas.extensions.firewallrouterinsertion`` -> ``neutron_lib.exceptions.firewall_v1`` * ``neutron_fwaas.extensions.firewall_v2`` -> ``neutron_lib.exceptions.firewall_v2`` neutron-lib-1.13.0/releasenotes/notes/alembic-branches-6d5947d141efd26e.yaml0000666000175100017510000000031613231472055026174 0ustar zuulzuul00000000000000--- features: - The constants ``EXPAND_BRANCH`` and ``CONTRACT_BRANCH`` are now available in ``neutron_lib.db.constants``. They should be used instead of the ones in ``neutron.db.migration.cli``. neutron-lib-1.13.0/releasenotes/notes/rehome-qosrtdetails-apidef-2276ec66a0e545ca.yaml0000666000175100017510000000023213231472055030217 0ustar zuulzuul00000000000000--- features: - The ``qos-rule-type-details`` extension's API definition is now available in ``neutron_lib.api.definitions.qos_rule_type_details``. neutron-lib-1.13.0/releasenotes/notes/port-range-compared-as-int-4d07fe030206f818.yaml0000666000175100017510000000033613231472055027701 0ustar zuulzuul00000000000000--- fixes: - Bug `1738371 `_ is fixed by comparing min port and max port in port range specification as integers instead of strings, during port range validation. neutron-lib-1.13.0/releasenotes/notes/data-plane-status-ext-c3452a01ef5007ce.yaml0000666000175100017510000000015313231472055027112 0ustar zuulzuul00000000000000--- features: - API definition and reference documentation for the port data plane status extension. neutron-lib-1.13.0/releasenotes/notes/rehome-qos-driverbase-f729875b2ad74ce0.yaml0000666000175100017510000000043613231472055027222 0ustar zuulzuul00000000000000--- features: - The ``DriverBase`` class from ``neutron.services.qos.drivers.base`` is now available in the ``neutron_lib.services.qos.base`` module. - The constants defined in ``neutron.services.qos.qos_consts`` are now available in ``neutron_lib.services.qos.constants``. neutron-lib-1.13.0/releasenotes/notes/router-interface-fip-1e79b7909f8b264f.yaml0000666000175100017510000000015413231472055027001 0ustar zuulzuul00000000000000--- features: - API reference and definition for networking-midonet's ``router-interface-fip`` extension. neutron-lib-1.13.0/releasenotes/notes/bgpvpn-routes-control-51cd95d6ab265cb1.yaml0000666000175100017510000000053713231472055027355 0ustar zuulzuul00000000000000--- features: - | The ``bgpvpn-routes-control`` API extension is introduced to enrich the base ``bgpvpn`` extension. It allows to control BGPVPN connectivity at the granularity of a port and the advertisement into a BGPVPN of routes corresponding to destination reachable via a given port (static routes, BGPVPN route leaking). neutron-lib-1.13.0/releasenotes/notes/add-exception-pkg-5a14389891abf358.yaml0000666000175100017510000000044013231472055026157 0ustar zuulzuul00000000000000--- features: - A new ``neutron_lib.exceptions`` package is now available where the existing definitions from the ``exceptions`` module are now in ``neutron_lib.exceptions.__init__`` and subsequent per-component exceptions can be created in their own exceptions sub-module. neutron-lib-1.13.0/releasenotes/notes/rehome-netaz-apidef-74e962ef682380bc.yaml0000666000175100017510000000026213231472055026564 0ustar zuulzuul00000000000000--- features: - The API definition for neutron's ``network_availability_zone`` extension is now available in ``neutron_lib.api.definitions.network_availability_zone``. neutron-lib-1.13.0/releasenotes/notes/rehome-sorting-apidef-1547f093da322c14.yaml0000666000175100017510000000017613231472055027027 0ustar zuulzuul00000000000000--- features: - The ``sorting`` extension's API definition is now available in ``neutron_lib.api.definitions.sorting``. neutron-lib-1.13.0/releasenotes/notes/rehome-topics-ca451e72c8c9603a.yaml0000666000175100017510000000024113231472055025554 0ustar zuulzuul00000000000000--- features: - The public constants and ``get_topic_name`` function from ``neutron.common.topics`` are now available in ``neutron_lib.agent.topics``. neutron-lib-1.13.0/releasenotes/notes/rehome-l3extgwmode-apidef-8f83e0f6cf0515e7.yaml0000666000175100017510000000021713231472055027763 0ustar zuulzuul00000000000000--- features: - The API definition for the ``ext-gw-mode`` extension is now available in ``neutron_lib.api.definitions.l3_ext_gw_mode``. neutron-lib-1.13.0/releasenotes/notes/context-public-6df198b77027c224.yaml0000666000175100017510000000040613231472055025612 0ustar zuulzuul00000000000000--- features: - | The ``context`` module has been made public. For example: .. code-block:: python from neutron_lib import context ctx = context.get_admin_context() For more examples, see: https://review.openstack.org/#/c/388157/ neutron-lib-1.13.0/releasenotes/notes/bgpvpn_rt_fix-6d02db6a1c22f002.yaml0000666000175100017510000000025013231472055025621 0ustar zuulzuul00000000000000--- fixes: - | Fixes BGPVPN Interconnection API to not allow the definition of an empty string Route Target (allowing it was simply wrong and unintentional). neutron-lib-1.13.0/releasenotes/notes/rehome-dhcpopts-apidef-389ab9d8935e5e0d.yaml0000666000175100017510000000076513231472055027363 0ustar zuulzuul00000000000000--- features: - The ``extra_dhcp_opt`` API extension definition from ``neutron.extensions`` has been rehomed to ``neutron_lib.api.definitions`` with the same name. - A new validator ``validate_any_key_specs_or_none`` has been added for the corresponding validation type ``type:list_of_any_key_specs_or_none``. This validator can be used to check that a list of dicts match at least 1 key spec allowing consumers the ability to define multiple formats for their validated data. neutron-lib-1.13.0/releasenotes/notes/rehome-qosdft-apidef-b70596ca11c08803.yaml0000666000175100017510000000020613231472055026636 0ustar zuulzuul00000000000000--- features: - The ``qos-default`` extension's API definition is now available in ``neutron_lib.api.definitions.qos_default``. neutron-lib-1.13.0/releasenotes/notes/fwaas-api-def-a6f03db369177b4a.yaml0000666000175100017510000000010713231472055025404 0ustar zuulzuul00000000000000--- features: - Adds neutron-fwaas API definitions to neutron-lib. neutron-lib-1.13.0/releasenotes/notes/create-netmtu-writable-extension-284892119ef6595c.yaml0000666000175100017510000000047113231472055031207 0ustar zuulzuul00000000000000--- features: - The new ``net-mtu-writable`` extension API definition has been added as ``neutron_lib.api.definitions.network_mtu_writable``. The new extension indicates that the network ``mtu`` attribute is writeable. Plugins supporting the new extension are expected to also support ``net-mtu``. neutron-lib-1.13.0/releasenotes/notes/rehome-ovo-exceptions-fbddfeea582ef3f1.yaml0000666000175100017510000000023313231472055027626 0ustar zuulzuul00000000000000--- features: - The neutron versioned object exceptions from ``neutron.objects.exceptions`` are now available in ``neutron_lib.objects.exceptions``. neutron-lib-1.13.0/releasenotes/notes/rehome-extraroute-apidef-e14e72e03ce18ead.yaml0000666000175100017510000000040013231472055030036 0ustar zuulzuul00000000000000--- features: - The API definition for the ``extraroute`` extension is now available in ``neutron_lib.api.defintions.extraroute``. - Exceptions related to the ``extraroute`` extension are now available in ``neutron_lib.exceptions.extraroute``. neutron-lib-1.13.0/releasenotes/notes/rehome-common-constants-8ac9580e52fd3618.yaml0000666000175100017510000000040713231472055027516 0ustar zuulzuul00000000000000--- features: - Constants from ``neutron.common.constants`` are now available in neutron-lib. Note that consumers using ``ROUTER_STATUS_ACTIVE`` or ``ROUTER_STATUS_ERROR`` should now just use ``ACTIVE`` and ``ERROR`` from ``neutron_lib.constants``. neutron-lib-1.13.0/releasenotes/notes/update-hacking-check-n536-2f63898bea693125.yaml0000666000175100017510000000027513231472055027314 0ustar zuulzuul00000000000000--- fixes: - Update hacking check ``N536``. Current implementation recognizes ``self.assertEqual((None, None), A)`` as invalid incorrectly while ``(None, None)`` is not ``None``. neutron-lib-1.13.0/releasenotes/notes/enable-hacking-check-H904-f512ecc98c0a4033.yaml0000666000175100017510000000034113231472055027317 0ustar zuulzuul00000000000000--- other: - OpenStack dev hacking check ``H904`` is now enabled in ``tox.ini`` via the ``enable-extensions`` configuration property. Neutron-lib adopters should also enable this hacking check in their ``tox.ini``. neutron-lib-1.13.0/releasenotes/notes/l3-apidefs-d028c708c22ef2a0.yaml0000666000175100017510000000026713231472055024725 0ustar zuulzuul00000000000000--- features: - The ``floating_ip`` and ``router`` API definitions from ``neutron.extensions.l3`` have been rehomed to ``neutron_lib.api.definitions`` as the module ``l3``. neutron-lib-1.13.0/releasenotes/notes/logging-resource-api-cecf33e3be468eb2.yaml0000666000175100017510000000015013231472055027243 0ustar zuulzuul00000000000000--- features: - API reference and definition for networking-midonet's ``logging-resource`` extension. neutron-lib-1.13.0/releasenotes/notes/add-convert-to-string-524541aa6224f66f.yaml0000666000175100017510000000026013231472055026771 0ustar zuulzuul00000000000000--- features: - | A new converter ``convert_to_string`` into ``neutron_lib.api.converters``. This method can convert an argument which is not None into string value. neutron-lib-1.13.0/releasenotes/notes/revert-review-400408-4999a9159689c0c5.yaml0000666000175100017510000000044613231472055026165 0ustar zuulzuul00000000000000--- fixes: - Bug `1720046 `_ is fixed by reverting the logic of ``neutron_lib.utils.net.get_random_mac`` to its original behavior from commit `If2539f94b5479f0d6afa64c973082cbe8c5309ac `_. neutron-lib-1.13.0/releasenotes/notes/provider-net-apidef-9ebe9f56840c79f7.yaml0000666000175100017510000000022013231472055026675 0ustar zuulzuul00000000000000--- features: - The Neutron ``Provider network`` extension API definition has been added as ``neutron_lib.api.definitions.provider_net``. ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000neutron-lib-1.13.0/releasenotes/notes/subresource-update-attrmap-and-classmethods-76accdd5c56a3bd4.yamlneutron-lib-1.13.0/releasenotes/notes/subresource-update-attrmap-and-classmethods-76accdd5c56a3bd4.y0000666000175100017510000000103313231472055033242 0ustar zuulzuul00000000000000--- features: - All methods defined in ``APIExtensionDescriptor`` are now class methods. This allows consumers to call them without a reference to an actual extension object instance. fixes: - The ``get_extended_resources`` method of the ``APIExtensionDescriptor`` was updated to also include the underlying API definition's ``SUB_RESOURCE_ATTRIBUTE_MAP`` in the returned dict. As a result, the ``update_attributes_map`` method now also includes the sub-resources if no ``extension_attrs_map`` is passed to it. neutron-lib-1.13.0/releasenotes/notes/api-definition-base-d2e9514c5ee2ef5b.yaml0000666000175100017510000000027413231472055026762 0ustar zuulzuul00000000000000--- other: - Provide API definition framework for Neutron Stadium APIs to be consolidated into neutron-lib. For more details see review https://review.openstack.org/#/c/353131/. neutron-lib-1.13.0/releasenotes/notes/boilerplate-ext-descriptor-a5cec8b9b900cbfd.yaml0000666000175100017510000000044013231472055030554 0ustar zuulzuul00000000000000--- features: - The ``APIExtensionDescriptor`` was added to ``neutron_lib.api.extensions`` and can be used with extensions that have an API definition in neutron-lib to minimize the boilplate code needed in the extension definition class. For more details, see the dev-ref. neutron-lib-1.13.0/releasenotes/notes/rehome-api-faults-cf30246e5e5bf8b8.yaml0000666000175100017510000000022313231472055026411 0ustar zuulzuul00000000000000--- features: - The ``FAULT_MAP`` dictionary from ``neutron.api.v2.base`` has been rehomed to ``neutron_lib.api.faults`` with the same name. neutron-lib-1.13.0/releasenotes/notes/hacking-check-n537-280ec39c061d9dd7.yaml0000666000175100017510000000015213231472055026157 0ustar zuulzuul00000000000000--- features: - Added hacking check ``N536``. This hacking check is added to the incubating checks. neutron-lib-1.13.0/releasenotes/notes/rehome-routeraz-apidef-efc5f202e04b8272.yaml0000666000175100017510000000024413231472055027355 0ustar zuulzuul00000000000000--- features: - Neutron's ``router_availability_zone`` extension API definition is now available in ``neutron_lib.api.definitions.router_availability_zone``. neutron-lib-1.13.0/releasenotes/notes/rehome-l2adjacency-apidef-f91bf184d90122c8.yaml0000666000175100017510000000021013231472055027601 0ustar zuulzuul00000000000000--- features: - The ``l2_adjacency`` extension's API definition is now available in ``neutron_lib.api.definitions.l2_adjacency``. neutron-lib-1.13.0/releasenotes/notes/add-port-binding-resource-73f9800dbda121ca.yaml0000666000175100017510000000046213231472055030021 0ustar zuulzuul00000000000000--- features: - A new ``PORT_BINDING`` resource definition has been added to ``neutron_lib.callbacks.resources``, to enable the multiple port binding service plugin to notify the core plugin and other subscribers when create, update and delete operations are performed on a port binding. neutron-lib-1.13.0/releasenotes/notes/fip64-0c6bb38417d602f1.yaml0000666000175100017510000000013513231472055023642 0ustar zuulzuul00000000000000--- features: - API reference and definition for networking-midonet's ``fip64`` extension. neutron-lib-1.13.0/releasenotes/notes/core-attributes-43e6969f1b187e5c.yaml0000666000175100017510000000154013231472055026060 0ustar zuulzuul00000000000000--- features: - A bulk of the ``neutron.api.v2.attributes`` functionality is now available in ``neutron_lib.api.attributes``. A new ``AttributeInfo`` class is available in that acts as a wrapper for an API resource's attribute dict and allows consumers to perform operations with the underlying attribute dict. The ``populate_project_info`` function is now available. The global attribute map ``RESOURCES`` is now available and will take the place of neutron's global ``RESOURCE_ATTRIBUTE_MAP``. - The ``neutron_lib.fixture.APIDefinitionFixture`` has been updated to handle backing-up and restoring the global ``RESOURCES`` dict. By default the constructor now also uses all API definitions if none are passed to it's constructor. This is the default behavior almost all consumers need and is thus a convenience change. neutron-lib-1.13.0/releasenotes/notes/extra-dhcp-opt-public-vars-ec4e1c2dcac43d69.yaml0000666000175100017510000000030313231472055030300 0ustar zuulzuul00000000000000--- features: - The constants ``VALID_BLANK_EXTRA_DHCP_OPTS`` and ``DHCP_OPT_VALUE_MAX_LEN`` are now public in the ``neutron_lib.api.definitions.extra_dhcp_opt`` API definition module. neutron-lib-1.13.0/releasenotes/source/0000775000175100017510000000000013231472430020046 5ustar zuulzuul00000000000000neutron-lib-1.13.0/releasenotes/source/pike.rst0000666000175100017510000000021713231472055021535 0ustar zuulzuul00000000000000=================================== Pike Series Release Notes =================================== .. release-notes:: :branch: stable/pike neutron-lib-1.13.0/releasenotes/source/conf.py0000666000175100017510000002206113231472055021353 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. # Neutron Library Release Notes documentation build configuration file, # created by # sphinx-quickstart on Wed Oct 18 17:40:50 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'openstackdocstheme', 'reno.sphinxext', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. # source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'Neutron Library Release Notes' copyright = u'2016, Neutron Library Developers' # Release notes are version independent. # The full version, including alpha/beta/rc tags. release = '' # The short X.Y version. version = '' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # today = '' # Else, today_fmt is used as the format for a strftime call. # today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [] # The reST default role (used for this markup: `text`) to use for all # documents. # default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. # add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). # add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. # show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. # modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. # keep_warnings = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'openstackdocs' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". # html_title = None # A shorter title for the navigation bar. Default is the same as html_title. # html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. # html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. # html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. # html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. # html_last_updated_fmt = '%b %d, %Y' html_last_updated_fmt = '%Y-%m-%d %H:%M' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True # Custom sidebar templates, maps document names to template names. # html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. # html_additional_pages = {} # If false, no module index is generated. # html_domain_indices = True # If false, no index is generated. # html_use_index = True # If true, the index is split into individual pages for each letter. # html_split_index = False # If true, links to the reST sources are added to the pages. # html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. # html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. # html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. # html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). # html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'NeutronLibReleaseNotesdoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # 'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ ('index', 'NeutronLibReleaseNotes.tex', u'Neutron Library Notes Documentation', u'Neutron Library Developers', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. # latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. # latex_use_parts = False # If true, show page references after internal links. # latex_show_pagerefs = False # If true, show URL addresses after external links. # latex_show_urls = False # Documents to append as an appendix to all manuals. # latex_appendices = [] # If false, no module index is generated. # latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'neutronlibreleasenotes', u'Neutron Library', 'Neutron Library Release Notes Documentation', [u'Neutron Library Developers'], 1) ] # If true, show URL addresses after external links. # man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'NeutronLibReleaseNotes', u'Neutron Library', 'Neutron Library Release Notes Documentation', u'Neutron Library Developers', 'NeutronLibReleaseNotes', 'For sharing/decoupling neutron functionality across the Stadium.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. # texinfo_appendices = [] # If false, no module index is generated. # texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. # texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. # texinfo_no_detailmenu = False # -- Options for Internationalization output ------------------------------ locale_dirs = ['locale/'] # -- Options for openstackdocstheme ------------------------------------------- repository_name = 'openstack/neutron-lib' bug_project = 'neutron' bug_tag = 'doc' neutron-lib-1.13.0/releasenotes/source/_templates/0000775000175100017510000000000013231472430022203 5ustar zuulzuul00000000000000neutron-lib-1.13.0/releasenotes/source/_templates/.placeholder0000666000175100017510000000000013231472055024461 0ustar zuulzuul00000000000000neutron-lib-1.13.0/releasenotes/source/ocata.rst0000666000175100017510000000023013231472055021667 0ustar zuulzuul00000000000000=================================== Ocata Series Release Notes =================================== .. release-notes:: :branch: origin/stable/ocata neutron-lib-1.13.0/releasenotes/source/unreleased.rst0000666000175100017510000000015613231472055022736 0ustar zuulzuul00000000000000============================= Current Series Release Notes ============================= .. release-notes:: neutron-lib-1.13.0/releasenotes/source/README.rst0000666000175100017510000000077213231472055021550 0ustar zuulzuul00000000000000=================================== Neutron Library Release Notes Howto =================================== Release notes for documenting new features in OpenStack projects. Background on the process, tooling, and methodology is documented in a `mailing list post by Doug Hellmann `_. For information on how to create release notes, please consult the `Release Notes documentation `_. neutron-lib-1.13.0/releasenotes/source/_static/0000775000175100017510000000000013231472430021474 5ustar zuulzuul00000000000000neutron-lib-1.13.0/releasenotes/source/_static/.placeholder0000666000175100017510000000000013231472055023752 0ustar zuulzuul00000000000000neutron-lib-1.13.0/releasenotes/source/index.rst0000666000175100017510000000025313231472055021714 0ustar zuulzuul00000000000000=============================== Neutron Library Release Notes =============================== .. toctree:: :maxdepth: 1 README.rst unreleased pike ocata neutron-lib-1.13.0/LICENSE0000666000175100017510000002363713231472055015102 0ustar zuulzuul00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. neutron-lib-1.13.0/api-ref/0000775000175100017510000000000013231472430015400 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/0000775000175100017510000000000013231472430016700 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/conf.py0000666000175100017510000001622413231472055020211 0ustar zuulzuul00000000000000# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # # neutron documentation build configuration file, created by # sphinx-quickstart on Sat May 1 15:17:47 2010. # # This file is execfile()d with the current directory set to # its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import os import sys extensions = [ 'os_api_ref', 'openstackdocstheme', ] html_theme = 'openstackdocs' html_theme_options = { "sidebar_mode": "toc", } # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('../../')) sys.path.insert(0, os.path.abspath('../')) sys.path.insert(0, os.path.abspath('./')) # -- General configuration ---------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. # # source_encoding = 'utf-8' # The master toctree document. master_doc = 'index' # General information about the project. project = u'Networking API Reference' copyright = u'2010-present, OpenStack Foundation' # openstackdocstheme options repository_name = 'openstack/neutron-lib' bug_project = 'neutron' bug_tag = 'api-ref' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # from neutron_lib.version import version_info # The full version, including alpha/beta/rc tags. release = version_info.release_string() # The short X.Y version. version = version_info.version_string() # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # today = '' # Else, today_fmt is used as the format for a strftime call. # today_fmt = '%B %d, %Y' # The reST default role (used for this markup: `text`) to use # for all documents. # default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. # add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). add_module_names = False # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # -- Options for man page output ---------------------------------------------- # Grouping the document tree for man pages. # List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual' # -- Options for HTML output -------------------------------------------------- # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. # html_theme_path = ["."] # html_theme = '_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". # html_title = None # A shorter title for the navigation bar. Default is the same as html_title. # html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. # html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. # html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". # html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. # html_last_updated_fmt = '%b %d, %Y' html_last_updated_fmt = '%Y-%m-%d %H:%M' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True # Custom sidebar templates, maps document names to template names. # html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. # html_additional_pages = {} # If false, no module index is generated. # html_use_modindex = True # If false, no index is generated. # html_use_index = True # If true, the index is split into individual pages for each letter. # html_split_index = False # If true, links to the reST sources are added to the pages. # html_show_sourcelink = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. # html_use_opensearch = '' # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). # html_file_suffix = '' # Output file base name for HTML help builder. htmlhelp_basename = 'neutrondoc' # -- Options for LaTeX output ------------------------------------------------- # The paper size ('letter' or 'a4'). # latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). # latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass # [howto/manual]). latex_documents = [ ('index', 'Neutron.tex', u'OpenStack Networking API Documentation', u'OpenStack Foundation', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. # latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. # latex_use_parts = False # Additional stuff for the LaTeX preamble. # latex_preamble = '' # Documents to append as an appendix to all manuals. # latex_appendices = [] # If false, no module index is generated. # latex_use_modindex = True linkcheck_anchors_ignore = [ # skip gerrit anchors '\/q\/.*', 'q\,.*', '\/c\/.*' ] neutron-lib-1.13.0/api-ref/source/v2/0000775000175100017510000000000013231472430017227 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/subnetpools.inc0000666000175100017510000001453013231472055022307 0ustar zuulzuul00000000000000.. -*- rst -*- ==================================== Subnet pools extension (subnetpools) ==================================== Lists, creates, shows details for, updates, and deletes subnet pools. Show subnet pool ================ .. rest_method:: GET /v2.0/subnetpools/{subnetpool_id} Shows information for a subnet pool. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - subnetpool_id: subnetpool_id - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - subnetpool: subnetpool - id: subnetpool_id_body - name: name - default_quota: default_quota - tenant_id: project_id - project_id: project_id - created_at: created_at - updated_at: updated_at - prefixes: prefixes - min_prefixlen: min_prefixlen - address_scope_id: address_scope_id - ip_version: ip_version - shared: shared - default_prefixlen: default_prefixlen - max_prefixlen: max_prefixlen - description: description - is_default: subnetpool_is_default - revision_number: revision_number Response Example ---------------- .. literalinclude:: samples/subnets/subnetpool-show-response.json :language: javascript Update subnet pool ================== .. rest_method:: PUT /v2.0/subnetpools/{subnetpool_id} Updates a subnet pool. Normal response codes: 200 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - subnetpool_id: subnetpool_id - subnetpool: subnetpool - name: name - default_quota: default_quota - tenant_id: project_id - project_id: project_id - prefixes: prefixes - min_prefixlen: min_prefixlen - address_scope_id: address_scope_id - default_prefixlen: default_prefixlen - max_prefixlen: max_prefixlen - description: description-request Request Example --------------- .. literalinclude:: samples/subnets/subnetpool-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - subnetpool: subnetpool - id: subnetpool_id_body - name: name - default_quota: default_quota - tenant_id: project_id - project_id: project_id - created_at: created_at - updated_at: updated_at - prefixes: prefixes - min_prefixlen: min_prefixlen - address_scope_id: address_scope_id - ip_version: ip_version - shared: shared - default_prefixlen: default_prefixlen - max_prefixlen: max_prefixlen - description: description - is_default: subnetpool_is_default - revision_number: revision_number Response Example ---------------- .. literalinclude:: samples/subnets/subnetpool-update-response.json :language: javascript Delete subnet pool ================== .. rest_method:: DELETE /v2.0/subnetpools/{subnetpool_id} Deletes a subnet pool. The operation fails if any subnets allocated from the subnet pool are still in use. Normal response codes: 204 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - subnetpool_id: subnetpool_id Response -------- There is no body content for the response of a successful DELETE request. List subnet pools ================= .. rest_method:: GET /v2.0/subnetpools Lists subnet pools that the project has access to. Default policy settings return only the subnet pools owned by the project of the user submitting the request, unless the user has administrative role. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - subnetpools: subnetpools - id: subnetpool_id_body - name: name - default_quota: default_quota - tenant_id: project_id - project_id: project_id - created_at: created_at - updated_at: updated_at - prefixes: prefixes - min_prefixlen: min_prefixlen - address_scope_id: address_scope_id - ip_version: ip_version - shared: shared - default_prefixlen: default_prefixlen - max_prefixlen: max_prefixlen - description: description - is_default: subnetpool_is_default - revision_number: revision_number Response Example ---------------- .. literalinclude:: samples/subnets/subnetpools-list-response.json :language: javascript Create subnet pool ================== .. rest_method:: POST /v2.0/subnetpools Creates a subnet pool. Normal response codes: 201 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - subnetpool: subnetpool - name: name - default_quota: default_quota - tenant_id: project_id - project_id: project_id - prefixes: prefixes - min_prefixlen: min_prefixlen - address_scope_id: address_scope_id - shared: shared - default_prefixlen: default_prefixlen - max_prefixlen: max_prefixlen - description: description-request Request Example --------------- .. literalinclude:: samples/subnets/subnetpool-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - subnetpool: subnetpool - id: subnetpool_id_body - name: name - default_quota: default_quota - tenant_id: project_id - project_id: project_id - created_at: created_at - updated_at: updated_at - prefixes: prefixes - min_prefixlen: min_prefixlen - address_scope_id: address_scope_id - ip_version: ip_version - shared: shared - default_prefixlen: default_prefixlen - max_prefixlen: max_prefixlen - description: description - is_default: subnetpool_is_default - revision_number: revision_number Response Example ---------------- .. literalinclude:: samples/subnets/subnetpool-create-response.json :language: javascriptneutron-lib-1.13.0/api-ref/source/v2/trunk-details.inc0000666000175100017510000000214113231472055022513 0ustar zuulzuul00000000000000.. -*- rst -*- ========================================= Trunk details extended attributes (ports) ========================================= The trunk_details extension attribute is available when showing a port resource that participates in a trunk as parent. The extension is useful for REST clients that may want to access trunk details when getting the parent port, and it allows them to avoid extra lookups. Show trunk details ================== .. rest_method:: GET /v2.0/ports/{port_id} Shows details for a port. The details available in the `trunk_details` attribute contain the trunk ID and the array showing information about the subports that belong to the trunk: the port UUID, the segmentation type, the segmentation ID, and the MAC address. Normal response codes: 200 Request ------- .. rest_parameters:: parameters.yaml - port_id: port_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - trunk_details: trunk_details Response Example ---------------- .. literalinclude:: ../v2/samples/trunks/trunk-details-show-response.json :language: javascript neutron-lib-1.13.0/api-ref/source/v2/logging.inc0000666000175100017510000001261313231472055021360 0ustar zuulzuul00000000000000.. -*- rst -*- ============ Log resource ============ The ``logging`` extension lists, creates, shows information for, and updates log resource. List logs ========= .. rest_method:: GET /v2.0/log/logs Lists all log resources associated with your project. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. The list might be empty. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - logs: logs - id: log_id - name: name - description: description - tenant_id: project_id - project_id: project_id - event: log_event - revision_number: revision_number - resource_type: resource_log_type - resource_id: resource_log_id - target_id: resource_target_log_id - enabled: log_enabled Response Example ---------------- .. literalinclude:: samples/logs/log-list-response.json :language: javascript Create log ========== .. rest_method:: POST /v2.0/log/logs Creates a log resource. Creates a log resource by using the configuration that you define in the request object. A response object is returned. The object contains a unique ID. If the caller is not an administrative user, this call returns the HTTP ``Forbidden (403)`` response code. Users with an administrative role can create policies on behalf of other projects by specifying a project ID that is different than their own. Normal response codes: 201 Error response codes: 400, 401, 403, 409 Request ------- .. rest_parameters:: parameters.yaml - log: log - name: name-request - description: description-request - tenant_id: project_id-request - project_id: project_id-request - event: log_event-request - resource_type: resource_log_type - resource_id: resource_log_id-request - target_id: resource_target_log_id-request - enabled: log_enabled-request Request Example --------------- .. literalinclude:: samples/logs/log-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - log: log - id: log_id - name: name - description: description - tenant_id: project_id - project_id: project_id - event: log_event - revision_number: revision_number - resource_type: resource_log_type - resource_id: resource_log_id - target_id: resource_target_log_id - enabled: log_enabled Request Example --------------- .. literalinclude:: samples/logs/log-create-response.json :language: javascript Show log ======== .. rest_method:: GET /v2.0/log/logs/{log_id} Shows details log resource. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - log_id: log_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - log: log - id: log_id - name: name - description: description - tenant_id: project_id - project_id: project_id - event: log_event - revision_number: revision_number - resource_type: resource_log_type - resource_id: resource_log_id - target_id: resource_target_log_id - enabled: log_enabled Response Example ---------------- .. literalinclude:: samples/logs/log-show-response.json :language: javascript Update log ========== .. rest_method:: PUT /v2.0/log/logs/{log_id} Updates a log resource. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - log_id: log_id-path - log: log - name: name-request - description: description-request - enabled: log_enabled-request-put Request Example --------------- .. literalinclude:: samples/logs/log-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - log: log - id: log_id - name: name - description: description - tenant_id: project_id - project_id: project_id - event: log_event - revision_number: revision_number - resource_type: resource_log_type - resource_id: resource_log_id - target_id: resource_target_log_id - enabled: log_enabled Response Example ---------------- .. literalinclude:: samples/logs/log-update-response.json :language: javascript Delete log ========== .. rest_method:: DELETE /v2.0/log/logs/{log_id} Deletes a log resource. Normal response codes: 204 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - log_id: log_id-path Response -------- There is no body content for the response of a successful DELETE request. ================= Loggable resource ================= List loggable resources ======================= .. rest_method:: GET /v2.0/log/loggable-resources Lists all resource log types are supporting. Normal response codes: 200 Error response codes: 401 Request ------- Response Parameters ------------------- .. rest_parameters:: parameters.yaml - loggable_resources: loggable_resources - type: resource_log_type Response Example ---------------- .. literalinclude:: samples/logs/loggable_resources-list-response.json :language: javascriptneutron-lib-1.13.0/api-ref/source/v2/lbaas-v2.inc0000666000175100017510000012656313231472055021353 0ustar zuulzuul00000000000000.. -*- rst -*- ================== LBaaS 2.0 (STABLE) ================== The Load-Balancer-as-a-Service (LBaaS) version 2.0 extension pairs with the Networking 2.0 API to enable OpenStack projects to manage load balancers for their VMs. With this extension you can load-balance client traffic from one network to application services, such as VMs, on the same network. Use this extension to create and manage load balancers, listeners, pools, members of a pool, and health monitors and view status of a resource. **Load balancer statuses** +----------------+--------------------------------------------------------------------+ | Status | Description | +----------------+--------------------------------------------------------------------+ | ACTIVE | The resource is ready and active. | +----------------+--------------------------------------------------------------------+ | PENDING_CREATE | The resource is being created. | +----------------+--------------------------------------------------------------------+ | PENDING_UPDATE | The resource is being updated. | +----------------+--------------------------------------------------------------------+ | PENDING_DELETE | The resource is pending deletion. | +----------------+--------------------------------------------------------------------+ | INACTIVE | The resource is not active. | +----------------+--------------------------------------------------------------------+ | ERROR | An object within the service is not working. The ``error_details`` | | | attribute provides an explanation for the error, its cause, and | | | possibly a solution. | +----------------+--------------------------------------------------------------------+ .. ============================================================ ============== Load balancers ============== List load balancers =================== .. rest_method:: GET /v2.0/lbaas/loadbalancers Lists all load balancers for the project. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. The list might be empty. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - loadbalancers: loadbalancers - admin_state_up: admin_state_up - description: description - flavor: flavor-id-response - id: loadbalancer-id - listeners: listeners - name: name - operating_status: operating_status - project_id: project_id - provider: loadbalancer-provider - provisioning_status: provisioning_status - tenant_id: project_id - vip_address: vip_address - vip_subnet_id: vip_subnet_id - pools: pools-obj Response Example ---------------- .. literalinclude:: samples/lbaas/loadbalancers-list-response.json :language: javascript Create a load balancer ====================== .. rest_method:: POST /v2.0/lbaas/loadbalancers Creates a load balancer. This operation provisions a new load balancer by using the configuration that you define in the request object. After the API validates the request and starts the provisioning process, the API returns a response object that contains a unique ID and the status of provisioning the load balancer. In the response, the load balancer provisioning status is ``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``. If the status is ``PENDING_CREATE``, issue GET ``/lbaas/loadbalancers/loadbalancer_id`` to view the progress of the provisioning operation. When the load balancer status changes to ``ACTIVE``, the load balancer is successfully provisioned and operational for traffic handling. If the API cannot fulfill the request due to insufficient data or data that is not valid, the service returns the HTTP ``Bad Request (400)`` response code with information about the failure in the response body. Validation errors require that you correct the error and submit the request again. You can configure all documented features of the load balancer at creation time by specifying the additional elements or attributes in the request. Administrative users can specify a project ID that is different than their own to create load balancers for other projects. **Example: Create a load balancer** - ``project_id``. Admin only. Required to create a load balancer for another project. - ``vip_subnet_id``. The network on which to allocate the VIP address for the load balancer. A project can only create load balancer VIPs on networks that the policy authorizes, such as her own networks or shared or provider networks. Some attributes receive default values if you omit them from the request: - ``admin_state_up``. Default is ``true``. - ``name``. Default is an empty string. - ``description``. Default is an empty string. If you own the subnet where you want to create the load balancer VIP, you can specify a ``vip_address`` attribute. If you omit the ``vip_address`` attribute from the payload, the LBaaS service allocates a VIP address from the subnet of the load balancer VIP. An optional ``flavor`` attribute can be passed to enable dynamic selection of an appropriate provider if configured by the operator. The basic selection algorithm chooses the provider in the first service profile currently associated with flavor. You can also specify the ``provider`` attribute when you create a load balancer. You can set this attribute to any service provider with a ``LOADBALANCER`` service type. Setting both a flavor and a provider will result in a conflict error. Finally, ``vip_network_id`` can be used in place of ``vip_subnet_id``. When this option is used, the VIP port is created on the given network using the default behavior. If assigned multiple fixed IPs, an IPv4 addresses is chosen as the VIP in preference to IPv6 addresses. Normal response codes: 201 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - loadbalancer: loadbalancer - admin_state_up: admin_state_up-request - description: description-request - flavor: flavor-id-request - name: name-request - project_id: project_id-request - provider: loadbalancer-provider-request - tenant_id: project_id-request - vip_address: vip_address - vip_subnet_id: vip_subnet_id Request Example --------------- .. literalinclude:: samples/lbaas/loadbalancer-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - loadbalancer: loadbalancer - admin_state_up: admin_state_up - description: description - flavor: flavor-id-response - id: loadbalancer-id - listeners: listeners - name: name - operating_status: operating_status - project_id: project_id - provider: loadbalancer-provider - provisioning_status: provisioning_status - tenant_id: project_id - vip_address: vip_address - vip_network_id: vip_network_id - vip_subnet_id: vip_subnet_id - pools: pools-obj Response Example ---------------- .. literalinclude:: samples/lbaas/loadbalancer-create-response.json :language: javascript Show load balancer details ========================== .. rest_method:: GET /v2.0/lbaas/loadbalancers/{loadbalancer_id} Shows details for a load balancer. This operation returns a load balancer object, by ID. If you are not an administrative user and the load balancer object does not belong to your project, the service returns the HTTP ``Forbidden (403)`` response code. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - loadbalancer_id: loadbalancer-id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - loadbalancer: loadbalancer - admin_state_up: admin_state_up - description: description - id: loadbalancer-id - listeners: listeners - name: name - operating_status: operating_status - project_id: project_id - provisioning_status: provisioning_status - tenant_id: project_id - vip_address: vip_address - vip_subnet_id: vip_subnet_id - pools: pools-obj Response Example ---------------- .. literalinclude:: samples/lbaas/loadbalancer-show-response.json :language: javascript Update load balancer ==================== .. rest_method:: PUT /v2.0/lbaas/loadbalancers/{loadbalancer_id} Updates a load balancer. If the request is valid, the service returns the ``Accepted (202)`` response code. To confirm the update, check that the load balancer provisioning status is ``ACTIVE``. If the status is ``PENDING_UPDATE``, use a GET operation to poll the load balancer object for changes. This operation returns the updated load balancer object with the ``ACTIVE``, ``PENDING_UPDATE``, or ``ERROR`` provisioning status. Normal response codes: 202 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - loadbalancer_id: loadbalancer-id-path - loadbalancer: loadbalancer - admin_state_up: admin_state_up-request - name: name-request - description: description-request Request Example --------------- .. literalinclude:: samples/lbaas/loadbalancer-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - loadbalancer: loadbalancer - admin_state_up: admin_state_up - description: description - flavor: flavor-id-response - id: loadbalancer-id - listeners: listeners - name: name - operating_status: operating_status - project_id: project_id - provider: loadbalancer-provider - provisioning_status: provisioning_status - tenant_id: project_id - vip_address: vip_address - vip_subnet_id: vip_subnet_id - pools: pools-obj Response Example ---------------- .. literalinclude:: samples/lbaas/loadbalancer-update-response.json :language: javascript Remove load balancer ==================== .. rest_method:: DELETE /v2.0/lbaas/loadbalancers/{loadbalancer_id} Removes a load balancer and its associated configuration from the project. The API immediately purges any and all configuration data. You cannot recover it. Example: Delete a load balancer Normal response codes: 204 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - loadbalancer_id: loadbalancer-id-path Response -------- There is no body content for the response of a successful DELETE request. ====================== Load balancer statuses ====================== Show load balancer status tree ============================== .. rest_method:: GET /v2.0/lbaas/loadbalancers/{loadbalancer_id}/statuses Shows the status tree for a load balancer. This operation returns a status tree for a load balancer object, by load balancer ID. If you are not an administrative user and the load balancer object does not belong to the project, the API returns the ``Forbidden (403)`` response code. If the operation succeeds, the returned element is a status tree that contains the load balancer and all provisioning and operating statuses for its children. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - loadbalancer_id: loadbalancer-id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - statuses: loadbalancer-statuses - loadbalancer: loadbalancer - listeners: listeners - pools: pools - healthmonitor: healthmonitor - id: loadbalancer-id - members: members - operating_status: operating_status - provisioning_status: provisioning_status Response Example ---------------- .. literalinclude:: samples/lbaas/loadbalancer-status-tree.json :language: javascript .. ============================================================ ========= Listeners ========= List listeners ============== .. rest_method:: GET /v2.0/lbaas/listeners Lists all listeners. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. This operation lists all listeners that are associated with your project. The list might be empty. Example: List listeners Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - listeners: listeners-response - admin_state_up: admin_state_up - connection_limit: connection_limit-response - default_pool_id: default_pool_id-response - default_tls_container_ref: default_tls_container_ref-response - description: description - id: listener-id-response - loadbalancers: loadbalancers - name: name - project_id: project_id - protocol: protocol-response - protocol_port: protocol_port - sni_container_refs: sni_container_refs-response - tenant_id: project_id Response Example ---------------- .. literalinclude:: samples/lbaas/listeners-list-response.json :language: javascript Create listener =============== .. rest_method:: POST /v2.0/lbaas/listeners Creates a listener. This operation provisions a new listener by using the configuration that you define in the request object. After the request is validated and the provisioning process begins, a response object is returned. The object contains a unique identifier. At a minimum, you must specify these listener attributes: - ``project_id``. Admin only. Required to create a listener for another project. - ``loadbalancer_id``. The load balancer on which to provision this listener. A project can only create listeners on load balancers that the policy authorizes. For example, her own load balancers. - ``description``. The load balancer description. - ``protocol``. The protocol for which the front end listens. Must be ``HTTP``, ``HTTPS``, ``TCP``, or ``TERMINATED_HTTPS``. - ``protocol_port``. The port on which the front end listens. Must be an integer from 1 to 65535. Some attributes receive default values if you omit them from the request: - ``default_tls_container_ref``. The reference to a container that holds TLS secrets. If you also specify ``sni_container_refs``, this container is the default. This parameter is required for the ``TERMINATED_HTTPS`` protocol. - ``sni_container_refs``. A list of references to containers that hold TLS secrets for server name indication (SNI). This parameter is required for the ``TERMINATED_HTTPS`` protocol. - ``admin_state_up``. Default is ``true``. - ``name``. Default is an empty string. - ``description``. Default is an empty string. - ``connection_limit``. Default is ``-1``, which indicates an infinite limit. If the API cannot fulfill the request due to insufficient data or data that is not valid, the service returns the HTTP ``Bad Request (400)`` response code with information about the failure in the response body. Validation errors require that you correct the error and submit the request again. You can configure all documented features of the listener at creation time by specifying the additional elements or attributes in the request. Administrative users can specify a project ID that is different than their own to create listeners for other projects. To update a listener, the load balancer to which to attach must have an ``ACTIVE`` provisioning status. Normal response codes: 201 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - listener: listener - admin_state_up: admin_state_up-request - connection_limit: connection_limit - default_pool_id: default_pool_id - default_tls_container_ref: default_tls_container_ref - description: description - loadbalancer_id: loadbalancer-id - name: name - project_id: project_id-request - protocol: protocol-response - protocol_port: protocol_port-request - sni_container_refs: sni_container_refs - tenant_id: project_id-request Request Example --------------- .. literalinclude:: samples/lbaas/listener-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - listener: listener - admin_state_up: admin_state_up - connection_limit: connection_limit-response - default_pool_id: default_pool_id-response - default_tls_container_ref: default_tls_container_ref-response - description: description - id: listener-id-response - loadbalancers: loadbalancers - name: name - project_id: project_id - protocol: protocol-response - protocol_port: protocol_port - sni_container_refs: sni_container_refs-response - tenant_id: project_id Response Example ---------------- .. literalinclude:: samples/lbaas/listener-create-response.json :language: javascript Show listener details ===================== .. rest_method:: GET /v2.0/lbaas/listeners/{listener_id} Shows details for a listener. This operation returns a listener object, by ID. If you are not an administrative user and the listener object does not belong to your account, the API returns the HTTP ``Forbidden (403)`` response code. Example: Show listener details Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - listener_id: listener-id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - listener: listener - admin_state_up: admin_state_up - connection_limit: connection_limit-response - id: listener-id-response - default_pool_id: default_pool_id-response - default_tls_container_ref: default_tls_container_ref-response - description: description - loadbalancers: loadbalancers - name: name - project_id: project_id - protocol: protocol-response - protocol_port: protocol_port - sni_container_refs: sni_container_refs-response - tenant_id: project_id Response Example ---------------- .. literalinclude:: samples/lbaas/listener-show-response.json :language: javascript Update listener =============== .. rest_method:: PUT /v2.0/lbaas/listeners/{listener_id} Updates a listener. This operation updates the attributes of a listener. Upon successful validation of the request, the service returns the HTTP ``Accepted (202)`` response code. Note: You cannot update the ``listener_id``, ``project_id``, ``loadbalancer_id``, ``loadbalancers``, ``default_pool_id``, ``protocol``, and ``protocol_port`` attributes. Attempting to update an immutable attribute results in the HTTP ``Immutable (422)`` response code. Note: You cannot update a listener if the load balancer to which the listener is attached does not have an ``ACTIVE`` provisioning status. Normal response codes: 202 Error response codes: 401, 404, 422 Request ------- .. rest_parameters:: parameters.yaml - listener_id: listener-id-path - listener: listener - admin_state_up: admin_state_up-request - connection_limit: connection_limit - default_tls_container_ref: default_tls_container_ref - description: description - name: name - sni_container_refs: sni_container_refs Request Example --------------- .. literalinclude:: samples/lbaas/listener-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - listener: listener - admin_state_up: admin_state_up - connection_limit: connection_limit-response - default_pool_id: default_pool_id-response - default_tls_container_ref: default_tls_container_ref-response - description: description - id: listener-id-response - loadbalancers: loadbalancers - name: name - project_id: project_id - protocol: protocol-response - protocol_port: protocol_port - sni_container_refs: sni_container_refs-response - tenant_id: project_id Response Example ---------------- .. literalinclude:: samples/lbaas/listener-update-response.json :language: javascript Remove listener =============== .. rest_method:: DELETE /v2.0/lbaas/listeners/{listener_id} Removes a listener. This operation removes a listener and its associated configuration from the project. The API immediately purges any and all configuration data. You cannot recover it. You cannot delete a listener if the load balancer to which it is attached does not have an ``ACTIVE`` provisioning status. Example: Delete a listener Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - listener_id: listener-id-path Response -------- There is no body content for the response of a successful DELETE request. .. ============================================================ ===== Pools ===== List pools ========== .. rest_method:: GET /v2.0/lbaas/pools Lists all pools that are associated with your project. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. The list might be empty. Example: List pools Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - pools: pools-obj - admin_state_up: admin_state_up - description: description - healthmonitors: healthmonitors-response - healthmonitors_status: healthmonitors_status - id: pool-id-response - lb_algorithm: lb_algorithm - members: members - name: name - project_id: project_id - protocol: protocol-response - provider: loadbalancer-provider - status: pool-status - status_description: status_description - subnet_id: pool-subnet_id - tenant_id: project_id - vip_id: vip_id Response Example ---------------- .. literalinclude:: samples/lbaas/pools-list-response.json :language: javascript Create pool =========== .. rest_method:: POST /v2.0/lbaas/pools Creates a pool. This operation provisions a pool by using the configuration that you define in the request object. After the API validates the request and starts the provisioning process, the API returns a response object, which contains a unique ID. At a minimum, you must specify these pool attributes: - ``project_id``. Admin only. Required to create a pool for another project. - ``protocol``. The protocol for which this pool and its members listen. A valid value is ``TCP``, ``HTTP``, or ``HTTPS``. - ``lb_algorithm``. The load-balancer algorithm, such as ``ROUND_ROBIN``, ``LEAST_CONNECTIONS``, and ``SOURCE_IP``, that distributes traffic to the pool members. The load-balancer provider must support this algorithm. - ``listener_id``. The ID of the listener in which this pool becomes the default pool. Each listener has only one default pool. Some attributes receive default values if you omit them from the request: - ``admin_state_up``. Default is ``true``. - ``name``. Default is an empty string. - ``description``. Default is an empty string. - ``session_persistence``. Default is an empty dictionary. If the API cannot fulfill the request due to insufficient data or data that is not valid, the service returns the HTTP ``Bad Request (400)`` response code with information about the failure in the response body. Validation errors require that you correct the error and submit the request again. Users can configure all documented features at creation time by providing the additional elements or attributes in the request. Administrative users can specify a project ID that is different than their own to create pools for other projects. To update a pool, the load balancer to which to attach must have an ``ACTIVE`` provisioning status. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - pool: pool - admin_state_up: admin_state_up-request - description: description-request - lb_algorithm: lb_algorithm - listener_id: listener-id-response - name: name - project_id: project_id-request - protocol: protocol - subnet_id: pool-subnet_id - tenant_id: project_id-request Request Example --------------- .. literalinclude:: samples/lbaas/pool-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - pool: pool - admin_state_up: admin_state_up - description: description - healthmonitors: healthmonitors-response - healthmonitors_status: healthmonitors_status - id: pool-id-response - lb_algorithm: lb_algorithm - members: members - name: name - project_id: project_id - protocol: protocol-response - provider: loadbalancer-provider - status: pool-status - status_description: status_description - subnet_id: pool-subnet_id - tenant_id: project_id - vip_id: vip_id Response Example ---------------- .. literalinclude:: samples/lbaas/pool-create-response.json :language: javascript Show pool details ================= .. rest_method:: GET /v2.0/lbaas/pools/{pool_id} Shows details for a pool. This operation shows details for a pool, by ID. If you are not an administrative user and the pool object does not belong to your project, the call returns the HTTP ``Forbidden (403)`` response code. If this operation succeeds, it returns a ``pool`` element. Example: Show pool details Normal response codes: 200 Error response codes: 403 Request ------- .. rest_parameters:: parameters.yaml - pool_id: pool_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - pool: pool - admin_state_up: admin_state_up - description: description - healthmonitors: healthmonitors-response - healthmonitors_status: healthmonitors_status - lb_algorithm: lb_algorithm - members: members - id: pool-id-response - name: name - status: pool-status - status_description: status_description - project_id: project_id - protocol: protocol-response - provider: loadbalancer-provider - subnet_id: pool-subnet_id - tenant_id: project_id - vip_id: vip_id Response Example ---------------- .. literalinclude:: samples/lbaas/pool-show-response.json :language: javascript Update pool =========== .. rest_method:: PUT /v2.0/lbaas/pools/{pool_id} Updates a pool. This operation updates the attributes of a pool. Upon successful validation of the request, the service returns the HTTP ``Accepted (202)`` response code. Note: You cannot update the pool ID, ``project_id``, ``listener_id``, ``listeners``, ``healthmonitor_id``, ``protocol``, and ``members`` immutable attributes. If you try to update any of these attributes, the service returns the HTTP ``Immutable (422)`` response code . Note: You cannot update a pool if the load balancer to which it is attached does not have an ``ACTIVE`` provisioning status. Normal response codes: 202 Error response codes: 401, 404, 422 Request ------- .. rest_parameters:: parameters.yaml - pool_id: pool_id-path - pool: pool - admin_state_up: admin_state_up-request - description: description-request - lb_algorithm: lb_algorithm - name: name Request Example --------------- .. literalinclude:: samples/lbaas/pool-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - pool: pool - admin_state_up: admin_state_up - description: description - healthmonitors: healthmonitors-response - healthmonitors_status: healthmonitors_status - id: pool-id-response - lb_algorithm: lb_algorithm - members: members - name: name - status: pool-status - status_description: status_description - project_id: project_id - protocol: protocol-response - provider: loadbalancer-provider - subnet_id: pool-subnet_id - tenant_id: project_id - vip_id: vip_id Response Example ---------------- .. literalinclude:: samples/lbaas/pool-update-response.json :language: javascript Remove pool =========== .. rest_method:: DELETE /v2.0/lbaas/pools/{pool_id} Removes a pool. This operation removes a pool and its associated configuration from the project. The API immediately purges any and all configuration data. You cannot recover it. You cannot delete a pool if the load balancer to which it is attached does not have an ``ACTIVE`` provisioning status. Normal response codes: 204 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - pool_id: pool_id-path Response -------- There is no body content for the response of a successful DELETE request. .. ============================================================ ============ Pool members ============ List pool members ================= .. rest_method:: GET /v2.0/lbaas/pools/{pool_id}/members Lists members of a pool. Lists all members that are associated with a pool that is associated with your project. The list of members includes only members that belong to the pool object identified by ``pool_id``. The list might be empty. Example: List pool members Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - pool_id: pool_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - members: members - address: address - admin_state_up: admin_state_up - id: member-id-response - project_id: project_id - protocol_port: protocol_port - subnet_id: pool-subnet_id - tenant_id: project_id - weight: member-weight Response Example ---------------- .. literalinclude:: samples/lbaas/pool-members-list-response.json :language: javascript Add member to pool ================== .. rest_method:: POST /v2.0/lbaas/pools/{pool_id}/members Adds a member to a pool. This operation provisions a member and adds it to a pool by using the configuration that you define in the request object. After the API validates the request and starts the provisioning process, it returns a response object, which contains a unique ID. At a minimum, you must specify these pool attributes: - ``project_id``. Admin only. Required to create a pool for another project. - ``address``. The IP address of the member to receive traffic from the load balancer. - ``protocol_port`` The port on which the member listens for traffic. Some attributes receive default values if you omit them from the request: - ``admin_state_up``. Default is ``true``. - ``weight``. Default is ``1``. If you omit the ``subnet_id`` parameter, LBaaS uses the ``vip_subnet_id`` parameter value for the subnet UUID. If the request fails due to incorrect data, the service returns the HTTP ``Bad Request (400)`` response code with information about the failure in the response body. Validation errors require that you correct the error and submit the request again. To configure all documented member features at creation time, specify additional elements or attributes in the request. Administrative users can specify a project ID that is different than their own to create members for other projects. To update a member, the load balancer must have an ``ACTIVE`` provisioning status. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - pool_id: pool_id-path - address: address - member: member - project_id: project_id-request - protocol_port: protocol_port - subnet_id: pool-subnet_id-request - tenant_id: project_id-request Request Example --------------- .. literalinclude:: samples/lbaas/member-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - member: member - address: address - admin_state_up: admin_state_up - id: member-id-response - project_id: project_id - protocol_port: protocol_port - subnet_id: pool-subnet_id - tenant_id: project_id - weight: member-weight Response Example ---------------- .. literalinclude:: samples/lbaas/member-create-response.json :language: javascript Show pool member details ======================== .. rest_method:: GET /v2.0/lbaas/pools/{pool_id}/members/{member_id} Shows details for a pool member. This operation returns a member object identified by ``member_id`` that belongs to a pool object identified by ``pool_id``. If you are not an administrative user and the pool or member object does not belong to your project, the service returns the HTTP ``Forbidden (403)`` response code. If this operation succeeds, it returns a pool element. Example: Show pool member details Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - pool_id: pool_id-path - member_id: member_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - member: member - address: address - admin_state_up: admin_state_up - id: member-id-response - project_id: project_id - protocol_port: protocol_port - subnet_id: pool-subnet_id - tenant_id: project_id - weight: member-weight Response Example ---------------- .. literalinclude:: samples/lbaas/member-show-response.json :language: javascript Update pool member ================== .. rest_method:: PUT /v2.0/lbaas/pools/{pool_id}/members/{member_id} Updates attributes for a pool member. Upon successful validation of the request, the service returns the HTTP ``OK (200)`` response code. Note: You cannot update the member ID, ``project_id``, ``address``, ``protocol_port``, and ``subnet_id`` attributes. If you attempt to update any of these attributes, the service returns the HTTP ``Immutable (422)`` response code. Note: You cannot update a member if the attached load balancer does not have an ``ACTIVE`` provisioning status. Normal response codes: 200 Error response codes: 401, 404, 422 Request ------- .. rest_parameters:: parameters.yaml - pool_id: pool_id-path - member_id: member_id-path - member: member - admin_state_up: admin_state_up - weight: member-weight-request Request Example --------------- .. literalinclude:: samples/lbaas/member-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - member: member - address: address - admin_state_up: admin_state_up - id: member-id-response - project_id: project_id - protocol_port: protocol_port - subnet_id: pool-subnet_id - tenant_id: project_id - weight: member-weight Response Example ---------------- .. literalinclude:: samples/lbaas/member-update-response.json :language: javascript Remove member from pool ======================= .. rest_method:: DELETE /v2.0/lbaas/pools/{pool_id}/members/{member_id} Removes a member from a pool and its associated configuration from the project. The API immediately purges any and all configuration data. You cannot recover it. You cannot delete a member if the attached load balancer does not have an ``ACTIVE`` provisioning status. Example: Remove a member from a pool Normal response codes: 204 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - pool_id: pool_id-path - member_id: member_id-path Response -------- There is no body content for the response of a successful DELETE request. .. ============================================================ =============== Health monitors =============== List health monitors ==================== .. rest_method:: GET /v2.0/lbaas/healthmonitors Lists health monitors. This operation lists all health monitors that are associated with your project. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. This operation returns a list, which might be empty. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - healthmonitors: healthmonitors-obj - admin_state_up: admin_state_up - delay: delay - expected_codes: expected_codes-response - http_method: http_method - id: healthmonitor-id - max_retries: max_retries - pools: pools - project_id: project_id - tenant_id: project_id - timeout: timeout - type: type - url_path: url_path-response Response Example ---------------- .. literalinclude:: samples/lbaas/healthmonitors-list-response.json :language: javascript Create health monitor ===================== .. rest_method:: POST /v2.0/lbaas/healthmonitors Creates a health monitor. This operation provisions a health monitor by using the configuration that you define in the request object. After the API validates the request and start the provisioning process, it returns a response object. The object contains a unique identifier. At a minimum, you must specify these health monitor attributes: - ``project_id``. Admin only. Required to create a health monitor for another project. - ``type``. The type of health monitor. A valid value is ``TCP``, ``HTTP``, or ``HTTPS``. - ``delay``. The interval, in seconds, between health checks. - ``timeout``. The time, in seconds, after which a health check times out. - ``max_retries``. Number of failed health checks before marked as OFFLINE. - ``pool_id``. The pool to monitor. Some attributes receive default values if you omit them from the request, and are only useful when you specify a health monitor type of HTTP(S): - ``http_method``. Default is ``GET``. - ``url_path``. Default is ``/``. - ``expected_codes``. The expected HTTP status codes to get from a successful health check. Default is ``200``. - ``admin_state_up``. Default is ``true``. If the API cannot fulfill the request due to insufficient data or data that is not valid, it returns the ``Bad Request (400)`` response code with information about the nature of the failure in the response body. Failures in the validation process are non- recoverable and require that you correct the cause of the failure and submit the request again. You can configure all documented features of the health monitor at creation time by specifying the additional elements or attributes in the request. Administrative users can specify a project ID that is different than their own to create health monitors for other projects. To update a health monitor, the load balancer to which to attach must have an ``ACTIVE`` provisioning status. Normal response codes: 201 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - healthmonitor: healthmonitor - admin_state_up: admin_state_up - delay: delay - expected_codes: expected_codes - http_method: http_method - max_retries: max_retries - pool_id: pool_id-request - project_id: project_id - tenant_id: project_id - timeout: timeout - type: type - url_path: url_path Request Example --------------- .. literalinclude:: samples/lbaas/healthmonitor-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - healthmonitor: healthmonitor - admin_state_up: admin_state_up - delay: delay - expected_codes: expected_codes-response - http_method: http_method - id: healthmonitor-id - max_retries: max_retries - pools: pools - project_id: project_id - tenant_id: project_id - timeout: timeout - type: type - url_path: url_path-response Response Example ---------------- .. literalinclude:: samples/lbaas/healthmonitor-show-response.json :language: javascript Show health monitor details =========================== .. rest_method:: GET /v2.0/lbaas/healthmonitors/{healthmonitor_id} Shows details for a health monitor. This operation returns a health monitor object, by health monitor ID. If you are not an administrative user and the health monitor object does not belong to your project, the service returns the HTTP ``Forbidden (403)`` response code. Example: Show health monitor details Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - healthmonitor_id: healthmonitor_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - healthmonitor: healthmonitor - admin_state_up: admin_state_up - delay: delay - expected_codes: expected_codes-response - http_method: http_method - max_retries: max_retries - id: healthmonitor-id - pools: pools - project_id: project_id - tenant_id: project_id - timeout: timeout - type: type - url_path: url_path-response Response Example ---------------- .. literalinclude:: samples/lbaas/healthmonitor-show-response.json :language: javascript Update health monitor ===================== .. rest_method:: PUT /v2.0/lbaas/healthmonitors/{healthmonitor_id} Updates a health monitor. Upon successful validation of the request, the service returns the HTTP ``Accepted (202)`` response code. Note: The health monitor ID, ``project_id``, ``pool_id``, and type are immutable attributes and cannot be updated. If you specify an unsupported attribute, the service returns the HTTP ``Immutable (422)`` response code. Normal response codes: 202 Error response codes: 401, 404, 422 Request ------- .. rest_parameters:: parameters.yaml - healthmonitor_id: healthmonitor_id-path - healthmonitor: healthmonitor - admin_state_up: admin_state_up - delay: delay - expected_codes: expected_codes - http_method: http_method - max_retries: max_retries - timeout: timeout - url_path: url_path Request Example --------------- .. literalinclude:: samples/lbaas/healthmonitor-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - healthmonitor: healthmonitor - admin_state_up: admin_state_up - delay: delay - expected_codes: expected_codes-response - http_method: http_method - max_retries: max_retries - id: healthmonitor-id - pools: pools - project_id: project_id - tenant_id: project_id - timeout: timeout - type: type - url_path: url_path-response Response Example ---------------- .. literalinclude:: samples/lbaas/healthmonitor-update-response.json :language: javascript Remove health monitor ===================== .. rest_method:: DELETE /v2.0/lbaas/healthmonitors/{healthmonitor_id} Removes a health monitor and its associated configuration from the project. The API immediately purges any and all configuration data. You cannot recover it. You cannot delete a health monitor if the attached load balancer does not have an ``ACTIVE`` provisioning status. Example: Delete a health monitor Normal response codes: 204 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - healthmonitor_id: healthmonitor_id-path Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/firewall_log.inc0000666000175100017510000001204413231472055022376 0ustar zuulzuul00000000000000.. -*- rst -*- =============== Firewall Logs =============== .. note:: Currently this extension ``logging-resource`` is only available for networking-midonet. Lists, shows information for, creates, updates and deletes firewall logs. List Firewall Logs ================== .. rest_method:: GET /v2.0/logging/logging_resources/{logging_resource_id}/firewall_logs Lists firewall logs. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - logging_resource_id: logging_resource_id - fields: fields Response -------- .. rest_parameters:: parameters.yaml - firewall_logs: firewall_logs - logging_resource_id: logging_resource_id-body - id: firewall_log_id-body - tenant_id: project_id - project_id: project_id - description: description - fw_event: fw_event - firewall_id: firewall_id-body Response Example ---------------- .. literalinclude:: samples/firewall_log/firewall_logs-list-response.json :language: javascript Create Firewall Log =================== .. rest_method:: POST /v2.0/logging/logging_resources/{logging_resource_id}/firewall_logs Creates a firewall log. Normal response codes: 200 Error response codes: 400, 401, 403 Request ------- .. rest_parameters:: parameters.yaml - logging_resource_id: logging_resource_id - firewall_log: firewall_log - tenant_id: project_id-request - project_id: project_id-request - description: description-request - fw_event: fw_event-request - firewall_id: firewall_id-body Request Example --------------- .. literalinclude:: samples/firewall_log/firewall_log-create-request.json :language: javascript Response -------- .. rest_parameters:: parameters.yaml - firewall_log: firewall_log - logging_resource_id: logging_resource_id-body - id: firewall_log_id-body - tenant_id: project_id - project_id: project_id - description: description - fw_event: fw_event - firewall_id: firewall_id-body Response Example ---------------- .. literalinclude:: samples/firewall_log/firewall_log-create-response.json :language: javascript Show Firewall Log Details ========================= .. rest_method:: GET /v2.0/logging/logging_resources/{logging_resource_id}/firewall_logs/{firewall_log_id} Shows details for a firewall log. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - logging_resource_id: logging_resource_id - firewall_log_id: firewall_log_id - fields: fields Response -------- .. rest_parameters:: parameters.yaml - firewall_log: firewall_log - logging_resource_id: logging_resource_id-body - id: firewall_log_id-body - tenant_id: project_id - project_id: project_id - description: description - fw_event: fw_event - firewall_id: firewall_id-body Response Example ---------------- .. literalinclude:: samples/firewall_log/firewall_log-show-response.json :language: javascript Update Firewall Log =================== .. rest_method:: PUT /v2.0/logging/logging_resources/{logging_resource_id}/firewall_logs/{firewall_log_id} Updates a firewall log. Normal response codes: 200 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - logging_resource_id: logging_resource_id - firewall_log_id: firewall_log_id - firewall_log: firewall_log - description: description-request-put - fw_event: fw_event-request-put Request Example ---------------- .. literalinclude:: samples/firewall_log/firewall_log-update-request.json :language: javascript Response -------- .. rest_parameters:: parameters.yaml - firewall_log: firewall_log - logging_resource_id: logging_resource_id-body - id: firewall_log_id-body - tenant_id: project_id - project_id: project_id - description: description - fw_event: fw_event - firewall_id: firewall_id-body Response Example ---------------- .. literalinclude:: samples/firewall_log/firewall_log-update-response.json :language: javascript Delete Firewall Log =================== .. rest_method:: DELETE /v2.0/logging/logging_resources/{logging_resource_id}/firewall_logs/{firewall_log_id} Deletes a firewall log. Normal response codes: 202 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - logging_resource_id: logging_resource_id - firewall_log_id: firewall_log_id Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/versions.inc0000666000175100017510000000240113231472055021574 0ustar zuulzuul00000000000000.. -*- rst -*- .. needs:example_verification ============ API versions ============ Lists information for all Networking API versions. List API versions ================= .. rest_method:: GET / Lists information about all Networking API versions. Normal response codes: 200 Request ------- .. .. rest_parameters:: parameters.yaml Response Parameters ------------------- .. rest_parameters:: parameters.yaml - versions: versions - status: version-status - id: version-id - links: version-links - href: version-href - rel: version-rel Response Example ---------------- .. literalinclude:: samples/networks/versions-list-response.json :language: javascript Show API v2 details =================== .. rest_method:: GET /v2.0/ Shows details for Networking API v2.0. Normal response codes: 200 Error response codes: 401 Request ------- .. .. rest_parameters:: parameters.yaml Response Parameters ------------------- .. rest_parameters:: parameters.yaml - resources: resources - name: resource-name - collection: resource-collection - links: resource-links - href: resource-href - rel: resource-rel Response Example ---------------- .. literalinclude:: samples/networks/version-show-response.json :language: javascript neutron-lib-1.13.0/api-ref/source/v2/service-providers.inc0000666000175100017510000000175713231472055023414 0ustar zuulzuul00000000000000.. -*- rst -*- ================= Service providers ================= Lists service providers. List service providers ====================== .. rest_method:: GET /v2.0/service-providers Lists service providers and their associated service types. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - service_providers: service_providers - service_type: service_type - name: name - default: default Response Example ---------------- .. literalinclude:: samples/service-type-response.json :language: javascript neutron-lib-1.13.0/api-ref/source/v2/network-ip-availability.inc0000666000175100017510000000471113231472055024501 0ustar zuulzuul00000000000000.. -*- rst -*- ======================================= Network IP availability and usage stats ======================================= The extension ``network-ip-availability`` allows users to list and show the network IP usage stats of all networks or of a specified network. By default policy configuration, only administrative users can use this API. Show Network IP Availability ============================ .. rest_method:: GET /v2.0/network-ip-availabilities/{network_id} Shows network IP availability details for a network. By default policy configuration, only administrative users can retrieve IP availability. Otherwise, ``Not Found (404)`` will be returned. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - network_id: network_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - network_ip_availability: network_ip_availability - network_id: network_ip_availability-network_id - network_name: network-name - tenant_id: project_id - project_id: project_id - total_ips: total_ips - used_ips: used_ips - subnet_ip_availability: subnet_ip_availability - subnet_id: network_ip_availability-subnet_id - subnet_name: subnet_name - ip_version: subnet-ip_version - cidr: cidr Response Example ---------------- .. literalinclude:: samples/network-ip-availability/network-ip-availability-show.json :language: javascript List Network IP Availability ============================ .. rest_method:: GET /v2.0/network-ip-availabilities Lists network IP availability of all networks. By default policy configuration, only administrative users can retrieve IP availabilities. Otherwise, an empty list will be returned. Normal response codes: 200 Error response codes: 401 Request ------- Response Parameters ------------------- .. rest_parameters:: parameters.yaml - network_ip_availabilities: network_ip_availabilities - network_id: network_ip_availability-network_id - network_name: network-name - tenant_id: project_id - project_id: project_id - total_ips: total_ips - used_ips: used_ips - subnet_ip_availability: subnet_ip_availability - subnet_id: network_ip_availability-subnet_id - subnet_name: subnet_name - ip_version: subnet-ip_version - cidr: cidr Response Example ---------------- .. literalinclude:: samples/network-ip-availability/network-ip-availability-list.json :language: javascript neutron-lib-1.13.0/api-ref/source/v2/bgpvpn-network_associations.inc0000666000175100017510000000755313231472055025503 0ustar zuulzuul00000000000000==================== Network Associations ==================== Associating a BGPVPN to a Network can be done for both BGPVPN of type L2 and of type L3. For type L3, the semantic is that all Subnets bound to the Network will be interconnected with the BGP VPN (and thus between themselves). A given Network can be associated with multiple BGPVPNs. Associating or disassociating a BGPVPN to a Network is done by manipulating a Network association API resource as a sub-resource of the BGPVPN resource: List Network Associations ========================= .. rest_method:: GET /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/network_associations Lists network associations for a given BGP VPN. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - network_associations: bgpvpn-network_associations - id: bgpvpn-network_association_id - network_id: bgpvpn-network_id - tenant_id: project_id - project_id: project_id Response Example ---------------- .. literalinclude:: samples/bgpvpn/network_associations/network_association-list-response.json :language: javascript Create Network Association ========================== .. rest_method:: POST /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/network_associations Creates a network association for a given BGP VPN Normal response codes: 201 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path - network_association: bgpvpn-network_association - network_id: bgpvpn-network_id Request Example --------------- .. literalinclude:: samples/bgpvpn/network_associations/network_association-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - network_association: bgpvpn-network_association - id: bgpvpn-network_association_id - network_id: bgpvpn-network_id - tenant_id: project_id - project_id: project_id Response Example ---------------- .. literalinclude:: samples/bgpvpn/network_associations/network_association-create-response.json :language: javascript Show Network Association details ================================ .. rest_method:: GET /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/network_associations/{network_association_id} Shows details for a network association. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path - network_association_id: bgpvpn-network_association_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - network_association: bgpvpn-network_association - id: bgpvpn-network_association_id - network_id: bgpvpn-network_id - tenant_id: project_id - project_id: project_id Response Example ---------------- .. literalinclude:: samples/bgpvpn/network_associations/network_association-show-response.json :language: javascript Delete Network Association ========================== .. rest_method:: DELETE /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/network_associations/{network_association_id} Deletes a network association. Normal response codes: 204 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path - network_association_id: bgpvpn-network_association_id-path Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/intro.inc0000666000175100017510000004332713231472055021073 0ustar zuulzuul00000000000000.. -*- rst -*- .. needs:method_verification .. needs:parameter_verification .. needs:example_verification .. needs:body_verification ========= API guide ========= This section introduces readers to OpenStack Networking (v2) API, provides guidelines on how to use it, and describes common features available to users throughout all Networking APIs. General information =================== The Networking API v2.0 is a RESTful HTTP service that uses all aspects of the HTTP protocol including methods, URIs, media types, response codes, and so on. Providers can use existing features of the protocol including caching, persistent connections, and content compression. For example, providers who employ a caching layer can respond with a ``203`` code instead of a ``200`` code when a request is served from the cache. Additionally, providers can offer support for conditional ``GET`` requests by using ETags, or they may send a redirect in response to a ``GET`` request. Create clients so that these differences are accounted for. Authentication and authorization ================================ The Networking API v2.0 uses the `OpenStack Identity service `_ as the default authentication service. When Keystone is enabled, users that submit requests to the OpenStack Networking service must provide an authentication token in ``X-Auth-Token`` request header. You obtain the token by authenticating to the Keystone endpoint. When Keystone is enabled, the ``project_id`` attribute is not required in create requests because the project ID is derived from the authentication token. NOTE: Currently the Networking API accepts the deprecated ``tenant_id`` attribute for the project ID for backward compatibility. The default authorization settings allow only administrative users to create resources on behalf of a different project. OpenStack Networking uses information received from Keystone to authorize user requests. OpenStack Networking handles the following types of authorization policies: - **Operation-based policies** specify access criteria for specific operations, possibly with fine-grained control over specific attributes. - **Resource-based policies** access a specific resource. Permissions might or might not be granted depending on the permissions configured for the resource. Currently available for only the network resource. The actual authorization policies enforced in OpenStack Networking might vary from deployment to deployment. Request and response formats ============================ The Networking API v2.0 supports JSON data serialization request and response formats only. Request format -------------- The Networking API v2.0 only accepts requests with the JSON data serialization format. The ``Content-Type`` header is ignored. Tenant and project attributes in requests ----------------------------------------- Starting with the Newton release of the Networking service, the Networking API accepts the ``project_id`` attribute in addition to the ``tenant_id`` attribute in requests. The ``tenant_id`` attribute is accepted for backward compatibility. If both the ``project_id`` and the ``tenant_id`` attribute are provided in the same request, their values must be identical. To determine whether a Networking API v2.0 endpoint supports the ``project_id`` attribute in requests, check that the ``project-id`` API extension is enabled (see Extensions_). Response format --------------- The Networking API v2.0 always responds with the JSON data serialization format. The ``Accept`` header is ignored. Query extension A ``.json`` extension can be added to the request URI. For example, the ``.json`` extension in the following requests are equivalent: - ``GET`` *publicURL*/networks - ``GET`` *publicURL*/networks.json Tenant and project attributes in responses ------------------------------------------ Starting with the Newton release of the Networking service, the Networking API returns a ``project_id`` attribute in responses, while still returning a ``tenant_id`` attribute for backward compatibility. The values will always be identical. To determine whether a Networking API v2.0 endpoint returns the ``project_id`` attribute in responses, check that the ``project-id`` API extension is enabled (see Extensions_). .. _filtering: Filtering and column selection ============================== The Networking API v2.0 supports filtering based on all top level attributes of a resource. Filters are applicable to all list requests. For example, the following request returns all networks named ``foobar``: .. code:: GET /v2.0/networks?name=foobar When you specify multiple filters using different fields, the Networking API v2.0 returns only objects that meet all filtering criteria. The operation applies an AND condition among different filter fields. OpenStack Networking offers an OR mechanism for filters by repeating the field with the different OR criteria. For example, to find all networks named ``foobar`` OR ``bizbaz``: .. code:: GET /v2.0/networks?name=foobar&name=bizbaz ORs and ANDs can be combined. For example, if you want all networks with admin_state_up=True and shared=True and named ``foobar`` or ``bizbaz``: .. code:: GET /v2.0/networks?name=foobar&name=bizbaz&admin_state_up=True&shared=True Note ---- By default, OpenStack Networking returns all attributes for any show or list call. The Networking API v2.0 has a mechanism to limit the set of attributes returned. For example, return ``id``. You can use the ``fields`` query parameter to control the attributes returned from the Networking API v2.0. For example, the following request returns only ``id`` and ``name`` for each network: .. code:: GET /v2.0/networks.json?fields=id&fields=name Synchronous versus asynchronous plug-in behavior ================================================ The Networking API v2.0 presents a logical model of network connectivity consisting of networks, ports, and subnets. It is up to the OpenStack Networking plug-in to communicate with the underlying infrastructure to ensure packet forwarding is consistent with the logical model. A plug-in might perform these operations asynchronously. When an API client modifies the logical model by issuing an HTTP ``POST``, ``PUT``, or ``DELETE`` request, the API call might return before the plug-in modifies underlying virtual and physical switching devices. However, an API client is guaranteed that all subsequent API calls properly reflect the changed logical model. For example, if a client issues an HTTP ``PUT`` request to set the attachment for a port, there is no guarantee that packets sent by the interface named in the attachment are forwarded immediately when the HTTP call returns. However, it is guaranteed that a subsequent HTTP ``GET`` request to view the attachment on that port returns the new attachment value. You can use the ``status`` attribute with the network and port resources to determine whether the OpenStack Networking plug-in has successfully completed the configuration of the resource. Bulk-create =========== The Networking API v2.0 enables you to create several objects of the same type in the same API request. Bulk create operations use exactly the same API syntax as single create operations except that you specify a list of objects rather than a single object in the request body. Bulk operations are always performed atomically, meaning that either all or none of the objects in the request body are created. If a particular plug-in does not support atomic operations, the Networking API v2.0 emulates the atomic behavior so that users can expect the same behavior regardless of the particular plug-in running in the background. OpenStack Networking might be deployed without support for bulk operations and when the client attempts a bulk create operation, a ``400`` Bad request error is returned. Pagination ========== To reduce load on the service, list operations will return a maximum number of items at a time. To navigate the collection, the parameters ``limit``, ``marker`` and ``page_reverse`` can be set in the URI. For example: .. code:: ?limit=100&marker=1234&page_reverse=False The ``marker`` parameter is the ID of the last item in the previous list. The ``limit`` parameter sets the page size. The ``page_reverse`` parameter sets the page direction. These parameters are optional. If the client requests a limit beyond the maximum limit configured by the deployment, the server returns the maximum limit number of items. For convenience, list responses contain atom ``next`` links and ``previous`` links. The last page in the list requested with ``page_reverse=False`` will not contain ``next`` link, and the last page in the list requested with ``page_reverse=True`` will not contain ``previous`` link. The following examples illustrate two pages with three items. The first page was retrieved through: .. code:: GET http://127.0.0.1:9696/v2.0/networks.json?limit=2 Pagination is an optional feature of OpenStack Networking API, and it might be disabled. If pagination is disabled, the pagination parameters will be ignored and return all the items. If a particular plug-in does not support pagination operations, and pagination is enabled, the Networking API v2.0 will emulate the pagination behavior so that users can expect the same behavior regardless of the particular plug-in running in the background. To determine if pagination is supported, a user can check whether the 'pagination' extension API is available. **Example Network collection, first page: JSON request** .. code:: GET /v2.0/networks.json?limit=2 HTTP/1.1 Host: 127.0.0.1:9696 Content-Type: application/json Accept: application/json **Example Network collection, first page: JSON response** .. code:: { "networks": [ { "admin_state_up": true, "id": "396f12f8-521e-4b91-8e21-2e003500433a", "name": "net3", "provider:network_type": "vlan", "provider:physical_network": "physnet1", "provider:segmentation_id": 1002, "router:external": false, "shared": false, "status": "ACTIVE", "subnets": [], "tenant_id": "20bd52ff3e1b40039c312395b04683cf" "project_id": "20bd52ff3e1b40039c312395b04683cf" }, { "admin_state_up": true, "id": "71c1e68c-171a-4aa2-aca5-50ea153a3718", "name": "net2", "provider:network_type": "vlan", "provider:physical_network": "physnet1", "provider:segmentation_id": 1001, "router:external": false, "shared": false, "status": "ACTIVE", "subnets": [], "tenant_id": "20bd52ff3e1b40039c312395b04683cf" "project_id": "20bd52ff3e1b40039c312395b04683cf" } ], "networks_links": [ { "href": "http://127.0.0.1:9696/v2.0/networks.json?limit=2&marker=71c1e68c-171a-4aa2-aca5-50ea153a3718", "rel": "next" }, { "href": "http://127.0.0.1:9696/v2.0/networks.json?limit=2&marker=396f12f8-521e-4b91-8e21-2e003500433a&page_reverse=True", "rel": "previous" } ] } The last page won't show the ``next`` links **Example Network collection, last page: JSON request** .. code:: GET /v2.0/networks.json?limit=2&marker=71c1e68c-171a-4aa2-aca5-50ea153a3718 HTTP/1.1 Host: 127.0.0.1:9696 Content-Type: application/json Accept: application/json **Example Network collection, last page: JSON response** .. code:: { "networks": [ { "admin_state_up": true, "id": "b3680498-03da-4691-896f-ef9ee1d856a7", "name": "net1", "provider:network_type": "vlan", "provider:physical_network": "physnet1", "provider:segmentation_id": 1000, "router:external": false, "shared": false, "status": "ACTIVE", "subnets": [], "tenant_id": "c05140b3dc7c4555afff9fab6b58edc2" "project_id": "c05140b3dc7c4555afff9fab6b58edc2" } ], "networks_links": [ { "href": "http://127.0.0.1:9696/v2.0/networks.json?limit=2&marker=b3680498-03da-4691-896f-ef9ee1d856a7&page_reverse=True", "rel": "previous" } ] } Sorting ======= You can use the ``sort_key`` and ``sort_dir`` parameters to sort the results of list operations. Currently sorting does not work with extended attributes of resource. The ``sort_key`` and ``sort_dir`` can be repeated, and the number of ``sort_key`` and ``sort_dir`` provided must be same. The ``sort_dir`` parameter indicates in which direction to sort. Acceptable values are ``asc`` (ascending) and ``desc`` (descending). Sorting is optional feature of OpenStack Networking API, and it might be disabled. If sorting is disabled, the sorting parameters are ignored. If a particular plug-in does not support sorting operations and sorting is enabled, the Networking API v2.0 emulates the sorting behavior so that users can expect the same behavior regardless of the particular plug-in that runs in the background. To determine if sorting is supported, a user can check whether the 'sorting' extension API is available. .. _Extensions: Extensions ========== The Networking API v2.0 is extensible. The purpose of Networking API v2.0 extensions is to: - Introduce new features in the API without requiring a version change. - Introduce vendor-specific niche functionality. - Act as a proving ground for experimental functionalities that might be included in a future version of the API. To programmatically determine which extensions are available, issue a ``GET`` request on the ``v2.0/extensions`` URI. To query extensions individually by unique alias, issue a ``GET`` request on the ``/v2.0/extensions/*alias_name*`` URI. Use this method to easily determine if an extension is available. If the extension is not available, a ``404 Not Found`` response is returned. You can extend existing core API resources with new actions or extra attributes. Also, you can add new resources as extensions. Extensions usually have tags that prevent conflicts with other extensions that define attributes or resources with the same names, and with core resources and attributes. Because an extension might not be supported by all plug-ins, the availability of an extension varies with deployments and the specific plug-in in use. Faults ====== The Networking API v2.0 returns an error response if a failure occurs while processing a request. OpenStack Networking uses only standard HTTP error codes. ``4nn`` errors indicate problems in the particular request being sent from the client. +-------+--------------------------------------------------------------+ | Error | Description | +=======+==============================================================+ |``400``| Bad request | | | Malformed request URI or body requested admin state invalid | | | Invalid values entered | | | Bulk operations disallowed | | | Validation failed | | | Method not allowed for request body (such as trying to | | | update attributes that can be specified at create-time only) | +-------+--------------------------------------------------------------+ |``404``| Not Found | | | Non existent URI | | | Resource not found | +-------+--------------------------------------------------------------+ |``409``| Conflict | | | Port configured on network | | | IP allocated on subnet | | | Conflicting IP allocation pools for subnet | +-------+--------------------------------------------------------------+ |``500``| Internal server error | | | Internal OpenStack Networking error | +-------+--------------------------------------------------------------+ |``503``| Service unavailable | | | Failure in Mac address generation | +-------+--------------------------------------------------------------+ Users submitting requests to the Networking API v2.0 might also receive the following errors: - ``401 Unauthorized`` - If invalid credentials are provided. - ``403 Forbidden`` - If the user cannot access a specific resource or perform the requested operation. Revisions ========= The ``Resource revision numbers`` extension (``standard-attr-revisions``) adds the ``revision_number`` attribute to all API resources that support standard attributes. This includes networks, ports, subnets, subnet pools, floating IPs, routers, logs, security groups/rules, network segments, QoS policies and trunks. As you'd expect, the ``revision_number`` indicates the number of updates a particular resource has undergone and is read-only. In addition, the ``If-Match constraints based on revision_number`` extension (``revision-if-match``) allows API consumers to leverage the ``If-Match`` HTTP header to conditionally update/delete a resource when the HTTP ``If-Match`` header matches the ``revision_number`` of the said resource. neutron-lib-1.13.0/api-ref/source/v2/logging_resource.inc0000666000175100017510000001145513231472055023272 0ustar zuulzuul00000000000000.. -*- rst -*- =================== Logging Resources =================== .. note:: Currently this extension ``logging-resource`` is only available for networking-midonet. Lists, shows information for, creates, updates and deletes logging resources. List Logging Resources ====================== .. rest_method:: GET /v2.0/logging/logging_resources Lists logging resources. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response -------- .. rest_parameters:: parameters.yaml - logging_resources: logging_resources - id: logging_resource_id-body - tenant_id: project_id - project_id: project_id - firewall_logs: firewall_logs - name: name - description: description - enabled: logging_resource_enabled Response Example ---------------- .. literalinclude:: samples/logging_resource/logging_resources-list-response.json :language: javascript Create Logging Resource ======================= .. rest_method:: POST /v2.0/logging/logging_resources Creates a logging resource. Normal response codes: 200 Error response codes: 400, 401, 403 Request ------- .. rest_parameters:: parameters.yaml - logging_resource: logging_resource - tenant_id: project_id-request - project_id: project_id-request - name: name-request - description: description-request - enabled: logging_resource_enabled-request Request Example --------------- .. literalinclude:: samples/logging_resource/logging_resource-create-request.json :language: javascript Response -------- .. rest_parameters:: parameters.yaml - logging_resource: logging_resource - id: logging_resource_id-body - tenant_id: project_id - project_id: project_id - firewall_logs: firewall_logs - name: name - description: description - enabled: logging_resource_enabled Response Example ---------------- .. literalinclude:: samples/logging_resource/logging_resource-create-response.json :language: javascript Show Logging Resource Details ============================= .. rest_method:: GET /v2.0/logging/logging_resources/{logging_resource_id} Shows details for a logging resource. Use the ``fields`` query parameter to control which fields are returned in the response body. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - logging_resource_id: logging_resource_id - fields: fields Response -------- .. rest_parameters:: parameters.yaml - logging_resource: logging_resource - id: logging_resource_id-body - tenant_id: project_id - project_id: project_id - firewall_logs: firewall_logs - name: name - description: description - enabled: logging_resource_enabled Response Example ---------------- .. literalinclude:: samples/logging_resource/logging_resource-show-response.json :language: javascript Update Logging Resource ======================= .. rest_method:: PUT /v2.0/logging/logging_resources/{logging_resource_id} Updates a logging resource. Normal response codes: 200 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - logging_resource_id: logging_resource_id - logging_resource: logging_resource - name: name-request-put - description: description-request-put - enabled: logging_resource_enabled-request-put Request Example ---------------- .. literalinclude:: samples/logging_resource/logging_resource-update-request.json :language: javascript Response -------- .. rest_parameters:: parameters.yaml - logging_resource: logging_resource - id: logging_resource_id-body - tenant_id: project_id - project_id: project_id - firewall_logs: firewall_logs - name: name - description: description - enabled: logging_resource_enabled Response Example ---------------- .. literalinclude:: samples/logging_resource/logging_resource-update-response.json :language: javascript Delete Logging Resource ======================= .. rest_method:: DELETE /v2.0/logging/logging_resources/{logging_resource_id} Deletes a logging resource. Normal response codes: 202 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - logging_resource_id: logging_resource_id Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/fwaas.inc0000666000175100017510000004435713231472055021045 0ustar zuulzuul00000000000000========================================================================== FWaaS v1.0 (DEPRECATED) (fw, firewalls, firewall_policies, firewall_rules) ========================================================================== .. note:: While FWaaS v1.0 is still maintained, new features will be implemented in FWaaS v2.0 API. Use the Firewall-as-a-Service (FWaaS) v1.0 extension to deploy firewalls to protect your networks. The FWaaS extension enables you to: - Apply firewall rules on traffic entering and leaving project networks. - Apply TCP, UDP, ICMP, or protocol-agnostic rules. - Create and share firewall policies that hold an ordered collection of the firewall rules. - Audit firewall rules and policies. This extension introduces these resources: - ``firewall``. A logical firewall resource that a project can instantiate and manage. A firewall can have one firewall policy. - ``firewall_policy``. An ordered collection of firewall rules. You can share a firewall policy across projects. You can include a firewall policy as part of an audit workflow so that an authorized relevant entity can audit the firewall policy. This entity can differ from the user who created, or the projects that use, the firewall policy. - ``firewall_rule``. A collection of attributes, such as ports and IP addresses. These attributes define match criteria and an action to take, such as allow or deny, on matched data traffic. List firewall policies ====================== .. rest_method:: GET /v2.0/fw/firewall_policies Lists all firewall policies. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - tenant_id: project_id - firewall_policies: firewall_policies - audited: audited - description: description - firewall_rules: firewall_rules - id: firewall_policy_id-body - name: name - shared: shared-response - project_id: project_id Response Example ---------------- .. literalinclude:: samples/firewalls/firewall-policies-list-response.json :language: javascript Create firewall policy ====================== .. rest_method:: POST /v2.0/fw/firewall_policies Creates a firewall policy. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - firewall_policy: firewall_policy - firewall_rules_id: firewall_rules_id - name: name - tenant_id: project_id-request - project_id: project_id-request - shared: shared - audited: audited - description: description-request Request Example --------------- .. literalinclude:: samples/firewalls/firewall-policy-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_policy: firewall_policy - name: name - firewall_rules: firewall_rules - tenant_id: project_id - project_id: project_id - audited: audited - shared: shared-response - id: firewall_policy_id-body - description: description Show firewall policy details ============================ .. rest_method:: GET /v2.0/fw/firewall_policies/{firewall_policy_id} Shows details for a firewall policy. If the user is not an administrative user and the firewall policy object does not belong to the project, this call returns the ``Forbidden (403)`` response code. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - firewall_policy_id: firewall_policy_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_policy: firewall_policy - tenant_id: project_id - project_id: project_id - audited: audited - description: description - firewall_rules: firewall_rules - id: firewall_policy_id-body - name: name - shared: shared-response Response Example ---------------- .. literalinclude:: samples/firewalls/firewall-policy-show-response.json :language: javascript Update firewall policy ====================== .. rest_method:: PUT /v2.0/fw/firewall_policies/{firewall_policy_id} Updates a firewall policy. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - firewall_policy_id: firewall_policy_id-path - firewall_rule: firewall_rule - shared: shared - audited: audited - description: description-request - name: name Request Example --------------- .. literalinclude:: samples/firewalls/firewall-policy-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_policy: firewall_policy - project_id: project_id - audited: audited - description: description - firewall_rules: firewall_rules - id: firewall_policy_id-body - name: name - shared: shared-response - tenant_id: project_id Response Example ---------------- .. literalinclude:: samples/firewalls/firewall-policy-update-response.json :language: javascript Delete firewall policy ====================== .. rest_method:: DELETE /v2.0/fw/firewall_policies/{firewall_policy_id} Deletes a firewall policy. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - firewall_policy_id: firewall_policy_id-path Response -------- There is no body content for the response of a successful DELETE request. Insert rule into a firewall policy ================================== .. rest_method:: PUT /v2.0/fw/firewall_policies/{firewall_policy_id}/insert_rule Insert firewall rule into a policy. A firewall_rule_id is inserted relative to the position of the firewall_rule_id set in ``insert_before`` or ``insert_after``. If ``insert_before`` is set, ``insert_after`` is ignored. If both ``insert_before`` and ``insert_after`` are not set, the new firewall_rule_id is inserted at the top of the policy. Normal response codes: 200 Error response codes: 400, 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - firewall_policy_id: firewall_policy_id-path - firewall_rule_id: firewall_rule_id-body - insert_after: insert_after - insert_before: insert_before Request Example --------------- .. literalinclude:: samples/firewalls/firewall-policy-insert-rule-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - audited: audited - description: description - firewall_list: firewall_list - firewall_rules: firewall_rules - tenant_id: project_id - project_id: project_id - id: firewall_policy_id-body - name: name - shared: shared-response Response Example ---------------- .. literalinclude:: samples/firewalls/firewall-policy-insert-rule-response.json :language: javascript Remove rule from firewall policy ================================ .. rest_method:: PUT /v2.0/fw/firewall_policies/{firewall_policy_id}/remove_rule Remove firewall rule from a policy. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - firewall_policy_id: firewall_policy_id-path - firewall_rule_id: firewall_rule_id-body Request Example --------------- .. literalinclude:: samples/firewalls/firewall-policy-remove-rule-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - tenant_id: project_id - project_id: project_id - audited: audited - description: description - firewall_list: firewall_list - firewall_rules: firewall_rules - id: firewall_id-body - name: name - shared: shared-response Response Example ---------------- .. literalinclude:: samples/firewalls/firewall-policy-remove-rule-response.json :language: javascript List firewall rules =================== .. rest_method:: GET /v2.0/fw/firewall_rules Lists all firewall rules. The list might be empty. Normal response codes: 200 Error response codes: 401, 403 Request ------- Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_rule: firewall_rule - action: action-response - description: description - tenant_id: project_id - project_id: project_id - destination_ip_address: destination_ip_address-response - destination_port: destination_port-response - enabled: enabled-response - firewall_policy_id: firewall_policy_id-body - id: firewall_id-body - ip_version: ip_version-response - name: name - position: position - protocol: protocol-response - shared: shared-response - source_ip_address: source_ip_address - source_port: source_port-response Response Example ---------------- .. literalinclude:: samples/firewalls/firewall-rules-list-response.json :language: javascript Create firewall rule ==================== .. rest_method:: POST /v2.0/fw/firewall_rules Creates a firewall rule. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - firewall_rule: firewall_rule - action: action - destination_port: destination_port - enabled: enabled - description: description-request - tenant_id: project_id-request - project_id: project_id-request - enabled: enabled - name: name - protocol: protocol - ip_version: ip_version - destination_ip_address: destination_ip_address - source_port: source_port - shared: shared Request Example --------------- .. literalinclude:: samples/firewalls/firewall-rule-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_rule: firewall_rule - action: action-response - description: description - tenant_id: project_id - project_id: project_id - destination_ip_address: destination_ip_address-response - destination_port: destination_port-response - enabled: enabled-response - firewall_policy_id: firewall_policy_id-body - id: firewall_id-body - ip_version: ip_version-response - name: name - position: position - protocol: protocol-response - shared: shared-response - source_ip_address: source_ip_address - source_port: source_port-response Response Example ---------------- .. literalinclude:: samples/firewalls/firewall-rule-create-response.json :language: javascript Show firewall rule details ========================== .. rest_method:: GET /v2.0/fw/firewall_rules/{firewall_rule_id} Shows details for a firewall rule. If the user is not an administrative user and the firewall rule object does not belong to the project, this call returns the ``Forbidden (403)`` response code. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - firewall_rule_id: firewall_rule_id Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_rule: firewall_rule - action: action-response - description: description - tenant_id: project_id - project_id: project_id - destination_ip_address: destination_ip_address-response - destination_port: destination_port-response - enabled: enabled-response - firewall_policy_id: firewall_policy_id - id: firewall_rule_id-body - ip_version: ip_version-response - name: name - position: position - protocol: protocol-response - shared: shared-response - source_ip_address: source_ip_address - source_port: source_port-response Response Example ---------------- .. literalinclude:: samples/firewalls/firewall-rule-show-response.json :language: javascript Update firewall rule ==================== .. rest_method:: PUT /v2.0/fw/firewall_rules/{firewall_rule_id} Updates a firewall rule. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - firewall_rule_id: firewall_rule_id - firewall_rule: firewall_rule - shared: shared - description: description-request - tenant_id: project_id-request - project_id: project_id-request - enabled: enabled - ip_version: ip_version - destination_ip_address: destination_ip_address - source_port: source_port - action: action - protocol: protocol - destination_port: destination_port - name: name Request Example --------------- .. literalinclude:: samples/firewalls/firewall-rule-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_rule: firewall_rule - action: action-response - description: description - source_ip_address: source_ip_address - tenant_id: project_id - project_id: project_id - enabled: enabled - protocol: protocol - source_port: source_port - ip_version: ip_version - destination_ip_address: destination_ip_address-response - destination_port: destination_port-response - enabled: enabled-response - firewall_policy_id: firewall_policy_id - id: firewall_rule_id-body - ip_version: ip_version-response - name: name - position: position - protocol: protocol-response - shared: shared-response - source_ip_address: source_ip_address - source_port: source_port-response Response Example ---------------- .. literalinclude:: samples/firewalls/firewall-rule-update-response.json :language: javascript Delete firewall rule ==================== .. rest_method:: DELETE /v2.0/fw/firewall_rules/{firewall_rule_id} Deletes a firewall rule. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - firewall_rule_id: firewall_rule_id Response -------- There is no body content for the response of a successful DELETE request. List firewalls ============== .. rest_method:: GET /v2.0/fw/firewalls Lists all firewalls. The list might be empty. Normal response codes: 200 Error response codes: 401, 403 Request ------- Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewalls: firewalls - admin_state_up: admin_state_up - tenant_id: project_id - project_id: project_id - description: description - firewall_policy_id: firewall_policy_id-body - id: firewall_id-body - name: name - status: firewall-status Response Example ---------------- .. literalinclude:: samples/firewalls/firewalls-list-response.json :language: javascript Create firewall =============== .. rest_method:: POST /v2.0/fw/firewalls Creates a firewall. The firewall must be associated with a firewall policy. If ``admin_state_up`` is ``false``, the firewall would block all traffic. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - firewall: firewall - admin_state_up: admin_state_up - firewall_policy_id: firewall_policy_id-body - description: description-request - name: name - router_ids: router_ids Request Example --------------- .. literalinclude:: samples/firewalls/firewall-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall: firewall - tenant_id: project_id - project_id: project_id - admin_state_up: admin_state_up - description: description - firewall_policy_id: firewall_policy_id-body - id: firewall_id-body - name: name - status: firewall-status - router_ids: router_ids-response Response Example ---------------- .. literalinclude:: samples/firewalls/firewall-create-response.json :language: javascript Show firewall details ===================== .. rest_method:: GET /v2.0/fw/firewalls/{firewall_id} Shows details for a firewall. If the user is not an administrative user and the firewall object does not belong to the project, this call returns the ``Forbidden (403)`` response code. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - firewall_id: firewall_id Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall: firewall - tenant_id: project_id - project_id: project_id - admin_state_up: admin_state_up - description: description - status: firewall-status - firewall_policy_id: firewall_policy_id - id: firewall_rule_id-body - name: name - router_ids: router_ids-response Response Example ---------------- .. literalinclude:: samples/firewalls/firewall-show-response.json :language: javascript Update firewall =============== .. rest_method:: PUT /v2.0/fw/firewalls/{firewall_id} Updates a firewall. To update a service, the service status cannot be a ``PENDING_*`` status. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - firewall_id: firewall_id - firewall: firewall - admin_state_up: admin_state_up - description: description-request - firewall_policy_id: firewall_policy_id-body - name: name - router_ids: router_ids Request Example --------------- .. literalinclude:: samples/firewalls/firewall-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall: firewall - tenant_id: project_id - project_id: project_id - admin_state_up: admin_state_up - description: description - status: firewall-status - firewall_policy_id: firewall_policy_id-body - id: firewall_id-body - name: name - router_ids: router_ids-response Response Example ---------------- .. literalinclude:: samples/firewalls/firewall-update-response.json :language: javascript Delete firewall =============== .. rest_method:: DELETE /v2.0/fw/firewalls/{firewall_id} Deletes a firewall. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - firewall_id: firewall_id Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/trunk.inc0000666000175100017510000002206013231472055021072 0ustar zuulzuul00000000000000.. -*- rst -*- ================ Trunk networking ================ The trunk extension can be used to multiplex packets coming from and going to multiple neutron logical networks using a single neutron logical port. A trunk is modeled in neutron as a collection of neutron logical ports. One port, called parent port, must be associated to a trunk and it is *the* port to be used to connect instances with neutron. A sequence of subports (or sub_ports) each typically belonging to distinct neutron networks, is also associated to a trunk, and each subport may have a segmentation type and ID used to mux/demux the traffic coming in and out of the parent port. In more details, the extension introduces the following resources: - **trunk**. A top level logical entity to model the group of neutron logical networks whose traffic flows through the trunk. - **sub_port**. An association to a neutron logical port with attributes segmentation_id and segmentation_type. List trunks =========== .. rest_method:: GET /v2.0/trunks Lists trunks that are accessible to the user who submits the request. Default policy settings return only those trunks that are owned by the user who submits the request, unless an admin user submits the request. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see the Filtering_ section for more details. Normal response codes: 200 Error response codes: 401, 404 Response Parameters ------------------- .. rest_parameters:: parameters.yaml - admin_state_up: admin_state_up_trunk - created_at: created_at_resource - description: description_resource - id: id_resource - name: name_resource - port_id: trunk_port_id - revision_number: revision_number - status: trunk-status - tenant_id: project_id-request - project_id: project_id-request - sub_ports: sub_ports - updated_at: updated_at_resource Response Example ---------------- .. literalinclude:: ../v2/samples/trunks/trunks-list-response.json :language: javascript Create trunk ============ .. rest_method:: POST /v2.0/trunks Error codes: - ``400`` The operation returns this error code if the request is malformed, e.g. there are missing or invalid parameters in the request. - ``401`` The operation is not authorized. - ``404`` If the extension is not available or the port UUID of any of the specified ports is not found. - ``409`` The operation returns this error code for one of these reasons: - A port to be used as subport is in use by another trunk. - The segmentation type and segmentation ID are already in use in the trunk. - A port to be used as parent port is in use by another trunk or cannot be trunked. - A system configuration prevents the operation from succeeding. Normal response codes: 201 Error response codes: 400, 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - tenant_id: project_id - project_id: project_id - port_id: trunk_port_id - name: name_resource - description: description_resource - admin_state_up: admin_state_up_trunk - sub_ports: sub_ports Request Example --------------- .. literalinclude:: ../v2/samples/trunks/trunk-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - admin_state_up: admin_state_up_trunk - created_at: created_at_resource - description: description_resource - id: id_resource - name: name_resource - port_id: trunk_port_id - revision_number: revision_number - status: trunk-status - tenant_id: project_id - project_id: project_id - sub_ports: sub_ports - updated_at: updated_at_resource Response Example ---------------- .. literalinclude:: ../v2/samples/trunks/trunks-create-response.json :language: javascript Add subports to trunk ===================== .. rest_method:: PUT /v2.0/trunks/{trunk_id}/add_subports Normal response codes: 200 Error response codes: 400, 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - trunk_id: trunk_id - segmentation_id: segmentation_id - segmentation_type: segmentation_type-request - port_id: port_id_subport Request Example --------------- .. literalinclude:: ../v2/samples/trunks/trunk-add-subports-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - admin_state_up: admin_state_up_trunk - created_at: created_at_resource - description: description_resource - id: id_resource - name: name_resource - port_id: trunk_port_id - revision_number: revision_number - status: trunk-status - tenant_id: project_id - project_id: project_id - sub_ports: sub_ports - updated_at: updated_at_resource Response Example ---------------- .. literalinclude:: ../v2/samples/trunks/trunk-add-subports-response.json :language: javascript Delete subports from trunk ========================== .. rest_method:: PUT /v2.0/trunks/{trunk_id}/remove_subports Normal response codes: 200 Error response codes: 400, 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - trunk_id: trunk_id - port_id: port_id Request Example --------------- .. literalinclude:: ../v2/samples/trunks/trunk-remove-subports-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - admin_state_up: admin_state_up_trunk - created_at: created_at_resource - description: description_resource - id: id_resource - name: name_resource - port_id: trunk_port_id - revision_number: revision_number - status: trunk-status - tenant_id: project_id - project_id: project_id - sub_ports: sub_ports - updated_at: updated_at_resource Response Example ---------------- .. literalinclude:: ../v2/samples/trunks/trunk-remove-subports-response.json :language: javascript List subports for trunk ======================= .. rest_method:: GET /v2.0/trunks/{trunk_id}/get_subports Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - trunk_id: trunk_id Response Parameters ------------------- .. rest_parameters:: parameters.yaml - port_id: port_id_subport - segmentation_type: segmentation_type - segmentation_id: segmentation_id Response Example ---------------- .. literalinclude:: ../v2/samples/trunks/trunk-list-subports-response.json :language: javascript Update trunk ============ .. rest_method:: PUT /v2.0/trunks/{trunk_id} The update request is only for changing fields like name, description or admin_state_up. Setting the admin_state_up to False locks the trunk in that it prevents operations such as as adding/removing subports. Normal response codes: 200 Error response codes: 400, 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - name_resource: name_resource - admin_state_up_trunk: admin_state_up - description_resource: description_resource - trunk_id: trunk_id Request Example --------------- .. literalinclude:: ../v2/samples/trunks/trunk-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - admin_state_up: admin_state_up_trunk - created_at: created_at_resource - description: description_resource - id: id_resource - name: name_resource - port_id: trunk_port_id - revision_number: revision_number - status: trunk-status - tenant_id: project_id - project_id: project_id - sub_ports: sub_ports - updated_at: updated_at_resource Response Example ---------------- .. literalinclude:: ../v2/samples/trunks/trunk-update-response.json :language: javascript Show trunk ========== .. rest_method:: GET /v2.0/trunks/{trunk_id} Shows details for a trunk. Use the ``fields`` query parameter to control which fields are returned in the response body. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - trunk_id: trunk_id Response Parameters ------------------- .. rest_parameters:: parameters.yaml - admin_state_up: admin_state_up_trunk - created_at: created_at_resource - description: description_resource - id: id_resource - name: name_resource - port_id: trunk_port_id - revision_number: revision_number - status: trunk-status - tenant_id: project_id - project_id: project_id - sub_ports: sub_ports - updated_at: updated_at_resource Response Example ---------------- .. literalinclude:: ../v2/samples/trunks/trunk-show-response.json :language: javascript Delete trunk ============ .. rest_method:: DELETE /v2.0/trunks/{trunk_id} Deletes a trunk, if its state allows it. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - trunk_id: trunk_id neutron-lib-1.13.0/api-ref/source/v2/flavors.inc0000666000175100017510000003116313231472055021407 0ustar zuulzuul00000000000000.. -*- rst -*- ===================================================================== Networking Flavors Framework v2.0 (CURRENT) (flavor, service_profile) ===================================================================== Extension that allows user selection of operator-curated flavors during resource creation. Users can check if flavor available by performing a GET on the /v2.0/extensions/flavors. If it is unavailable,there is an 404 error response (itemNotFound). Refer `Show extension details <#show-extension-details>`__ for more details. List flavors ============ .. rest_method:: GET /v2.0/flavors Lists all flavors visible to the project. The list can be empty. Standard query parameters are supported on the URI. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. If Neutron configuration supports pagination by overriding allow_pagination = false, the ``marker`` query parameter can set the last element id the client has seen and ``limit`` set the maximum number of items to return. if Neutron configuration has allow_sorting = true, ``sort_key`` and ``sort_dir`` pairs can be used where sort direction is 'asc' or 'desc'. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - flavors: flavors - id: flavor-id - service_type: flavor-service_type - name: flavor-name - description: flavor-description - enabled: flavor-enabled - service_profiles: flavor-service_profiles Response Example ---------------- .. literalinclude:: samples/flavors/flavors-list-response.json :language: javascript Create flavor ============= .. rest_method:: POST /v2.0/flavors Creates a flavor. This operation establishes a new flavor. The service_type to which the flavor applies is a required parameter. The corresponding service plugin must have been activated as part of the configuration. Check `Service providers <#list-service-providers>`__ for how to see currently loaded service types. Additionally the service plugin needs to support the use of flavors. For example, the LOADBALANCERV2 service type using the LBaaSv2 API currently supports Neutron service flavors. Creation currently limited to administrators. Other users will receive a ``Forbidden 403`` response code with a response body NeutronError message expressing that creation is disallowed by policy. Until one or more service profiles are associated with the flavor by the operator, attempts to use the flavor during resource creations will currently return a ``Not Found 404`` with a response body that indicates no service profile could be found. If the API cannot fulfill the request due to insufficient data or data that is not valid, the service returns the HTTP ``Bad Request (400)`` response code with information about the failure in the response body. Validation errors require that you correct the error and submit the request again. Normal response codes: 201 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - flavor: flavor - service_type: flavor-service_type - enabled: flavor-enabled-request - description: flavor-description-request - name: flavor-name-request Request Example --------------- .. literalinclude:: samples/flavors/flavor-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - flavor: flavor - id: flavor-id - service_type: flavor-service_type - name: flavor-name - description: flavor-description - enabled: flavor-enabled - service_profiles: flavor-service_profiles Response Example ---------------- .. literalinclude:: samples/flavors/flavor-create-response.json :language: javascript Show flavor details =================== .. rest_method:: GET /v2.0/flavors/{flavor_id} Shows details for a flavor. This operation returns a flavor object by ID. If you are not an administrative user and the flavor object is not visible to your project account, the service returns the HTTP ``Forbidden (403)`` response code. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - flavor_id: flavor_id Response Parameters ------------------- .. rest_parameters:: parameters.yaml - flavor: flavor - id: flavor-id - service_type: flavor-service_type - name: flavor-name - description: flavor-description - enabled: flavor-enabled - service_profiles: flavor-service_profiles Response Example ---------------- .. literalinclude:: samples/flavors/flavor-show-response.json :language: javascript Update flavor ============= .. rest_method:: PUT /v2.0/flavors/{flavor_id} Updates a flavor. The service_type cannot be updated as there may be associated service profiles and consumers depending on the value. Normal response codes: 200 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - flavor_id: flavor_id - flavor: flavor - name: flavor-name-request - description: flavor-description-request - enabled: flavor-enabled-request Request Example --------------- .. literalinclude:: samples/flavors/flavor-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - flavor: flavor - id: flavor-id - service_type: flavor-service_type - name: flavor-name - description: flavor-description - enabled: flavor-enabled - service_profiles: flavor-service_profiles Response Example ---------------- .. literalinclude:: samples/flavors/flavor-update-response.json :language: javascript Delete flavor ============= .. rest_method:: DELETE /v2.0/flavors/{flavor_id} Deletes a flavor. Normal response codes: 204 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - flavor_id: flavor_id Response -------- No body content is returned on a successful DELETE. Associate flavor with a service profile ======================================= .. rest_method:: POST /v2.0/flavors/{flavor_id}/service_profiles Associate a flavor with a service profile. A flavor can be associated with more than one profile. Will return ``409 Conflict`` if association already exists. Normal response codes: 201 Error response codes: 400, 401, 403, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - flavor_id: flavor_id - service_profile: service_profile - id: service_profile-id Request Example --------------- .. literalinclude:: samples/flavors/flavor-associate-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - service_profile: service_profile - id: id Response Example ---------------- .. literalinclude:: samples/flavors/flavor-associate-response.json :language: javascript Disassociate a flavor. ====================== .. rest_method:: DELETE /v2.0/flavors/{flavor_id}/service_profiles/{profile_id} Disassociate a flavor from a service profile. Normal response codes: 204 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - profile_id: profile_id - flavor_id: flavor_id Response -------- No body content is returned on a successful disassociation. List service profiles ===================== .. rest_method:: GET /v2.0/service_profiles Lists all service profiles visible for the tenant account. The list can be empty. Standard query parameters are supported on the URI. Normal response codes: 200 Error response codes: 401 Request ------- Response Parameters ------------------- .. rest_parameters:: parameters.yaml - service_profiles: service_profiles - id: service_profile-id - enabled: service_profile-enabled - driver: service_profile-driver - description: service_profile-description - metainfo: service_profile-metainfo Response Example ---------------- .. literalinclude:: samples/flavors/service-profiles-list-response.json :language: javascript Create service profile ====================== .. rest_method:: POST /v2.0/service_profiles Creates a service profile. This operation establishes a new service profile that can be associated with one or more flavors. Either metadata or a driver is required. If a driver is specified but does not exist, call will return a ``Not found 404`` error with the response body explaining that the driver could not be found. Creation currently limited to administrators. Other users will receive a ``Forbidden 403`` response code with a response body NeutronError message expressing that creation is disallowed by policy. If the API cannot fulfill the request due to insufficient data or data that is not valid, the service returns the HTTP ``Bad Request (400)`` response code with information about the failure in the response body. Validation errors require that you correct the error and submit the request again. Normal response codes: 201 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - service_profile: service_profile - description: service_profile-description-request - metainfo: service_profile-metainfo-request - enabled: service_profile-enabled-request - driver: service_profile-driver-request Request Example --------------- .. literalinclude:: samples/flavors/service-profile-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - service_profile: service_profile - id: service_profile-id - enabled: service_profile-enabled - driver: service_profile-driver - description: service_profile-description - metainfo: service_profile-metainfo Response Example ---------------- .. literalinclude:: samples/flavors/service-profile-create-response.json :language: javascript Show service profile details ============================ .. rest_method:: GET /v2.0/service_profiles/{profile_id} Shows details for a service profile. This operation returns a service profile object by ID. If you are not an administrative user and the object is not visible to your tenant account, the service returns the HTTP ``Forbidden (403)`` response code. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - profile_id: profile_id Response Parameters ------------------- .. rest_parameters:: parameters.yaml - service_profile: service_profile - id: service_profile-id - enabled: service_profile-enabled - driver: service_profile-driver - description: service_profile-description - metainfo: service_profile-metainfo Response Example ---------------- .. literalinclude:: samples/flavors/service-profile-show-response.json :language: javascript Update service profile ====================== .. rest_method:: PUT /v2.0/service_profiles/{profile_id} Updates a service profile. Normal response codes: 200 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - profile_id: profile_id - service_profile: service_profile - enabled: service_profile-enabled-request - driver: service_profile-driver-request - description: service_profile-description-request - metainfo: service_profile-metainfo-request Request Example --------------- .. literalinclude:: samples/flavors/service-profile-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - service_profile: service_profile - id: service_profile-id - enabled: service_profile-enabled - driver: service_profile-driver - description: service_profile-description - metainfo: service_profile-metainfo Response Example ---------------- .. literalinclude:: samples/flavors/service-profile-update-response.json :language: javascript Delete service profile ====================== .. rest_method:: DELETE /v2.0/service_profiles/{profile_id} Deletes a service profile. Attempting to delete a service profile that is currently associated with a flavor will return a ``Conflict 409`` with a response body containing an in use message. Either metadata or a driver is required. Normal response codes: 204 Error response codes: 401, 403, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - profile_id: profile_id Response -------- No body content is returned on a successful DELETE. neutron-lib-1.13.0/api-ref/source/v2/floatingips.inc0000666000175100017510000002253213231472055022252 0ustar zuulzuul00000000000000========================== Floating IPs (floatingips) ========================== DNS integration =============== The ``dns-integration`` extension adds the ``dns_name`` and ``dns_domain`` attributes to floating IPs allowing them to be specified at creation time. The data in these attributes will be published in an external DNS service when Neutron is configured to integrate with such a service. List floating IPs ================= .. rest_method:: GET /v2.0/floatingips Lists floating IPs visible to the user. Default policy settings return only the floating IPs owned by the user's project, unless the user has admin role. This example request lists floating IPs in JSON format: :: GET /v2.0/floatingips Accept: application/json Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - floatingips: floatingips - id: floatingip-id - router_id: floatingip-router_id - status: floatingip-status - tenant_id: project_id - project_id: project_id - created_at: created_at_resource - updated_at: updated_at_resource - revision_number: revision_number - description: description - dns_domain: dns_domain - dns_name: dns_name - floating_network_id: floating_network_id - fixed_ip_address: floatingip-fixed_ip_address - floating_ip_address: floating_ip_address - port_id: floatingip-port_id - revision_number: revision_number Response Example ---------------- .. literalinclude:: samples/floatingips/floating-ips-list-response.json :language: javascript Create floating IP ================== .. rest_method:: POST /v2.0/floatingips Creates a floating IP, and, if you specify port information, associates the floating IP with an internal port. To associate the floating IP with an internal port, specify the port ID attribute in the request body. If you do not specify a port ID in the request, you can issue a PUT request instead of a POST request. Default policy settings enable only administrative users to set floating IP addresses and some non-administrative users might require a floating IP address. If you do not specify a floating IP address in the request, the operation automatically allocates one. By default, this operation associates the floating IP address with a single fixed IP address that is configured on an OpenStack Networking port. If a port has multiple IP addresses, you must specify the ``fixed_ip_address`` attribute in the request body to associate a fixed IP address with the floating IP address. You can create floating IPs on only external networks. When you create a floating IP, you must specify the ID of the network on which you want to create the floating IP. Alternatively, you can create a floating IP on a subnet in the external network, based on the costs and quality of that subnet. You must configure an IP address with the internal OpenStack Networking port that is associated with the floating IP address. The operation returns the ``Bad Request (400)`` response code for one of reasons: - The network is not external, such as ``router:external=False``. - The internal OpenStack Networking port is not associated with the floating IP address. - The requested floating IP address does not fall in the subnet range for the external network. - The fixed IP address is not valid. If the port ID is not valid, this operation returns ``404`` response code. The operation returns the ``Conflict (409)`` response code for one of reasons: - The requested floating IP address is already in use. - The internal OpenStack Networking port and fixed IP address are already associated with another floating IP. Normal response codes: 201 Error response codes: 400, 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - floatingip: floatingip - tenant_id: project_id - project_id: project_id - floating_network_id: floating_network_id - fixed_ip_address: floatingip-fixed_ip_address-request - floating_ip_address: floating_ip_address-request - port_id: floatingip-port_id-post-request - subnet_id: floatingip-subnet_id - description: description-request - dns_domain: dns_domain-request - dns_name: dns_name-request Request Example --------------- .. literalinclude:: samples/floatingips/floatingip-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - floatingip: floatingip - router_id: floatingip-router_id - status: floatingip-status - description: description - dns_domain: dns_domain - dns_name: dns_name - tenant_id: project_id - created_at: created_at_resource - updated_at: updated_at_resource - revision_number: revision_number - project_id: project_id - floating_network_id: floating_network_id - fixed_ip_address: floatingip-fixed_ip_address - floating_ip_address: floating_ip_address - port_id: floatingip-port_id - id: floatingip-id Response Example ---------------- .. literalinclude:: samples/floatingips/floatingip-create-response.json :language: javascript Show floating IP details ======================== .. rest_method:: GET /v2.0/floatingips/{floatingip_id} Shows details for a floating IP. Use the ``fields`` query parameter to control which fields are returned in the response body. For information, see `Filtering and Column Selection `__. This example request shows details for a floating IP in JSON format. This example also filters the result by the ``fixed_ip_address`` and ``floating_ip_address`` fields. :: GET /v2.0/floatingips/{floatingip_id}?fields=fixed_ip_address & fields=floating_ip_address Accept: application/json Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - floatingip_id: floatingip-id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - floatingip: floatingip - router_id: floatingip-router_id - status: floatingip-status - description: description - dns_domain: dns_domain - dns_name: dns_name - tenant_id: project_id - created_at: created_at_resource - updated_at: updated_at_resource - revision_number: revision_number - project_id: project_id - floating_network_id: floating_network_id - fixed_ip_address: floatingip-fixed_ip_address - floating_ip_address: floating_ip_address - port_id: floatingip-port_id - id: floatingip-id Response Example ---------------- .. literalinclude:: samples/floatingips/floatingip-show-response.json :language: javascript Update floating IP ================== .. rest_method:: PUT /v2.0/floatingips/{floatingip_id} Updates a floating IP and its association with an internal port. The association process is the same as the process for the create floating IP operation. To disassociate a floating IP from a port, set the ``port_id`` attribute to null or omit it from the request body. This example updates a floating IP: :: PUT /v2.0/floatingips/{floatingip_id} Accept: application/json Depending on the request body that you submit, this request associates a port with or disassociates a port from a floating IP. Normal response codes: 200 Error response codes: 400, 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - floatingip: floatingip - floatingip_id: floatingip-id-path - port_id: floatingip-port_id-put-request - fixed_ip_address: floatingip-fixed_ip_address-request - description: description-request Request Example --------------- .. literalinclude:: samples/floatingips/floatingip-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - floatingip: floatingip - router_id: floatingip-router_id - status: floatingip-status - tenant_id: project_id - project_id: project_id - floating_network_id: floating_network_id - fixed_ip_address: floatingip-fixed_ip_address - floating_ip_address: floating_ip_address - port_id: floatingip-port_id - id: floatingip-id - created_at: created_at_resource - updated_at: updated_at_resource - revision_number: revision_number - description: description - dns_domain: dns_domain - dns_name: dns_name Response Example ---------------- .. literalinclude:: samples/floatingips/floatingip-update-response.json :language: javascript Delete floating IP ================== .. rest_method:: DELETE /v2.0/floatingips/{floatingip_id} Deletes a floating IP and, if present, its associated port. This example deletes a floating IP: :: DELETE /v2.0/floatingips/{floatingip_id} Accept: application/json Normal response codes: 204 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - floatingip_id: floatingip-id-path Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/quotas.inc0000666000175100017510000001071713231472055021251 0ustar zuulzuul00000000000000.. -*- rst -*- ========================= Quotas extension (quotas) ========================= Lists default quotas, current quotas for projects with non-default quota values, and shows, updates, and resets quotas for a project. A quota value of ``-1`` means that quota has no limit. List quotas for projects with non-default quota values ====================================================== .. rest_method:: GET /v2.0/quotas Lists quotas for projects with non-default quota values. Normal response codes: 200 Error response codes: 401, 403 Request ------- Response Parameters ------------------- .. rest_parameters:: parameters.yaml - quotas: quotas - floatingip: quota-floatingip - network: quota-network - port: quota-port - project_id: project_id - rbac_policy: quota-rbac_policy - router: quota-router - security_group: quota-security_group - security_group_rule: quota-security_group_rule - subnet: quota-subnet - subnetpool: quota-subnetpool - tenant_id: project_id Response Example ---------------- .. literalinclude:: samples/quotas/quotas-list-response.json :language: javascript List quotas for a project ========================= .. rest_method:: GET /v2.0/quotas/{project_id} Lists quotas for a project. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - project_id: project_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - quota: quota - floatingip: quota-floatingip - network: quota-network - port: quota-port - rbac_policy: quota-rbac_policy - router: quota-router - security_group: quota-security_group - security_group_rule: quota-security_group_rule - subnet: quota-subnet - subnetpool: quota-subnetpool Response Example ---------------- .. literalinclude:: samples/quotas/quotas-list-for-project-response.json :language: javascript Update quota for a project ========================== .. rest_method:: PUT /v2.0/quotas/{project_id} Updates quotas for a project. Use when non-default quotas are desired. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - project_id: project_id-path - quota: quota - floatingip: quota-floatingip-request - network: quota-network-request - port: quota-port-request - rbac_policy: quota-rbac_policy-request - router: quota-router-request - security_group: quota-security_group-request - security_group_rule: quota-security_group_rule-request - subnet: quota-subnet-request - subnetpool: quota-subnetpool-request Request Example --------------- .. literalinclude:: samples/quotas/quotas-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - quota: quota - floatingip: quota-floatingip - network: quota-network - port: quota-port - rbac_policy: quota-rbac_policy - router: quota-router - security_group: quota-security_group - security_group_rule: quota-security_group_rule - subnet: quota-subnet - subnetpool: quota-subnetpool Response Example ---------------- .. literalinclude:: samples/quotas/quotas-update-response.json :language: javascript Reset quota for a project ========================= .. rest_method:: DELETE /v2.0/quotas/{project_id} Resets quotas to default values for a project. Normal response codes: 204 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - project_id: project_id-path Response -------- There is no body content for the response of a successful DELETE request. List default quotas for a project ================================= .. rest_method:: GET /v2.0/quotas/{project_id}/default Lists default quotas for a project. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - project_id: project_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - quota: quota - floatingip: quota-floatingip - network: quota-network - port: quota-port - rbac_policy: quota-rbac_policy - router: quota-router - security_group: quota-security_group - security_group_rule: quota-security_group_rule - subnet: quota-subnet - subnetpool: quota-subnetpool Response Example ---------------- .. literalinclude:: samples/quotas/quotas-list-for-project-response.json :language: javascript neutron-lib-1.13.0/api-ref/source/v2/samples/0000775000175100017510000000000013231472430020673 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/0000775000175100017510000000000013231472430021755 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/pools-list-response.json0000666000175100017510000000206613231472055026622 0ustar zuulzuul00000000000000{ "pools": [ { "status": "ACTIVE", "lb_algorithm": "ROUND_ROBIN", "protocol": "HTTP", "description": "", "healthmonitors": [ "b7633ade-24dc-4d72-8475-06aa22be5412" ], "members": [ "cf024846-7516-4e3a-b0fb-6590322c836f" ], "status_description": null, "id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", "vip_id": "388c739a-6a57-4e74-bc7b-a5cd60248bba", "name": "pool1", "admin_state_up": true, "subnet_id": "aa547115-d710-4d6d-bb2c-b038d9c2704b", "project_id": "eabfefa3fd1740a88a47ad98e132d238", "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", "healthmonitors_status": [ { "monitor_id": "b7633ade-24dc-4d72-8475-06aa22be5412", "status": "ACTIVE", "status_description": null } ], "provider": "haproxy" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/vip-update-response.json0000666000175100017510000000125613231472055026573 0ustar zuulzuul00000000000000{ "vip": { "status": "PENDING_UPDATE", "protocol": "HTTP", "description": "", "address": "10.0.0.4", "protocol_port": 80, "port_id": "0ba4cd9c-edb4-4594-bac4-b68b49d5f04c", "id": "fa0373e0-9dd4-4ff7-98fc-8cceca9bdb4e", "status_description": null, "name": "NewVip", "admin_state_up": true, "subnet_id": "0ba2ef27-0054-4b28-a8fa-f215e8079272", "project_id": "e68c3e65e1f34ee9b2357d0fe418a78b", "tenant_id": "e68c3e65e1f34ee9b2357d0fe418a78b", "connection_limit": 1000, "pool_id": "105320c3-8416-4997-9c1c-4098b95fdaca", "session_persistence": null } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/healthmonitor-create-response.json0000666000175100017510000000070413231472055030630 0ustar zuulzuul00000000000000{ "healthmonitor": { "admin_state_up": true, "project_id": "eabfefa3fd1740a88a47ad98e132d238", "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", "delay": 1, "expected_codes": "200,201,202", "max_retries": 5, "http_method": "GET", "timeout": 1, "pools": [], "url_path": "/index.html", "type": "HTTP", "id": "b7633ade-24dc-4d72-8475-06aa22be5412" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/pool-show-response.json0000666000175100017510000000167113231472055026445 0ustar zuulzuul00000000000000{ "pool": { "status": "ACTIVE", "lb_algorithm": "ROUND_ROBIN", "protocol": "HTTP", "description": "", "healthmonitors": [ "b7633ade-24dc-4d72-8475-06aa22be5412" ], "members": [ "cf024846-7516-4e3a-b0fb-6590322c836f" ], "status_description": null, "id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", "vip_id": "388c739a-6a57-4e74-bc7b-a5cd60248bba", "name": "pool1", "admin_state_up": true, "subnet_id": "aa547115-d710-4d6d-bb2c-b038d9c2704b", "project_id": "eabfefa3fd1740a88a47ad98e132d238", "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", "healthmonitors_status": [ { "monitor_id": "b7633ade-24dc-4d72-8475-06aa22be5412", "status": "ACTIVE", "status_description": null } ], "provider": "haproxy" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/healthmonitor-show-response.json0000666000175100017510000000117313231472055030346 0ustar zuulzuul00000000000000{ "healthmonitor": { "admin_state_up": true, "project_id": "eabfefa3fd1740a88a47ad98e132d238", "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", "delay": 1, "expected_codes": "200,201,202", "max_retries": 5, "http_method": "GET", "timeout": 1, "pools": [ { "status": "ACTIVE", "status_description": null, "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332" } ], "url_path": "/index.html", "type": "HTTP", "id": "b7633ade-24dc-4d72-8475-06aa22be5412" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/member-update-response.json0000666000175100017510000000056113231472055027242 0ustar zuulzuul00000000000000{ "member": { "admin_state_up": true, "weight": 5, "address": "10.0.1.22", "project_id": "eabfefa3fd1740a88a47ad98e132d238", "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", "protocol_port": 90, "id": "cf024846-7516-4e3a-b0fb-6590322c836f", "subnet_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/listener-update-response.json0000666000175100017510000000156113231472055027621 0ustar zuulzuul00000000000000{ "listener": { "admin_state_up": false, "connection_limit": 200, "default_pool_id": null, "description": "listener two", "id": "39de4d56-d663-46e5-85a1-5b9d5fa17829", "loadbalancers": [ { "id": "a36c20d0-18e9-42ce-88fd-82a35977ee8c" } ], "name": "listener2", "protocol": "HTTP", "protocol_port": 80, "project_id": "1a3e005cf9ce40308c900bcb08e5320c", "tenant_id": "1a3e005cf9ce40308c900bcb08e5320c", "default_tls_container_ref": "https://barbican.endpoint/containers/a36c20d0-18e9-42ce-88fd-82a35977ee8c", "sni_container_refs": [ "https://barbican.endpoint/containers/b36c20d0-18e9-42ce-88fd-82a35977ee8d", "https://barbican.endpoint/containers/c36c20d0-18e9-42ce-88fd-82a35977ee8e" ] } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/member-show-response.json0000666000175100017510000000056113231472055026740 0ustar zuulzuul00000000000000{ "member": { "admin_state_up": true, "weight": 1, "address": "10.0.1.22", "project_id": "eabfefa3fd1740a88a47ad98e132d238", "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", "protocol_port": 90, "id": "cf024846-7516-4e3a-b0fb-6590322c836f", "subnet_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/pools-list-response2.json0000666000175100017510000000114713231472055026703 0ustar zuulzuul00000000000000{ "pools": [ { "admin_state_up": true, "description": "simple pool", "healthmonitor_id": null, "id": "4c0a0a5f-cf8f-44b7-b912-957daa8ce5e5", "lb_algorithm": "ROUND_ROBIN", "listeners": [ { "id": "35cb8516-1173-4035-8dae-0dae3453f37f" } ], "members": [], "name": "pool1", "protocol": "HTTP", "project_id": "1a3e005cf9ce40308c900bcb08e5320c", "tenant_id": "1a3e005cf9ce40308c900bcb08e5320c" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/loadbalancer-show-response.json0000666000175100017510000000101613231472055030074 0ustar zuulzuul00000000000000{ "loadbalancer": { "description": "simple lb", "admin_state_up": true, "project_id": "1a3e005cf9ce40308c900bcb08e5320c", "tenant_id": "1a3e005cf9ce40308c900bcb08e5320c", "provisioning_status": "ACTIVE", "listeners": [], "vip_address": "10.0.0.2", "vip_subnet_id": "013d3059-87a4-45a5-91e9-d721068ae0b2", "id": "a9729389-6147-41a3-ab22-a24aed8692b2", "operating_status": "ONLINE", "name": "loadbalancer1", "pools": [] } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/vip-update-request.json0000666000175100017510000000007213231472055026420 0ustar zuulzuul00000000000000{ "vip": { "connection_limit": "1000" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/healthmonitor-update-response.json0000666000175100017510000000116413231472055030650 0ustar zuulzuul00000000000000{ "healthmonitor": { "admin_state_up": false, "project_id": "eabfefa3fd1740a88a47ad98e132d238", "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", "delay": 2, "expected_codes": "200", "max_retries": 2, "http_method": "POST", "timeout": 2, "pools": [ { "status": "ACTIVE", "status_description": null, "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332" } ], "url_path": "/page.html", "type": "HTTP", "id": "b7633ade-24dc-4d72-8475-06aa22be5412" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/pool-update-request.json0000666000175100017510000000006413231472055026574 0ustar zuulzuul00000000000000{ "pool": { "name": "SuperPool" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/healthmonitor-associate-request.json0000666000175100017510000000012613231472055031170 0ustar zuulzuul00000000000000{ "healthmonitor": { "id": "b624decf-d5d3-4c66-9a3d-f047e7786181" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/healthmonitor-associate-response.json0000666000175100017510000000003413231472055031334 0ustar zuulzuul00000000000000{ "healthmonitor": {} } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/member-update-request.json0000666000175100017510000000005613231472055027073 0ustar zuulzuul00000000000000{ "member": { "weight": 5 } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/loadbalancer-create-request.json0000666000175100017510000000062513231472055030216 0ustar zuulzuul00000000000000{ "loadbalancer": { "name": "loadbalancer1", "description": "simple lb", "project_id": "b7c1a69e88bf4b21a8148f787aef2081", "tenant_id": "b7c1a69e88bf4b21a8148f787aef2081", "vip_subnet_id": "013d3059-87a4-45a5-91e9-d721068ae0b2", "vip_address": "10.0.0.4", "admin_state_up": true, "flavor": "a7ae5d5a-d855-4f9a-b187-af66b53f4d04" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/loadbalancer-update-response.json0000666000175100017510000000117113231472055030400 0ustar zuulzuul00000000000000{ "loadbalancer": { "admin_state_up": false, "description": "simple lb2", "id": "a36c20d0-18e9-42ce-88fd-82a35977ee8c", "listeners": [], "name": "loadbalancer2", "operating_status": "ONLINE", "provisioning_status": "PENDING_UPDATE", "project_id": "b7c1a69e88bf4b21a8148f787aef2081", "tenant_id": "b7c1a69e88bf4b21a8148f787aef2081", "vip_address": "10.0.0.4", "vip_subnet_id": "013d3059-87a4-45a5-91e9-d721068ae0b2", "flavor": "a7ae5d5a-d855-4f9a-b187-af66b53f4d04", "provider": "sample_provider", "pools": [] } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/pool-create-request.json0000666000175100017510000000046713231472055026564 0ustar zuulzuul00000000000000{ "pool": { "admin_state_up": true, "description": "simple pool", "lb_algorithm": "ROUND_ROBIN", "name": "my-pool", "protocol": "HTTP", "subnet_id": "e301aed0-d9e7-498a-977c-1bbfaf14ed5d", "listener_id": "39de4d56-d663-46e5-85a1-5b9d5fa17829" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/vip-show-response.json0000666000175100017510000000124413231472055026266 0ustar zuulzuul00000000000000{ "vip": { "status": "ACTIVE", "protocol": "HTTP", "description": "", "address": "10.0.0.4", "protocol_port": 80, "port_id": "5328aeea-2988-41c0-b5fe-0fd0660979d3", "id": "388c739a-6a57-4e74-bc7b-a5cd60248bba", "status_description": null, "name": "my-Vip", "admin_state_up": true, "subnet_id": "aa547115-d710-4d6d-bb2c-b038d9c2704b", "project_id": "eabfefa3fd1740a88a47ad98e132d238", "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", "connection_limit": -1, "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", "session_persistence": null } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/listener-create-request.json0000666000175100017510000000115413231472055027432 0ustar zuulzuul00000000000000{ "listener": { "admin_state_up": true, "connection_limit": 100, "description": "listener one", "loadbalancer_id": "a36c20d0-18e9-42ce-88fd-82a35977ee8c", "name": "listener1", "protocol": "HTTP", "protocol_port": "80", "default_tls_container_ref": "https://barbican.endpoint/containers/a36c20d0-18e9-42ce-88fd-82a35977ee8c", "sni_container_refs": [ "https://barbican.endpoint/containers/b36c20d0-18e9-42ce-88fd-82a35977ee8d", "https://barbican.endpoint/containers/c36c20d0-18e9-42ce-88fd-82a35977ee8e" ] } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/loadbalancer-update-request.json0000666000175100017510000000020613231472055030230 0ustar zuulzuul00000000000000{ "loadbalancer": { "admin_state_up": false, "description": "simple lb2", "name": "loadbalancer2" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/member-create-request.json0000666000175100017510000000031213231472055027047 0ustar zuulzuul00000000000000{ "member": { "address": "10.0.0.22", "admin_state_up": true, "protocol_port": "90", "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", "weight": "1" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/listener-show-response.json0000666000175100017510000000153313231472055027316 0ustar zuulzuul00000000000000{ "listener": { "admin_state_up": true, "connection_limit": 100, "default_pool_id": null, "description": "", "id": "35cb8516-1173-4035-8dae-0dae3453f37f", "loadbalancers": [ { "id": "a9729389-6147-41a3-ab22-a24aed8692b2" } ], "name": "", "protocol": "HTTP", "protocol_port": 80, "project_id": "3e4d8bec50a845fcb09e03a4375c691d", "tenant_id": "3e4d8bec50a845fcb09e03a4375c691d", "default_tls_container_ref": "https://barbican.endpoint/containers/a36c20d0-18e9-42ce-88fd-82a35977ee8c", "sni_container_refs": [ "https://barbican.endpoint/containers/b36c20d0-18e9-42ce-88fd-82a35977ee8d", "https://barbican.endpoint/containers/c36c20d0-18e9-42ce-88fd-82a35977ee8e" ] } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/healthmonitor-create-request.json0000666000175100017510000000050313231472055030457 0ustar zuulzuul00000000000000{ "healthmonitor": { "pool_id": "74aa2010-a59f-4d35-a436-60a6da882819", "admin_state_up": true, "delay": "1", "expected_codes": "200,201,202", "http_method": "GET", "max_retries": 5, "timeout": 1, "type": "HTTP", "url_path": "/index.html" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/member-create-response.json0000666000175100017510000000056113231472055027223 0ustar zuulzuul00000000000000{ "member": { "admin_state_up": true, "weight": 1, "address": "10.0.1.22", "project_id": "eabfefa3fd1740a88a47ad98e132d238", "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", "protocol_port": 90, "id": "cf024846-7516-4e3a-b0fb-6590322c836f", "subnet_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/vip-create-request.json0000666000175100017510000000040313231472055026377 0ustar zuulzuul00000000000000{ "vip": { "protocol": "HTTP", "name": "NewVip", "admin_state_up": true, "subnet_id": "0ba2ef27-0054-4b28-a8fa-f215e8079272", "pool_id": "105320c3-8416-4997-9c1c-4098b95fdaca", "protocol_port": "80" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/listener-update-request.json0000666000175100017510000000075713231472055027461 0ustar zuulzuul00000000000000{ "listener": { "admin_state_up": false, "connection_limit": 200, "description": "listener two", "name": "listener2", "default_tls_container_ref": "https://barbican.endpoint/containers/a36c20d0-18e9-42ce-88fd-82a35977ee8c", "sni_container_refs": [ "https://barbican.endpoint/containers/b36c20d0-18e9-42ce-88fd-82a35977ee8d", "https://barbican.endpoint/containers/c36c20d0-18e9-42ce-88fd-82a35977ee8e" ] } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/loadbalancers-list-response.json0000666000175100017510000000127413231472055030260 0ustar zuulzuul00000000000000{ "loadbalancers": [ { "description": "simple lb", "admin_state_up": true, "project_id": "1a3e005cf9ce40308c900bcb08e5320c", "tenant_id": "1a3e005cf9ce40308c900bcb08e5320c", "provisioning_status": "ACTIVE", "listeners": [], "vip_address": "10.0.0.2", "vip_subnet_id": "013d3059-87a4-45a5-91e9-d721068ae0b2", "id": "a9729389-6147-41a3-ab22-a24aed8692b2", "operating_status": "ONLINE", "name": "loadbalancer1", "flavor": "a7ae5d5a-d855-4f9a-b187-af66b53f4d04", "provider": "sample-provider", "pools": [] } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/vip-create-response.json0000666000175100017510000000125413231472055026552 0ustar zuulzuul00000000000000{ "vip": { "status": "PENDING_CREATE", "protocol": "HTTP", "description": "", "address": "10.0.0.4", "protocol_port": 80, "port_id": "0ba4cd9c-edb4-4594-bac4-b68b49d5f04c", "id": "fa0373e0-9dd4-4ff7-98fc-8cceca9bdb4e", "status_description": null, "name": "NewVip", "admin_state_up": true, "subnet_id": "0ba2ef27-0054-4b28-a8fa-f215e8079272", "project_id": "e68c3e65e1f34ee9b2357d0fe418a78b", "tenant_id": "e68c3e65e1f34ee9b2357d0fe418a78b", "connection_limit": -1, "pool_id": "105320c3-8416-4997-9c1c-4098b95fdaca", "session_persistence": null } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/members-list-response.json0000666000175100017510000000075413231472055027122 0ustar zuulzuul00000000000000{ "members": [ { "admin_state_up": true, "status": "ACTIVE", "status_description": null, "weight": 1, "address": "10.0.1.22", "project_id": "eabfefa3fd1740a88a47ad98e132d238", "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", "protocol_port": 90, "id": "cf024846-7516-4e3a-b0fb-6590322c836f", "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/healthmonitors-list-response.json0000666000175100017510000000133013231472055030517 0ustar zuulzuul00000000000000{ "healthmonitors": [ { "admin_state_up": true, "project_id": "eabfefa3fd1740a88a47ad98e132d238", "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", "delay": 1, "expected_codes": "200,201,202", "max_retries": 5, "http_method": "GET", "timeout": 1, "pools": [ { "status": "ACTIVE", "status_description": null, "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332" } ], "url_path": "/index.html", "type": "HTTP", "id": "b7633ade-24dc-4d72-8475-06aa22be5412" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/vips-list-response.json0000666000175100017510000000137113231472055026445 0ustar zuulzuul00000000000000{ "vips": [ { "status": "ACTIVE", "protocol": "HTTP", "description": "", "address": "10.0.0.4", "protocol_port": 80, "port_id": "5328aeea-2988-41c0-b5fe-0fd0660979d3", "id": "388c739a-6a57-4e74-bc7b-a5cd60248bba", "status_description": null, "name": "my-Vip", "admin_state_up": true, "subnet_id": "aa547115-d710-4d6d-bb2c-b038d9c2704b", "project_id": "eabfefa3fd1740a88a47ad98e132d238", "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", "connection_limit": -1, "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", "session_persistence": null } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/healthmonitor-update-request.json0000666000175100017510000000035113231472055030477 0ustar zuulzuul00000000000000{ "healthmonitor": { "admin_state_up": false, "delay": "2", "expected_codes": "200", "http_method": "POST", "max_retries": 2, "timeout": 2, "url_path": "/page.html" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/pool-create-response.json0000666000175100017510000000117213231472055026724 0ustar zuulzuul00000000000000{ "pool": { "status": "PENDING_CREATE", "lb_algorithm": "ROUND_ROBIN", "protocol": "HTTP", "description": "simple pool", "healthmonitors": [], "members": [], "status_description": null, "id": "af95e0ce-8a26-4f29-9524-db41e7769c73", "vip_id": null, "name": "my-pool", "admin_state_up": true, "subnet_id": "e301aed0-d9e7-498a-977c-1bbfaf14ed5d", "project_id": "eabfefa3fd1740a88a47ad98e132d238", "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", "healthmonitors_status": [], "provider": "haproxy" } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/listeners-list-response.json0000666000175100017510000000170013231472055027470 0ustar zuulzuul00000000000000{ "listeners": [ { "admin_state_up": true, "connection_limit": 100, "default_pool_id": null, "description": "", "id": "35cb8516-1173-4035-8dae-0dae3453f37f", "loadbalancers": [ { "id": "a9729389-6147-41a3-ab22-a24aed8692b2" } ], "name": "", "protocol": "HTTP", "protocol_port": 80, "project_id": "3e4d8bec50a845fcb09e03a4375c691d", "tenant_id": "3e4d8bec50a845fcb09e03a4375c691d", "default_tls_container_ref": "https://barbican.endpoint/containers/a36c20d0-18e9-42ce-88fd-82a35977ee8c", "sni_container_refs": [ "https://barbican.endpoint/containers/b36c20d0-18e9-42ce-88fd-82a35977ee8d", "https://barbican.endpoint/containers/c36c20d0-18e9-42ce-88fd-82a35977ee8e" ] } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/pool-members-list-response.json0000666000175100017510000000064513231472055030070 0ustar zuulzuul00000000000000{ "members": [ { "address": "10.0.0.8", "admin_state_up": true, "id": "9a7aff27-fd41-4ec1-ba4c-3eb92c629313", "protocol_port": 80, "subnet_id": "013d3059-87a4-45a5-91e9-d721068ae0b2", "project_id": "1a3e005cf9ce40308c900bcb08e5320c", "tenant_id": "1a3e005cf9ce40308c900bcb08e5320c", "weight": 1 } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/listener-create-response.json0000666000175100017510000000156013231472055027601 0ustar zuulzuul00000000000000{ "listener": { "admin_state_up": true, "connection_limit": 100, "default_pool_id": null, "description": "listener one", "id": "39de4d56-d663-46e5-85a1-5b9d5fa17829", "loadbalancers": [ { "id": "a36c20d0-18e9-42ce-88fd-82a35977ee8c" } ], "name": "listener1", "protocol": "HTTP", "protocol_port": 80, "project_id": "1a3e005cf9ce40308c900bcb08e5320c", "tenant_id": "1a3e005cf9ce40308c900bcb08e5320c", "default_tls_container_ref": "https://barbican.endpoint/containers/a36c20d0-18e9-42ce-88fd-82a35977ee8c", "sni_container_refs": [ "https://barbican.endpoint/containers/b36c20d0-18e9-42ce-88fd-82a35977ee8d", "https://barbican.endpoint/containers/c36c20d0-18e9-42ce-88fd-82a35977ee8e" ] } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/loadbalancer-create-response.json0000666000175100017510000000115713231472055030365 0ustar zuulzuul00000000000000{ "loadbalancer": { "admin_state_up": true, "description": "simple lb", "id": "a36c20d0-18e9-42ce-88fd-82a35977ee8c", "listeners": [], "name": "loadbalancer1", "operating_status": "ONLINE", "provisioning_status": "ACTIVE", "project_id": "b7c1a69e88bf4b21a8148f787aef2081", "tenant_id": "b7c1a69e88bf4b21a8148f787aef2081", "vip_address": "10.0.0.4", "vip_subnet_id": "013d3059-87a4-45a5-91e9-d721068ae0b2", "flavor": "a7ae5d5a-d855-4f9a-b187-af66b53f4d04", "provider": "sample_provider", "pools": [] } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/loadbalancer-status-tree.json0000666000175100017510000000372613231472055027552 0ustar zuulzuul00000000000000{ "statuses": { "loadbalancer": { "name": "lb1", "listeners": [ { "pools": [ { "name": "pool1", "provisioning_status": "ACTIVE", "healthmonitor": { "type": "HTTP", "id": "90f7c765-0bc9-47c4-8513-4cc0c264c8f8", "provisioning_status": "ACTIVE" }, "members": [ { "address": "10.0.0.4", "protocol_port": 80, "id": "32723bee-2484-4de3-b6fc-c0b98d35fc84", "operating_status": "ONLINE", "provisioning_status": "ACTIVE" }, { "address": "10.0.0.3", "protocol_port": 80, "id": "173b8164-0c9a-43ec-ab33-4ae0e7a8f863", "operating_status": "ONLINE", "provisioning_status": "ACTIVE" } ], "id": "ae6f93b8-a3f6-46cd-bb18-c2ab0308abf7", "operating_status": "ONLINE" } ], "name": "listener1", "id": "c2a41fbe-b70a-4645-bb11-4d3c28f23a25", "operating_status": "ONLINE", "provisioning_status": "ACTIVE" } ], "id": "a4c19566-6f81-4c96-ac11-33954a9825a2", "operating_status": "ONLINE", "provisioning_status": "ACTIVE" } } } neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/loadbalancer-update-response.txt0000666000175100017510000000015713231472055030251 0ustar zuulzuul00000000000000#!wiki caution Note A Load Balancer that is does not have a provisioning_status of ACTIVE cannot be updated. neutron-lib-1.13.0/api-ref/source/v2/samples/lbaas/pool-update-response.json0000666000175100017510000000170513231472055026745 0ustar zuulzuul00000000000000{ "pool": { "status": "PENDING_UPDATE", "lb_algorithm": "ROUND_ROBIN", "protocol": "HTTP", "description": "", "healthmonitors": [ "b7633ade-24dc-4d72-8475-06aa22be5412" ], "members": [ "cf024846-7516-4e3a-b0fb-6590322c836f" ], "status_description": null, "id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", "vip_id": "388c739a-6a57-4e74-bc7b-a5cd60248bba", "name": "SuperPool", "admin_state_up": true, "subnet_id": "aa547115-d710-4d6d-bb2c-b038d9c2704b", "project_id": "eabfefa3fd1740a88a47ad98e132d238", "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", "healthmonitors_status": [ { "monitor_id": "b7633ade-24dc-4d72-8475-06aa22be5412", "status": "ACTIVE", "status_description": null } ], "provider": "haproxy" } } neutron-lib-1.13.0/api-ref/source/v2/samples/agents/0000775000175100017510000000000013231472430022154 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/agents/agent-update-request.json0000666000175100017510000000011513231472055027115 0ustar zuulzuul00000000000000{ "agent": { "description": "My OVS agent for OpenStack" } } neutron-lib-1.13.0/api-ref/source/v2/samples/agents/agent-update-response.json0000666000175100017510000000316713231472055027275 0ustar zuulzuul00000000000000{ "agent": { "binary": "neutron-openvswitch-agent", "description": "My OVS agent for OpenStack", "availability_zone": null, "heartbeat_timestamp": "2017-09-12 19:40:38", "admin_state_up": true, "alive": true, "id": "04c62b91-b799-48b7-9cd5-2982db6df9c6", "topic": "N/A", "host": "agenthost1", "agent_type": "Open vSwitch agent", "started_at": "2017-09-12 19:35:38", "created_at": "2017-09-12 19:35:38", "configurations": { "ovs_hybrid_plug": true, "in_distributed_mode": false, "datapath_type": "system", "vhostuser_socket_dir": "/var/run/openvswitch", "tunneling_ip": "172.16.78.191", "arp_responder_enabled": false, "devices": 0, "ovs_capabilities": { "datapath_types": [ "netdev", "system" ], "iface_types": [ "geneve", "gre", "internal", "ipsec_gre", "lisp", "patch", "stt", "system", "tap", "vxlan" ] }, "log_agent_heartbeats": false, "l2_population": false, "tunnel_types": [ "vxlan" ], "extensions": [], "enable_distributed_routing": false, "bridge_mappings": { "public": "br-ex" } } } } neutron-lib-1.13.0/api-ref/source/v2/samples/agents/agent-show-response.json0000666000175100017510000000313713231472055026770 0ustar zuulzuul00000000000000{ "agent": { "binary": "neutron-openvswitch-agent", "description": null, "availability_zone": null, "heartbeat_timestamp": "2017-09-12 19:40:38", "admin_state_up": true, "alive": true, "id": "04c62b91-b799-48b7-9cd5-2982db6df9c6", "topic": "N/A", "host": "agenthost1", "agent_type": "Open vSwitch agent", "started_at": "2017-09-12 19:35:38", "created_at": "2017-09-12 19:35:38", "configurations": { "ovs_hybrid_plug": true, "in_distributed_mode": false, "datapath_type": "system", "vhostuser_socket_dir": "/var/run/openvswitch", "tunneling_ip": "172.16.78.191", "arp_responder_enabled": false, "devices": 0, "ovs_capabilities": { "datapath_types": [ "netdev", "system" ], "iface_types": [ "geneve", "gre", "internal", "ipsec_gre", "lisp", "patch", "stt", "system", "tap", "vxlan" ] }, "log_agent_heartbeats": false, "l2_population": false, "tunnel_types": [ "vxlan" ], "extensions": [], "enable_distributed_routing": false, "bridge_mappings": { "public": "br-ex" } } } } neutron-lib-1.13.0/api-ref/source/v2/samples/agents/agents-list-response.json0000666000175100017510000001056513231472055027151 0ustar zuulzuul00000000000000{ "agents": [ { "binary": "neutron-openvswitch-agent", "description": null, "availability_zone": null, "heartbeat_timestamp": "2017-09-12 19:40:08", "admin_state_up": true, "alive": true, "id":" 04c62b91-b799-48b7-9cd5-2982db6df9c6", "topic": "N/A", "host": "agenthost1", "agent_type": "Open vSwitch agent", "started_at": "2017-09-12 19:35:38", "created_at": "2017-09-12 19:35:38", "configurations": { "ovs_hybrid_plug": true, "in_distributed_mode": false, "datapath_type": "system", "vhostuser_socket_dir": "/var/run/openvswitch", "tunneling_ip": "172.16.78.191", "arp_responder_enabled": false, "devices": 0, "ovs_capabilities": { "datapath_types": [ "netdev", "system" ], "iface_types": [ "geneve", "gre", "internal", "ipsec_gre", "lisp", "patch", "stt", "system", "tap", "vxlan" ] }, "log_agent_heartbeats": false, "l2_population": false, "tunnel_types": [ "vxlan" ], "extensions": [ ], "enable_distributed_routing": false, "bridge_mappings": { "public": "br-ex" } } }, { "binary": "neutron-dhcp-agent", "description": null, "availability_zone": "nova", "heartbeat_timestamp": "2017-09-12 19:39:56", "admin_state_up": true, "alive": true, "id": "840d5d68-5759-4e9e-812f-f3bd19214c7f", "topic": "dhcp_agent", "host": "agenthost1", "agent_type" :"DHCP agent", "started_at": "2017-09-12 19:35:36", "created_at": "2017-09-12 19:35:36", "configurations": { "subnets": 2, "dhcp_lease_duration": 86400, "dhcp_driver": "neutron.agent.linux.dhcp.Dnsmasq", "networks": 1, "log_agent_heartbeats": false, "ports": 3 } }, { "binary": "neutron-l3-agent", "description": null, "availability_zone": "nova", "heartbeat_timestamp": "2017-09-12 19:40:08", "admin_state_up": true, "alive": true, "id": "a09b81fc-5a42-46d3-a306-1a5d122a7787", "topic": "l3_agent", "host": "agenthost1", "agent_type": "L3 agent", "started_at": "2017-09-12 19:35:38", "created_at": "2017-09-12 19:35:38", "configurations": { "agent_mode": "legacy", "gateway_external_network_id": "", "handle_internal_only_routers": true, "routers": 1, "interfaces": 2, "floating_ips": 0, "interface_driver": "openvswitch", "log_agent_heartbeats": false, "external_network_bridge": "", "ex_gw_ports": 1 } }, { "binary": "neutron-metadata-agent", "description": null, "availability_zone": null, "heartbeat_timestamp": "2017-09-12 19:40:09", "admin_state_up": true, "alive": true, "id": "c876c9f7-1058-4b9b-90ed-20fb3f905ec4", "topic": "N/A", "host": "agenthost1", "agent_type": "Metadata agent", "started_at": "2017-09-12 19:35:39", "created_at": "2017-09-12 19:35:39", "configurations": { "log_agent_heartbeats": false, "nova_metadata_host": "172.16.78.191", "nova_metadata_port": 8775, "metadata_proxy_socket": "/opt/stack/data/neutron/metadata_proxy" } } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/routers/0000775000175100017510000000000013231472430022376 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/routers/router-update-response.json0000666000175100017510000000173513231472055027740 0ustar zuulzuul00000000000000{ "router": { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "description": "", "distributed": false, "external_gateway_info": { "enable_snat": true, "external_fixed_ips": [ { "ip_address": "172.24.4.6", "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" } ], "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3" }, "ha": false, "id": "f8a44de0-fc8e-45df-93c7-f79bf3b01c95", "name": "router1", "revision_number": 3, "routes": [ { "destination": "179.24.1.0/24", "nexthop": "172.24.3.99" } ], "status": "ACTIVE", "project_id": "0bd18306d801447bb457a46252d82d13", "tenant_id": "0bd18306d801447bb457a46252d82d13" } } neutron-lib-1.13.0/api-ref/source/v2/samples/routers/router-add-interface-request-with-port.json0000666000175100017510000000007213231472055032722 0ustar zuulzuul00000000000000{ "port_id": "2dc46bcc-d1f2-4077-b99e-91ee28afaff0" } neutron-lib-1.13.0/api-ref/source/v2/samples/routers/router-remove-interface-request.json0000666000175100017510000000007413231472055031536 0ustar zuulzuul00000000000000{ "subnet_id": "a2f1f29d-571b-4533-907f-5803ab96ead1" } neutron-lib-1.13.0/api-ref/source/v2/samples/routers/router-show-response.json0000666000175100017510000000217313231472055027433 0ustar zuulzuul00000000000000{ "router": { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "description": "", "distributed": false, "external_gateway_info": { "enable_snat": true, "external_fixed_ips": [ { "ip_address": "172.24.4.6", "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" }, { "ip_address": "2001:db8::9", "subnet_id": "0c56df5d-ace5-46c8-8f4c-45fa4e334d18" } ], "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3" }, "ha": false, "id": "f8a44de0-fc8e-45df-93c7-f79bf3b01c95", "name": "router1", "revision_number": 1, "routes": [ { "destination": "179.24.1.0/24", "nexthop": "172.24.3.99" } ], "status": "ACTIVE", "project_id": "0bd18306d801447bb457a46252d82d13", "tenant_id": "0bd18306d801447bb457a46252d82d13" } } neutron-lib-1.13.0/api-ref/source/v2/samples/routers/router-add-interface-response.json0000666000175100017510000000062413231472055031140 0ustar zuulzuul00000000000000{ "id": "915a14a6-867b-4af7-83d1-70efceb146f9", "network_id": "91c013e2-d65a-474e-9177-c3e1799ca726", "port_id": "2dc46bcc-d1f2-4077-b99e-91ee28afaff0", "subnet_id": "a2f1f29d-571b-4533-907f-5803ab96ead1", "subnet_ids": [ "a2f1f29d-571b-4533-907f-5803ab96ead1" ], "project_id": "0bd18306d801447bb457a46252d82d13", "tenant_id": "0bd18306d801447bb457a46252d82d13" } neutron-lib-1.13.0/api-ref/source/v2/samples/routers/router-update-request.json0000666000175100017510000000104413231472055027563 0ustar zuulzuul00000000000000{ "router": { "external_gateway_info": { "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3", "enable_snat": true, "external_fixed_ips": [ { "ip_address": "172.24.4.6", "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" } ], "routes": [ { "destination": "179.24.1.0/24", "nexthop": "172.24.3.99" } ] } } } neutron-lib-1.13.0/api-ref/source/v2/samples/routers/router-remove-interface-request-with-port.json0000666000175100017510000000007213231472055033467 0ustar zuulzuul00000000000000{ "port_id": "2dc46bcc-d1f2-4077-b99e-91ee28afaff0" } neutron-lib-1.13.0/api-ref/source/v2/samples/routers/router-create-response.json0000666000175100017510000000153713231472055027721 0ustar zuulzuul00000000000000{ "router": { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "description": "", "distributed": false, "external_gateway_info": { "enable_snat": true, "external_fixed_ips": [ { "ip_address": "172.24.4.6", "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" } ], "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3" }, "ha": false, "id": "f8a44de0-fc8e-45df-93c7-f79bf3b01c95", "name": "router1", "routes": [], "revision_number": 1, "status": "ACTIVE", "project_id": "0bd18306d801447bb457a46252d82d13", "tenant_id": "0bd18306d801447bb457a46252d82d13" } } neutron-lib-1.13.0/api-ref/source/v2/samples/routers/routers-list-response.json0000666000175100017510000000460413231472055027612 0ustar zuulzuul00000000000000{ "routers": [ { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "description": "", "distributed": false, "external_gateway_info": { "enable_snat": true, "external_fixed_ips": [ { "ip_address": "172.24.4.3", "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" }, { "ip_address": "2001:db8::c", "subnet_id": "0c56df5d-ace5-46c8-8f4c-45fa4e334d18" } ], "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3" }, "ha": false, "id": "915a14a6-867b-4af7-83d1-70efceb146f9", "name": "router2", "revision_number": 1, "routes": [ { "destination": "179.24.1.0/24", "nexthop": "172.24.3.99" } ], "status": "ACTIVE", "project_id": "0bd18306d801447bb457a46252d82d13", "tenant_id": "0bd18306d801447bb457a46252d82d13" }, { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "description": "", "distributed": false, "external_gateway_info": { "enable_snat": true, "external_fixed_ips": [ { "ip_address": "172.24.4.6", "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" }, { "ip_address": "2001:db8::9", "subnet_id": "0c56df5d-ace5-46c8-8f4c-45fa4e334d18" } ], "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3" }, "ha": false, "id": "f8a44de0-fc8e-45df-93c7-f79bf3b01c95", "name": "router1", "revision_number": 1, "routes": [], "status": "ACTIVE", "project_id": "0bd18306d801447bb457a46252d82d13", "tenant_id": "0bd18306d801447bb457a46252d82d13" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/routers/router-remove-interface-response.json0000666000175100017510000000062413231472055031705 0ustar zuulzuul00000000000000{ "id": "915a14a6-867b-4af7-83d1-70efceb146f9", "network_id": "91c013e2-d65a-474e-9177-c3e1799ca726", "port_id": "a5b7d209-dc02-4c46-a51f-805eadd3de64", "subnet_id": "4e5fe97c-82bc-432e-87d8-06d7e157dffa", "subnet_ids": [ "4e5fe97c-82bc-432e-87d8-06d7e157dffa" ], "project_id": "0bd18306d801447bb457a46252d82d13", "tenant_id": "0bd18306d801447bb457a46252d82d13" } neutron-lib-1.13.0/api-ref/source/v2/samples/routers/router-add-interface-request.json0000666000175100017510000000007413231472055030771 0ustar zuulzuul00000000000000{ "subnet_id": "a2f1f29d-571b-4533-907f-5803ab96ead1" } neutron-lib-1.13.0/api-ref/source/v2/samples/routers/router-create-request.json0000666000175100017510000000066313231472055027552 0ustar zuulzuul00000000000000{ "router": { "name": "router1", "external_gateway_info": { "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3", "enable_snat": true, "external_fixed_ips": [ { "ip_address": "172.24.4.6", "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" } ] }, "admin_state_up": true } } neutron-lib-1.13.0/api-ref/source/v2/samples/subnets/0000775000175100017510000000000013231472430022356 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/subnets/subnetpool-show-response.json0000666000175100017510000000131213231472055030257 0ustar zuulzuul00000000000000{ "subnetpool": { "min_prefixlen": "64", "address_scope_id": null, "default_prefixlen": "64", "id": "03f761e6-eee0-43fc-a921-8acf64c14988", "max_prefixlen": "64", "name": "my-subnet-pool", "default_quota": null, "is_default": false, "project_id": "9fadcee8aa7c40cdb2114fff7d569c08", "tenant_id": "9fadcee8aa7c40cdb2114fff7d569c08", "created_at": "2016-03-08T20:19:41", "prefixes": [ "2001:db8:0:2::/64", "2001:db8::/63" ], "updated_at": "2016-03-08T20:19:41", "ip_version": 6, "shared": false, "description": "", "revision_number": 2 } } neutron-lib-1.13.0/api-ref/source/v2/samples/subnets/subnet-create-request.json0000666000175100017510000000022413231472055027503 0ustar zuulzuul00000000000000{ "subnet": { "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", "ip_version": 4, "cidr": "192.168.199.0/24" } } neutron-lib-1.13.0/api-ref/source/v2/samples/subnets/subnet-update-request.json0000666000175100017510000000006613231472055027526 0ustar zuulzuul00000000000000{ "subnet": { "name": "my_subnet" } } neutron-lib-1.13.0/api-ref/source/v2/samples/subnets/subnet-create-response.json0000666000175100017510000000162513231472055027657 0ustar zuulzuul00000000000000{ "subnet": { "name": "", "enable_dhcp": true, "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", "segment_id": null, "project_id": "4fd44f30292945e481c7b8a0c8908869", "tenant_id": "4fd44f30292945e481c7b8a0c8908869", "dns_nameservers": [], "allocation_pools": [ { "start": "192.168.199.2", "end": "192.168.199.254" } ], "host_routes": [], "ip_version": 4, "gateway_ip": "192.168.199.1", "cidr": "192.168.199.0/24", "id": "3b80198d-4f7b-4f77-9ef5-774d54e17126", "created_at": "2016-10-10T14:35:47Z", "description": "", "ipv6_address_mode": null, "ipv6_ra_mode": null, "revision_number": 1, "service_types": [], "subnetpool_id": null, "updated_at": "2016-10-10T14:35:47Z" } } neutron-lib-1.13.0/api-ref/source/v2/samples/subnets/subnet-update-response.json0000666000175100017510000000126113231472055027672 0ustar zuulzuul00000000000000{ "subnet": { "name": "my_subnet", "enable_dhcp": true, "network_id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324", "revision_number": 1, "segment_id": null, "project_id": "26a7980765d0414dbc1fc1f88cdb7e6e", "tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e", "dns_nameservers": [], "allocation_pools": [ { "start": "10.0.0.2", "end": "10.0.0.254" } ], "host_routes": [], "ip_version": 4, "gateway_ip": "10.0.0.1", "cidr": "10.0.0.0/24", "id": "08eae331-0402-425a-923c-34f7cfe39c1b", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/subnets/subnets-create-bulk-request.json0000666000175100017510000000051413231472055030623 0ustar zuulzuul00000000000000{ "subnets": [ { "cidr": "192.168.199.0/24", "ip_version": 4, "network_id": "e6031bc2-901a-4c66-82da-f4c32ed89406" }, { "cidr": "10.56.4.0/22", "ip_version": 4, "network_id": "64239a54-dcc4-4b39-920b-b37c2144effa" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/subnets/subnetpool-create-response.json0000666000175100017510000000114613231472055030547 0ustar zuulzuul00000000000000{ "subnetpool": { "address_scope_id": null, "default_prefixlen": 25, "default_quota": null, "description": "", "id": "f49a1319-423a-4ee6-ba54-1d95a4f6cc68", "ip_version": 4, "is_default": false, "max_prefixlen": 30, "min_prefixlen": 24, "name": "my-subnet-pool", "prefixes": [ "10.10.0.0/21", "192.168.0.0/16" ], "project_id": "9fadcee8aa7c40cdb2114fff7d569c08", "revision_number": 1, "shared": false, "tenant_id": "9fadcee8aa7c40cdb2114fff7d569c08" } } neutron-lib-1.13.0/api-ref/source/v2/samples/subnets/subnetpools-list-response.json0000666000175100017510000000260213231472055030440 0ustar zuulzuul00000000000000{ "subnetpools": [ { "min_prefixlen": "64", "address_scope_id": null, "default_prefixlen": "64", "id": "03f761e6-eee0-43fc-a921-8acf64c14988", "max_prefixlen": "64", "name": "my-subnet-pool-ipv6", "default_quota": null, "is_default": false, "project_id": "9fadcee8aa7c40cdb2114fff7d569c08", "tenant_id": "9fadcee8aa7c40cdb2114fff7d569c08", "prefixes": [ "2001:db8:0:2::/64", "2001:db8::/63" ], "ip_version": 6, "shared": false, "description": "", "revision_number": 2 }, { "min_prefixlen": "24", "address_scope_id": null, "default_prefixlen": "25", "id": "f49a1319-423a-4ee6-ba54-1d95a4f6cc68", "max_prefixlen": "30", "name": "my-subnet-pool-ipv4", "default_quota": null, "is_default": false, "project_id": "9fadcee8aa7c40cdb2114fff7d569c08", "tenant_id": "9fadcee8aa7c40cdb2114fff7d569c08", "prefixes": [ "10.10.0.0/21", "192.168.0.0/16" ], "ip_version": 4, "shared": false, "description": "", "revision_number": 2 } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/subnets/subnets-create-bulk-response.json0000666000175100017510000000377213231472055031002 0ustar zuulzuul00000000000000{ "subnets": [ { "allocation_pools": [ { "end": "192.168.199.254", "start": "192.168.199.2" } ], "cidr": "192.168.199.0/24", "dns_nameservers": [], "enable_dhcp": true, "gateway_ip": "192.168.199.1", "host_routes": [], "id": "0468a7a7-290d-4127-aedd-6c9449775a24", "ip_version": 4, "name": "", "network_id": "e6031bc2-901a-4c66-82da-f4c32ed89406", "segment_id": null, "project_id": "d19231fc08ec4bc4829b668040d34512", "tenant_id": "d19231fc08ec4bc4829b668040d34512", "created_at": "2016-10-10T14:35:47Z", "description": "", "ipv6_address_mode": null, "ipv6_ra_mode": null, "revision_number": 1, "service_types": [], "subnetpool_id": null, "updated_at": "2016-10-10T14:35:47Z" }, { "allocation_pools": [ { "end": "10.56.7.254", "start": "10.56.4.2" } ], "cidr": "10.56.4.0/22", "dns_nameservers": [], "enable_dhcp": true, "gateway_ip": "10.56.4.1", "host_routes": [], "id": "b0e7435c-1512-45fb-aa9e-9a7c5932fb30", "ip_version": 4, "name": "", "network_id": "64239a54-dcc4-4b39-920b-b37c2144effa", "segment_id": null, "project_id": "d19231fc08ec4bc4829b668040d34512", "tenant_id": "d19231fc08ec4bc4829b668040d34512", "created_at": "2016-10-10T14:35:34Z", "description": "", "ipv6_address_mode": null, "ipv6_ra_mode": null, "revision_number": 1, "service_types": [], "subnetpool_id": null, "updated_at": "2016-10-10T14:35:34Z" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/subnets/subnetpool-create-request.json0000666000175100017510000000041713231472055030401 0ustar zuulzuul00000000000000{ "subnetpool": { "name": "my-subnet-pool", "prefixes": [ "192.168.0.0/16", "10.10.0.0/21" ], "default_prefixlen": 25, "min_prefixlen": 24, "max_prefixlen": 30, "shared": "false" } } neutron-lib-1.13.0/api-ref/source/v2/samples/subnets/subnets-list-response.json0000666000175100017510000000400013231472055027540 0ustar zuulzuul00000000000000{ "subnets": [ { "name": "private-subnet", "enable_dhcp": true, "network_id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324", "segment_id": null, "project_id": "26a7980765d0414dbc1fc1f88cdb7e6e", "tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e", "dns_nameservers": [], "allocation_pools": [ { "start": "10.0.0.2", "end": "10.0.0.254" } ], "host_routes": [], "ip_version": 4, "gateway_ip": "10.0.0.1", "cidr": "10.0.0.0/24", "id": "08eae331-0402-425a-923c-34f7cfe39c1b", "created_at": "2016-10-10T14:35:34Z", "description": "", "ipv6_address_mode": null, "ipv6_ra_mode": null, "revision_number": 2, "service_types": [], "subnetpool_id": null, "updated_at": "2016-10-10T14:35:34Z" }, { "name": "my_subnet", "enable_dhcp": true, "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", "segment_id": null, "project_id": "4fd44f30292945e481c7b8a0c8908869", "tenant_id": "4fd44f30292945e481c7b8a0c8908869", "dns_nameservers": [], "allocation_pools": [ { "start": "192.0.0.2", "end": "192.255.255.254" } ], "host_routes": [], "ip_version": 4, "gateway_ip": "192.0.0.1", "cidr": "192.0.0.0/8", "id": "54d6f61d-db07-451c-9ab3-b9609b6b6f0b", "created_at": "2016-10-10T14:35:47Z", "description": "", "ipv6_address_mode": null, "ipv6_ra_mode": null, "revision_number": 2, "service_types": [], "subnetpool_id": null, "updated_at": "2016-10-10T14:35:47Z" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/subnets/subnet-show-response.json0000666000175100017510000000161713231472055027375 0ustar zuulzuul00000000000000{ "subnet": { "name": "my_subnet", "enable_dhcp": true, "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", "segment_id": null, "project_id": "4fd44f30292945e481c7b8a0c8908869", "tenant_id": "4fd44f30292945e481c7b8a0c8908869", "created_at": "2016-03-08T20:19:41", "dns_nameservers": [], "allocation_pools": [ { "start": "192.0.0.2", "end": "192.255.255.254" } ], "host_routes": [], "ip_version": 4, "gateway_ip": "192.0.0.1", "cidr": "192.0.0.0/8", "updated_at": "2016-03-08T20:19:41", "id": "54d6f61d-db07-451c-9ab3-b9609b6b6f0b", "description": "", "ipv6_address_mode": null, "ipv6_ra_mode": null, "revision_number": 2, "service_types": [], "subnetpool_id": null } } neutron-lib-1.13.0/api-ref/source/v2/samples/subnets/subnetpool-update-request.json0000666000175100017510000000044113231472055030415 0ustar zuulzuul00000000000000{ "subnetpool": { "name": "my-new-subnetpool-name", "prefixes": [ "2001:db8::/64", "2001:db8:0:1::/64", "2001:db8:0:2::/64" ], "min_prefixlen": 64, "default_prefixlen": 64, "max_prefixlen": 64 } } neutron-lib-1.13.0/api-ref/source/v2/samples/subnets/subnetpool-update-response.json0000666000175100017510000000116213231472055030564 0ustar zuulzuul00000000000000{ "subnetpool": { "name": "my-new-subnetpool-name", "default_quota": null, "is_default": false, "project_id": "9fadcee8aa7c40cdb2114fff7d569c08", "tenant_id": "9fadcee8aa7c40cdb2114fff7d569c08", "prefixes": [ "2001:db8::/63", "2001:db8:0:2::/64" ], "min_prefixlen": 64, "address_scope_id": null, "ip_version": 6, "shared": false, "default_prefixlen": 64, "id": "03f761e6-eee0-43fc-a921-8acf64c14988", "max_prefixlen": 64, "description": "", "revision_number": 2 } } neutron-lib-1.13.0/api-ref/source/v2/samples/logging_resource/0000775000175100017510000000000013231472430024230 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/logging_resource/logging_resource-show-response.json0000666000175100017510000000137313231472055033303 0ustar zuulzuul00000000000000{ "logging_resource": { "description": "my log", "enabled": true, "firewall_logs": [ { "description": "", "firewall_id": "682cfe44-5fcf-4c16-982e-1176493f6825", "fw_event": "ALL", "id": "1ee6fea7-c294-418e-9b97-06db48e3f3d5", "logging_resource_id": "13b64f3c-20af-4741-b230-658ab7d5b257", "project_id": "8d018258316e4f22890561e8780c85bb", "tenant_id": "8d018258316e4f22890561e8780c85bb" } ], "id": "13b64f3c-20af-4741-b230-658ab7d5b257", "name": "log", "project_id": "8d018258316e4f22890561e8780c85bb", "tenant_id": "8d018258316e4f22890561e8780c85bb" } } neutron-lib-1.13.0/api-ref/source/v2/samples/logging_resource/logging_resources-list-response.json0000666000175100017510000000126413231472055033460 0ustar zuulzuul00000000000000{ "logging_resources": [ { "description": "my log", "enabled": true, "firewall_logs": [], "id": "13b64f3c-20af-4741-b230-658ab7d5b257", "name": "log", "project_id": "8d018258316e4f22890561e8780c85bb", "tenant_id": "8d018258316e4f22890561e8780c85bb" }, { "description": "my log2", "enabled": true, "firewall_logs": [], "id": "335c7b7d-c4a9-423a-9c24-9f4982f31e24", "name": "log2", "project_id": "8d018258316e4f22890561e8780c85bb", "tenant_id": "8d018258316e4f22890561e8780c85bb" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/logging_resource/logging_resource-update-response.json0000666000175100017510000000137613231472055033610 0ustar zuulzuul00000000000000{ "logging_resource": { "description": "my log2", "enabled": false, "firewall_logs": [ { "description": "", "firewall_id": "682cfe44-5fcf-4c16-982e-1176493f6825", "fw_event": "ALL", "id": "1ee6fea7-c294-418e-9b97-06db48e3f3d5", "logging_resource_id": "335c7b7d-c4a9-423a-9c24-9f4982f31e24", "project_id": "8d018258316e4f22890561e8780c85bb", "tenant_id": "8d018258316e4f22890561e8780c85bb" } ], "id": "335c7b7d-c4a9-423a-9c24-9f4982f31e24", "name": "log2", "project_id": "8d018258316e4f22890561e8780c85bb", "tenant_id": "8d018258316e4f22890561e8780c85bb" } } neutron-lib-1.13.0/api-ref/source/v2/samples/logging_resource/logging_resource-update-request.json0000666000175100017510000000013713231472055033434 0ustar zuulzuul00000000000000{ "logging_resource": { "description": "my log2", "enabled": false } } neutron-lib-1.13.0/api-ref/source/v2/samples/logging_resource/logging_resource-create-response.json0000666000175100017510000000047213231472055033565 0ustar zuulzuul00000000000000{ "logging_resource": { "description": "my log", "enabled": true, "firewall_logs": [], "id": "13b64f3c-20af-4741-b230-658ab7d5b257", "name": "log", "project_id": "8d018258316e4f22890561e8780c85bb", "tenant_id": "8d018258316e4f22890561e8780c85bb" } } neutron-lib-1.13.0/api-ref/source/v2/samples/logging_resource/logging_resource-create-request.json0000666000175100017510000000016413231472055033415 0ustar zuulzuul00000000000000{ "logging_resource": { "description": "my log", "enabled": true, "name": "log" } } neutron-lib-1.13.0/api-ref/source/v2/samples/ports/0000775000175100017510000000000013231472430022042 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/ports/ports-bind-list-response.json0000666000175100017510000000570313231472055027635 0ustar zuulzuul00000000000000{ "ports": [ { "admin_state_up": true, "allowed_address_pairs": [], "binding:host_id": "devstack", "binding:profile": {}, "binding:vif_details": { "ovs_hybrid_plug": true, "port_filter": true }, "binding:vif_type": "ovs", "binding:vnic_type": "normal", "data_plane_status": null, "description": "", "device_id": "9ae135f4-b6e0-4dad-9e91-3c223e385824", "device_owner": "network:router_gateway", "dns_assignment": { "hostname": "myport", "ip_address": "172.24.4.2", "fqdn": "myport.my-domain.org" }, "dns_domain": "my-domain.org.", "dns_name": "myport", "extra_dhcp_opts": [], "fixed_ips": [ { "ip_address": "172.24.4.2", "subnet_id": "008ba151-0b8c-4a67-98b5-0d2b87666062" } ], "id": "d80b1a3b-4fc1-49f3-952e-1e2ab7081d8b", "mac_address": "fa:16:3e:58:42:ed", "name": "", "network_id": "70c1db1f-b701-45bd-96e0-a313ee3430b3", "port_security_enabled": true, "project_id": "", "revision_number": 1, "security_groups": [], "status": "ACTIVE", "tenant_id": "" }, { "admin_state_up": true, "allowed_address_pairs": [], "binding:host_id": "devstack", "binding:profile": {}, "binding:vif_details": { "ovs_hybrid_plug": true, "port_filter": true }, "binding:vif_type": "ovs", "binding:vnic_type": "normal", "data_plane_status": null, "description": "", "device_id": "9ae135f4-b6e0-4dad-9e91-3c223e385824", "device_owner": "network:router_interface", "dns_assignment": { "hostname": "myport2", "ip_address": "10.0.0.1", "fqdn": "myport2.my-domain.org" }, "dns_domain": "my-domain.org.", "dns_name": "myport2", "extra_dhcp_opts": [], "fixed_ips": [ { "ip_address": "10.0.0.1", "subnet_id": "288bf4a1-51ba-43b6-9d0a-520e9005db17" } ], "id": "f71a6703-d6de-4be1-a91a-a570ede1d159", "mac_address": "fa:16:3e:bb:3c:e4", "name": "", "network_id": "f27aa545-cbdd-4907-b0c6-c9e8b039dcc2", "port_security_enabled": true, "project_id": "d397de8a63f341818f198abb0966f6f3", "revision_number": 2, "security_groups": [], "status": "ACTIVE", "tenant_id": "d397de8a63f341818f198abb0966f6f3" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/ports/port-bind-create-response.json0000666000175100017510000000330513231472055027736 0ustar zuulzuul00000000000000{ "port": { "admin_state_up": true, "allowed_address_pairs": [ { "ip_address": "12.12.11.12", "mac_address": "fa:14:2a:b3:cb:f0" } ], "binding:host_id": "4df8d9ff-6f6f-438f-90a1-ef660d4586ad", "binding:profile": { "local_link_information": [ { "port_id": "Ethernet3/1", "switch_id": "0a:1b:2c:3d:4e:5f", "switch_info": "switch1" } ] }, "binding:vif_details": {}, "binding:vif_type": "unbound", "binding:vnic_type": "other", "data_plane_status": null, "description": "", "device_id": "d90a13da-be41-461f-9f99-1dbcf438fdf2", "device_owner": "baremetal:none", "dns_assignment": { "hostname": "myport", "ip_address": "10.0.0.2", "fqdn": "myport.my-domain.org" }, "dns_domain": "my-domain.org.", "dns_name": "myport", "fixed_ips": [ { "ip_address": "10.0.0.2", "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" } ], "id": "65c0ee9f-d634-4522-8954-51021b570b0d", "mac_address": "fa:16:3e:c9:cb:f0", "name": "private-port", "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", "project_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", "revision_number": 1, "security_groups": [ "f0ac4394-7e4a-4409-9701-ba8be283dbc3" ], "status": "DOWN", "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", "port_security_enabled": true } } neutron-lib-1.13.0/api-ref/source/v2/samples/ports/port-create-request.json0000666000175100017510000000065413231472055026662 0ustar zuulzuul00000000000000{ "port": { "admin_state_up": true, "dns_domain": "my-domain.org.", "dns_name": "myport", "name": "private-port", "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", "port_security_enabled": true, "allowed_address_pairs": [ { "ip_address": "12.12.11.12", "mac_address": "fa:14:2a:b3:cb:f0" } ] } } neutron-lib-1.13.0/api-ref/source/v2/samples/ports/ports-list-response.json0000666000175100017510000000460313231472055026721 0ustar zuulzuul00000000000000{ "ports": [ { "admin_state_up": true, "allowed_address_pairs": [], "data_plane_status": null, "description": "", "device_id": "9ae135f4-b6e0-4dad-9e91-3c223e385824", "device_owner": "network:router_gateway", "dns_assignment": { "hostname": "myport", "ip_address": "172.24.4.2", "fqdn": "myport.my-domain.org" }, "dns_domain": "my-domain.org.", "dns_name": "myport", "extra_dhcp_opts": [], "fixed_ips": [ { "ip_address": "172.24.4.2", "subnet_id": "008ba151-0b8c-4a67-98b5-0d2b87666062" } ], "id": "d80b1a3b-4fc1-49f3-952e-1e2ab7081d8b", "mac_address": "fa:16:3e:58:42:ed", "name": "", "network_id": "70c1db1f-b701-45bd-96e0-a313ee3430b3", "project_id": "", "revision_number": 1, "security_groups": [], "status": "ACTIVE", "tenant_id": "", "port_security_enabled": false }, { "admin_state_up": true, "allowed_address_pairs": [], "data_plane_status": null, "description": "", "device_id": "9ae135f4-b6e0-4dad-9e91-3c223e385824", "device_owner": "network:router_interface", "dns_assignment": { "hostname": "myport2", "ip_address": "10.0.0.1", "fqdn": "myport2.my-domain.org" }, "dns_domain": "my-domain.org.", "dns_name": "myport2", "extra_dhcp_opts": [], "fixed_ips": [ { "ip_address": "10.0.0.1", "subnet_id": "288bf4a1-51ba-43b6-9d0a-520e9005db17" } ], "id": "f71a6703-d6de-4be1-a91a-a570ede1d159", "mac_address": "fa:16:3e:bb:3c:e4", "name": "", "network_id": "f27aa545-cbdd-4907-b0c6-c9e8b039dcc2", "project_id": "d397de8a63f341818f198abb0966f6f3", "revision_number": 1, "security_groups": [], "status": "ACTIVE", "tenant_id": "d397de8a63f341818f198abb0966f6f3", "port_security_enabled": false } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/ports/port-bind-update-request.json0000666000175100017510000000033113231472055027603 0ustar zuulzuul00000000000000{ "port": { "binding:host_id": "test_for_port_update_host", "device_id": "d90a13da-be41-461f-9f99-1dbcf438fdf2", "data_plane_status": "DOWN", "device_owner": "compute:nova" } } neutron-lib-1.13.0/api-ref/source/v2/samples/ports/port-bind-show-response.json0000666000175100017510000000267513231472055027464 0ustar zuulzuul00000000000000{ "port": { "admin_state_up": true, "allowed_address_pairs": [], "binding:host_id": "devstack", "binding:profile": {}, "binding:vif_details": { "ovs_hybrid_plug": true, "port_filter": true }, "binding:vif_type": "ovs", "binding:vnic_type": "normal", "created_at": "2016-03-08T20:19:41", "data_plane_status": "ACTIVE", "description": "", "device_id": "5e3898d7-11be-483e-9732-b2f5eccd2b2e", "device_owner": "network:router_interface", "dns_assignment": { "hostname": "myport", "ip_address": "10.0.0.1", "fqdn": "myport.my-domain.org" }, "dns_domain": "my-domain.org.", "dns_name": "myport", "extra_dhcp_opts": [], "fixed_ips": [ { "ip_address": "10.0.0.1", "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" } ], "id": "46d4bfb9-b26e-41f3-bd2e-e6dcc1ccedb2", "mac_address": "fa:16:3e:23:fd:d7", "name": "", "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", "port_security_enabled": false, "project_id": "7e02058126cc4950b75f9970368ba177", "revision_number": 1, "security_groups": [], "status": "ACTIVE", "tenant_id": "7e02058126cc4950b75f9970368ba177", "updated_at": "2016-03-08T20:19:41" } } neutron-lib-1.13.0/api-ref/source/v2/samples/ports/ports-bulk-create-request.json0000666000175100017510000000053013231472055027771 0ustar zuulzuul00000000000000{ "ports": [ { "admin_state_up": false, "name": "sample_port_1", "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7" }, { "admin_state_up": false, "name": "sample_port_2", "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/ports/port-create-response.json0000666000175100017510000000250613231472055027026 0ustar zuulzuul00000000000000{ "port": { "admin_state_up": true, "allowed_address_pairs": [ { "ip_address": "12.12.11.12", "mac_address": "fa:14:2a:b3:cb:f0" } ], "created_at": "2016-03-08T20:19:41", "data_plane_status": null, "description": "", "device_id": "", "device_owner": "", "dns_assignment": { "hostname": "myport", "ip_address": "10.0.0.2", "fqdn": "myport.my-domain.org" }, "dns_domain": "my-domain.org.", "dns_name": "myport", "extra_dhcp_opts": [], "fixed_ips": [ { "ip_address": "10.0.0.2", "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" } ], "id": "65c0ee9f-d634-4522-8954-51021b570b0d", "mac_address": "fa:16:3e:c9:cb:f0", "name": "private-port", "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", "port_security_enabled": true, "project_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", "revision_number": 1, "security_groups": [ "f0ac4394-7e4a-4409-9701-ba8be283dbc3" ], "status": "DOWN", "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", "updated_at": "2016-03-08T20:19:41" } } neutron-lib-1.13.0/api-ref/source/v2/samples/ports/port-bind-create-request.json0000666000175100017510000000110413231472055027563 0ustar zuulzuul00000000000000{ "port": { "binding:host_id": "4df8d9ff-6f6f-438f-90a1-ef660d4586ad", "binding:profile": { "local_link_information": [ { "port_id": "Ethernet3/1", "switch_id": "0a:1b:2c:3d:4e:5f", "switch_info": "switch1" } ] }, "binding:vnic_type": "baremetal", "device_id": "d90a13da-be41-461f-9f99-1dbcf438fdf2", "device_owner": "baremetal:none", "dns_domain": "my-domain.org.", "dns_name": "myport" } } neutron-lib-1.13.0/api-ref/source/v2/samples/ports/port-bind-update-response.json0000666000175100017510000000256313231472055027762 0ustar zuulzuul00000000000000{ "port": { "admin_state_up": true, "allowed_address_pairs": [], "binding:host_id": "test_for_port_update_host", "binding:profile": {}, "binding:vif_details": {}, "binding:vif_type": "binding_failed", "binding:vnic_type": "normal", "data_plane_status": "DOWN", "description": "", "device_id": "d90a13da-be41-461f-9f99-1dbcf438fdf2", "device_owner": "compute:nova", "dns_assignment": { "hostname": "myport", "ip_address": "20.20.0.4", "fqdn": "myport.my-domain.org" }, "dns_domain": "my-domain.org.", "dns_name": "myport", "extra_dhcp_opts": [], "fixed_ips": [ { "ip_address": "20.20.0.4", "subnet_id": "898dec4a-74df-4193-985f-c76721bcc746" } ], "id": "43c831e0-19ce-4a76-9a49-57b57e69428b", "mac_address": "fa:16:3e:11:11:5e", "name": "test-for-port-update", "network_id": "883fc383-5ea1-4c8b-8916-e1ddb0a9f365", "project_id": "522eda8d23124b25bf03fe44f1986b74", "revision_number": 2, "security_groups": [ "ce0179d6-8a94-4f7c-91c2-f3038e2acbd0" ], "status": "DOWN", "tenant_id": "522eda8d23124b25bf03fe44f1986b74", "port_security_enabled": false } } neutron-lib-1.13.0/api-ref/source/v2/samples/ports/port-show-response.json0000666000175100017510000000227413231472055026545 0ustar zuulzuul00000000000000{ "port": { "admin_state_up": true, "allowed_address_pairs": [], "created_at": "2016-03-08T20:19:41", "data_plane_status": "ACTIVE", "description": "", "device_id": "5e3898d7-11be-483e-9732-b2f5eccd2b2e", "device_owner": "network:router_interface", "dns_assignment": { "hostname": "myport", "ip_address": "10.0.0.1", "fqdn": "myport.my-domain.org" }, "dns_domain": "my-domain.org.", "dns_name": "myport", "extra_dhcp_opts": [], "fixed_ips": [ { "ip_address": "10.0.0.1", "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" } ], "id": "46d4bfb9-b26e-41f3-bd2e-e6dcc1ccedb2", "mac_address": "fa:16:3e:23:fd:d7", "name": "", "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", "port_security_enabled": false, "project_id": "7e02058126cc4950b75f9970368ba177", "revision_number": 1, "security_groups": [], "status": "ACTIVE", "tenant_id": "7e02058126cc4950b75f9970368ba177", "updated_at": "2016-03-08T20:19:41" } } neutron-lib-1.13.0/api-ref/source/v2/samples/ports/port-update-request.json0000666000175100017510000000030413231472055026671 0ustar zuulzuul00000000000000{ "port": { "admin_state_up": true, "device_id": "d90a13da-be41-461f-9f99-1dbcf438fdf2", "device_owner": "compute:nova", "name": "test-for-port-update" } } neutron-lib-1.13.0/api-ref/source/v2/samples/ports/port-update-response.json0000666000175100017510000000256513231472055027052 0ustar zuulzuul00000000000000{ "port": { "admin_state_up": true, "allowed_address_pairs": [], "binding:host_id": "test_for_port_update_host", "binding:profile": {}, "binding:vif_details": {}, "binding:vif_type": "binding_failed", "binding:vnic_type": "normal", "data_plane_status": "ACTIVE", "description": "", "device_id": "d90a13da-be41-461f-9f99-1dbcf438fdf2", "device_owner": "compute:nova", "dns_assignment": { "hostname": "myport", "ip_address": "20.20.0.4", "fqdn": "myport.my-domain.org" }, "dns_domain": "my-domain.org.", "dns_name": "myport", "extra_dhcp_opts": [], "fixed_ips": [ { "ip_address": "20.20.0.4", "subnet_id": "898dec4a-74df-4193-985f-c76721bcc746" } ], "id": "43c831e0-19ce-4a76-9a49-57b57e69428b", "mac_address": "fa:16:3e:11:11:5e", "name": "test-for-port-update", "network_id": "883fc383-5ea1-4c8b-8916-e1ddb0a9f365", "project_id": "522eda8d23124b25bf03fe44f1986b74", "revision_number": 1, "security_groups": [ "ce0179d6-8a94-4f7c-91c2-f3038e2acbd0" ], "status": "DOWN", "tenant_id": "522eda8d23124b25bf03fe44f1986b74", "port_security_enabled": false } } neutron-lib-1.13.0/api-ref/source/v2/samples/ports/ports-bulk-create-response.json0000666000175100017510000000407613231472055030150 0ustar zuulzuul00000000000000{ "ports": [ { "admin_state_up": false, "allowed_address_pairs": [], "data_plane_status": null, "description": "", "device_id": "", "device_owner": "", "dns_domain": "", "dns_name": "", "fixed_ips": [ { "ip_address": "10.0.0.5", "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" } ], "id": "94225baa-9d3f-4b93-bf12-b41e7ce49cdb", "mac_address": "fa:16:3e:48:b8:9f", "name": "sample_port_1", "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", "project_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", "revision_number": 1, "security_groups": [ "f0ac4394-7e4a-4409-9701-ba8be283dbc3" ], "status": "DOWN", "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", "port_security_enabled": false }, { "admin_state_up": false, "allowed_address_pairs": [], "data_plane_status": null, "description": "", "device_id": "", "device_owner": "", "dns_assignment": {}, "dns_domain": "", "dns_name": "", "fixed_ips": [ { "ip_address": "10.0.0.6", "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" } ], "id": "235b09e0-63c4-47f1-b221-66ba54c21760", "mac_address": "fa:16:3e:f4:73:df", "name": "sample_port_2", "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", "project_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", "revision_number": 1, "security_groups": [ "f0ac4394-7e4a-4409-9701-ba8be283dbc3" ], "status": "DOWN", "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", "port_security_enabled": false } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/quota_details/0000775000175100017510000000000013231472430023531 5ustar zuulzuul00000000000000././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/quota_details/quota-details-show-for-project-response.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/quota_details/quota-details-show-for-project-response.j0000666000175100017510000000143213231472055033527 0ustar zuulzuul00000000000000{ "quota": { "rbac_policy": { "used": 4, "limit": 10, "reserved": 0 }, "subnetpool": { "used": 2, "limit": -1, "reserved": 0 }, "security_group_rule": { "used": 10, "limit": 100, "reserved": 1 }, "security_group": { "used": 3, "limit": 10, "reserved": 0 }, "subnet": { "used": 3, "limit": 100, "reserved": 0 }, "port": { "used": 21, "limit": 500, "reserved": 3 }, "network" :{ "used": 9, "limit": 100, "reserved": 2 } } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/0000775000175100017510000000000013231472430021475 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/qos/policy-show-response.json0000666000175100017510000000157113231472055026512 0ustar zuulzuul00000000000000{ "policy": { "project_id": "8d4c70a21fed4aeba121a1a429ba0d04", "tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04", "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", "name": "10Mbit", "description": "This policy limits the ports to 10Mbit max.", "revision_number": 3, "shared": false, "rules": [ { "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c793", "qos_policy_id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", "max_kbps": 10000, "max_burst_kbps": 0, "type": "bandwidth_limit" }, { "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c794", "qos_policy_id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", "dscp_mark": 26, "type": "dscp_marking" } ] } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/bandwidth_limit_rule-show-response.json0000666000175100017510000000026413231472055031402 0ustar zuulzuul00000000000000{ "bandwidth_limit_rule": { "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c793", "max_kbps": 10000, "max_burst_kbps": 0, "direction": "egress" } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/dscp_marking_rule-update-response.json0000666000175100017510000000016313231472055031201 0ustar zuulzuul00000000000000{ "dscp_marking_rule": { "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c794", "dscp_mark": 16 } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/bandwidth_limit_rule-update-response.json0000666000175100017510000000026413231472055031704 0ustar zuulzuul00000000000000{ "bandwidth_limit_rule": { "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c793", "max_kbps": 10000, "max_burst_kbps": 0, "direction": "egress" } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/dscp_marking_rule-create-response.json0000666000175100017510000000016313231472055031162 0ustar zuulzuul00000000000000{ "dscp_marking_rule": { "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c794", "dscp_mark": 26 } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/minimum_bandwidth_rule-update-request.json0000666000175100017510000000010613231472055032066 0ustar zuulzuul00000000000000{ "minimum_bandwidth_rule": { "min_kbps": "20000" } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/rule_types-list-response.json0000666000175100017510000000031513231472055027374 0ustar zuulzuul00000000000000{ "rule_types": [ { "type": "bandwidth_limit" }, { "type": "dscp_marking" }, { "type": "minimum_bandwidth" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/dscp_marking_rule-create-request.json0000666000175100017510000000007713231472055031020 0ustar zuulzuul00000000000000{ "dscp_marking_rule": { "dscp_mark": "26" } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/rule_type-details-response.json0000666000175100017510000000360513231472055027670 0ustar zuulzuul00000000000000{ "drivers": [ { "name": "openvswitch", "supported_parameters": [ { "parameter_name": "max_kbps", "parameter_type": "range", "parameter_values": { "end": 2147483647, "start": 0 } }, { "parameter_name": "direction", "parameter_type": "choices", "parameter_values": [ "ingress", "egress" ] }, { "parameter_name": "max_burst_kbps", "parameter_type": "range", "parameter_values": { "end": 2147483647, "start": 0 } } ] }, { "name": "linuxbridge", "supported_parameters": [ { "parameter_name": "max_kbps", "parameter_type": "range", "parameter_values": { "end": 2147483647, "start": 0 } }, { "parameter_name": "direction", "parameter_type": "choices", "parameter_values": [ "ingress", "egress" ] }, { "parameter_name": "max_burst_kbps", "parameter_type": "range", "parameter_values": { "end": 2147483647, "start": 0 } } ] } ], "type": "bandwidth_limit" } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/policy-update-response.json0000666000175100017510000000053113231472055027007 0ustar zuulzuul00000000000000{ "policy": { "name": "10Mbit", "description": "This policy limits the ports to 10Mbit max.", "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", "project_id": "8d4c70a21fed4aeba121a1a429ba0d04", "revision_number": 3, "tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04", "shared": false } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/bandwidth_limit_rule-update-request.json0000666000175100017510000000010413231472055031527 0ustar zuulzuul00000000000000{ "bandwidth_limit_rule": { "max_kbps": "10000" } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/dscp_marking_rules-list-response.json0000666000175100017510000000022013231472055031047 0ustar zuulzuul00000000000000{ "dscp_marking_rules": [ { "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c794", "dscp_mark": 26 } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/bandwidth_limit_rule-create-request.json0000666000175100017510000000010413231472055031510 0ustar zuulzuul00000000000000{ "bandwidth_limit_rule": { "max_kbps": "10000" } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/policy-create-request.json0000666000175100017510000000022213231472055026617 0ustar zuulzuul00000000000000{ "policy": { "name": "10Mbit", "description": "This policy limits the ports to 10Mbit max.", "shared": false } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/minimum_bandwidth_rule-create-response.json0000666000175100017510000000023113231472055032214 0ustar zuulzuul00000000000000{ "minimum_bandwidth_rule": { "id": "1eddf7af-0b4c-42c5-8ae1-390b32f1de08", "min_kbps": 10000, "direction": "egress" } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/minimum_bandwidth_rule-create-request.json0000666000175100017510000000010613231472055032047 0ustar zuulzuul00000000000000{ "minimum_bandwidth_rule": { "min_kbps": "10000" } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/dscp_marking_rule-update-request.json0000666000175100017510000000007713231472055031037 0ustar zuulzuul00000000000000{ "dscp_marking_rule": { "dscp_mark": "16" } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/minimum_bandwidth_rules-list-response.json0000666000175100017510000000027213231472055032114 0ustar zuulzuul00000000000000{ "minimum_bandwidth_rules": [ { "id": "1eddf7af-0b4c-42c5-8ae1-390b32f1de08", "min_kbps": 10000, "direction": "egress" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/policy-create-response.json0000666000175100017510000000055613231472055026777 0ustar zuulzuul00000000000000{ "policy": { "name": "10Mbit", "description": "This policy limits the ports to 10Mbit max.", "rules": [], "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", "project_id": "8d4c70a21fed4aeba121a1a429ba0d04", "revision_number": 1, "tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04", "shared": false } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/dscp_marking_rule-show-response.json0000666000175100017510000000016313231472055030677 0ustar zuulzuul00000000000000{ "dscp_marking_rule": { "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c794", "dscp_mark": 26 } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/policies-list-response.json0000666000175100017510000000174613231472055027021 0ustar zuulzuul00000000000000{ "policies": [ { "project_id": "8d4c70a21fed4aeba121a1a429ba0d04", "tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04", "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", "name": "10Mbit", "description": "This policy limits the ports to 10Mbit max.", "revision_number": 3, "shared": false, "rules": [ { "max_kbps": 10000, "type": "bandwidth_limit", "id": "b1866696-032a-4228-857f-846075f63487", "max_burst_kbps": 0, "qos_policy_id": "46ebaec0-0570-43ac-82f6-60d2b03168c4" }, { "dscp_mark": 20, "type": "dscp_marking", "id": "d9c021d5-5433-4d7c-8bfa-69cca486aac8", "qos_policy_id": "46ebaec0-0570-43ac-82f6-60d2b03168c4" } ] } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/bandwidth_limit_rule-create-response.json0000666000175100017510000000026413231472055031665 0ustar zuulzuul00000000000000{ "bandwidth_limit_rule": { "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c793", "max_kbps": 10000, "max_burst_kbps": 0, "direction": "egress" } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/policy-update-request.json0000666000175100017510000000022213231472055026636 0ustar zuulzuul00000000000000{ "policy": { "name": "10Mbit", "description": "This policy limits the ports to 10Mbit max.", "shared": false } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/bandwidth_limit_rules-list-response.json0000666000175100017510000000033113231472055031553 0ustar zuulzuul00000000000000{ "bandwidth_limit_rules": [ { "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c793", "max_kbps": 10000, "max_burst_kbps": 0, "direction": "egress" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/minimum_bandwidth_rule-update-response.json0000666000175100017510000000023113231472055032233 0ustar zuulzuul00000000000000{ "minimum_bandwidth_rule": { "id": "1eddf7af-0b4c-42c5-8ae1-390b32f1de08", "min_kbps": 20000, "direction": "egress" } } neutron-lib-1.13.0/api-ref/source/v2/samples/qos/minimum_bandwidth_rule-show-response.json0000666000175100017510000000023113231472055031731 0ustar zuulzuul00000000000000{ "minimum_bandwidth_rule": { "id": "1eddf7af-0b4c-42c5-8ae1-390b32f1de08", "min_kbps": 10000, "direction": "egress" } } neutron-lib-1.13.0/api-ref/source/v2/samples/extensions/0000775000175100017510000000000013231472430023072 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/extensions/extension-show-response.json0000666000175100017510000000031613231472055030620 0ustar zuulzuul00000000000000{ "extension": { "updated": "2013-02-03T10:00:00-00:00", "name": "agent", "links": [], "alias": "agent", "description": "The agent management extension." } } neutron-lib-1.13.0/api-ref/source/v2/samples/extensions/extensions-list-response.json0000666000175100017510000001136113231472055031000 0ustar zuulzuul00000000000000{ "extensions": [ { "updated": "2013-01-20T00:00:00-00:00", "name": "Neutron Service Type Management", "links": [], "alias": "service-type", "description": "API for retrieving service providers for Neutron advanced services" }, { "updated": "2012-10-05T10:00:00-00:00", "name": "security-group", "links": [], "alias": "security-group", "description": "The security groups extension." }, { "updated": "2013-02-07T10:00:00-00:00", "name": "L3 Agent Scheduler", "links": [], "alias": "l3_agent_scheduler", "description": "Schedule routers among l3 agents" }, { "updated": "2013-02-07T10:00:00-00:00", "name": "Loadbalancer Agent Scheduler", "links": [], "alias": "lbaas_agent_scheduler", "description": "Schedule pools among lbaas agents" }, { "updated": "2013-03-28T10:00:00-00:00", "name": "Neutron L3 Configurable external gateway mode", "links": [], "alias": "ext-gw-mode", "description": "Extension of the router abstraction for specifying whether SNAT should occur on the external gateway" }, { "updated": "2014-02-03T10:00:00-00:00", "name": "Port Binding", "links": [], "alias": "binding", "description": "Expose port bindings of a virtual port to external application" }, { "updated": "2012-09-07T10:00:00-00:00", "name": "Provider Network", "links": [], "alias": "provider", "description": "Expose mapping of virtual networks to physical networks" }, { "updated": "2013-02-03T10:00:00-00:00", "name": "agent", "links": [], "alias": "agent", "description": "The agent management extension." }, { "updated": "2012-07-29T10:00:00-00:00", "name": "Quota management support", "links": [], "alias": "quotas", "description": "Expose functions for quotas management per tenant" }, { "updated": "2013-02-07T10:00:00-00:00", "name": "DHCP Agent Scheduler", "links": [], "alias": "dhcp_agent_scheduler", "description": "Schedule networks among dhcp agents" }, { "updated": "2013-06-27T10:00:00-00:00", "name": "Multi Provider Network", "links": [], "alias": "multi-provider", "description": "Expose mapping of virtual networks to multiple physical networks" }, { "updated": "2013-01-14T10:00:00-00:00", "name": "Neutron external network", "links": [], "alias": "external-net", "description": "Adds external network attribute to network resource." }, { "updated": "2012-07-20T10:00:00-00:00", "name": "Neutron L3 Router", "links": [], "alias": "router", "description": "Router abstraction for basic L3 forwarding between L2 Neutron networks and access to external networks via a NAT gateway." }, { "updated": "2013-07-23T10:00:00-00:00", "name": "Allowed Address Pairs", "links": [], "alias": "allowed-address-pairs", "description": "Provides allowed address pairs" }, { "updated": "2013-03-17T12:00:00-00:00", "name": "Neutron Extra DHCP opts", "links": [], "alias": "extra_dhcp_opt", "description": "Extra options configuration for DHCP. For example PXE boot options to DHCP clients can be specified (e.g. tftp-server, server-ip-address, bootfile-name)" }, { "updated": "2012-10-07T10:00:00-00:00", "name": "LoadBalancing service", "links": [], "alias": "lbaas", "description": "Extension for LoadBalancing service" }, { "updated": "2013-02-01T10:00:00-00:00", "name": "Neutron Extra Route", "links": [], "alias": "extraroute", "description": "Extra routes configuration for L3 router" }, { "updated": "2016-01-24T10:00:00-00:00", "name": "Neutron Port Data Plane Status", "links": [], "alias": "data-plane-status", "description": "Status of the underlying data plane." } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/0000775000175100017510000000000013231472430022167 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/network_associations/0000775000175100017510000000000013231472430026437 5ustar zuulzuul00000000000000././@LongLink0000000000000000000000000000016200000000000011214 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-create-response.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-create-0000666000175100017510000000037113231472055033773 0ustar zuulzuul00000000000000{ "network_association": { "network_id": "8c5d88dc-60ac-4b02-a65a-36b65888ddcd", "tenant_id": "b7549121395844bea941bb92feb3fad9", "project_id": "b7549121395844bea941bb92feb3fad9", "id": "73238ca1-e05d-4c7a-b4d4-70407b4b8730" } } ././@LongLink0000000000000000000000000000016000000000000011212 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-show-response.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-show-re0000666000175100017510000000043713231472055034042 0ustar zuulzuul00000000000000{ "network_association": { "id": "1b09fd12-c769-4be7-9c26-dececa474acf", "network_id": "a4f2b8df-cb42-4893-a333-d0b5c36ade17", "tenant_id": "b7549121395844bea941bb92feb3fad9", "project_id": "b7549121395844bea941bb92feb3fad9" } } ././@LongLink0000000000000000000000000000016000000000000011212 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-list-response.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-list-re0000666000175100017510000000077113231472055034036 0ustar zuulzuul00000000000000{ "network_associations": [ { "network_id": "8c5d88dc-60ac-4b02-a65a-36b65888ddcd", "tenant_id": "b7549121395844bea941bb92feb3fad9", "project_id": "b7549121395844bea941bb92feb3fad9", "id": "96227c78-6a0c-4d9d-b441-c4b8f6fb6c4a" }, { "network_id": "a4f2b8df-cb42-4893-a333-d0b5c36ade17", "tenant_id": "b7549121395844bea941bb92feb3fad9", "project_id": "b7549121395844bea941bb92feb3fad9", "id": "1b09fd12-c769-4be7-9c26-dececa474acf" } ] } ././@LongLink0000000000000000000000000000016100000000000011213 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-create-request.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-create-0000666000175100017510000000013413231472055033770 0ustar zuulzuul00000000000000{ "network_association": { "network_id": "8c5d88dc-60ac-4b02-a65a-36b65888ddcd" } } neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/bgpvpns/0000775000175100017510000000000013231472430023646 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-create-request.json0000666000175100017510000000044013231472055030767 0ustar zuulzuul00000000000000{ "bgpvpn": { "tenant_id": "b7549121395844bea941bb92feb3fad9", "route_targets": "64512:1444", "import_targets": "64512:1555", "export_targets": "64512:1666", "route_distinguishers": ["64512:1777", "64512:1888", "64512:1999"], "type": "l3", "vni": 1000 } } neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-show-response.json0000666000175100017510000000100313231472055030646 0ustar zuulzuul00000000000000{ "bgpvpn": { "id": "460ac411-3dfb-45bb-8116-ed1a7233d143", "name": "foo", "route_targets": ["64512:1444"], "export_targets": [], "import_targets": [], "type": "l3", "tenant_id": "f94ea398564d49dfb0d542f086c68ce7", "project_id": "f94ea398564d49dfb0d542f086c68ce7", "routers": [], "route_distinguishers": [], "networks": [ "a4f2b8df-cb42-4893-a333-d0b5c36ade17" ], "local_pref": null, "vni": 1000 } } neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-update-response.json0000666000175100017510000000057713231472055031167 0ustar zuulzuul00000000000000{ "bgpvpn": { "export_targets": [], "name": "", "routers": [], "route_distinguishers": [ "12345:1234" ], "tenant_id": "b7549121395844bea941bb92feb3fad9", "import_targets": [], "route_targets": ["64512:1444"], "type": "l3", "id": "4d627abf-06dd-45ab-920b-8e61422bb984", "networks": [], "local_pref": null, "vni": 1000 } } neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-create-response.json0000666000175100017510000000103113231472055031132 0ustar zuulzuul00000000000000{ "bgpvpn": { "export_targets": [ "64512:1666" ], "name": "", "routers": [], "route_distinguishers": [ "64512:1777", "64512:1888", "64512:1999" ], "tenant_id": "b7549121395844bea941bb92feb3fad9", "project_id": "b7549121395844bea941bb92feb3fad9", "import_targets": [ "64512:1555" ], "route_targets": [ "64512:1444" ], "type": "l3", "id": "0f9d472a-908f-40f5-8574-b4e8a63ccbf0", "networks": [], "local_pref": null, "vni": 1000 } } neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-update-request.json0000666000175100017510000000022113231472055031003 0ustar zuulzuul00000000000000{ "bgpvpn": { "name": "foo", "route_targets": ["64512:1444"], "export_targets": [], "import_targets": [] } } neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpns-list-response.json0000666000175100017510000000112413231472055031030 0ustar zuulzuul00000000000000{ "bgpvpns": [ { "export_targets": [ "64512:1666" ], "name": "", "routers": [], "route_distinguishers": [ "64512:1777", "64512:1888", "64512:1999" ], "tenant_id": "b7549121395844bea941bb92feb3fad9", "project_id": "b7549121395844bea941bb92feb3fad9", "import_targets": [ "64512:1555" ], "route_targets": [ "64512:1444" ], "type": "l3", "id": "0f9d472a-908f-40f5-8574-b4e8a63ccbf0", "networks": [], "local_pref": null, "vni": 1000 } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/router_associations/0000775000175100017510000000000013231472430026266 5ustar zuulzuul00000000000000././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-list-response.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-list-resp0000666000175100017510000000046213231472055034054 0ustar zuulzuul00000000000000{ "router_associations": [ { "router_id": "61222227-49eb-4dcc-b2d6-66bbfb2fdd7a", "tenant_id": "b7549121395844bea941bb92feb3fad9", "project_id": "b7549121395844bea941bb92feb3fad9", "id": "95277be7-a231-4e96-9625-8f9fe41de9d6", "advertise_extra_routes": true } ] } ././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-show-response.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-show-resp0000666000175100017510000000046313231472055034062 0ustar zuulzuul00000000000000{ "router_association": { "id": "c63149a0-a0b3-4ca7-aba4-9aaa1b39d7f3", "router_id": "46a1a80b-7c42-4c45-88fd-b531e636969f", "tenant_id": "b7549121395844bea941bb92feb3fad9", "project_id": "b7549121395844bea941bb92feb3fad9", "advertise_extra_routes": true } } ././@LongLink0000000000000000000000000000016000000000000011212 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-create-response.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-create-re0000666000175100017510000000043313231472055033777 0ustar zuulzuul00000000000000{ "router_association": { "router_id": "46a1a80b-7c42-4c45-88fd-b531e636969f", "tenant_id": "b7549121395844bea941bb92feb3fad9", "project_id": "b7549121395844bea941bb92feb3fad9", "id": "c63149a0-a0b3-4ca7-aba4-9aaa1b39d7f3", "advertise_extra_routes": true } } ././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-update-request.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-update-re0000666000175100017510000000021313231472055034012 0ustar zuulzuul00000000000000{ "router_association": { "router_id": "46a1a80b-7c42-4c45-88fd-b531e636969f", "advertise_extra_routes": false } } ././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-create-request.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-create-re0000666000175100017510000000013213231472055033773 0ustar zuulzuul00000000000000{ "router_association": { "router_id": "b58a6241-6e49-4b11-87c6-8e0606dde796" } } ././@LongLink0000000000000000000000000000016000000000000011212 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-update-response.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-update-re0000666000175100017510000000037213231472055034020 0ustar zuulzuul00000000000000{ "router_association": { "id": "c63149a0-a0b3-4ca7-aba4-9aaa1b39d7f3", "project_id": "b7549121395844bea941bb92feb3fad9", "router_id": "46a1a80b-7c42-4c45-88fd-b531e636969f", "advertise_extra_routes": false } }neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/port_associations/0000775000175100017510000000000013231472430025732 5ustar zuulzuul00000000000000././@LongLink0000000000000000000000000000015300000000000011214 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/port_associations/port_association-update-request.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/port_associations/port_association-update-reques0000666000175100017510000000051013231472055034020 0ustar zuulzuul00000000000000{ "port_association": { "port_id": "46a1a80b-7c42-4c45-88fd-b531e636969f", "routes": [ { "type": "bgpvpn", "bgpvpn_id": "180630e3-9eae-4ba7-9939-d5f47966e1f0", "local_pref": 111 } ], "advertise_fixed_ips": false } } ././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/port_associations/port_association-list-response.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/port_associations/port_association-list-response0000666000175100017510000000066513231472055034056 0ustar zuulzuul00000000000000{ "port_associations": [ { "id": "95277be7-a231-4e96-9625-8f9fe41de9d6", "port_id": "61222227-49eb-4dcc-b2d6-66bbfb2fdd7a", "project_id": "b7549121395844bea941bb92feb3fad9", "routes": [ { "type": "prefix", "prefix": "20.1.0.0/16" } ], "advertise_fixed_ips": true } ] } ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/port_associations/port_association-update-response.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/port_associations/port_association-update-respon0000666000175100017510000000067013231472055034031 0ustar zuulzuul00000000000000{ "port_association": { "id": "c63149a0-a0b3-4ca7-aba4-9aaa1b39d7f3", "port_id": "46a1a80b-7c42-4c45-88fd-b531e636969f", "project_id": "b7549121395844bea941bb92feb3fad9", "routes": [ { "type": "bgpvpn", "bgpvpn_id": "180630e3-9eae-4ba7-9939-d5f47966e1f0", "local_pref": 111 } ], "advertise_fixed_ips": false } } ././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/port_associations/port_association-show-response.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/port_associations/port_association-show-response0000666000175100017510000000057013231472055034056 0ustar zuulzuul00000000000000{ "port_association": { "id": "c63149a0-a0b3-4ca7-aba4-9aaa1b39d7f3", "port_id": "46a1a80b-7c42-4c45-88fd-b531e636969f", "project_id": "b7549121395844bea941bb92feb3fad9", "routes": [ { "type": "prefix", "prefix": "20.1.0.0/16" } ], "advertise_fixed_ips": true } } ././@LongLink0000000000000000000000000000015300000000000011214 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/port_associations/port_association-create-request.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/port_associations/port_association-create-reques0000666000175100017510000000034313231472055034005 0ustar zuulzuul00000000000000{ "port_association": { "port_id": "b58a6241-6e49-4b11-87c6-8e0606dde796", "routes": [ { "type": "prefix", "prefix": "20.1.0.0/16" } ] } } ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/port_associations/port_association-create-response.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/bgpvpn/port_associations/port_association-create-respon0000666000175100017510000000057013231472055034011 0ustar zuulzuul00000000000000{ "port_association": { "id": "c63149a0-a0b3-4ca7-aba4-9aaa1b39d7f3", "port_id": "46a1a80b-7c42-4c45-88fd-b531e636969f", "project_id": "b7549121395844bea941bb92feb3fad9", "routes": [ { "type": "prefix", "prefix": "20.1.0.0/16" } ], "advertise_fixed_ips": true } } neutron-lib-1.13.0/api-ref/source/v2/samples/rbac_policy/0000775000175100017510000000000013231472430023161 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/rbac_policy/rbac-policy-show-response.json0000666000175100017510000000053313231472055031100 0ustar zuulzuul00000000000000{ "rbac_policy": { "target_tenant": "*", "tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", "object_type": "network", "object_id": "1f32f072-4d17-4811-b619-3623d018bd40", "action": "access_as_external", "project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", "id": "6d4c666e-1aad-465e-b670-4d112b760137" } }neutron-lib-1.13.0/api-ref/source/v2/samples/rbac_policy/rbac-policy-update-response.json0000666000175100017510000000053313231472055031402 0ustar zuulzuul00000000000000{ "rbac_policy": { "target_tenant": "*", "tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", "object_type": "network", "object_id": "1f32f072-4d17-4811-b619-3623d018bd40", "action": "access_as_external", "project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", "id": "6d4c666e-1aad-465e-b670-4d112b760137" } }neutron-lib-1.13.0/api-ref/source/v2/samples/rbac_policy/rbac-policy-create-request.json0000666000175100017510000000032513231472055031214 0ustar zuulzuul00000000000000{ "rbac_policy": { "action": "access_as_shared", "object_type": "network", "target_tenant": "0670b690f27e47a58b6a479d26004715", "object_id": "1f32f072-4d17-4811-b619-3623d018bd40" } }neutron-lib-1.13.0/api-ref/source/v2/samples/rbac_policy/rbac-policies-list-response.json0000666000175100017510000000060113231472055031377 0ustar zuulzuul00000000000000{ "rbac_policies": [ { "target_tenant": "*", "tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", "object_type": "network", "object_id": "1f32f072-4d17-4811-b619-3623d018bd40", "action": "access_as_external", "project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", "id":"6d4c666e-1aad-465e-b670-4d112b760137" } ] }neutron-lib-1.13.0/api-ref/source/v2/samples/rbac_policy/rbac-policy-create-response.json0000666000175100017510000000057013231472055031364 0ustar zuulzuul00000000000000{ "rbac_policy": { "target_tenant": "0670b690f27e47a58b6a479d26004715", "tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", "object_type": "network", "object_id": "1f32f072-4d17-4811-b619-3623d018bd40", "action": "access_as_shared", "project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", "id": "2cf7523a-93b5-4e69-9360-6c6bf986bb7c" } }neutron-lib-1.13.0/api-ref/source/v2/samples/rbac_policy/rbac-policy-update-request.json0000666000175100017510000000006713231472055031236 0ustar zuulzuul00000000000000{ "rbac_policy": { "target_tenant": "*" } }neutron-lib-1.13.0/api-ref/source/v2/samples/service-type-response.json0000666000175100017510000000024013231472055026042 0ustar zuulzuul00000000000000{ "service_providers": [ { "service_type": "LOADBALANCER", "default": true, "name": "haproxy" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/logs/0000775000175100017510000000000013231472430021637 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/logs/loggable_resources-list-response.json0000666000175100017510000000013713231472055031213 0ustar zuulzuul00000000000000{ "loggable_resources": [ { "type": "security_group" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/logs/log-create-request.json0000666000175100017510000000022713231472055026250 0ustar zuulzuul00000000000000{ "log": { "name": "security group log", "description": "Log for project demo.", "resource_type": "security_group" } } neutron-lib-1.13.0/api-ref/source/v2/samples/logs/log-show-response.json0000666000175100017510000000071213231472055026132 0ustar zuulzuul00000000000000{ "log": { "name": "security group log", "description": "Log for project demo.", "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", "project_id": "8d4c70a21fed4aeba121a1a429ba0d04", "tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04", "enabled": true, "revision_number": 1, "resource_type": "security_group", "resource_id": null, "target_id": null, "event": "ACCEPT" } } neutron-lib-1.13.0/api-ref/source/v2/samples/logs/log-create-response.json0000666000175100017510000000070713231472055026421 0ustar zuulzuul00000000000000{ "log": { "name": "security group log", "description": "Log for project demo.", "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", "project_id": "92a5a4f4245a4abbafacb7ca73b027b0", "tenant_id": "92a5a4f4245a4abbafacb7ca73b027b0", "enabled": true, "resource_type": "security_group", "resource_id": null, "revision_number": 1, "target_id": null, "event": "ALL" } } neutron-lib-1.13.0/api-ref/source/v2/samples/logs/log-list-response.json0000666000175100017510000000101013231472055026115 0ustar zuulzuul00000000000000{ "logs": [ { "name": "security group log", "description": "Log for project demo.", "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", "project_id": "92a5a4f4245a4abbafacb7ca73b027b0", "tenant_id": "92a5a4f4245a4abbafacb7ca73b027b0", "enabled": true, "revision_number": 1, "resource_type": "security_group", "resource_id": null, "target_id": null, "event": "ALL" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/logs/log-update-request.json0000666000175100017510000000006013231472055026262 0ustar zuulzuul00000000000000{ "log": { "enabled": false } } neutron-lib-1.13.0/api-ref/source/v2/samples/logs/log-update-response.json0000666000175100017510000000071113231472055026433 0ustar zuulzuul00000000000000{ "log": { "name": "security group log", "description": "Log for project demo.", "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", "project_id": "8d4c70a21fed4aeba121a1a429ba0d04", "tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04", "enabled": false, "revision_number": 3, "resource_type": "security_group", "resource_id": null, "target_id": null, "event": "DROP" } } neutron-lib-1.13.0/api-ref/source/v2/samples/metering/0000775000175100017510000000000013231472430022505 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-rule-show-request-json-http.txt0000666000175100017510000000036513231472055033503 0ustar zuulzuul00000000000000GET /v2.0/metering/metering-label-rules/9536641a-7d14-4dc5-afaf-93a973ce0eb8 HTTP/1.1 Host: controlnode:9696 User-Agent: python-neutronclient Content-Type: application/json Accept: application/json X-Auth-Token: c52a1b304fec4ca0ac85dc1741eec6e2 ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-rules-list-request-json-http.txtneutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-rules-list-request-json-http.tx0000666000175100017510000000032013231472055033464 0ustar zuulzuul00000000000000GET /v2.0/metering/metering-label-rules HTTP/1.1 Host: controlnode:9696 User-Agent: python-neutronclient Content-Type: application/json Accept: application/json X-Auth-Token: c52a1b304fec4ca0ac85dc1741eec6e2 neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-show-response.json0000666000175100017510000000045213231472055031107 0ustar zuulzuul00000000000000{ "metering_label": { "project_id": "45345b0ee1ea477fac0f541b2cb79cd4", "tenant_id": "45345b0ee1ea477fac0f541b2cb79cd4", "description": "label1 description", "name": "label1", "id": "a6700594-5b7a-4105-8bfe-723b346ce866", "shared": false } } ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-rule-delete-request-json-http.txtneutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-rule-delete-request-json-http.t0000666000175100017510000000036313231472055033407 0ustar zuulzuul00000000000000DELETE /v2.0/metering/metering-labels/37b31179-71ee-4f0a-b130-0eeb28e7ede7 HTTP/1.1 Host: controlnode:9696 User-Agent: python-neutronclient Content-Type: application/json Accept: application/json X-Auth-Token: c52a1b304fec4ca0ac85dc1741eec6e2 neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-rule-create-response.json0000666000175100017510000000040713231472055032337 0ustar zuulzuul00000000000000{ "metering_label_rule": { "remote_ip_prefix": "10.0.1.0/24", "direction": "ingress", "metering_label_id": "e131d186-b02d-4c0b-83d5-0c0725c4f812", "id": "00e13b58-b4f2-4579-9c9c-7ac94615f9ae", "excluded": false } } neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-create-response.json0000666000175100017510000000045513231472055031375 0ustar zuulzuul00000000000000{ "metering_label": { "project_id": "45345b0ee1ea477fac0f541b2cb79cd4", "tenant_id": "45345b0ee1ea477fac0f541b2cb79cd4", "description": "description of label1", "name": "label1", "id": "bc91b832-8465-40a7-a5d8-ba87de442266", "shared": false } } neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-rules-list-response.json0000666000175100017510000000107113231472055032230 0ustar zuulzuul00000000000000{ "metering_label_rules": [ { "remote_ip_prefix": "20.0.0.0/24", "direction": "ingress", "metering_label_id": "e131d186-b02d-4c0b-83d5-0c0725c4f812", "id": "9536641a-7d14-4dc5-afaf-93a973ce0eb8", "excluded": false }, { "remote_ip_prefix": "10.0.0.0/24", "direction": "ingress", "metering_label_id": "e131d186-b02d-4c0b-83d5-0c0725c4f812", "id": "ffc6fd15-40de-4e7d-b617-34d3f7a93aec", "excluded": false } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-rule-create-request.json0000666000175100017510000000026613231472055032174 0ustar zuulzuul00000000000000{ "metering_label_rule": { "remote_ip_prefix": "10.0.1.0/24", "direction": "ingress", "metering_label_id": "e131d186-b02d-4c0b-83d5-0c0725c4f812" } } neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-create-request.json0000666000175100017510000000015313231472055031222 0ustar zuulzuul00000000000000{ "metering_label": { "name": "label1", "description": "description of label1" } } neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-delete-request-json-http.txt0000666000175100017510000000036313231472055033016 0ustar zuulzuul00000000000000DELETE /v2.0/metering/metering-labels/a6700594-5b7a-4105-8bfe-723b346ce866 HTTP/1.1 Host: controlnode:9696 User-Agent: python-neutronclient Content-Type: application/json Accept: application/json X-Auth-Token: c52a1b304fec4ca0ac85dc1741eec6e2 ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-rule-delete-response-json-http.txtneutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-rule-delete-response-json-http.0000666000175100017510000000001413231472055033362 0ustar zuulzuul00000000000000status: 204 neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-show-request-json-http.txt0000666000175100017510000000036013231472055032531 0ustar zuulzuul00000000000000GET /v2.0/metering/metering-labels/a6700594-5b7a-4105-8bfe-723b346ce866 HTTP/1.1 Host: controlnode:9696 User-Agent: python-neutronclient Content-Type: application/json Accept: application/json X-Auth-Token: c52a1b304fec4ca0ac85dc1741eec6e2 neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-labels-list-request-json-http.txt0000666000175100017510000000031313231472055032705 0ustar zuulzuul00000000000000GET /v2.0/metering/metering-labels HTTP/1.1 Host: controlnode:9696 User-Agent: python-neutronclient Content-Type: application/json Accept: application/json X-Auth-Token: c52a1b304fec4ca0ac85dc1741eec6e2 neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-labels-list-response.json0000666000175100017510000000121413231472055031262 0ustar zuulzuul00000000000000{ "metering_labels": [ { "project_id": "45345b0ee1ea477fac0f541b2cb79cd4", "tenant_id": "45345b0ee1ea477fac0f541b2cb79cd4", "description": "label1 description", "name": "label1", "id": "a6700594-5b7a-4105-8bfe-723b346ce866", "shared": false }, { "project_id": "45345b0ee1ea477fac0f541b2cb79cd4", "tenant_id": "45345b0ee1ea477fac0f541b2cb79cd4", "description": "label2 description", "name": "label2", "id": "e131d186-b02d-4c0b-83d5-0c0725c4f812", "shared": false } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-delete-response-json-http.txt0000666000175100017510000000001413231472055033155 0ustar zuulzuul00000000000000status: 204 neutron-lib-1.13.0/api-ref/source/v2/samples/metering/metering-label-rule-show-response.json0000666000175100017510000000040713231472055032054 0ustar zuulzuul00000000000000{ "metering_label_rule": { "remote_ip_prefix": "20.0.0.0/24", "direction": "ingress", "metering_label_id": "e131d186-b02d-4c0b-83d5-0c0725c4f812", "id": "9536641a-7d14-4dc5-afaf-93a973ce0eb8", "excluded": false } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/0000775000175100017510000000000013231472430022663 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-show-response.json0000666000175100017510000000071313231472055030203 0ustar zuulzuul00000000000000{ "firewall": { "admin_state_up": true, "description": "", "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", "name": "", "status": "ACTIVE", "router_ids": [ "650bfd2f-7766-4a0d-839f-218f33e16998" ], "project_id": "45977fa2dbd7482098dd68d0d8970117", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-rule-update-response.json0000666000175100017510000000115113231472055031447 0ustar zuulzuul00000000000000{ "firewall_rule": { "action": "allow", "description": "", "destination_ip_address": null, "destination_port": "80", "enabled": true, "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", "ip_version": 4, "name": "ALLOW_HTTP", "position": 1, "protocol": "tcp", "shared": true, "source_ip_address": null, "source_port": null, "project_id": "45977fa2dbd7482098dd68d0d8970117", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-create-request.json0000666000175100017510000000020113231472055030310 0ustar zuulzuul00000000000000{ "firewall": { "admin_state_up": true, "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-policies-list-response.json0000666000175100017510000000072013231472055032001 0ustar zuulzuul00000000000000{ "firewall_policies": [ { "audited": false, "description": "", "firewall_rules": [ "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" ], "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "name": "test-policy", "shared": false, "project_id": "45977fa2dbd7482098dd68d0d8970117", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewalls-list-response.json0000666000175100017510000000101413231472055030354 0ustar zuulzuul00000000000000{ "firewalls": [ { "admin_state_up": true, "description": "", "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", "name": "", "status": "ACTIVE", "router_ids": [ "650bfd2f-7766-4a0d-839f-218f33e16998" ], "project_id": "45977fa2dbd7482098dd68d0d8970117", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-policy-update-request.json0000666000175100017510000000026013231472055031631 0ustar zuulzuul00000000000000{ "firewall_policy": { "firewall_rules": [ "a08ef905-0ff6-4784-8374-175fffe7dade", "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" ] } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-policy-remove-rule-request.json0000666000175100017510000000010313231472055032605 0ustar zuulzuul00000000000000{ "firewall_rule_id": "7bc34b8c-8d3b-4ada-a9c8-1f4c11c65692" } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-policy-remove-rule-response.json0000666000175100017510000000062413231472055032763 0ustar zuulzuul00000000000000{ "audited": false, "description": "", "firewall_list": [], "firewall_rules": [ "a08ef905-0ff6-4784-8374-175fffe7dade", "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" ], "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "name": "test-policy", "shared": false, "project_id": "45977fa2dbd7482098dd68d0d8970117", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-update-response.json0000666000175100017510000000072413231472055030507 0ustar zuulzuul00000000000000{ "firewall": { "admin_state_up": false, "description": "", "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", "name": "", "status": "PENDING_UPDATE", "router_ids": [ "650bfd2f-7766-4a0d-839f-218f33e16998" ], "project_id": "45977fa2dbd7482098dd68d0d8970117", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-policy-create-response.json0000666000175100017510000000062213231472055031762 0ustar zuulzuul00000000000000{ "firewall_policy": { "audited": false, "description": "", "firewall_rules": [ "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" ], "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "name": "test-policy", "shared": false, "project_id": "45977fa2dbd7482098dd68d0d8970117", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-policy-insert-rule-response.json0000666000175100017510000000070413231472055032771 0ustar zuulzuul00000000000000{ "audited": false, "description": "", "firewall_list": [], "firewall_rules": [ "a08ef905-0ff6-4784-8374-175fffe7dade", "7bc34b8c-8d3b-4ada-a9c8-1f4c11c65692", "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" ], "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "name": "test-policy", "shared": false, "project_id": "45977fa2dbd7482098dd68d0d8970117", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-policy-show-response.json0000666000175100017510000000062213231472055031477 0ustar zuulzuul00000000000000{ "firewall_policy": { "audited": false, "description": "", "firewall_rules": [ "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" ], "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "name": "test-policy", "shared": false, "project_id": "45977fa2dbd7482098dd68d0d8970117", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-rule-show-response.json0000666000175100017510000000111313231472055031143 0ustar zuulzuul00000000000000{ "firewall_rule": { "action": "allow", "description": "", "destination_ip_address": null, "destination_port": "80", "enabled": true, "firewall_policy_id": null, "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", "ip_version": 4, "name": "ALLOW_HTTP", "position": null, "protocol": "tcp", "shared": false, "source_ip_address": null, "source_port": null, "project_id": "45977fa2dbd7482098dd68d0d8970117", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-rule-create-request.json0000666000175100017510000000025713231472055031270 0ustar zuulzuul00000000000000{ "firewall_rule": { "action": "allow", "destination_port": "80", "enabled": true, "name": "ALLOW_HTTP", "protocol": "tcp" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-rule-update-request.json0000666000175100017510000000007213231472055031302 0ustar zuulzuul00000000000000{ "firewall_rule": { "shared": "true" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-create-response.json0000666000175100017510000000072313231472055030467 0ustar zuulzuul00000000000000{ "firewall": { "admin_state_up": true, "description": "", "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", "name": "", "status": "PENDING_CREATE", "router_ids": [ "650bfd2f-7766-4a0d-839f-218f33e16998" ], "project_id": "45977fa2dbd7482098dd68d0d8970117", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-rule-create-response.json0000666000175100017510000000111313231472055031426 0ustar zuulzuul00000000000000{ "firewall_rule": { "action": "allow", "description": "", "destination_ip_address": null, "destination_port": "80", "enabled": true, "firewall_policy_id": null, "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", "ip_version": 4, "name": "ALLOW_HTTP", "position": null, "protocol": "tcp", "shared": false, "source_ip_address": null, "source_port": null, "project_id": "45977fa2dbd7482098dd68d0d8970117", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-policy-update-response.json0000666000175100017510000000070613231472055032004 0ustar zuulzuul00000000000000{ "firewall_policy": { "audited": false, "description": "", "firewall_rules": [ "a08ef905-0ff6-4784-8374-175fffe7dade", "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" ], "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "name": "test-policy", "shared": false, "project_id": "45977fa2dbd7482098dd68d0d8970117", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-policy-create-request.json0000666000175100017510000000023313231472055031612 0ustar zuulzuul00000000000000{ "firewall_policy": { "firewall_rules": [ "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" ], "name": "test-policy" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-update-request.json0000666000175100017510000000007613231472055030341 0ustar zuulzuul00000000000000{ "firewall": { "admin_state_up": "false" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-policy-insert-rule-request.json0000666000175100017510000000023013231472055032615 0ustar zuulzuul00000000000000{ "firewall_rule_id": "7bc34b8c-8d3b-4ada-a9c8-1f4c11c65692", "insert_after": "a08ef905-0ff6-4784-8374-175fffe7dade", "insert_before": "" } neutron-lib-1.13.0/api-ref/source/v2/samples/firewalls/firewall-rules-list-response.json0000666000175100017510000000127713231472055031334 0ustar zuulzuul00000000000000{ "firewall_rules": [ { "action": "allow", "description": "", "destination_ip_address": null, "destination_port": "80", "enabled": true, "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", "ip_version": 4, "name": "ALLOW_HTTP", "position": 1, "protocol": "tcp", "shared": false, "source_ip_address": null, "source_port": null, "project_id": "45977fa2dbd7482098dd68d0d8970117", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/trunks/0000775000175100017510000000000013231472430022221 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/trunks/trunk-remove-subports-request.json0000666000175100017510000000015413231472055031124 0ustar zuulzuul00000000000000{ "sub_ports": [ { "port_id": "4b4c691b-086d-43d2-8a65-5487e9434155" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/trunks/trunks-list-response.json0000666000175100017510000000110113231472055027245 0ustar zuulzuul00000000000000{ "trunks": [ { "status": "DOWN", "sub_ports": [], "name": "test", "admin_state_up": true, "project_id": "313be01bd0744cea86643c711c57012b", "tenant_id": "313be01bd0744cea86643c711c57012b", "created_at": "2016-10-05T20:11:16Z", "updated_at": "2016-10-05T20:11:16Z", "revision_number": 1, "port_id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", "id": "ee98bdb4-a817-43af-943f-4318bff98f51", "description": "" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/trunks/trunk-details-show-response.json0000666000175100017510000000271113231472055030522 0ustar zuulzuul00000000000000{ "port": { "status": "DOWN", "created_at": "2016-10-05T20:05:14Z", "description": "", "admin_state_up": true, "network_id": "1cf9e069-365f-4a78-8784-616bc12c4c5a", "project_id": "313be01bd0744cea86643c711c57012b", "tenant_id": "313be01bd0744cea86643c711c57012b", "extra_dhcp_opts": [], "updated_at": "2016-10-05T20:05:14Z", "name": "test", "device_owner": "", "trunk_details": { "trunk_id": "8905d084-010c-46e8-a863-f21cb4441ab1", "sub_ports": [ { "segmentation_id": 33, "port_id": "70df9f3e-b409-4761-8304-ce029b2079f5", "segmentation_type": "vlan", "mac_address": "fa:16:3e:86:9b:dc" }, { "segmentation_id": 44, "port_id": "4b4c691b-086d-43d2-8a65-5487e9434155", "segmentation_type": "vlan", "mac_address": "fa:16:3e:fe:29:97" } ] }, "revision_number": 5, "mac_address": "fa:16:3e:5c:e9:a3", "fixed_ips": [ { "subnet_id": "76a059c0-b189-479f-882c-5e8bd464ea49", "ip_address": "40.0.0.3" } ], "id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", "security_groups": ["da88a249-12ac-4221-9565-c406b6feeb48"], "device_id": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/trunks/trunks-create-response.json0000666000175100017510000000077413231472055027554 0ustar zuulzuul00000000000000{ "trunk": { "status": "DOWN", "sub_ports": [], "name": "test", "admin_state_up": true, "project_id": "145a14e4a64b49bf98baad8945dbd4f1", "tenant_id": "145a14e4a64b49bf98baad8945dbd4f1", "created_at": "2016-10-05T22:31:37Z", "updated_at": "2016-10-05T22:31:37Z", "revision_number": 1, "port_id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", "id": "114a26b1-d124-4835-bb4f-021d3d886023", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/trunks/trunk-remove-subports-response.json0000666000175100017510000000066713231472055031303 0ustar zuulzuul00000000000000{ "status": "DOWN", "sub_ports": [], "name": "test", "admin_state_up": true, "project_id": "145a14e4a64b49bf98baad8945dbd4f1", "tenant_id": "145a14e4a64b49bf98baad8945dbd4f1", "created_at": "2016-10-05T22:31:37Z", "updated_at": "2016-10-05T22:57:44Z", "revision_number": 3, "port_id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", "id": "114a26b1-d124-4835-bb4f-021d3d886023", "description": "" } neutron-lib-1.13.0/api-ref/source/v2/samples/trunks/trunk-add-subports-response.json0000666000175100017510000000113213231472055030522 0ustar zuulzuul00000000000000{ "status": "DOWN", "sub_ports": [ { "segmentation_type": "vlan", "port_id": "4b4c691b-086d-43d2-8a65-5487e9434155", "segmentation_id": 44 } ], "name": "test", "admin_state_up": true, "project_id": "145a14e4a64b49bf98baad8945dbd4f1", "tenant_id": "145a14e4a64b49bf98baad8945dbd4f1", "created_at": "2016-10-05T22:31:37Z", "updated_at": "2016-10-05T22:52:04Z", "revision_number": 2, "port_id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", "id": "114a26b1-d124-4835-bb4f-021d3d886023", "description": "" } neutron-lib-1.13.0/api-ref/source/v2/samples/trunks/trunk-create-request.json0000666000175100017510000000021313231472055027207 0ustar zuulzuul00000000000000{ "trunk": { "port_id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", "name": "test", "admin_state_up": true } } neutron-lib-1.13.0/api-ref/source/v2/samples/trunks/trunk-list-subports-response.json0000666000175100017510000000027313231472055030752 0ustar zuulzuul00000000000000{ "sub_ports": [ { "segmentation_type": "vlan", "port_id": "4b4c691b-086d-43d2-8a65-5487e9434155", "segmentation_id": 44 } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/trunks/trunk-update-response.json0000666000175100017510000000126613231472055027405 0ustar zuulzuul00000000000000{ "trunk": { "status": "DOWN", "sub_ports": [ { "segmentation_type": "vlan", "port_id": "4b4c691b-086d-43d2-8a65-5487e9434155", "segmentation_id": 44 } ], "name": "foo", "admin_state_up": true, "project_id": "145a14e4a64b49bf98baad8945dbd4f1", "tenant_id": "145a14e4a64b49bf98baad8945dbd4f1", "created_at": "2016-10-05T22:31:37Z", "updated_at": "2016-10-05T23:28:17Z", "revision_number": 9, "port_id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", "id": "114a26b1-d124-4835-bb4f-021d3d886023", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/trunks/trunk-update-request.json0000666000175100017510000000011713231472055027231 0ustar zuulzuul00000000000000{ "trunk": { "name": "foo", "admin_state_up": true } } neutron-lib-1.13.0/api-ref/source/v2/samples/trunks/trunk-show-response.json0000666000175100017510000000127113231472055027077 0ustar zuulzuul00000000000000{ "trunk": { "status": "DOWN", "sub_ports": [ { "segmentation_type": "vlan", "port_id": "4b4c691b-086d-43d2-8a65-5487e9434155", "segmentation_id": 44 } ], "name": "foo", "admin_state_up": true, "project_id": "145a14e4a64b49bf98baad8945dbd4f1", "tenant_id": "145a14e4a64b49bf98baad8945dbd4f1", "created_at": "2016-10-05T22:31:37Z", "updated_at": "2016-10-05T23:28:17Z", "revision_number": 9, "port_id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", "id": "114a26b1-d124-4835-bb4f-021d3d886023", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/trunks/trunk-add-subports-request.json0000666000175100017510000000027313231472055030361 0ustar zuulzuul00000000000000{ "sub_ports": [ { "segmentation_id": 44, "port_id": "4b4c691b-086d-43d2-8a65-5487e9434155", "segmentation_type": "vlan" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/floatingips/0000775000175100017510000000000013231472430023212 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/floatingips/floatingip-create-response.json0000666000175100017510000000135113231472055031343 0ustar zuulzuul00000000000000{ "floatingip": { "fixed_ip_address": "10.0.0.3", "floating_ip_address": "172.24.4.228", "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", "id": "2f245a7b-796b-4f26-9cf9-9e82d248fda7", "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", "status": "ACTIVE", "project_id": "4969c491a3c74ee4af974e6d800c62de", "tenant_id": "4969c491a3c74ee4af974e6d800c62de", "description": "floating ip for testing", "dns_domain": "my-domain.org.", "dns_name": "myfip", "created_at": "2016-12-21T01:36:04Z", "updated_at": "2016-12-21T01:36:04Z", "revision_number": 1 } } neutron-lib-1.13.0/api-ref/source/v2/samples/floatingips/floatingip-disassociate-response.json0000666000175100017510000000115513231472055032555 0ustar zuulzuul00000000000000{ "floatingip": { "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", "fixed_ip_address": null, "floating_ip_address": "172.24.4.228", "project_id": "4969c491a3c74ee4af974e6d800c62de", "tenant_id": "4969c491a3c74ee4af974e6d800c62de", "status": "ACTIVE", "port_id": null, "id": "2f245a7b-796b-4f26-9cf9-9e82d248fda7", "description": "for test", "created_at": "2016-12-21T10:55:50Z", "updated_at": "2016-12-22T03:13:49Z", "revision_number": 3 } } neutron-lib-1.13.0/api-ref/source/v2/samples/floatingips/floatingip-show-response.json0000666000175100017510000000135113231472055031060 0ustar zuulzuul00000000000000{ "floatingip": { "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", "fixed_ip_address": "10.0.0.3", "floating_ip_address": "172.24.4.228", "project_id": "4969c491a3c74ee4af974e6d800c62de", "tenant_id": "4969c491a3c74ee4af974e6d800c62de", "status": "ACTIVE", "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", "id": "2f245a7b-796b-4f26-9cf9-9e82d248fda7", "description": "floating ip for testing", "dns_domain": "my-domain.org.", "dns_name": "myfip", "created_at": "2016-12-21T01:36:04Z", "updated_at": "2016-12-21T01:36:04Z", "revision_number": 1 } } neutron-lib-1.13.0/api-ref/source/v2/samples/floatingips/floatingip-update-response.json0000666000175100017510000000135013231472055031361 0ustar zuulzuul00000000000000{ "floatingip": { "created_at": "2016-12-21T10:55:50Z", "description": "floating ip for testing", "dns_domain": "my-domain.org.", "dns_name": "myfip", "fixed_ip_address": "10.0.0.4", "floating_ip_address": "172.24.4.228", "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", "id": "2f245a7b-796b-4f26-9cf9-9e82d248fda7", "port_id": "fc861431-0e6c-4842-a0ed-e2363f9bc3a8", "project_id": "4969c491a3c74ee4af974e6d800c62de", "revision_number": 3, "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", "status": "ACTIVE", "tenant_id": "4969c491a3c74ee4af974e6d800c62de", "updated_at": "2016-12-22T03:13:49Z" } }neutron-lib-1.13.0/api-ref/source/v2/samples/floatingips/floating-ips-list-response.json0000666000175100017510000000306113231472055031313 0ustar zuulzuul00000000000000{ "floatingips": [ { "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", "description": "for test", "dns_domain": "my-domain.org.", "dns_name": "myfip", "created_at": "2016-12-21T10:55:50Z", "updated_at": "2016-12-21T10:55:53Z", "revision_number": 1, "project_id": "4969c491a3c74ee4af974e6d800c62de", "tenant_id": "4969c491a3c74ee4af974e6d800c62de", "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", "fixed_ip_address": "10.0.0.3", "floating_ip_address": "172.24.4.228", "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", "id": "2f245a7b-796b-4f26-9cf9-9e82d248fda7", "revision_number": 1, "status": "ACTIVE" }, { "router_id": null, "description": "for test", "dns_domain": "my-domain.org.", "dns_name": "myfip2", "created_at": "2016-12-21T11:55:50Z", "updated_at": "2016-12-21T11:55:53Z", "revision_number": 2, "project_id": "4969c491a3c74ee4af974e6d800c62de", "tenant_id": "4969c491a3c74ee4af974e6d800c62de", "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", "fixed_ip_address": null, "floating_ip_address": "172.24.4.227", "port_id": null, "id": "61cea855-49cb-4846-997d-801b70c71bdd", "revision_number": 1, "status": "DOWN" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/floatingips/floatingip-create-request.json0000666000175100017510000000065213231472055031200 0ustar zuulzuul00000000000000{ "floatingip": { "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", "subnet_id": "278d9507-36e7-403c-bb80-1d7093318fe6", "fixed_ip_address": "10.0.0.3", "floating_ip_address": "172.24.4.228", "description": "floating ip for testing", "dns_domain": "my-domain.org.", "dns_name": "myfip" } } neutron-lib-1.13.0/api-ref/source/v2/samples/floatingips/floatingip-disassociate-request.json0000666000175100017510000000006613231472055032407 0ustar zuulzuul00000000000000{ "floatingip": { "port_id": null } } neutron-lib-1.13.0/api-ref/source/v2/samples/floatingips/floatingip-update-request.json0000666000175100017510000000013013231472055031206 0ustar zuulzuul00000000000000{ "floatingip": { "port_id": "fc861431-0e6c-4842-a0ed-e2363f9bc3a8" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/0000775000175100017510000000000013231472430023025 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-group-create-request.json0000666000175100017510000000033513231472055031614 0ustar zuulzuul00000000000000{ "firewall_group": { "admin_state_up": false, "egress_firewall_policy_id": "14c9d3c1-b472-44f9-8226-30dc4ffd454c", "ingress_firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-groups-list-response.json0000666000175100017510000000120213231472055031647 0ustar zuulzuul00000000000000{ "firewall_groups": [ { "admin_state_up": true, "description": "", "egress_firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", "ingress_firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "name": "", "ports": [ "650bfd2f-7766-4a0d-839f-218f33e16998" ], "shared": true, "project_id": "45977fa2dbd7482098dd68d0d8970117", "status": "ACTIVE", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-group-show-response.json0000666000175100017510000000064713231472055031505 0ustar zuulzuul00000000000000{ "firewall_group": { "admin_state_up": true, "description": "", "egress_firewall_policy_id": null, "id": "07411bda-0147-418b-af05-c8665630d937", "ingress_firewall_policy_id": null, "name": "", "project_id": "96108b04417b416e9b9bc788c11c42c9", "shared": false, "status": "INACTIVE", "tenant_id": "96108b04417b416e9b9bc788c11c42c9" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-rule-update-response.json0000666000175100017510000000130213231472055031607 0ustar zuulzuul00000000000000{ "firewall_rule": { "action": "allow", "description": "", "destination_firewall_group_id": null, "destination_ip_address": null, "destination_port": "80", "enabled": true, "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", "ip_version": 4, "name": "ALLOW_HTTP", "position": 1, "project_id": "45977fa2dbd7482098dd68d0d8970117", "protocol": "tcp", "shared": true, "source_firewall_group_id": null, "source_ip_address": null, "source_port": null, "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-policies-list-response.json0000666000175100017510000000072013231472055032143 0ustar zuulzuul00000000000000{ "firewall_policies": [ { "audited": false, "description": "", "firewall_rules": [ "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" ], "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "name": "test-policy", "project_id": "45977fa2dbd7482098dd68d0d8970117", "shared": false, "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-group-update-response.json0000666000175100017510000000110213231472055031772 0ustar zuulzuul00000000000000{ "firewall_group": { "admin_state_up": false, "description": "", "egress_firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "ingress_firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", "name": "", "ports": [ "650bfd2f-7766-4a0d-839f-218f33e16998" ], "shared": true, "project_id": "45977fa2dbd7482098dd68d0d8970117", "status": "PENDING_UPDATE", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-policy-update-request.json0000666000175100017510000000026013231472055031773 0ustar zuulzuul00000000000000{ "firewall_policy": { "firewall_rules": [ "a08ef905-0ff6-4784-8374-175fffe7dade", "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" ] } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-policy-remove-rule-request.json0000666000175100017510000000010313231472055032747 0ustar zuulzuul00000000000000{ "firewall_rule_id": "7bc34b8c-8d3b-4ada-a9c8-1f4c11c65692" } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-policy-remove-rule-response.json0000666000175100017510000000040313231472055033120 0ustar zuulzuul00000000000000{ "audited": false, "description": "", "firewall_rules": [], "id": "c9e15d6e-b6ba-4ef4-8715-985d1f100467", "name": "policy2", "project_id": "95573613ec554b4b8df9f2679c64557b", "shared": false, "tenant_id": "95573613ec554b4b8df9f2679c64557b" } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-group-create-response.json0000666000175100017510000000110113231472055031752 0ustar zuulzuul00000000000000{ "firewall_group": { "admin_state_up": true, "description": "", "egress_firewall_policy_id": "1244ed87-b472-44f9-8226-30dc4ffd454c", "ingress_firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", "name": "", "ports": [ "650bfd2f-7766-4a0d-839f-218f33e16998" ], "project_id": "45977fa2dbd7482098dd68d0d8970117", "shared": true, "status": "PENDING_CREATE", "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-policy-create-response.json0000666000175100017510000000062213231472055032124 0ustar zuulzuul00000000000000{ "firewall_policy": { "audited": false, "description": "", "firewall_rules": [ "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" ], "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "name": "test-policy", "project_id": "45977fa2dbd7482098dd68d0d8970117", "shared": false, "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-policy-insert-rule-response.json0000666000175100017510000000046113231472055033133 0ustar zuulzuul00000000000000{ "audited": false, "description": "", "firewall_rules": [ "acbdfead-eca2-4456-838c-8b531e47b9c7" ], "id": "c9e15d6e-b6ba-4ef4-8715-985d1f100467", "name": "policy2", "shared": false, "project_id": "95573613ec554b4b8df9f2679c64557b", "tenant_id": "95573613ec554b4b8df9f2679c64557b" } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-policy-show-response.json0000666000175100017510000000062213231472055031641 0ustar zuulzuul00000000000000{ "firewall_policy": { "audited": false, "description": "", "firewall_rules": [ "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" ], "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "name": "test-policy", "project_id": "45977fa2dbd7482098dd68d0d8970117", "shared": false, "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-rule-show-response.json0000666000175100017510000000124413231472055031312 0ustar zuulzuul00000000000000{ "firewall_rule": { "action": "allow", "description": "", "destination_firewall_group_id": null, "destination_ip_address": null, "destination_port": "80", "enabled": true, "firewall_policy_id": null, "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", "ip_version": 4, "name": "ALLOW_HTTP", "position": null, "project_id": "45977fa2dbd7482098dd68d0d8970117", "protocol": "tcp", "shared": false, "source_firewall_group_id": null, "source_ip_address": null, "source_port": null, "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-rule-create-request.json0000666000175100017510000000025713231472055031432 0ustar zuulzuul00000000000000{ "firewall_rule": { "action": "allow", "destination_port": "80", "enabled": true, "name": "ALLOW_HTTP", "protocol": "tcp" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-rule-update-request.json0000666000175100017510000000007013231472055031442 0ustar zuulzuul00000000000000{ "firewall_rule": { "shared": true } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-group-update-request.json0000666000175100017510000000010413231472055031625 0ustar zuulzuul00000000000000{ "firewall_group": { "admin_state_up": "false" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-rule-create-response.json0000666000175100017510000000113713231472055031576 0ustar zuulzuul00000000000000{ "firewall_rule": { "action": "deny", "description": "", "destination_firewall_group_id": null, "destination_ip_address": null, "destination_port": null, "enabled": true, "id": "1fd59b2f-cc87-435f-a244-1df2c0cc3f70", "ip_version": 4, "name": "rule3", "project_id": "95573613ec554b4b8df9f2679c64557b", "protocol": null, "shared": false, "source_firewall_group_id": null, "source_ip_address": null, "source_port": null, "tenant_id": "95573613ec554b4b8df9f2679c64557b" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-policy-update-response.json0000666000175100017510000000070613231472055032146 0ustar zuulzuul00000000000000{ "firewall_policy": { "audited": false, "description": "", "firewall_rules": [ "a08ef905-0ff6-4784-8374-175fffe7dade", "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" ], "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "name": "test-policy", "project_id": "45977fa2dbd7482098dd68d0d8970117", "shared": false, "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-policy-create-request.json0000666000175100017510000000023313231472055031754 0ustar zuulzuul00000000000000{ "firewall_policy": { "name": "test-policy", "firewall_rules": [ "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" ] } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-policy-insert-rule-request.json0000666000175100017510000000023013231472055032757 0ustar zuulzuul00000000000000{ "firewall_rule_id": "7bc34b8c-8d3b-4ada-a9c8-1f4c11c65692", "insert_after": "a08ef905-0ff6-4784-8374-175fffe7dade", "insert_before": "" } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall-v2/firewall-rules-list-response.json0000666000175100017510000000144013231472055031466 0ustar zuulzuul00000000000000{ "firewall_rules": [ { "action": "allow", "description": "", "destination_firewall_group_id": null, "destination_ip_address": null, "destination_port": "80", "enabled": true, "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", "ip_version": 4, "name": "ALLOW_HTTP", "position": 1, "project_id": "45977fa2dbd7482098dd68d0d8970117", "protocol": "tcp", "shared": false, "source_firewall_group_id": null, "source_ip_address": null, "source_port": null, "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall_log/0000775000175100017510000000000013231472430023341 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/firewall_log/firewall_logs-list-response.json0000666000175100017510000000155613231472055031706 0ustar zuulzuul00000000000000{ "firewall_logs": [ { "description": "my firewall log 2", "firewall_id": "a6564146-f8b3-49c3-add1-fb213455d5a8", "fw_event": "ACCEPT", "id": "3969b708-d600-4343-93b9-01645f8e9a8a", "logging_resource_id": "13b64f3c-20af-4741-b230-658ab7d5b257", "project_id": "8d018258316e4f22890561e8780c85bb", "tenant_id": "8d018258316e4f22890561e8780c85bb" }, { "description": "my firewall log", "firewall_id": "a6564146-f8b3-49c3-add1-fb213455d5a8", "fw_event": "DROP", "id": "deb19331-e5d5-4a80-a37f-5e5ad407b353", "logging_resource_id": "13b64f3c-20af-4741-b230-658ab7d5b257", "project_id": "8d018258316e4f22890561e8780c85bb", "tenant_id": "8d018258316e4f22890561e8780c85bb" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall_log/firewall_log-create-response.json0000666000175100017510000000062413231472055032006 0ustar zuulzuul00000000000000{ "firewall_log": { "description": "my firewall log", "firewall_id": "a6564146-f8b3-49c3-add1-fb213455d5a8", "fw_event": "DROP", "id": "deb19331-e5d5-4a80-a37f-5e5ad407b353", "logging_resource_id": "13b64f3c-20af-4741-b230-658ab7d5b257", "project_id": "8d018258316e4f22890561e8780c85bb", "tenant_id": "8d018258316e4f22890561e8780c85bb" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall_log/firewall_log-create-request.json0000666000175100017510000000024413231472055031636 0ustar zuulzuul00000000000000{ "firewall_log": { "description": "my firewall log", "firewall_id": "a6564146-f8b3-49c3-add1-fb213455d5a8", "fw_event": "DROP" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall_log/firewall_log-update-request.json0000666000175100017510000000014613231472055031656 0ustar zuulzuul00000000000000{ "firewall_log": { "description": "my firewall log 3", "fw_event": "ALL" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall_log/firewall_log-update-response.json0000666000175100017510000000062513231472055032026 0ustar zuulzuul00000000000000{ "firewall_log": { "description": "my firewall log 3", "firewall_id": "a6564146-f8b3-49c3-add1-fb213455d5a8", "fw_event": "ALL", "id": "3969b708-d600-4343-93b9-01645f8e9a8a", "logging_resource_id": "13b64f3c-20af-4741-b230-658ab7d5b257", "project_id": "8d018258316e4f22890561e8780c85bb", "tenant_id": "8d018258316e4f22890561e8780c85bb" } } neutron-lib-1.13.0/api-ref/source/v2/samples/firewall_log/firewall_log-show-response.json0000666000175100017510000000062513231472055031524 0ustar zuulzuul00000000000000{ "firewall_log": { "description": "my firewall log 3", "firewall_id": "a6564146-f8b3-49c3-add1-fb213455d5a8", "fw_event": "ALL", "id": "3969b708-d600-4343-93b9-01645f8e9a8a", "logging_resource_id": "13b64f3c-20af-4741-b230-658ab7d5b257", "project_id": "8d018258316e4f22890561e8780c85bb", "tenant_id": "8d018258316e4f22890561e8780c85bb" } } neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/0000775000175100017510000000000013231472430024057 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-rule-show-response.json0000666000175100017510000000101313231472055033532 0ustar zuulzuul00000000000000{ "security_group_rule": { "direction": "egress", "ethertype": "IPv6", "id": "3c0e45ff-adaf-4124-b083-bf390e5482ff", "port_range_max": null, "port_range_min": null, "protocol": null, "remote_group_id": null, "remote_ip_prefix": null, "revision_number": 1, "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550" } } ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-show-request-json-http.txtneutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-show-request-json-http.t0000666000175100017510000000012713231472055033642 0ustar zuulzuul00000000000000GET /v2.0/security-groups/85cc3048-abc3-43cc-89b3-377341426ac5 Accept: application/jsonneutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-update-request.json0000666000175100017510000000015313231472055032725 0ustar zuulzuul00000000000000{ "security_group": { "name": "mysecgroup", "description": "my security group" } } neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-rule-create-request.json0000666000175100017510000000050613231472055033655 0ustar zuulzuul00000000000000{ "security_group_rule": { "direction": "ingress", "port_range_min": "80", "ethertype": "IPv4", "port_range_max": "80", "protocol": "tcp", "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "security_group_id": "a7734e61-b545-452d-a3cd-0189cbd9747a" } } neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-create-response.json0000666000175100017510000000316613231472055033063 0ustar zuulzuul00000000000000{ "security_group": { "description": "security group for webservers", "id": "2076db17-a522-4506-91de-c6dd8e837028", "name": "new-webservers", "security_group_rules": [ { "direction": "egress", "ethertype": "IPv4", "id": "38ce2d8e-e8f1-48bd-83c2-d33cb9f50c3d", "port_range_max": null, "port_range_min": null, "protocol": null, "remote_group_id": null, "remote_ip_prefix": null, "security_group_id": "2076db17-a522-4506-91de-c6dd8e837028", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 1, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "description": "" }, { "direction": "egress", "ethertype": "IPv6", "id": "565b9502-12de-4ffd-91e9-68885cff6ae1", "port_range_max": null, "port_range_min": null, "protocol": null, "remote_group_id": null, "remote_ip_prefix": null, "security_group_id": "2076db17-a522-4506-91de-c6dd8e837028", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 1, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "description": "" } ], "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 1, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550" } } ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-rule-create-response.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-rule-create-response.jso0000666000175100017510000000110613231472055033642 0ustar zuulzuul00000000000000{ "security_group_rule": { "direction": "ingress", "ethertype": "IPv4", "id": "2bc0accf-312e-429a-956e-e4407625eb62", "port_range_max": 80, "port_range_min": 80, "protocol": "tcp", "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "remote_ip_prefix": null, "security_group_id": "a7734e61-b545-452d-a3cd-0189cbd9747a", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 1, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-rules-list-response.json0000666000175100017510000000461513231472055033723 0ustar zuulzuul00000000000000{ "security_group_rules": [ { "direction": "egress", "ethertype": "IPv6", "id": "3c0e45ff-adaf-4124-b083-bf390e5482ff", "port_range_max": null, "port_range_min": null, "protocol": null, "remote_group_id": null, "remote_ip_prefix": null, "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 1, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "description": "" }, { "direction": "egress", "ethertype": "IPv4", "id": "93aa42e5-80db-4581-9391-3a608bd0e448", "port_range_max": null, "port_range_min": null, "protocol": null, "remote_group_id": null, "remote_ip_prefix": null, "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 1, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "description": "" }, { "direction": "ingress", "ethertype": "IPv6", "id": "c0b09f00-1d49-4e64-a0a7-8a186d928138", "port_range_max": null, "port_range_min": null, "protocol": null, "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "remote_ip_prefix": null, "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 2, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "description": "" }, { "direction": "ingress", "ethertype": "IPv4", "id": "f7d45c89-008e-4bab-88ad-d6811724c51c", "port_range_max": null, "port_range_min": null, "protocol": null, "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "remote_ip_prefix": null, "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 1, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "description": "" } ] } ././@LongLink0000000000000000000000000000015100000000000011212 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-delete-request-json-http.txtneutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-delete-request-json-http0000666000175100017510000000017113231472055033661 0ustar zuulzuul00000000000000DELETE /v2.0/security-groups/e470bdfc-4869-459b-a561-cb3377efae59 Content-Type: application/json Accept: application/json././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-delete-response-json-http.txtneutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-delete-response-json-htt0000666000175100017510000000001313231472055033642 0ustar zuulzuul00000000000000status: 204././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-rule-delete-request-json-http.txtneutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-rule-delete-request-json0000666000175100017510000000017613231472055033656 0ustar zuulzuul00000000000000DELETE /v2.0/security-group-rules/fc3c327a-b5b5-4cd3-9577-52893289ce08 Content-Type: application/json Accept: application/json././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-groups-list-request-json-http.txtneutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-groups-list-request-json-http.0000666000175100017510000000006213231472055033632 0ustar zuulzuul00000000000000GET /v2.0/security-groups Accept: application/jsonneutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-show-response.json0000666000175100017510000000564713231472055032606 0ustar zuulzuul00000000000000{ "security_group": { "description": "default", "id": "85cc3048-abc3-43cc-89b3-377341426ac5", "name": "default", "security_group_rules": [ { "direction": "egress", "ethertype": "IPv6", "id": "3c0e45ff-adaf-4124-b083-bf390e5482ff", "port_range_max": null, "port_range_min": null, "protocol": null, "remote_group_id": null, "remote_ip_prefix": null, "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 1, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "description": "" }, { "direction": "egress", "ethertype": "IPv4", "id": "93aa42e5-80db-4581-9391-3a608bd0e448", "port_range_max": null, "port_range_min": null, "protocol": null, "remote_group_id": null, "remote_ip_prefix": null, "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 2, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "description": "" }, { "direction": "ingress", "ethertype": "IPv6", "id": "c0b09f00-1d49-4e64-a0a7-8a186d928138", "port_range_max": null, "port_range_min": null, "protocol": null, "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "remote_ip_prefix": null, "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 1, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "description": "" }, { "direction": "ingress", "ethertype": "IPv4", "id": "f7d45c89-008e-4bab-88ad-d6811724c51c", "port_range_max": null, "port_range_min": null, "protocol": null, "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "remote_ip_prefix": null, "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 1, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "description": "" } ], "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 4, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550" } } ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-rule-show-request-json-http.txtneutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-rule-show-request-json-h0000666000175100017510000000013513231472055033614 0ustar zuulzuul00000000000000GET /v2.0/security-group-rules/3c0e45ff-adaf-4124-b083-bf390e5482ff Accept: application/json neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-create-request.json0000666000175100017510000000017313231472055032710 0ustar zuulzuul00000000000000{ "security_group": { "name": "new-webservers", "description": "security group for webservers" } } ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-rules-list-request-json-http.txtneutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-rules-list-request-json-0000666000175100017510000000007013231472055033620 0ustar zuulzuul00000000000000GET /v2.0/security-group-rules/ Accept: application/jsonneutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-groups-list-response.json0000666000175100017510000000631413231472055032754 0ustar zuulzuul00000000000000{ "security_groups": [ { "description": "default", "id": "85cc3048-abc3-43cc-89b3-377341426ac5", "name": "default", "security_group_rules": [ { "direction": "egress", "ethertype": "IPv6", "id": "3c0e45ff-adaf-4124-b083-bf390e5482ff", "port_range_max": null, "port_range_min": null, "protocol": null, "remote_group_id": null, "remote_ip_prefix": null, "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 1, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "description": "" }, { "direction": "egress", "ethertype": "IPv4", "id": "93aa42e5-80db-4581-9391-3a608bd0e448", "port_range_max": null, "port_range_min": null, "protocol": null, "remote_group_id": null, "remote_ip_prefix": null, "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 2, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "description": "" }, { "direction": "ingress", "ethertype": "IPv6", "id": "c0b09f00-1d49-4e64-a0a7-8a186d928138", "port_range_max": null, "port_range_min": null, "protocol": null, "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "remote_ip_prefix": null, "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 1, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "description": "" }, { "direction": "ingress", "ethertype": "IPv4", "id": "f7d45c89-008e-4bab-88ad-d6811724c51c", "port_range_max": null, "port_range_min": null, "protocol": null, "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "remote_ip_prefix": null, "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 1, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "description": "" } ], "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", "revision_number": 8, "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-update-response.json0000666000175100017510000000052613231472055033077 0ustar zuulzuul00000000000000{ "security_group": { "security_group_rules": [], "project_id": "a52cdb9cc7854a39a23d3af73a40899e", "revision_number": 4, "tenant_id": "a52cdb9cc7854a39a23d3af73a40899e", "id": "01fbade5-b664-42f6-83ae-4e214f4263fa", "name": "mysecgroup", "description": "my security group" } } ././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-rule-delete-response-json-http.txtneutron-lib-1.13.0/api-ref/source/v2/samples/security-groups/security-group-rule-delete-response-jso0000666000175100017510000000001313231472055033634 0ustar zuulzuul00000000000000status: 204neutron-lib-1.13.0/api-ref/source/v2/samples/tag/0000775000175100017510000000000013231472430021446 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/tag/tag-update-response.json0000666000175100017510000000006613231472055026237 0ustar zuulzuul00000000000000{ "tags": [ "red", "blue" ] } neutron-lib-1.13.0/api-ref/source/v2/samples/tag/tag-update-request.json0000666000175100017510000000006613231472055026071 0ustar zuulzuul00000000000000{ "tags": [ "red", "blue" ] } neutron-lib-1.13.0/api-ref/source/v2/samples/tag/tag-obtain-response.json0000666000175100017510000000006613231472055026231 0ustar zuulzuul00000000000000{ "tags": [ "red", "blue" ] } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/0000775000175100017510000000000013231472430021476 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ipsec-site-connection-create-response.json0000666000175100017510000000200513231472055031672 0ustar zuulzuul00000000000000{ "ipsec_site_connection": { "status": "PENDING_CREATE", "psk": "secret", "initiator": "bi-directional", "name": "vpnconnection1", "admin_state_up": true, "project_id": "10039663455a446d8ba2cbb058b0f578", "tenant_id": "10039663455a446d8ba2cbb058b0f578", "auth_mode": "psk", "peer_cidrs": [], "mtu": 1500, "peer_ep_group_id": "9ad5a7e0-6dac-41b4-b20d-a7b8645fddf1", "ikepolicy_id": "9b00d6b0-6c93-4ca5-9747-b8ade7bb514f", "vpnservice_id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", "dpd": { "action": "hold", "interval": 30, "timeout": 120 }, "route_mode": "static", "ipsecpolicy_id": "e6e23d0c-9519-4d52-8ea4-5b1f96d857b1", "local_ep_group_id": "3e1815dd-e212-43d0-8f13-b494fa553e68", "peer_address": "172.24.4.233", "peer_id": "172.24.4.233", "id": "851f280f-5639-4ea3-81aa-e298525ab74b", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ipsec-site-connection-show-response.json0000666000175100017510000000177313231472055031422 0ustar zuulzuul00000000000000{ "ipsec_site_connection": { "status": "DOWN", "psk": "secret", "initiator": "bi-directional", "name": "vpnconnection1", "admin_state_up": true, "project_id": "10039663455a446d8ba2cbb058b0f578", "tenant_id": "10039663455a446d8ba2cbb058b0f578", "auth_mode": "psk", "peer_cidrs": [], "mtu": 1500, "peer_ep_group_id": "9ad5a7e0-6dac-41b4-b20d-a7b8645fddf1", "ikepolicy_id": "9b00d6b0-6c93-4ca5-9747-b8ade7bb514f", "vpnservice_id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", "dpd": { "action": "hold", "interval": 30, "timeout": 120 }, "route_mode": "static", "ipsecpolicy_id": "e6e23d0c-9519-4d52-8ea4-5b1f96d857b1", "local_ep_group_id": "3e1815dd-e212-43d0-8f13-b494fa553e68", "peer_address": "172.24.4.226", "peer_id": "172.24.4.226", "id": "851f280f-5639-4ea3-81aa-e298525ab74b", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/vpn-endpoint-group-show-response.json0000666000175100017510000000055513231472055030770 0ustar zuulzuul00000000000000{ "endpoint_group": { "description": "", "project_id": "4ad57e7ce0b24fca8f12b9834d91079d", "tenant_id": "4ad57e7ce0b24fca8f12b9834d91079d", "endpoints": [ "10.2.0.0/24", "10.3.0.0/24" ], "type": "cidr", "id": "6ecd9cf3-ca64-46c7-863f-f2eb1b9e838a", "name": "peers" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ipsecpolicy-update-request.json0000666000175100017510000000007013231472055027664 0ustar zuulzuul00000000000000{ "ipsecpolicy": { "pfs": "group14" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ipsec-site-connections-list-response.json0000666000175100017510000000217613231472055031576 0ustar zuulzuul00000000000000{ "ipsec_site_connections": [ { "status": "PENDING CREATE", "psk": "secret", "initiator": "bi-directional", "name": "vpnconnection1", "admin_state_up": true, "project_id": "10039663455a446d8ba2cbb058b0f578", "tenant_id": "10039663455a446d8ba2cbb058b0f578", "auth_mode": "psk", "peer_cidrs": [], "mtu": 1500, "peer_ep_group_id": "9ad5a7e0-6dac-41b4-b20d-a7b8645fddf1", "ikepolicy_id": "9b00d6b0-6c93-4ca5-9747-b8ade7bb514f", "vpnservice_id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", "dpd": { "action": "hold", "interval": 30, "timeout": 120 }, "route_mode": "static", "ipsecpolicy_id": "e6e23d0c-9519-4d52-8ea4-5b1f96d857b1", "local_ep_group_id": "3e1815dd-e212-43d0-8f13-b494fa553e68", "peer_address": "172.24.4.226", "peer_id": "172.24.4.226", "id": "851f280f-5639-4ea3-81aa-e298525ab74b", "description": "" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ikepolicy-create-response.json0000666000175100017510000000100713231472055027461 0ustar zuulzuul00000000000000{ "ikepolicy": { "name": "ikepolicy1", "project_id": "ccb81365fe36411a9011e90491fe1330", "tenant_id": "ccb81365fe36411a9011e90491fe1330", "auth_algorithm": "sha1", "encryption_algorithm": "aes-128", "pfs": "group5", "phase1_negotiation_mode": "main", "lifetime": { "units": "seconds", "value": 7200 }, "ike_version": "v1", "id": "5522aff7-1b3c-48dd-9c3c-b50f016b73db", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/vpnservice-update-request.json0000666000175100017510000000011313231472055027523 0ustar zuulzuul00000000000000{ "vpnservice": { "description": "Updated description" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ikepolicy-show-response.json0000666000175100017510000000100713231472055027176 0ustar zuulzuul00000000000000{ "ikepolicy": { "name": "ikepolicy1", "project_id": "ccb81365fe36411a9011e90491fe1330", "tenant_id": "ccb81365fe36411a9011e90491fe1330", "auth_algorithm": "sha1", "encryption_algorithm": "aes-256", "pfs": "group5", "phase1_negotiation_mode": "main", "lifetime": { "units": "seconds", "value": 3600 }, "ike_version": "v1", "id": "5522aff7-1b3c-48dd-9c3c-b50f016b73db", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/vpnservice-create-response.json0000666000175100017510000000075413231472055027665 0ustar zuulzuul00000000000000{ "vpnservice": { "router_id": "66e3b16c-8ce5-40fb-bb49-ab6d8dc3f2aa", "status": "PENDING_CREATE", "name": "myservice", "external_v6_ip": "2001:db8::1", "admin_state_up": true, "subnet_id": null, "project_id": "10039663455a446d8ba2cbb058b0f578", "tenant_id": "10039663455a446d8ba2cbb058b0f578", "external_v4_ip": "172.32.1.11", "id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ipsecpolicy-show-response.json0000666000175100017510000000102113231472055027525 0ustar zuulzuul00000000000000{ "ipsecpolicy": { "name": "ipsecpolicy1", "transform_protocol": "esp", "auth_algorithm": "sha1", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes-128", "pfs": "group14", "project_id": "ccb81365fe36411a9011e90491fe1330", "tenant_id": "ccb81365fe36411a9011e90491fe1330", "lifetime": { "units": "seconds", "value": 3600 }, "id": "5291b189-fd84-46e5-84bd-78f40c05d69c", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ikepolicy-update-response.json0000666000175100017510000000100713231472055027500 0ustar zuulzuul00000000000000{ "ikepolicy": { "name": "ikepolicy1", "project_id": "ccb81365fe36411a9011e90491fe1330", "tenant_id": "ccb81365fe36411a9011e90491fe1330", "auth_algorithm": "sha1", "encryption_algorithm": "aes-256", "pfs": "group5", "phase1_negotiation_mode": "main", "lifetime": { "units": "seconds", "value": 3600 }, "ike_version": "v1", "id": "5522aff7-1b3c-48dd-9c3c-b50f016b73db", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ipsec-site-connection-update-response.json0000666000175100017510000000201213231472055031707 0ustar zuulzuul00000000000000{ "ipsec_site_connection": { "status": "DOWN", "psk": "secret", "initiator": "bi-directional", "name": "vpnconnection1", "admin_state_up": true, "project_id": "10039663455a446d8ba2cbb058b0f578", "tenant_id": "10039663455a446d8ba2cbb058b0f578", "auth_mode": "psk", "peer_cidrs": [], "mtu": 2000, "peer_ep_group_id": "9ad5a7e0-6dac-41b4-b20d-a7b8645fddf1", "ikepolicy_id": "9b00d6b0-6c93-4ca5-9747-b8ade7bb514f", "vpnservice_id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", "dpd": { "action": "hold", "interval": 30, "timeout": 120 }, "route_mode": "static", "ipsecpolicy_id": "e6e23d0c-9519-4d52-8ea4-5b1f96d857b1", "local_ep_group_id": "3e1815dd-e212-43d0-8f13-b494fa553e68", "peer_address": "172.24.4.233", "peer_id": "172.24.4.233", "id": "851f280f-5639-4ea3-81aa-e298525ab74b", "description": "New description" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ipsecpolicy-create-request.json0000666000175100017510000000051413231472055027650 0ustar zuulzuul00000000000000{ "ipsecpolicy": { "name": "ipsecpolicy1", "transform_protocol": "esp", "auth_algorithm": "sha1", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes-128", "pfs": "group5", "lifetime": { "units": "seconds", "value": 7200 } } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/vpn-endpoint-groups-list-response.json0000666000175100017510000000145713231472055031150 0ustar zuulzuul00000000000000{ "endpoint_groups": [ { "description": "", "project_id": "4ad57e7ce0b24fca8f12b9834d91079d", "tenant_id": "4ad57e7ce0b24fca8f12b9834d91079d", "endpoints": [ "a3da778c-adfb-46db-88b3-d2ce53290a89" ], "type": "subnet", "id": "6bf34c7c-864c-4948-a6d4-db791669f9d4", "name": "locals" }, { "description": "", "project_id": "4ad57e7ce0b24fca8f12b9834d91079d", "tenant_id": "4ad57e7ce0b24fca8f12b9834d91079d", "endpoints": [ "10.2.0.0/24", "10.3.0.0/24" ], "type": "cidr", "id": "6ecd9cf3-ca64-46c7-863f-f2eb1b9e838a", "name": "peers" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/vpnservice-show-response.json0000666000175100017510000000075413231472055027402 0ustar zuulzuul00000000000000{ "vpnservice": { "router_id": "66e3b16c-8ce5-40fb-bb49-ab6d8dc3f2aa", "status": "PENDING_CREATE", "name": "myservice", "external_v6_ip": "2001:db8::1", "admin_state_up": true, "subnet_id": null, "project_id": "10039663455a446d8ba2cbb058b0f578", "tenant_id": "10039663455a446d8ba2cbb058b0f578", "external_v4_ip": "172.32.1.11", "id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ikepolicies-list-response.json0000666000175100017510000000112513231472055027502 0ustar zuulzuul00000000000000{ "ikepolicies": [ { "name": "ikepolicy1", "project_id": "ccb81365fe36411a9011e90491fe1330", "tenant_id": "ccb81365fe36411a9011e90491fe1330", "auth_algorithm": "sha1", "encryption_algorithm": "aes-256", "pfs": "group5", "phase1_negotiation_mode": "main", "lifetime": { "units": "seconds", "value": 3600 }, "ike_version": "v1", "id": "5522aff7-1b3c-48dd-9c3c-b50f016b73db", "description": "" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ipsec-site-connection-create-request.json0000666000175100017510000000113013231472055031522 0ustar zuulzuul00000000000000{ "ipsec_site_connection": { "psk": "secret", "initiator": "bi-directional", "ipsecpolicy_id": "e6e23d0c-9519-4d52-8ea4-5b1f96d857b1", "admin_state_up": true, "mtu": "1500", "peer_ep_group_id": "9ad5a7e0-6dac-41b4-b20d-a7b8645fddf1", "ikepolicy_id": "9b00d6b0-6c93-4ca5-9747-b8ade7bb514f", "vpnservice_id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", "local_ep_group_id": "3e1815dd-e212-43d0-8f13-b494fa553e68", "peer_address": "172.24.4.233", "peer_id": "172.24.4.233", "name": "vpnconnection1" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ipsecpolicy-create-response.json0000666000175100017510000000102013231472055030007 0ustar zuulzuul00000000000000{ "ipsecpolicy": { "name": "ipsecpolicy1", "transform_protocol": "esp", "auth_algorithm": "sha1", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes-128", "pfs": "group5", "project_id": "ccb81365fe36411a9011e90491fe1330", "tenant_id": "ccb81365fe36411a9011e90491fe1330", "lifetime": { "units": "seconds", "value": 7200 }, "id": "5291b189-fd84-46e5-84bd-78f40c05d69c", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/vpnservices-list-response.json0000666000175100017510000000105513231472055027553 0ustar zuulzuul00000000000000{ "vpnservices": [ { "router_id": "66e3b16c-8ce5-40fb-bb49-ab6d8dc3f2aa", "status": "PENDING_CREATE", "name": "myservice", "external_v6_ip": "2001:db8::1", "admin_state_up": true, "subnet_id": null, "project_id": "10039663455a446d8ba2cbb058b0f578", "tenant_id": "10039663455a446d8ba2cbb058b0f578", "external_v4_ip": "172.32.1.11", "id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", "description": "" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/vpn-endpoint-group-update-request.json0000666000175100017510000000011313231472055031112 0ustar zuulzuul00000000000000{ "endpoint_group": { "description": "New description" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/vpn-endpoint-group-update-response.json0000666000175100017510000000057413231472055031273 0ustar zuulzuul00000000000000{ "endpoint_group": { "description": "New description", "project_id": "4ad57e7ce0b24fca8f12b9834d91079d", "tenant_id": "4ad57e7ce0b24fca8f12b9834d91079d", "endpoints": [ "10.2.0.0/24", "10.3.0.0/24" ], "type": "cidr", "id": "6ecd9cf3-ca64-46c7-863f-f2eb1b9e838a", "name": "peers" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ikepolicy-create-request.json0000666000175100017510000000050313231472055027313 0ustar zuulzuul00000000000000{ "ikepolicy": { "phase1_negotiation_mode": "main", "auth_algorithm": "sha1", "encryption_algorithm": "aes-128", "pfs": "group5", "lifetime": { "units": "seconds", "value": 7200 }, "ike_version": "v1", "name": "ikepolicy1" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ipsecpolicy-update-response.json0000666000175100017510000000102113231472055030027 0ustar zuulzuul00000000000000{ "ipsecpolicy": { "name": "ipsecpolicy1", "transform_protocol": "esp", "auth_algorithm": "sha1", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes-128", "pfs": "group14", "project_id": "ccb81365fe36411a9011e90491fe1330", "tenant_id": "ccb81365fe36411a9011e90491fe1330", "lifetime": { "units": "seconds", "value": 3600 }, "id": "5291b189-fd84-46e5-84bd-78f40c05d69c", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/vpn-endpoint-group-create-response.json0000666000175100017510000000055513231472055031253 0ustar zuulzuul00000000000000{ "endpoint_group": { "description": "", "project_id": "4ad57e7ce0b24fca8f12b9834d91079d", "tenant_id": "4ad57e7ce0b24fca8f12b9834d91079d", "endpoints": [ "10.2.0.0/24", "10.3.0.0/24" ], "type": "cidr", "id": "6ecd9cf3-ca64-46c7-863f-f2eb1b9e838a", "name": "peers" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ipsec-site-connection-update-request.json0000666000175100017510000000007713231472055031552 0ustar zuulzuul00000000000000{ "ipsec_site_connection": { "mtu": "2000" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/vpnservice-update-response.json0000666000175100017510000000064113231472055027677 0ustar zuulzuul00000000000000{ "vpnservice": { "router_id": "881b7b30-4efb-407e-a162-5630a7af3595", "status": "ACTIVE", "name": "myvpn", "admin_state_up": true, "subnet_id": null, "project_id": "26de9cd6cae94c8cb9f79d660d628e1f", "tenant_id": "26de9cd6cae94c8cb9f79d660d628e1f", "id": "41bfef97-af4e-4f6b-a5d3-4678859d2485", "description": "Updated description" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/vpnservice-create-request.json0000666000175100017510000000026213231472055027511 0ustar zuulzuul00000000000000{ "vpnservice": { "subnet_id": null, "router_id": "66e3b16c-8ce5-40fb-bb49-ab6d8dc3f2aa", "name": "myservice", "admin_state_up": true } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ipsecpolicies-list-response.json0000666000175100017510000000113713231472055030040 0ustar zuulzuul00000000000000{ "ipsecpolicies": [ { "name": "ipsecpolicy1", "transform_protocol": "esp", "auth_algorithm": "sha1", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes-128", "pfs": "group14", "project_id": "ccb81365fe36411a9011e90491fe1330", "tenant_id": "ccb81365fe36411a9011e90491fe1330", "lifetime": { "units": "seconds", "value": 3600 }, "id": "5291b189-fd84-46e5-84bd-78f40c05d69c", "description": "" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/vpn-endpoint-group-create-request.json0000666000175100017510000000025113231472055031076 0ustar zuulzuul00000000000000{ "endpoint_group": { "endpoints": [ "10.2.0.0/24", "10.3.0.0/24" ], "type": "cidr", "name": "peers" } } neutron-lib-1.13.0/api-ref/source/v2/samples/vpn/ikepolicy-update-request.json0000666000175100017510000000010713231472055027332 0ustar zuulzuul00000000000000{ "ikepolicy": { "encryption_algorithm": "aes-256" } } neutron-lib-1.13.0/api-ref/source/v2/samples/segments/0000775000175100017510000000000013231472430022520 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/segments/segment-show-response.json0000666000175100017510000000044513231472055027677 0ustar zuulzuul00000000000000{ "segment": { "name": null, "network_id": "5c0cb560-4089-41dd-be29-469907a23b49", "segmentation_id": 2000, "network_type": "vlan", "physical_network": "segment-1", "revision_number": 1, "id": "57fe85e4-ca2f-4192-b3cd-d5c249d7a21f", "description": null } } neutron-lib-1.13.0/api-ref/source/v2/samples/segments/segments-list-response.json0000666000175100017510000000115513231472055030054 0ustar zuulzuul00000000000000{ "segments": [ { "name": null, "network_id": "5c0cb560-4089-41dd-be29-469907a23b49", "segmentation_id": 2000, "network_type": "vlan", "physical_network": "segment-1", "revision_number": 1, "id": "57fe85e4-ca2f-4192-b3cd-d5c249d7a21f", "description": null }, { "name": null, "network_id": "5c0cb560-4089-41dd-be29-469907a23b49", "segmentation_id": 2000, "network_type": "vlan", "physical_network": "segment-2", "revision_number": 3, "id": "f1364c3a-4fc1-4206-b2dc-3254bc25cbfc", "description": null } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/segments/segment-create-response.json0000666000175100017510000000044513231472055030162 0ustar zuulzuul00000000000000{ "segment": { "name": null, "network_id": "5c0cb560-4089-41dd-be29-469907a23b49", "segmentation_id": 2000, "network_type": "vlan", "physical_network": "segment-1", "revision_number": 1, "id": "57fe85e4-ca2f-4192-b3cd-d5c249d7a21f", "description": null } } neutron-lib-1.13.0/api-ref/source/v2/samples/segments/segment-update-response.json0000666000175100017510000000045513231472055030202 0ustar zuulzuul00000000000000{ "segment": { "name": "1", "network_id": "5c0cb560-4089-41dd-be29-469907a23b49", "segmentation_id": 2000, "network_type": "vlan", "physical_network": "segment-1", "revision_number": 4, "id": "57fe85e4-ca2f-4192-b3cd-d5c249d7a21f", "description": "Segment One" } } neutron-lib-1.13.0/api-ref/source/v2/samples/segments/segment-create-request.json0000666000175100017510000000030213231472055030004 0ustar zuulzuul00000000000000{ "segment": { "network_id": "5c0cb560-4089-41dd-be29-469907a23b49", "segmentation_id": 2000, "network_type": "vlan", "physical_network": "segment-1" } } neutron-lib-1.13.0/api-ref/source/v2/samples/segments/segment-update-request.json0000666000175100017510000000012513231472055030026 0ustar zuulzuul00000000000000{ "segment": { "name": "1", "description": "Segment One" } } neutron-lib-1.13.0/api-ref/source/v2/samples/flavors/0000775000175100017510000000000013231472430022347 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/flavors/flavors-list-response.json0000666000175100017510000000042313231472055027527 0ustar zuulzuul00000000000000{ "flavors": [ { "description": "", "enabled": true, "service_profiles": [], "service_type": "LOADBALANCERV2", "id": "f7b14d9a-b0dc-4fbe-bb14-a0f4970a69e0", "name": "dummy" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/flavors/flavor-create-request.json0000666000175100017510000000023413231472055027466 0ustar zuulzuul00000000000000{ "flavor": { "service_type": "LOADBALANCERV2", "enabled": true, "name": "dummy", "description": "Dummy flavor" } } neutron-lib-1.13.0/api-ref/source/v2/samples/flavors/flavor-update-request.json0000666000175100017510000000017013231472055027504 0ustar zuulzuul00000000000000{ "flavor": { "enabled": false, "name": "newname", "description": "New description" } } neutron-lib-1.13.0/api-ref/source/v2/samples/flavors/flavor-associate-request.json0000666000175100017510000000013013231472055030171 0ustar zuulzuul00000000000000{ "service_profile": { "id": "4e5b9191-ffbe-4f7a-b112-2db98232fd32" } } neutron-lib-1.13.0/api-ref/source/v2/samples/flavors/service-profile-update-request.json0000666000175100017510000000032513231472055031313 0ustar zuulzuul00000000000000{ "service_profile": { "enabled": false, "driver": "neutron_lbaas.drivers.octavia.driver.OctaviaDriver", "description": "New description", "metainfo": "{'new': 'info'}" } } neutron-lib-1.13.0/api-ref/source/v2/samples/flavors/flavor-update-response.json0000666000175100017510000000037013231472055027654 0ustar zuulzuul00000000000000{ "flavor": { "description": "New description", "enabled": false, "service_profiles": [], "service_type": "LOADBALANCERV2", "id": "7fc0581b-4509-49e1-90eb-c953c877fa4c", "name": "newname" } } neutron-lib-1.13.0/api-ref/source/v2/samples/flavors/service-profiles-list-response.json0000666000175100017510000000101313231472055031330 0ustar zuulzuul00000000000000{ "service_profiles": [ { "id": "4e5b9191-ffbe-4f7a-b112-2db98232fd32", "enabled": true, "driver": "neutron_lbaas.drivers.octavia.driver.OctaviaDriver", "description": "", "metainfo": "{}" }, { "id": "684322c5-703a-48a2-8138-34b99942a7ef", "enabled": true, "driver": "neutron_lbaas.drivers.octavia.driver.OctaviaDriver", "description": "", "metainfo": "{}" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/flavors/flavor-show-response.json0000666000175100017510000000034613231472055027355 0ustar zuulzuul00000000000000{ "flavor": { "description": "", "enabled": true, "service_profiles": [], "service_type": "LOADBALANCERV2", "id": "f7b14d9a-b0dc-4fbe-bb14-a0f4970a69e0", "name": "dummy" } } neutron-lib-1.13.0/api-ref/source/v2/samples/flavors/service-profile-create-request.json0000666000175100017510000000032313231472055031272 0ustar zuulzuul00000000000000{ "service_profile": { "enabled": "true", "driver": "neutron_lbaas.drivers.octavia.driver.OctaviaDriver", "description": "Dummy profile", "metainfo": "{'foo': 'bar'}" } } neutron-lib-1.13.0/api-ref/source/v2/samples/flavors/flavor-create-response.json0000666000175100017510000000036213231472055027636 0ustar zuulzuul00000000000000{ "flavor": { "id": "7fc0581b-4509-49e1-90eb-c953c877fa4c", "name": "dummy", "service_type": "LOADBALANCERV2", "description": "Dummy flavor", "enabled": true, "service_profiles": [] } } neutron-lib-1.13.0/api-ref/source/v2/samples/flavors/service-profile-update-response.json0000666000175100017510000000041313231472055031457 0ustar zuulzuul00000000000000{ "service_profile": { "enabled": false, "metainfo": "{'new': 'info'}", "driver": "neutron_lbaas.drivers.octavia.driver.OctaviaDriver", "id": "7c793e5f-9b64-44e0-8b1f-902e59c85a01", "description": "New description" } } neutron-lib-1.13.0/api-ref/source/v2/samples/flavors/service-profile-create-response.json0000666000175100017510000000040713231472055031443 0ustar zuulzuul00000000000000{ "service_profile": { "enabled": true, "metainfo": "{'foo': 'bar'}", "driver": "neutron_lbaas.drivers.octavia.driver.OctaviaDriver", "id": "7c793e5f-9b64-44e0-8b1f-902e59c85a01", "description": "Dummy profile" } } neutron-lib-1.13.0/api-ref/source/v2/samples/flavors/flavor-associate-response.json0000666000175100017510000000013013231472055030337 0ustar zuulzuul00000000000000{ "service_profile": { "id": "4e5b9191-ffbe-4f7a-b112-2db98232fd32" } } neutron-lib-1.13.0/api-ref/source/v2/samples/flavors/service-profile-show-response.json0000666000175100017510000000040713231472055031160 0ustar zuulzuul00000000000000{ "service_profile": { "enabled": true, "metainfo": "{'foo': 'bar'}", "driver": "neutron_lbaas.drivers.octavia.driver.OctaviaDriver", "id": "7c793e5f-9b64-44e0-8b1f-902e59c85a01", "description": "Dummy profile" } } neutron-lib-1.13.0/api-ref/source/v2/samples/network-ip-availability/0000775000175100017510000000000013231472430025442 5ustar zuulzuul00000000000000././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/network-ip-availability/network-ip-availability-show.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/network-ip-availability/network-ip-availability-show.js0000666000175100017510000000170213231472055033532 0ustar zuulzuul00000000000000{ "network_ip_availability": { "used_ips": 4, "subnet_ip_availability": [ { "used_ips": 2, "subnet_id": "44e70d00-80a2-4fb1-ab59-6190595ceb61", "subnet_name": "private-subnet", "ip_version": 4, "cidr": "10.0.0.0/24", "total_ips": 253 }, { "used_ips": 2, "subnet_id": "a90623df-00e1-4902-a675-40674385d74c", "subnet_name": "ipv6-private-subnet", "ip_version": 6, "cidr": "fdbf:ac66:9be8::/64", "total_ips": 18446744073709552000 } ], "network_id": "6801d9c8-20e6-4b27-945d-62499f00002e", "project_id": "d56d3b8dd6894a508cf41b96b522328c", "tenant_id": "d56d3b8dd6894a508cf41b96b522328c", "total_ips": 18446744073709552000, "network_name": "private" } } ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/network-ip-availability/network-ip-availability-list.jsonneutron-lib-1.13.0/api-ref/source/v2/samples/network-ip-availability/network-ip-availability-list.js0000666000175100017510000000405413231472055033530 0ustar zuulzuul00000000000000{ "network_ip_availabilities": [ { "network_id": "4cf895c9-c3d1-489e-b02e-59b5c8976809", "network_name": "public", "subnet_ip_availability": [ { "cidr": "2001:db8::/64", "ip_version": 6, "subnet_id": "ca3f46c4-c6ff-4272-9be4-0466f84c6077", "subnet_name": "ipv6-public-subnet", "total_ips": 18446744073709552000, "used_ips": 1 }, { "cidr": "172.24.4.0/24", "ip_version": 4, "subnet_id": "cc02efc1-9d47-46bd-bab6-760919c836b5", "subnet_name": "public-subnet", "total_ips": 253, "used_ips": 1 } ], "project_id": "1a02cc95f1734fcc9d3c753818f03002", "tenant_id": "1a02cc95f1734fcc9d3c753818f03002", "total_ips": 253, "used_ips": 2 }, { "network_id": "6801d9c8-20e6-4b27-945d-62499f00002e", "network_name": "private", "subnet_ip_availability": [ { "cidr": "10.0.0.0/24", "ip_version": 4, "subnet_id": "44e70d00-80a2-4fb1-ab59-6190595ceb61", "subnet_name": "private-subnet", "total_ips": 253, "used_ips": 2 }, { "ip_version": 6, "cidr": "fdbf:ac66:9be8::/64", "subnet_id": "a90623df-00e1-4902-a675-40674385d74c", "subnet_name": "ipv6-private-subnet", "total_ips": 18446744073709552000, "used_ips": 2 } ], "project_id": "d56d3b8dd6894a508cf41b96b522328c", "tenant_id": "d56d3b8dd6894a508cf41b96b522328c", "total_ips": 18446744073709552000, "used_ips": 4 } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/0000775000175100017510000000000013231472430022547 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/networks/version-show-response.json0000666000175100017510000000146713231472055027756 0ustar zuulzuul00000000000000{ "resources": [ { "links": [ { "href": "http://23.253.228.211:9696/v2.0/subnets", "rel": "self" } ], "name": "subnet", "collection": "subnets" }, { "links": [ { "href": "http://23.253.228.211:9696/v2.0/networks", "rel": "self" } ], "name": "network", "collection": "networks" }, { "links": [ { "href": "http://23.253.228.211:9696/v2.0/ports", "rel": "self" } ], "name": "port", "collection": "ports" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/network-multi-create-request.json0000666000175100017510000000074713231472055031227 0ustar zuulzuul00000000000000{ "network": { "segments": [ { "provider:segmentation_id": 2, "provider:physical_network": "public", "provider:network_type": "vlan" }, { "provider:physical_network": "default", "provider:network_type": "flat" } ], "name": "net1", "admin_state_up": true, "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e" } } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/network-provider-create-request.json0000666000175100017510000000041613231472055031720 0ustar zuulzuul00000000000000{ "network": { "admin_state_up": true, "name": "net1", "provider:network_type": "vlan", "provider:physical_network": "public", "provider:segmentation_id": 2, "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e" } } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/networks-bulk-create-request.json0000666000175100017510000000053313231472055031206 0ustar zuulzuul00000000000000{ "networks": [ { "admin_state_up": true, "name": "sample_network3", "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e" }, { "admin_state_up": true, "name": "sample_network4", "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/networks-bulk-create-response.json0000666000175100017510000000340313231472055031353 0ustar zuulzuul00000000000000{ "networks": [ { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "created_at": "2016-03-08T20:19:41", "dns_domain": "", "id": "bc1a76cb-8767-4c3a-bb95-018b822f2130", "mtu": 1500, "name": "sample_network3", "project_id": "4fd44f30292945e481c7b8a0c8908869", "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", "revision_number": 1, "router:external": false, "shared": false, "status": "ACTIVE", "subnets": [], "tenant_id": "4fd44f30292945e481c7b8a0c8908869", "updated_at": "2016-03-08T20:19:41", "vlan_transparent": false, "description": "", "port_security_enabled": true }, { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "created_at": "2016-03-08T20:19:41", "dns_domain": "", "id": "af374017-c9ae-4a1d-b799-ab73111476e2", "mtu": 1500, "name": "sample_network4", "project_id": "4fd44f30292945e481c7b8a0c8908869", "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", "revision_number": 1, "router:external": false, "shared": false, "status": "ACTIVE", "subnets": [], "tenant_id": "4fd44f30292945e481c7b8a0c8908869", "updated_at": "2016-03-08T20:19:41", "vlan_transparent": false, "description": "", "port_security_enabled": true } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/networks-provider-list-response.json0000666000175100017510000000475713231472055031775 0ustar zuulzuul00000000000000{ "networks": [ { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "created_at": "2016-03-08T20:19:41", "dns_domain": "my-domain.org.", "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", "mtu": 1500, "name": "net1", "port_security_enabled": true, "project_id": "4fd44f30292945e481c7b8a0c8908869", "provider:network_type": "vlan", "provider:physical_network": "public", "provider:segmentation_id": 3, "revision_number": 1, "router:external": false, "shared": false, "status": "ACTIVE", "subnets": [ "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" ], "tenant_id": "4fd44f30292945e481c7b8a0c8908869", "updated_at": "2016-03-08T20:19:41", "vlan_transparent": true, "description": "" }, { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "dns_domain": "my-domain.org.", "id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324", "mtu": 1450, "name": "net2", "port_security_enabled": true, "project_id": "26a7980765d0414dbc1fc1f88cdb7e6e", "provider:network_type": "local", "provider:physical_network": null, "provider:segmentation_id": null, "qos_policy_id": "bfdb6c39f71e4d44b1dfbda245c50819", "revision_number": 2, "router:external": false, "segments": [ { "provider:network_type": "vlan", "provider:physical_network": "public", "provider:segmentation_id": 2 }, { "provider:network_type": "vxlan", "provider:physical_network": "default", "provider:segmentation_id": 1000 } ], "shared": false, "status": "ACTIVE", "subnets": [ "08eae331-0402-425a-923c-34f7cfe39c1b" ], "tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e", "updated_at": "2016-03-08T20:19:41", "vlan_transparent": false, "description": "" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/versions-list-response.json0000666000175100017510000000042513231472055030125 0ustar zuulzuul00000000000000{ "versions": [ { "status": "CURRENT", "id": "v2.0", "links": [ { "href": "http://23.253.228.211:9696/v2.0", "rel": "self" } ] } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/network-provider-update-request.json0000666000175100017510000000023113231472055031732 0ustar zuulzuul00000000000000{ "network": { "provider:network_type": "vlan", "provider:physical_network": "public", "provider:segmentation_id": 2 } } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/network-multi-show-response.json0000666000175100017510000000235013231472055031102 0ustar zuulzuul00000000000000{ "network": { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "created_at": "2016-03-08T20:19:41", "dns_domain": "my-domain.org.", "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c", "mtu": 1500, "name": "net1", "port_security_enabled": true, "project_id": "9bacb3c5d39d41a79512987f338cf177", "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", "revision_number": 1, "router:external": false, "segments": [ { "provider:network_type": "vlan", "provider:physical_network": "public", "provider:segmentation_id": 2 }, { "provider:network_type": "flat", "provider:physical_network": "default", "provider:segmentation_id": 0 } ], "shared": false, "status": "ACTIVE", "subnets": [ "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" ], "tenant_id": "4fd44f30292945e481c7b8a0c8908869", "updated_at": "2016-03-08T20:19:41", "vlan_transparent": false, "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/networks-list-response.json0000666000175100017510000000353713231472055030140 0ustar zuulzuul00000000000000{ "networks": [ { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "created_at": "2016-03-08T20:19:41", "dns_domain": "my-domain.org.", "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", "mtu": 1500, "name": "net1", "port_security_enabled": true, "project_id": "4fd44f30292945e481c7b8a0c8908869", "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", "revision_number": 1, "router:external": false, "shared": false, "status": "ACTIVE", "subnets": [ "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" ], "tenant_id": "4fd44f30292945e481c7b8a0c8908869", "updated_at": "2016-03-08T20:19:41", "vlan_transparent": true, "description": "" }, { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "dns_domain": "my-domain.org.", "id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324", "mtu": 1500, "name": "net2", "port_security_enabled": true, "project_id": "26a7980765d0414dbc1fc1f88cdb7e6e", "qos_policy_id": "bfdb6c39f71e4d44b1dfbda245c50819", "revision_number": 3, "router:external": false, "shared": false, "status": "ACTIVE", "subnets": [ "08eae331-0402-425a-923c-34f7cfe39c1b" ], "tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e", "updated_at": "2016-03-08T20:19:41", "vlan_transparent": false, "description": "" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/network-show-response.json0000666000175100017510000000155313231472055027756 0ustar zuulzuul00000000000000{ "network": { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "created_at": "2016-03-08T20:19:41", "dns_domain": "my-domain.org.", "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", "mtu": 1500, "name": "private-network", "port_security_enabled": true, "project_id": "4fd44f30292945e481c7b8a0c8908869", "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", "revision_number": 1, "router:external": false, "shared": true, "status": "ACTIVE", "subnets": [ "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" ], "tenant_id": "4fd44f30292945e481c7b8a0c8908869", "updated_at": "2016-03-08T20:19:41", "vlan_transparent": false, "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/network-multi-create-response.json0000666000175100017510000000163513231472055031372 0ustar zuulzuul00000000000000{ "network": { "status": "ACTIVE", "subnets": [], "name": "net1", "admin_state_up": true, "dns_domain": "", "mtu": 1500, "port_security_enabled": true, "project_id": "9bacb3c5d39d41a79512987f338cf177", "tenant_id": "9bacb3c5d39d41a79512987f338cf177", "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", "revision_number": 1, "segments": [ { "provider:segmentation_id": 2, "provider:physical_network": "public", "provider:network_type": "vlan" }, { "provider:segmentation_id": null, "provider:physical_network": "default", "provider:network_type": "flat" } ], "shared": false, "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c", "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/network-provider-create-response.json0000666000175100017510000000133313231472055032065 0ustar zuulzuul00000000000000{ "network": { "status": "ACTIVE", "subnets": [], "availability_zone_hints": [], "dns_domain": "", "name": "net1", "provider:physical_network": "public", "admin_state_up": true, "project_id": "9bacb3c5d39d41a79512987f338cf177", "tenant_id": "9bacb3c5d39d41a79512987f338cf177", "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", "revision_number": 1, "router:external": false, "provider:network_type": "vlan", "mtu": 1500, "shared": false, "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c", "provider:segmentation_id": 2, "description": "", "port_security_enabled": true } } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/network-update-response.json0000666000175100017510000000156513231472055030263 0ustar zuulzuul00000000000000{ "network": { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "created_at": "2016-03-08T20:19:41", "dns_domain": "my-domain.org.", "id": "1f370095-98f6-4079-be64-6d3d4a6adcc6", "mtu": 1300, "name": "sample_network_5_updated", "port_security_enabled": true, "project_id": "4fd44f30292945e481c7b8a0c8908869", "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", "revision_number": 2, "router:external": false, "shared": false, "status": "ACTIVE", "subnets": [ "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" ], "tenant_id": "4fd44f30292945e481c7b8a0c8908869", "updated_at": "2016-03-08T20:19:41", "vlan_transparent": false, "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/network-create-response.json0000666000175100017510000000144513231472055030241 0ustar zuulzuul00000000000000{ "network": { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "created_at": "2016-03-08T20:19:41", "dns_domain": "my-domain.org.", "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c", "mtu": 1400, "name": "net1", "port_security_enabled": true, "project_id": "9bacb3c5d39d41a79512987f338cf177", "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", "revision_number": 1, "router:external": false, "shared": false, "status": "ACTIVE", "subnets": [], "tenant_id": "9bacb3c5d39d41a79512987f338cf177", "updated_at": "2016-03-08T20:19:41", "vlan_transparent": false, "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/network-create-request.json0000666000175100017510000000032613231472055030070 0ustar zuulzuul00000000000000{ "network": { "name": "sample_network", "admin_state_up": true, "dns_domain": "my-domain.org.", "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", "mtu": 1400 } } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/network-multi-update-request.json0000666000175100017510000000056213231472055031241 0ustar zuulzuul00000000000000{ "network": { "segments": [ { "provider:segmentation_id": 2, "provider:physical_network": "public", "provider:network_type": "vlan" }, { "provider:physical_network": "default", "provider:network_type": "flat" } ] } } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/network-update-request.json0000666000175100017510000000030013231472055030077 0ustar zuulzuul00000000000000{ "network": { "dns_domain": "my-domain.org.", "name": "sample_network_5_updated", "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", "mtu": 1300 } } neutron-lib-1.13.0/api-ref/source/v2/samples/networks/network-provider-show-response.json0000666000175100017510000000175213231472055031607 0ustar zuulzuul00000000000000{ "network": { "admin_state_up": true, "availability_zone_hints": [], "availability_zones": [ "nova" ], "created_at": "2016-03-08T20:19:41", "dns_domain": "my-domain.org.", "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", "mtu": 1500, "name": "private-network", "port_security_enabled": true, "project_id": "4fd44f30292945e481c7b8a0c8908869", "provider:network_type": "local", "provider:physical_network": null, "provider:segmentation_id": null, "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", "revision_number": 1, "router:external": false, "shared": true, "status": "ACTIVE", "subnets": [ "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" ], "tenant_id": "4fd44f30292945e481c7b8a0c8908869", "updated_at": "2016-03-08T20:19:41", "vlan_transparent": false, "description": "" } } neutron-lib-1.13.0/api-ref/source/v2/samples/quotas/0000775000175100017510000000000013231472430022207 5ustar zuulzuul00000000000000neutron-lib-1.13.0/api-ref/source/v2/samples/quotas/quotas-update-response.json0000666000175100017510000000040013231472055027531 0ustar zuulzuul00000000000000{ "quota": { "subnet": 10, "network": 15, "floatingip": 50, "subnetpool": -1, "security_group_rule": 100, "security_group": 10, "router": 10, "rbac_policy": -1, "port": 50 } } neutron-lib-1.13.0/api-ref/source/v2/samples/quotas/quotas-update-request.json0000666000175100017510000000040013231472055027363 0ustar zuulzuul00000000000000{ "quota": { "floatingip": 50, "network": 10, "port": 50, "rbac_policy": -1, "router": 10, "security_group": 10, "security_group_rule": 100, "subnet": 10, "subnetpool": -1 } } neutron-lib-1.13.0/api-ref/source/v2/samples/quotas/quotas-list-response.json0000666000175100017510000000066413231472055027236 0ustar zuulzuul00000000000000{ "quotas": [ { "floatingip": 50, "network": 15, "port": 50, "project_id": "bab7d5c60cd041a0a36f7c4b6e1dd978", "rbac_policy": -1, "router": 10, "security_group": 10, "security_group_rule": 100, "subnet": 10, "subnetpool": -1, "tenant_id": "bab7d5c60cd041a0a36f7c4b6e1dd978" } ] } neutron-lib-1.13.0/api-ref/source/v2/samples/quotas/quotas-list-for-project-response.json0000666000175100017510000000040013231472055031452 0ustar zuulzuul00000000000000{ "quota": { "floatingip": 50, "network": 10, "port": 50, "rbac_policy": -1, "router": 10, "security_group": 10, "security_group_rule": 100, "subnet": 10, "subnetpool": -1 } } neutron-lib-1.13.0/api-ref/source/v2/extensions.inc0000666000175100017510000000304713231472055022132 0ustar zuulzuul00000000000000.. -*- rst -*- ========== Extensions ========== Extensions introduce features and vendor-specific functionality to the API. List extensions =============== .. rest_method:: GET /v2.0/extensions Lists available extensions. Lists available Networking API v2.0 extensions and shows details for an extension. Normal response codes: 200 Error response codes: 401 Request ------- Response Parameters ------------------- .. rest_parameters:: parameters.yaml - extensions: extensions - name: extension-name - links: extension-links - alias: extension-alias-body - updated: extension-updated - description: extension-description Response Example ---------------- .. literalinclude:: samples/extensions/extensions-list-response.json :language: javascript Show extension details ====================== .. rest_method:: GET /v2.0/extensions/{alias} Shows details for an extension, by alias. The response shows the extension name and its alias. To show details for an extension, you specify the alias. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - alias: extensions-alias-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - extension: extension - name: extension-name - links: extension-links - alias: extension-alias-body - updated: extension-updated - description: extension-description Response Example ---------------- .. literalinclude:: samples/extensions/extension-show-response.json :language: javascript neutron-lib-1.13.0/api-ref/source/v2/agents.inc0000666000175100017510000000650413231472055021215 0ustar zuulzuul00000000000000.. -*- rst -*- ====== Agents ====== Lists, shows details for, updates, and deletes agents. List all agents =============== .. rest_method:: GET /v2.0/agents Shows details for an agent. Use the ``fields`` query parameter to control which fields are returned in the response body. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - admin_state_up: admin_state_up - agents: agents - agent_type: agent_type - alive: alive - binary: binary - configurations: configurations - created_at: created_at - description: description - heartbeat_timestamp: heartbeat_timestamp - host: host - id: id - started_at: started_at - topic: topic Response Example ---------------- .. literalinclude:: samples/agents/agents-list-response.json :language: javascript Show agent details ================== .. rest_method:: GET /v2.0/agents/{agent_id} Shows details for an agent. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - agent_id: agent_id-path - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - admin_state_up: admin_state_up - agent: agent - agent_type: agent_type - alive: alive - binary: binary - configurations: configurations - created_at: created_at - description: description - heartbeat_timestamp: heartbeat_timestamp - host: host - id: id - started_at: started_at - topic: topic Response Example ---------------- .. literalinclude:: samples/agents/agent-show-response.json :language: javascript Update agent ============== .. rest_method:: PUT /v2.0/agents/{agent_id} Updates an agent. Normal response codes: 200 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - agent_id: agent_id-path - admin_state_up: admin_state_up-request - description: description-request Request Example --------------- .. literalinclude:: samples/agents/agent-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - admin_state_up: admin_state_up - agent: agent - agent_type: agent_type - alive: alive - binary: binary - configurations: configurations - created_at: created_at - description: description - heartbeat_timestamp: heartbeat_timestamp - host: host - id: id - started_at: started_at - topic: topic Response Example ---------------- .. literalinclude:: samples/agents/agent-update-response.json :language: javascript Delete agent ============ .. rest_method:: DELETE /v2.0/agents/{agent_id} Agents that won't be used anymore can be removed. Before deleting agents via API, the agent should be stopped/disabled. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - agent_id: agent_id-path Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/bgpvpn-router_associations.inc0000666000175100017510000001331413231472055025322 0ustar zuulzuul00000000000000.. -*- rst -*- =================== Router Associations =================== Associating a BGPVPN to a Router can be done only for BGPVPN of type L3. The semantic is that all Subnets bound to the Router will be interconnected with the BGPVPN. A said Router can be associated with multiple BGPVPNs. Associating or disassociating a BGPVPN to a Router is done by manipulating a Router association API resource as a sub-resource of the BGPVPN resource: Advertising router extra routes to a BGPVPN =========================================== The ``bgpvpn-routes-control`` API extension allows to control the re-advertisement of a router extra routes in a BGPVPN ("extra routes" are routes defined in the ``routes`` attribute of a router when the ``extraroute`` extension is available). The ``advertise_extra_routes`` attribute can in this case be set on a router_association: - ``true``: the extra routes defined in the ``routes`` attribute of the router will be advertised to the BGPVPN (default value) - ``false``: the extra routes defined in the ``routes`` attribute of the router will **not** be advertised to the BGPVPN List Router Associations ========================= .. rest_method:: GET /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/router_associations Lists router associations for a given BGP VPN. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - router_associations: bgpvpn-router_associations - id: bgpvpn-router_association_id - router_id: bgpvpn-router_id - tenant_id: project_id - project_id: project_id Response Example ---------------- .. literalinclude:: samples/bgpvpn/router_associations/router_association-list-response.json :language: javascript Create Router Association ========================== .. rest_method:: POST /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/router_associations Creates a router association for a given BGP VPN Normal response codes: 201 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path - router_association: bgpvpn-router_association - router_id: bgpvpn-router_id Request Example --------------- .. literalinclude:: samples/bgpvpn/router_associations/router_association-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - router_association: bgpvpn-router_association - id: bgpvpn-router_association_id - router_id: bgpvpn-router_id - tenant_id: project_id - project_id: project_id Response Example ---------------- .. literalinclude:: samples/bgpvpn/router_associations/router_association-create-response.json :language: javascript Show Router Association details ================================ .. rest_method:: GET /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/router_associations/{router_association_id} Shows details for a router association. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path - router_association_id: bgpvpn-router_association_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - router_association: bgpvpn-router_association - id: bgpvpn-router_association_id - router_id: bgpvpn-router_id - tenant_id: project_id - project_id: project_id Response Example ---------------- .. literalinclude:: samples/bgpvpn/router_associations/router_association-show-response.json :language: javascript Update a Router Association ('bgpvpn-routes-control' extension) =============================================================== .. note:: This operation is only available when the ``bgpvpn-routes-control`` API extension is enabled. .. rest_method:: PUT /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/router_associations/{router_association_id} Updates a router association. Normal response codes: 201 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path - router_association_id: bgpvpn-router_association_id-path - router_association: bgpvpn-router_association - advertise_extra_routes: bgpvpn-advertise_extra_routes-request Request Example --------------- .. literalinclude:: samples/bgpvpn/router_associations/router_association-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - router_association: bgpvpn-router_association - id: bgpvpn-router_association_id - router_id: bgpvpn-router_id - project_id: project_id - advertise_extra_routes: bgpvpn-advertise_extra_routes Response Example ---------------- .. literalinclude:: samples/bgpvpn/router_associations/router_association-update-response.json :language: javascript Delete Router Association ========================== .. rest_method:: DELETE /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/router_associations/{router_association_id} Deletes a router association. Normal response codes: 204 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path - router_association_id: bgpvpn-router_association_id-path Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/bgpvpn-bgpvpns.inc0000666000175100017510000001376013231472055022707 0ustar zuulzuul00000000000000.. -*- rst -*- ======== BGP VPNs ======== A new BGPVPN resource is introduced. It contains a set of parameters for a BGP-based VPN. A BGPVPN is created by the admin and given to a tenant who can then associate it to Networks, Routers or Ports (the latter when the ``bgpvpn-routes-control`` extension is available). The BGP VPNs API lists, shows details for, creates, updates, and deletes BGP VPNs. List BGP VPNs ============= .. rest_method:: GET /v2.0/bgpvpn/bgpvpns Lists BGP VPNs to which the project has access. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 400, 401, 403 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - bgpvpns: bgpvpns - id: bgpvpn-id-body - name: bgpvpn-name-required - type: bgpvpn-type-required - route_distinguishers: bgpvpn-route_distinguishers-required - route_targets: bgpvpn-route_targets-required - import_targets: bgpvpn-import_targets-required - export_targets: bgpvpn-export_targets-required - networks: bgpvpn-networks-required - routers: bgpvpn-routers-required - ports: bgpvpn-ports - local_pref: bgpvpn-local_pref - vni: bgpvpn-vni-required - tenant_id: project_id - project_id: project_id Response Example ---------------- .. literalinclude:: samples/bgpvpn/bgpvpns/bgpvpns-list-response.json :language: javascript Create BGP VPNS =============== .. rest_method:: POST /v2.0/bgpvpn/bgpvpns Creates a BGP VPN. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn: bgpvpn - name: bgpvpn-name - route_distinguishers: bgpvpn-route_distinguishers - route_targets: bgpvpn-route_targets - import_targets: bgpvpn-import_targets - export_targets: bgpvpn-export_targets - local_pref: bgpvpn-local_pref-request - vni: bgpvpn-vni - tenant_id: tenant_id-request - project_id: project_id-request - type: bgpvpn-type Request Example --------------- .. literalinclude:: samples/bgpvpn/bgpvpns/bgpvpn-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - bgpvpn: bgpvpn - id: bgpvpn-id-body - name: bgpvpn-name-required - type: bgpvpn-type-required - route_targets: bgpvpn-route_targets-required - import_targets: bgpvpn-import_targets-required - export_targets: bgpvpn-export_targets-required - networks: bgpvpn-networks-required - routers: bgpvpn-routers-required - ports: bgpvpn-ports - local_pref: bgpvpn-local_pref - vni: bgpvpn-vni-required - tenant_id: project_id - project_id: project_id Response Example ---------------- .. literalinclude:: samples/bgpvpn/bgpvpns/bgpvpn-create-response.json :language: javascript Show BGP VPN details ==================== .. rest_method:: GET /v2.0/bgpvpn/bgpvpns/{bgpvpn_id} Shows details for a BGP VPN. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - bgpvpn: bgpvpn - id: bgpvpn-id-body - name: bgpvpn-name-required - type: bgpvpn-type-required - route_distinguishers: bgpvpn-route_distinguishers-required - route_targets: bgpvpn-route_targets-required - import_targets: bgpvpn-import_targets-required - export_targets: bgpvpn-export_targets-required - networks: bgpvpn-networks-required - routers: bgpvpn-routers-required - ports: bgpvpn-ports - local_pref: bgpvpn-local_pref - vni: bgpvpn-vni-required - tenant_id: project_id - project_id: project_id Response Example ---------------- .. literalinclude:: samples/bgpvpn/bgpvpns/bgpvpn-show-response.json :language: javascript Update a BGP VPN ================ .. rest_method:: PUT /v2.0/bgpvpn/bgpvpns/{bgpvpn_id} Updates a BGP VPN. Normal response codes: 201 Error response codes: 400, 401, 403, 404 Request ------- A non-admin user can only update the name parameter. All other updates require admin privileges. .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path - bgpvpn: bgpvpn - name: bgpvpn-name - route_distinguishers: bgpvpn-route_distinguishers - route_targets: bgpvpn-route_targets - import_targets: bgpvpn-import_targets - export_targets: bgpvpn-export_targets - local_pref: bgpvpn-local_pref-request Request Example --------------- .. literalinclude:: samples/bgpvpn/bgpvpns/bgpvpn-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - bgpvpn: bgpvpn - id: bgpvpn-id-body - name: bgpvpn-name-required - type: bgpvpn-type-required - route_distinguishers: bgpvpn-route_distinguishers-required - route_targets: bgpvpn-route_targets-required - import_targets: bgpvpn-import_targets-required - export_targets: bgpvpn-export_targets-required - networks: bgpvpn-networks-required - routers: bgpvpn-routers-required - ports: bgpvpn-ports - local_pref: bgpvpn-local_pref - vni: bgpvpn-vni-required - tenant_id: project_id - project_id: project_id Response Example ---------------- .. literalinclude:: samples/bgpvpn/bgpvpns/bgpvpn-update-response.json :language: javascript Delete BGP VPN ============== .. rest_method:: DELETE /v2.0/bgpvpn/bgpvpns/{bgpvpn_id} Deletes a BGP VPN and its network and/or router associations. Normal response codes: 204 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/routers.inc0000666000175100017510000003271313231472055021440 0ustar zuulzuul00000000000000.. -*- rst -*- ================= Routers (routers) ================= A ``router`` is a logical entity for forwarding packets across internal subnets and NATting them on external networks through an appropriate external gateway. This resource is provided when ``router`` extension is enabled. Extra routes extension (``extraroute``) ======================================= The extra route extension (``extraroute``) extends ``router`` resources adding a ``routes`` attribute that contains an array of route objects. Each route object has a ``destination`` and ``nexthop`` attribute representing the route. Router availability zone extension (``router_availability_zones``) ================================================================== The ``router_availability_zone`` extension adds the ``availability_zones`` and ``availability_zone_hints`` attributes to ``routers``, allowing scheduling based on availability zones and hints. This extension requires ``router`` and ``availability_zone`` extensions. List routers ============ .. rest_method:: GET /v2.0/routers Lists logical routers that the project who submits the request can access. Default policy settings return only those routers that the project who submits the request owns, unless an administrative user submits the request. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - routers: routers - id: router-id-body - tenant_id: project_id - project_id: project_id - name: name - description: description - admin_state_up: admin_state_up - status: router-status - external_gateway_info: router-external_gateway_info - network_id: router-network_id - enable_snat: router-enable_snat - external_fixed_ips: router-external_fixed_ips - revision_number: revision_number - routes: router-routes - destination: router-destination - nexthop: router-nexthop - distributed: router-distributed - ha: router-ha - availability_zone_hints: router-availability_zone_hints - availability_zones: router-availability_zones Response Example ---------------- .. literalinclude:: samples/routers/routers-list-response.json :language: javascript Create router ============= .. rest_method:: POST /v2.0/routers Creates a logical router. This operation creates a logical router. The logical router does not have any internal interface and it is not associated with any subnet. You can optionally specify an external gateway for a router at create time. The external gateway for the router must be plugged into an external network. An external network has its ``router:external`` extended field set to ``true``. To specify an external gateway, the ID of the external network must be passed in the ``network_id`` parameter of the ``external_gateway_info`` attribute in the request body. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - router: router - tenant_id: project_id-request - project_id: project_id-request - name: name-request - description: description-request - admin_state_up: admin_state_up-request - external_gateway_info: router-external_gateway_info-request - network_id: router-network_id - enable_snat: router-enable_snat-request - external_fixed_ips: router-external_fixed_ips-request - distributed: router-distributed-request - ha: router-ha-request - availability_zone_hints: router-availability_zone_hints-request Request Example --------------- .. literalinclude:: samples/routers/router-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - router: router - id: router-id-body - tenant_id: project_id - project_id: project_id - name: name - description: description - admin_state_up: admin_state_up - status: router-status - external_gateway_info: router-external_gateway_info - network_id: router-network_id - enable_snat: router-enable_snat - external_fixed_ips: router-external_fixed_ips - revision_number: revision_number - routes: router-routes - destination: router-destination - nexthop: router-nexthop - distributed: router-distributed - ha: router-ha - availability_zone_hints: router-availability_zone_hints - availability_zones: router-availability_zones Response Example ---------------- .. literalinclude:: samples/routers/router-create-response.json :language: javascript Show router details =================== .. rest_method:: GET /v2.0/routers/{router_id} Shows details for a router. Use the ``fields`` query parameter to control which fields are returned in the response body. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - router_id: router_id - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - router: router - id: router-id-body - tenant_id: project_id - project_id: project_id - name: name - description: description - admin_state_up: admin_state_up - status: router-status - external_gateway_info: router-external_gateway_info - network_id: router-network_id - enable_snat: router-enable_snat - external_fixed_ips: router-external_fixed_ips - revision_number: revision_number - routes: router-routes - destination: router-destination - nexthop: router-nexthop - distributed: router-distributed - ha: router-ha - availability_zone_hints: router-availability_zone_hints - availability_zones: router-availability_zones Response Example ---------------- .. literalinclude:: samples/routers/router-show-response.json :language: javascript Update router ============= .. rest_method:: PUT /v2.0/routers/{router_id} Updates a logical router. This operation does not enable the update of router interfaces. To update a router intreface, use the add router interface and remove router interface operations. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - router: router - external_gateway_info: router-external_gateway_info - enable_snat: router-enable_snat - name: name - admin_state_up: admin_state_up - external_fixed_ips: router-external_fixed_ips - router_id: router_id - description: description-request - routes: router-routes-request Request Example --------------- .. literalinclude:: samples/routers/router-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - router: router - id: router-id-body - tenant_id: project_id - project_id: project_id - name: name - description: description - admin_state_up: admin_state_up - status: router-status - external_gateway_info: router-external_gateway_info - network_id: router-network_id - enable_snat: router-enable_snat - external_fixed_ips: router-external_fixed_ips - revision_number: revision_number - routes: router-routes - destination: router-destination - nexthop: router-nexthop - distributed: router-distributed - ha: router-ha - availability_zone_hints: router-availability_zone_hints - availability_zones: router-availability_zones Response Example ---------------- .. literalinclude:: samples/routers/router-update-response.json :language: javascript Delete router ============= .. rest_method:: DELETE /v2.0/routers/{router_id} Deletes a logical router and, if present, its external gateway interface. This operation fails if the router has attached interfaces. Use the remove router interface operation to remove all router interfaces before you delete the router. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - router_id: router_id Response -------- There is no body content for the response of a successful DELETE request. Add interface to router ======================= .. rest_method:: PUT /v2.0/routers/{router_id}/add_router_interface Adds an internal interface to a logical router. This means a specified subnet is attached to a router as an internal router interface. Specify the ID of a subnet or port in the request body: - Subnet ID. The gateway IP address for the subnet is used as an IP address of the created router interface. - Port ID. The IP address associated with the port is used as an IP address of the created router interface. When you specify an IPv6 subnet, this operation adds the subnet to an existing internal port with same network ID, on the router. If a port with the same network ID does not exist, this operation creates a port on the router for that subnet. The limitation of one IPv4 subnet per router port remains, though a port can contain any number of IPv6 subnets that belong to the same network ID. When you use the ``port-create`` command to add a port and then call ``router-interface-add`` with this port ID, this operation adds the port to the router if the following conditions are met: - The port has no more than one IPv4 subnet. - The IPv6 subnets, if any, on the port do not have same network ID as the network ID of IPv6 subnets on any other ports. If you specify both subnet ID and port ID, this operation returns the ``Bad Request (400)`` response code. If the port is already in use, this operation returns the ``Conflict (409)`` response code. This operation returns a port ID that is either: - The same ID that is passed in the request body when a port is specified. - The ID of a port that this operation creates to attach the subnet to the router. After you run this operation, the operation sets: - The ``device_id`` attribute of this port to the router ID - The ``device_owner`` attribute to ``network:router_interface`` Normal response codes: 200 Error response codes: 400, 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - router_id: router_id - subnet_id: router-subnet_id-request - port_id: router-port_id-request Request Example --------------- .. literalinclude:: samples/routers/router-add-interface-request.json :language: javascript or .. literalinclude:: samples/routers/router-add-interface-request-with-port.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - id: router-id-body - subnet_id: router-subnet_id - subnet_ids: router-subnet_ids - tenant_id: router-project_id-interface - project_id: router-project_id-interface - port_id: router-port_id - network_id: router-network_id-interface Response Example ---------------- .. literalinclude:: samples/routers/router-add-interface-response.json :language: javascript Remove interface from router ============================ .. rest_method:: PUT /v2.0/routers/{router_id}/remove_router_interface Deletes an internal interface from a logical router. This operation deletes an internal router interface, which detaches a subnet from the router. If this subnet ID is the last subnet on the port, this operation deletes the port itself. You must specify either a subnet ID or port ID in the request body; the operation uses this value to identify which router interface to deletes. You can also specify both a subnet ID and port ID. If you specify both IDs, the subnet ID must correspond to the subnet ID of the first IP address on the port. Otherwise, this operation returns the ``Conflict (409)`` response code with information about the affected router and interface. If you try to delete the router interface for subnets that are used by one or more ``routes``, this operation returns the ``Conflict (409)`` response. In this case, you first need to delete such routes from the router. If the router or the subnet and port do not exist or are not visible to you, this operation returns the ``Not Found (404)`` response code. As a consequence of this operation, the operation removes the port connecting the router with the subnet from the subnet for the network. Normal response codes: 200 Error response codes: 400, 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - router_id: router_id - subnet_id: router-subnet_id-request - port_id: router-port_id-request Request Example --------------- .. literalinclude:: samples/routers/router-remove-interface-request.json :language: javascript or .. literalinclude:: samples/routers/router-remove-interface-request-with-port.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - id: router-id-body - subnet_id: router-subnet_id - subnet_ids: router-subnet_ids - tenant_id: router-project_id-interface - project_id: router-project_id-interface - port_id: router-port_id - network_id: router-network_id-interface Response Example ---------------- .. literalinclude:: samples/routers/router-remove-interface-response.json :language: javascript neutron-lib-1.13.0/api-ref/source/v2/vpnaas.inc0000666000175100017510000007164213231472055021231 0ustar zuulzuul00000000000000.. -*- rst -*- =================================================================================================================================================================================================== VPNaaS 2.0 (`UNMAINTAINED `_) (vpn, vpnservices, ikepolicies, ipsecpolicies, endpoint-groups, ipsec-site-connections) =================================================================================================================================================================================================== The Virtual-Private-Network-as-a-Service (VPNaaS) extension enables OpenStack projects to extend private networks across the public telecommunication infrastructure. This initial implementation of the VPNaaS extension provides: - Site-to-site VPN that connects two private networks. - Multiple VPN connections per project. - IKEv1 policy support with 3des, aes-128, aes-256, or aes-192 encryption. - IPSec policy support with 3des, aes-128, aes-192, or aes-256 encryption, sha1 authentication, ESP, AH, or AH-ESP transform protocol, and tunnel or transport mode encapsulation. - Dead Peer Detection (DPD) with hold, clear, restart, disabled, or restart-by-peer actions. This extension introduces these resources: - ``service``. A parent object that associates VPN with a specific subnet and router. - ``ikepolicy``. The Internet Key Exchange (IKE) policy that identifies the authentication and encryption algorithm to use during phase one and two negotiation of a VPN connection. - ``ipsecpolicy``. The IP security policy that specifies the authentication and encryption algorithm and encapsulation mode to use for the established VPN connection. - ``ipsec-site-connection``. Details for the site-to-site IPsec connection, including the peer CIDRs, MTU, authentication mode, peer address, DPD settings, and status. - ``endpoint-groups``. Defines one or more endpoints of a specific type, and can be used to specify both local and peer endpoints for IPSec Connections. List IKE policies ================= .. rest_method:: GET /v2.0/vpn/ikepolicies Lists IKE policies. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - ikepolicies: ikepolicies - name: name - description: description - tenant_id: project_id - project_id: project_id - auth_algorithm: auth_algorithm - encryption_algorithm: encryption_algorithm - pfs: pfs - value: value - phase1_negotiation_mode: phase1_negotiation_mode - units: units - lifetime: lifetime - id: ikepolicy_id-body-response - ike_version: ike_version Response Example ---------------- .. literalinclude:: samples/vpn/ikepolicies-list-response.json :language: javascript Create IKE policy ================= .. rest_method:: POST /v2.0/vpn/ikepolicies Creates an IKE policy. The IKE policy is used for phases one and two negotiation of the VPN connection. You can specify both the authentication and encryption algorithms for connections. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - ikepolicy: ikepolicy - name: name - description: description - tenant_id: project_id - project_id: project_id - auth_algorithm: auth_algorithm - encryption_algorithm: encryption_algorithm - pfs: pfs - value: value - phase1_negotiation_mode: phase1_negotiation_mode - units: units - lifetime: lifetime - ike_version: ike_version Request Example --------------- .. literalinclude:: samples/vpn/ikepolicy-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - ikepolicies: ikepolicies - ikepolicy: ikepolicy - name: name - description: description - tenant_id: project_id - project_id: project_id - auth_algorithm: auth_algorithm - encryption_algorithm: encryption_algorithm - pfs: pfs - value: value - phase1_negotiation_mode: phase1_negotiation_mode - units: units - lifetime: lifetime - id: ikepolicy_id-body-response - ike_version: ike_version Response Example ---------------- .. literalinclude:: samples/vpn/ikepolicy-create-response.json :language: javascript Show IKE policy details ======================= .. rest_method:: GET /v2.0/vpn/ikepolicies/{ikepolicy_id} Shows details for an IKE policy. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - ikepolicy_id: ikepolicy_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - ikepolicies: ikepolicies - ikepolicy: ikepolicy - name: name - description: description - tenant_id: project_id - project_id: project_id - auth_algorithm: auth_algorithm - encryption_algorithm: encryption_algorithm - pfs: pfs - value: value - phase1_negotiation_mode: phase1_negotiation_mode - units: units - lifetime: lifetime - id: ikepolicy_id-body-response - ike_version: ike_version Response Example ---------------- .. literalinclude:: samples/vpn/ikepolicy-show-response.json :language: javascript Update IKE policy ================= .. rest_method:: PUT /v2.0/vpn/ikepolicies/{ikepolicy_id} Updates policy settings in an IKE policy. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - ikepolicy_id: ikepolicy_id-path - ikepolicy: ikepolicy - description: description - auth_algorithm: auth_algorithm - name: name - encryption_algorithm: encryption_algorithm - pfs: pfs - value: value - phase1_negotiation_mode: phase1_negotiation_mode - units: units - lifetime: lifetime - ike_version: ike_version Request Example --------------- .. literalinclude:: samples/vpn/ikepolicy-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - ikepolicies: ikepolicies - ikepolicy: ikepolicy - description: description - tenant_id: project_id - project_id: project_id - auth_algorithm: auth_algorithm - name: name - encryption_algorithm: encryption_algorithm - pfs: pfs - value: value - phase1_negotiation_mode: phase1_negotiation_mode - units: units - lifetime: lifetime - id: ikepolicy_id-body-response - ike_version: ike_version Response Example ---------------- .. literalinclude:: samples/vpn/ikepolicy-update-response.json :language: javascript Remove IKE policy ================= .. rest_method:: DELETE /v2.0/vpn/ikepolicies/{ikepolicy_id} Removes an IKE policy. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - ikepolicy_id: ikepolicy_id-path Response -------- There is no body content for the response of a successful DELETE request. List IPSec policies =================== .. rest_method:: GET /v2.0/vpn/ipsecpolicies Lists all IPSec policies. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - ipsecpolicies: ipsecpolicies - description: description - tenant_id: project_id - project_id: project_id - auth_algorithm: auth_algorithm - encapsulation_mode: encapsulation_mode - encryption_algorithm: encryption_algorithm - pfs: pfs - value: value - transform_protocol: transform_protocol - units: units - lifetime: lifetime - id: ipsecpolicy_id-body-response - name: name Response Example ---------------- .. literalinclude:: samples/vpn/ipsecpolicies-list-response.json :language: javascript Create IPSec policy =================== .. rest_method:: POST /v2.0/vpn/ipsecpolicies Creates an IP security (IPSec) policy. The IPsec policy specifies the authentication and encryption algorithms and encapsulation mode to use for the established VPN connection. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - ipsecpolicy: ipsecpolicy - description: description - tenant_id: project_id - project_id: project_id - auth_algorithm: auth_algorithm - encapsulation_mode: encapsulation_mode - encryption_algorithm: encryption_algorithm - pfs: pfs - value: value - transform_protocol: transform_protocol - units: units - lifetime: lifetime - name: name Request Example --------------- .. literalinclude:: samples/vpn/ipsecpolicy-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - ipsecpolicies: ipsecpolicies - ipsecpolicy: ipsecpolicy - description: description - tenant_id: project_id - project_id: project_id - auth_algorithm: auth_algorithm - encapsulation_mode: encapsulation_mode - encryption_algorithm: encryption_algorithm - pfs: pfs - value: value - transform_protocol: transform_protocol - units: units - lifetime: lifetime - id: ipsecpolicy_id-body-response - name: name Response Example ---------------- .. literalinclude:: samples/vpn/ipsecpolicy-create-response.json :language: javascript Show IPSec policy ================= .. rest_method:: GET /v2.0/vpn/ipsecpolicies/{ipsecpolicy_id} Shows details for an IPSec policy. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - ipsecpolicy_id: ipsecpolicy_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - ipsecpolicies: ipsecpolicies - ipsecpolicy: ipsecpolicy - description: description - tenant_id: project_id - project_id: project_id - auth_algorithm: auth_algorithm - encapsulation_mode: encapsulation_mode - encryption_algorithm: encryption_algorithm - pfs: pfs - value: value - transform_protocol: transform_protocol - units: units - lifetime: lifetime - id: ipsecpolicy_id-body-response - name: name Response Example ---------------- .. literalinclude:: samples/vpn/ipsecpolicy-show-response.json :language: javascript Update IPSec policy =================== .. rest_method:: PUT /v2.0/vpn/ipsecpolicies/{ipsecpolicy_id} Updates policy settings in an IPSec policy. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - ipsecpolicy_id: ipsecpolicy_id-path - ipsecpolicy: ipsecpolicy - description: description - transform_protocol: transform_protocol - auth_algorithm: auth_algorithm - encapsulation_mode: encapsulation_mode - encryption_algorithm: encryption_algorithm - pfs: pfs - value: value - units: units - lifetime: lifetime - name: name Request Example --------------- .. literalinclude:: samples/vpn/ipsecpolicy-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - ipsecpolicies: ipsecpolicies - ipsecpolicy: ipsecpolicy - description: description - tenant_id: project_id - project_id: project_id - auth_algorithm: auth_algorithm - encapsulation_mode: encapsulation_mode - encryption_algorithm: encryption_algorithm - pfs: pfs - value: value - transform_protocol: transform_protocol - units: units - lifetime: lifetime - id: ipsecpolicy_id-body-response - name: name Response Example ---------------- .. literalinclude:: samples/vpn/ipsecpolicy-update-response.json :language: javascript Remove IPSec policy =================== .. rest_method:: DELETE /v2.0/vpn/ipsecpolicies/{ipsecpolicy_id} Removes an IPSec policy. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - ipsecpolicy_id: ipsecpolicy_id-path Response -------- There is no body content for the response of a successful DELETE request. List IPSec connections ====================== .. rest_method:: GET /v2.0/vpn/ipsec-site-connections Lists all IPSec connections. Use the ``fields`` query parameter to control which fields are returned in the response body. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - auth_mode: auth_mode - ikepolicy_id: ikepolicy_id-body-response - vpnservice_id: vpnservice_id-body-response - local_ep_group_id: local_ep_group_id - peer_address: peer_address - id: connection_id-body-response - route_mode: route_mode - ipsecpolicy_id: ipsecpolicy_id-body-response - peer_id: peer_id - status: ipsec_site_connection-status - psk: psk - description: description - initiator: initiator - peer_cidrs: peer_cidrs - name: name - admin_state_up: admin_state_up - tenant_id: project_id - project_id: project_id - interval: interval - mtu: mtu - peer_ep_group_id: peer_ep_group_id - dpd: dpd - timeout: ipsec_site_connection-timeout - action: ipsec_site_connection-action - local_id: local_id Response Example ---------------- .. literalinclude:: samples/vpn/ipsec-site-connections-list-response.json :language: javascript Create IPSec connection ======================= .. rest_method:: POST /v2.0/vpn/ipsec-site-connections Creates a site-to-site IPSec connection for a service. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - ipsec_site_connection: ipsec_site_connection - auth_mode: auth_mode - ikepolicy_id: ikepolicy_id-body-request - vpnservice_id: vpnservice_id-body-request - local_ep_group_id: local_ep_group_id - peer_address: peer_address - route_mode: route_mode - ipsecpolicy_id: ipsecpolicy_id-body-request - peer_id: peer_id - psk: psk - description: description - initiator: initiator - peer_cidrs: peer_cidrs - name: name - admin_state_up: admin_state_up - tenant_id: project_id - project_id: project_id - interval: interval - mtu: mtu - peer_ep_group_id: peer_ep_group_id - dpd: dpd - timeout: ipsec_site_connection-timeout - action: ipsec_site_connection-action - local_id: local_id Request Example --------------- .. literalinclude:: samples/vpn/ipsec-site-connection-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - ipsec_site_connection: ipsec_site_connection - auth_mode: auth_mode - ikepolicy_id: ikepolicy_id-body-response - vpnservice_id: vpnservice_id-body-response - local_ep_group_id: local_ep_group_id - peer_address: peer_address - id: connection_id-body-response - route_mode: route_mode - ipsecpolicy_id: ipsecpolicy_id-body-response - peer_id: peer_id - status: ipsec_site_connection-status - psk: psk - description: description - initiator: initiator - peer_cidrs: peer_cidrs - name: name - admin_state_up: admin_state_up - tenant_id: project_id - project_id: project_id - interval: interval - mtu: mtu - peer_ep_group_id: peer_ep_group_id - dpd: dpd - timeout: ipsec_site_connection-timeout - action: ipsec_site_connection-action - local_id: local_id Response Example ---------------- .. literalinclude:: samples/vpn/ipsec-site-connection-create-response.json :language: javascript Show IPSec connection ===================== .. rest_method:: GET /v2.0/vpn/ipsec-site-connections/{connection_id} Shows details for an IPSec connection. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - connection_id: connection_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - auth_mode: auth_mode - ikepolicy_id: ikepolicy_id-body-response - vpnservice_id: vpnservice_id-body-response - local_ep_group_id: local_ep_group_id - peer_address: peer_address - id: connection_id-body-response - ipsec_site_connection: ipsec_site_connection - route_mode: route_mode - ipsecpolicy_id: ipsecpolicy_id-body-response - peer_id: peer_id - status: ipsec_site_connection-status - psk: psk - description: description - initiator: initiator - peer_cidrs: peer_cidrs - name: name - admin_state_up: admin_state_up - tenant_id: project_id - project_id: project_id - interval: interval - mtu: mtu - peer_ep_group_id: peer_ep_group_id - dpd: dpd - timeout: ipsec_site_connection-timeout - action: ipsec_site_connection-action - local_id: local_id Response Example ---------------- .. literalinclude:: samples/vpn/ipsec-site-connection-show-response.json :language: javascript Update IPSec connection ======================= .. rest_method:: PUT /v2.0/vpn/ipsec-site-connections/{connection_id} Updates connection settings for an IPSec connection. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - connection_id: connection_id-path - ipsec_site_connection: ipsec_site_connection - psk: psk - initiator: initiator - description: description - admin_state_up: admin_state_up - interval: interval - peer_cidrs: peer_cidrs - mtu: mtu - peer_ep_group_id: peer_ep_group_id - local_ep_group_id: local_ep_group_id - dpd: dpd - timeout: ipsec_site_connection-timeout - action: ipsec_site_connection-action - peer_address: peer_address - peer_id: peer_id - name: name - local_id: local_id Request Example --------------- .. literalinclude:: samples/vpn/ipsec-site-connection-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - auth_mode: auth_mode - ikepolicy_id: ikepolicy_id-body-response - vpnservice_id: vpnservice_id-body-response - local_ep_group_id: local_ep_group_id - peer_address: peer_address - id: connection_id-body-response - ipsec_site_connection: ipsec_site_connection - route_mode: route_mode - ipsecpolicy_id: ipsecpolicy_id-body-response - peer_id: peer_id - status: ipsec_site_connection-status - psk: psk - description: description - initiator: initiator - peer_cidrs: peer_cidrs - name: name - admin_state_up: admin_state_up - tenant_id: project_id - project_id: project_id - interval: interval - mtu: mtu - peer_ep_group_id: peer_ep_group_id - dpd: dpd - timeout: ipsec_site_connection-timeout - action: ipsec_site_connection-action - local_id: local_id Response Example ---------------- .. literalinclude:: samples/vpn/ipsec-site-connection-update-response.json :language: javascript Remove IPSec connection ======================= .. rest_method:: DELETE /v2.0/vpn/ipsec-site-connections/{connection_id} Removes an IPSec connection. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - connection_id: connection_id-path Response -------- There is no body content for the response of a successful DELETE request. List VPN endpoint groups ======================== .. rest_method:: GET /v2.0/vpn/endpoint-groups Lists VPN endpoint groups. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - endpoints: endpoints - name: name - description: description - tenant_id: project_id - project_id: project_id - type: type - id: endpoint_group_id-body-response Response Example ---------------- .. literalinclude:: samples/vpn/vpn-endpoint-groups-list-response.json :language: javascript Create VPN endpoint group ========================= .. rest_method:: POST /v2.0/vpn/endpoint-groups Creates a VPN endpoint group. The endpoint group contains one or more endpoints of a specific type that you can use to create a VPN connections. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - tenant_id: project_id - project_id: project_id - endpoints: endpoints - type: type - description: description - name: name Request Example --------------- .. literalinclude:: samples/vpn/vpn-endpoint-group-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - endpoints: endpoints - description: description - tenant_id: project_id - project_id: project_id - type: type - id: endpoint_group_id-body-response - name: name Response Example ---------------- .. literalinclude:: samples/vpn/vpn-endpoint-group-create-response.json :language: javascript Show VPN endpoint group ======================= .. rest_method:: GET /v2.0/vpn/endpoint-groups/{endpoint_group_id} Shows details for a VPN endpoint group. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - endpoint_group_id: endpoint_group_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - endpoints: endpoints - description: description - tenant_id: project_id - project_id: project_id - type: type - id: endpoint_group_id-body-response - name: name Response Example ---------------- .. literalinclude:: samples/vpn/vpn-endpoint-group-show-response.json :language: javascript Update VPN endpoint group ========================= .. rest_method:: PUT /v2.0/vpn/endpoint-groups/{endpoint_group_id} Updates settings for a VPN endpoint group. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - description: description - name: name - endpoint_group_id: endpoint_group_id-path Request Example --------------- .. literalinclude:: samples/vpn/vpn-endpoint-group-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - endpoints: endpoints - description: description - tenant_id: project_id - project_id: project_id - type: type - id: endpoint_group_id-body-response - name: name Response Example ---------------- .. literalinclude:: samples/vpn/vpn-endpoint-group-update-response.json :language: javascript Remove VPN endpoint group ========================= .. rest_method:: DELETE /v2.0/vpn/endpoint-groups/{endpoint_group_id} Removes a VPN endpoint group. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - endpoint_group_id: endpoint_group_id-path Response -------- There is no body content for the response of a successful DELETE request. List VPN services ================= .. rest_method:: GET /v2.0/vpn/vpnservices Lists all VPN services. The list might be empty. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - vpnservices: vpnservices - router_id: router_id - status: vpnservice-status - name: name - external_v6_ip: external_v6_ip - admin_state_up: admin_state_up - subnet_id: subnet_id - tenant_id: project_id - project_id: project_id - external_v4_ip: external_v4_ip - id: vpnservice_id-body-response - description: description Response Example ---------------- .. literalinclude:: samples/vpn/vpnservices-list-response.json :language: javascript Create VPN service ================== .. rest_method:: POST /v2.0/vpn/vpnservices Creates a VPN service. The service is associated with a router. After you create the service, it can contain multiple VPN connections. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - vpnservice: vpnservice - router_id: router_id - description: description - admin_state_up: admin_state_up - subnet_id: subnet_id - tenant_id: project_id - project_id: project_id - name: name Request Example --------------- .. literalinclude:: samples/vpn/vpnservice-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - vpnservice: vpnservice - router_id: router_id - status: vpnservice-status - name: name - external_v6_ip: external_v6_ip - admin_state_up: admin_state_up - subnet_id: subnet_id - tenant_id: project_id - project_id: project_id - external_v4_ip: external_v4_ip - id: vpnservice_id-body-response - description: description Response Example ---------------- .. literalinclude:: samples/vpn/vpnservice-create-response.json :language: javascript Show VPN service details ======================== .. rest_method:: GET /v2.0/vpn/vpnservices/{service_id} Shows details for a VPN service. If the user is not an administrative user and the VPN service object does not belong to the tenant account for the user, the operation returns the ``Forbidden (403)`` response code. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - service_id: vpnservice_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - vpnservice: vpnservice - router_id: router_id - status: vpnservice-status - name: name - external_v6_ip: external_v6_ip - admin_state_up: admin_state_up - subnet_id: subnet_id - tenant_id: project_id - project_id: project_id - external_v4_ip: external_v4_ip - id: vpnservice_id-body-response - description: description Response Example ---------------- .. literalinclude:: samples/vpn/vpnservice-show-response.json :language: javascript Update VPN service ================== .. rest_method:: PUT /v2.0/vpn/vpnservices/{service_id} Updates a VPN service. Updates the attributes of a VPN service. You cannot update a service with a ``PENDING_*`` status. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - vpnservice: vpnservice - description: description - name: name - admin_state_up: admin_state_up - service_id: vpnservice_id-path Request Example --------------- .. literalinclude:: samples/vpn/vpnservice-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - vpnservice: vpnservice - router_id: router_id - status: vpnservice-status - name: name - external_v6_ip: external_v6_ip - admin_state_up: admin_state_up - subnet_id: subnet_id - tenant_id: project_id - project_id: project_id - external_v4_ip: external_v4_ip - id: vpnservice_id-body-response - description: description Response Example ---------------- .. literalinclude:: samples/vpn/vpnservice-update-response.json :language: javascript Remove VPN service ================== .. rest_method:: DELETE /v2.0/vpn/vpnservices/{service_id} Removes a VPN service. If the service has connections, the request is rejected. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - service_id: vpnservice_id-path Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/bgpvpn-port_associations.inc0000666000175100017510000001606713231472055024776 0ustar zuulzuul00000000000000================= Port Associations ================= .. note:: this feature is under development in the Queens release Port associations are available if the ``bgpvpn-routes-control`` extension is available. Associating or disassociating a BGPVPN to a Port is done by manipulating a Port association API resource as a sub-resource of the BGPVPN resource. The semantic behind this API call is a form of policy-based routing: the traffic from the given Port will be processed according to dataplane lookups specific to this Port. This means, in particular that Ports belonging to a given neutron network will possibly see a different L2 or L3 connectivity if they have different BGPVPN associations. When, a port association is defined for a given port, and at the same time, a network association is defined for the port's network, both associations are considered simultaneously active and the connectivity will be established between the port and the BGPVPNs in both associations. This is true also in the case where multiple associations are made, and for a router associations of a router connected to the port's network. Port routes =========== Additionally to providing Port-level granularity in the definition of BGPVPN connectivity, port associations also provide a way to control the advertisement of routes other than only the fixed IPs of neutron ports. So-called static routes are defined as follows: to indicate that prefix 20.1.0.0/16 is reachable via port A and should be advertised accordingly in BGPVPN X, a port association is defined between port A and BGPVPN X, with the ``routes`` attribute set to ``[ {'type': 'prefix', 'prefix': '20.1.0.0/16'} ]``. Route leaking of the routes of a given BGPVPN into another BGPVPN belonging to the same tenant, is supported similarily: to indicate that all the prefixes advertised to BGPVPN Y are reachable via port A (i.e. the routes tagged with at least an RT belonging to ``route_targets`` or ``import_targets`` of BGPVPN Y), and that they should be leaked into BGPVPN X, a port association is defined between port A and BGPVPN X, with the ``routes`` attribute set to ``[ {'type': 'bgpvpn', 'bgpvpn_id': } ]``. Control of BGP LOCAL_PREF attribute =================================== The BGP LOCAL_PREF for a specific route can be controlled to take a different value than the one defined in the BGPVPN ``local_pref`` attribute, by adding a ``'local_pref': VALUE`` in a route in the ``routes`` attribute (see example in port association Update request). List Port Associations ====================== .. rest_method:: GET /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/port_associations Lists port associations for a given BGP VPN. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - port_associations: bgpvpn-port_associations - id: bgpvpn-port_association_id - port_id: bgpvpn-port_id - project_id: project_id - routes: bgpvpn-routes - advertise_fixed_ips: bgpvpn-advertise_fixed_ips Response Example ---------------- .. literalinclude:: samples/bgpvpn/port_associations/port_association-list-response.json :language: javascript Create Port Association ======================= .. rest_method:: POST /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/port_associations Creates a port association for a given BGP VPN Normal response codes: 201 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path - port_association: bgpvpn-port_association - port_id: bgpvpn-port_id - routes: bgpvpn-routes-request - advertise_fixed_ips: bgpvpn-advertise_fixed_ips-request Request Example --------------- .. literalinclude:: samples/bgpvpn/port_associations/port_association-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - port_association: bgpvpn-port_association - id: bgpvpn-port_association_id - port_id: bgpvpn-port_id - project_id: project_id - routes: bgpvpn-routes - advertise_fixed_ips: bgpvpn-advertise_fixed_ips Response Example ---------------- .. literalinclude:: samples/bgpvpn/port_associations/port_association-create-response.json :language: javascript Show Port Association details ============================= .. rest_method:: GET /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/port_associations/{port_association_id} Shows details for a port association. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path - port_association_id: bgpvpn-port_association_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - port_association: bgpvpn-port_association - id: bgpvpn-port_association_id - port_id: bgpvpn-port_id - project_id: project_id - routes: bgpvpn-routes - advertise_fixed_ips: bgpvpn-advertise_fixed_ips Response Example ---------------- .. literalinclude:: samples/bgpvpn/port_associations/port_association-show-response.json :language: javascript Update a Port Association ========================= .. rest_method:: PUT /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/port_associations/{port_association_id} Updates a port Association. Normal response codes: 201 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path - port_association_id: bgpvpn-port_association_id-path - port_association: bgpvpn-port_association - routes: bgpvpn-routes-request - advertise_fixed_ips: bgpvpn-advertise_fixed_ips-request Request Example --------------- .. literalinclude:: samples/bgpvpn/port_associations/port_association-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - port_association: bgpvpn-port_association - id: bgpvpn-port_association_id - port_id: bgpvpn-port_id - project_id: project_id - routes: bgpvpn-routes - advertise_fixed_ips: bgpvpn-advertise_fixed_ips Response Example ---------------- .. literalinclude:: samples/bgpvpn/port_associations/port_association-update-response.json :language: javascript Delete Port Association ======================= .. rest_method:: DELETE /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/port_associations/{port_association_id} Deletes a port association. Normal response codes: 204 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - bgpvpn_id: bgpvpn-id-path - port_association_id: bgpvpn-port_association_id-path Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/rbac-policy.inc0000666000175100017510000001007713231472055022140 0ustar zuulzuul00000000000000.. -*- rst -*- ============= RBAC Policies ============= Lists, shows details for, creates, updates, and deletes RBAC policies. Show RBAC policy details ======================== .. rest_method:: GET /v2.0/rbac-policies/{rbac_policy_id} Show details for a given RBAC policy. You can control which response parameters are returned by using the fields query parameter. For information, see `Filtering and column selection `__. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - rbac_policy_id: rbac_policy_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - target_tenant: target_tenant - tenant_id: tenant_id - object_type: object_type - object_id: object_id - action: rbac_action - project_id: project_id - id: rbac_policy_id Response Example ---------------- .. literalinclude:: samples/rbac_policy/rbac-policy-show-response.json :language: javascript Update RBAC policy ================== .. rest_method:: PUT /v2.0/rbac-policies/{rbac_policy_id} Update RBAC policy for given tenant. Normal response codes: 200 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - rbac_policy_id: rbac_policy_id-path - target_tenant: target_tenant Request Example --------------- .. literalinclude:: samples/rbac_policy/rbac-policy-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - target_tenant: target_tenant - tenant_id: tenant_id - object_type: object_type - object_id: object_id - action: rbac_action - project_id: project_id - id: rbac_policy_id Response Example ---------------- .. literalinclude:: samples/rbac_policy/rbac-policy-update-response.json :language: javascript Delete RBAC policy ================== .. rest_method:: DELETE /v2.0/rbac-policies/{rbac_policy_id} Delete an RBAC policy. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - rbac_policy_id: rbac_policy_id-path Response -------- There is no body content for the response of a successful DELETE request. List RBAC policies ================== .. rest_method:: GET /v2.0/rbac-policies List RBAC policies that belong to a given tenant. Use the ``fields`` query parameter to filter the response. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - target_tenant: target_tenant - tenant_id: tenant_id - object_type: object_type - object_id: object_id - action: rbac_action - project_id: project_id - id: rbac_policy_id Response Example ---------------- .. literalinclude:: samples/rbac_policy/rbac-policies-list-response.json :language: javascript Create RBAC policy ================== .. rest_method:: POST /v2.0/rbac-policies Create RBAC policy for given tenant. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - target_tenant: target_tenant - object_type: object_type - object_id: object_id - action: rbac_action Request Example --------------- .. literalinclude:: samples/rbac_policy/rbac-policy-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - target_tenant: target_tenant - tenant_id: tenant_id - object_type: object_type - object_id: object_id - action: rbac_action - project_id: project_id - id: rbac_policy_id Response Example ---------------- .. literalinclude:: samples/rbac_policy/rbac-policy-create-response.json :language: javascript neutron-lib-1.13.0/api-ref/source/v2/parameters.yaml0000666000175100017510000047404513231472055022301 0ustar zuulzuul00000000000000 # variables in header # variables in path agent_id-path: description: | The ID of the agent. in: path required: true type: string bgpvpn-id-path: description: | The ID of the BGP VPN. in: path required: true type: string bgpvpn-network_association_id-path: description: | The ID of an association between a network and a BGP VPN. in: path required: true type: string bgpvpn-port_association_id-path: description: | The ID of an association between a port and a BGP VPN. in: path required: true type: string bgpvpn-router_association_id-path: description: | The ID of an association between a router and a BGP VPN. in: path required: true type: string connection_id-path: description: | The ID of the IPSec site-to-site connection. in: path required: false type: string dscp_rule_id: description: | The ID of the DSCP rule. in: path required: true type: string endpoint_group_id-path: description: | The ID of the VPN endpoint group. in: path required: false type: string extensions-alias-path: description: | The alias of an extension. in: path required: true type: string firewall_group_id-path-required: description: | The ID of the firewall group. in: path required: true type: string firewall_id: description: | The ID of the firewall. in: path required: true type: string firewall_log_id: description: | The ID of the firewall log resource. in: path required: true type: string firewall_policy_id-path: description: | The ID of the firewall policy. in: path required: true type: string firewall_policy_id-path-required: description: | The ID of the firewall policy. in: path required: true type: string firewall_rule_id: description: | The ID for the firewall rule. in: path required: true type: string firewall_rule_id-path-required: description: | The ID for the firewall rule. in: path required: true type: string flavor_id: description: | The UUID of the flavor. in: path required: true type: string floatingip-id-path: description: | The ID of the floating IP address. in: path required: true type: string health_monitor_id-path: description: | The ID for the health monitor. in: path required: true type: string healthmonitor_id-path: description: | The ID for the health monitor. in: path required: true type: string ikepolicy_id-path: description: | The ID of the IKE policy. in: path required: true type: string ipsecpolicy_id-path: description: | The ID of the IPSec policy. in: path required: false type: string listener-id-path: description: | The ID of the listener. in: path required: true type: string loadbalancer-id-path: description: | The ID of the load balancer. in: path required: true type: string log_id-path: description: | The ID of the log resource. in: path required: true type: string logging_resource_id: description: | The ID of the logging resource. in: path required: true type: string member_id-path: description: | The ID for the member. in: path required: true type: string metering_label-id-path: description: | The ID of the metering label. in: path required: true type: string metering_label_rule-id-path: description: | The ID of the metering label rule. in: path required: true type: string network_id-path: description: | The ID of the network. in: path required: true type: string pool_id-path: description: | The ID for the pool. in: path required: true type: string pool_id-request: description: | The ID for the pool. in: path required: true type: string port_id-path: description: | The ID of the port. in: path required: true type: string profile_id: description: | The UUID of the service profile. in: path required: true type: string project_id-path: description: | The ID of the project. in: path required: true type: string qos-policy-id-path: description: | The ID of the QoS policy. in: path required: true type: string qos-rule_id: description: | The ID of the QoS rule. in: path required: true type: string qos-rule_type: description: | The name of the QoS rule type. It should be one of the types returned by the List QoS rule types API, for example ``bandwidth_limit`` or ``dscp_marking``. in: path required: true type: string rbac_policy_id-path: description: | The ID of the RBAC policy. in: path required: true type: integer resource_id: description: | The ID of resource which the tag is set on. in: path required: true type: string resource_type: description: | The type of resource which the tag is set on. in: path required: true type: string router_id: description: | The ID of the router. in: path required: true type: string security_group-id-path: description: | The ID of the security group. in: path required: true type: string security_group_rule-id-path: description: | The ID of the security group rule. in: path required: true type: string segment_id-path: description: | The UUID of the segment. in: path required: true type: string subnet_id-path: description: | The ID of the subnet. in: path required: true type: string subnetpool_id: description: | The UUID of the subnet pool. in: path required: true type: string tag: description: | The name for the tag. in: path required: true type: string trunk_id: description: | The ID of the trunk. in: path required: true type: string vip_id-path: description: | The ID for the VIP. in: path required: true type: string vpnservice_id-path: description: | The ID of the VPN service. in: path required: false type: string # variables in query fields: description: | The fields that you want the server to return. If no ``fields`` query parameter is specified, the networking API returns all attributes allowed by the policy settings. By using ``fields`` parameter, the API returns only the requested set of attributes. ``fields`` parameter can be specified multiple times. For example, if you specify ``fields=id&fields=name`` in the request URL, only ``id`` and ``name`` attributes will be returned. in: query required: false type: string verbose: description: | Show detailed information. in: query required: false type: boolean # variables in body action: description: | The action that the API performs on traffic that matches the firewall rule. Valid value is ``allow`` or ``deny``. Default is ``deny``. in: body required: false type: string action-response: description: | The action that the API performs on traffic that matches the firewall rule. Valid value is ``allow``, ``deny`` or ``reject``. Default is ``deny``. in: body required: true type: string action_2: description: | The action that the API performs on traffic that matches the firewall rule. Value is ``allow`` or ``deny``. in: body required: true type: string address: description: | The IP address of the member. format: ipv4 in: body required: true type: string address_scope_id: description: | An address scope to assign to the subnet pool. in: body required: false type: string address_scope_id_1: description: | The address scope. in: body required: true type: string admin_state_up: description: | The administrative state of the resource, which is up (``true``) or down (``false``). in: body required: true type: boolean admin_state_up-request: description: | The administrative state of the resource, which is up (``true``) or down (``false``). Default is ``true``. in: body required: false type: boolean admin_state_up_1: description: | The administrative status of the port, which is up (``true``) or down (``false``). in: body required: false type: boolean admin_state_up_10: description: | The administrative state of the VIP. A valid value is up (``true``) or down (``false``). in: body required: false type: boolean admin_state_up_11: description: | The administrative state of the VPN service, which is up (``true``) or down (``false``). If down, connections on service are not active. in: body required: false type: boolean admin_state_up_12: description: | The administrative state of the firewall, which is up (``true``) or down (``false``). in: body required: true type: boolean admin_state_up_13: description: | The administrative state of the health monitor, which is up (``true``) or down (``false``). in: body required: false type: boolean admin_state_up_14: description: | The administrative state of the IPSec connection, which is up (``true``) or down (``false``). If down, the connection does not forward packets. in: body required: true type: boolean admin_state_up_15: description: | The administrative state of the listener, which is up (``true``) or down (``false``). in: body required: true type: boolean admin_state_up_16: description: | The administrative state of the load balancer, which is up (``true``) or down (``false``). in: body required: true type: boolean admin_state_up_17: description: | The administrative state of the member. A valid value is up (``true``) or down (``false``). in: body required: true type: boolean admin_state_up_19: description: | The administrative state of the pool, which is up (``true``) or down (``false``). in: body required: true type: boolean admin_state_up_20: description: | The administrative state of the router, which is up (``true``) or down (``false``). in: body required: true type: boolean admin_state_up_21: description: | The administrative state of the VIP. A valid value is up (``true``) or down (``false``). in: body required: true type: boolean admin_state_up_22: description: | The administrative state of the VPN service, which is up (``true``) or down (``false``). If down, the port does not forward packets. in: body required: true type: boolean admin_state_up_23: description: | The administrative state of the firewall, which is up (``true``) or down (``false``). in: body required: false type: boolean admin_state_up_24: description: | The administrative state of the health monitor. A valid value is up (``true``) or down (``false``). in: body required: false type: boolean admin_state_up_25: description: | The administrative state of the load balancer, which is up (``true``) or down (``false``). Set this attribute to ``false`` to create the listener in an administratively down state. in: body required: false type: boolean admin_state_up_26: description: | The administrative state of the IPSec connection, which is up (``true``) or down (``false``). If down, the connection does not forward packets. in: body required: false type: boolean admin_state_up_3: description: | The administrative state of the port, which is up (``true``) or down (``false``). in: body required: true type: boolean admin_state_up_4: description: | The administrative state of the load balancer, which is up (``true``) or down (``false``). in: body required: false type: boolean admin_state_up_5: description: | The administrative state of the member, which is up (``true``) or down (``false``). in: body required: true type: boolean admin_state_up_6: description: | The administrative state of the member. A valid value is up (``true``) or down (``false``). in: body required: false type: boolean admin_state_up_7: description: | The administrative state of the network, which is up (``true``) or down (``false``). in: body required: false type: boolean admin_state_up_8: description: | The administrative state of the pool. A valid value is up (``true``) or down (``false``). in: body required: false type: boolean admin_state_up_9: description: | The administrative state of the router, which is up (``true``) or down (``false``). in: body required: false type: boolean admin_state_up_trunk: description: | The administrative state of the trunk, which is up (``true``) or down (``false``). in: body required: false type: boolean agent: description: | An ``agent`` object. in: body required: true type: object agent_type: description: | The type of agent such as ``Open vSwitch agent`` or ``DHCP agent``. in: body required: true type: string agents: description: | A list of ``agent`` objects. in: body required: true type: array alias: description: | The alias for the extension. For example, "FOXNSOX", "os- availability-zone", "os-extended-quotas", "os- share-unmanage" or "os-used-limits." in: body required: true type: string alive: description: | Indicates the agent is alive and running. in: body required: true type: boolean allowed_address_pairs: description: | A set of zero or more allowed address pair objects each where address pair object contains an ``ip_address`` and ``mac_address``. While the ``ip_address`` is required, the ``mac_address`` will be taken from the port if not specified. The value of ``ip_address`` can be an IP Address or a CIDR (if supported by the underlying extension plugin). A server connected to the port can send a packet with source address which matches one of the specified allowed address pairs. in: body required: true type: array allowed_address_pairs-request: description: | A set of zero or more allowed address pair objects each where address pair object contains an ``ip_address`` and ``mac_address``. While the ``ip_address`` is required, the ``mac_address`` will be taken from the port if not specified. The value of ``ip_address`` can be an IP Address or a CIDR (if supported by the underlying extension plugin). A server connected to the port can send a packet with source address which matches one of the specified allowed address pairs. in: body required: false type: array audited: description: | Each time that the firewall policy or its associated rules are changed, the API sets this attribute to ``false``. To audit the policy, explicitly set this attribute to ``true``. in: body required: true type: boolean audited_1: description: | Indicates whether the policy has been audited. Each time that the firewall policy or its associated rules are changed, the API sets this attribute to ``false``. To audit the policy, the policy owner must explicitly update the policy to set this attribute to ``true``. in: body required: true type: boolean auth_algorithm: description: | The authentication hash algorithm. Valid values are ``sha1``, ``sha256``, ``sha384``, ``sha512``. The default is ``sha1``. in: body required: false type: string auth_mode: description: | The authentication mode. A valid value is ``psk``, which is the default. in: body required: false type: string availability_zone_hints: description: | The availability zone candidate for the network. in: body required: true type: array availability_zones: description: | The availability zone for the network. in: body required: true type: array bandwidth_limit_rule: description: | A ``bandwidth_limit_rule`` object. in: body required: true type: object bandwidth_limit_rules: description: | A list of bandwidth limit rules associated with the QoS policy. in: body required: true type: array bgpvpn: description: | A ``bgpvpn`` object represents an MPLS network with which Neutron routers and/or networks may be associated in: body required: true type: object bgpvpn-advertise_extra_routes: description: | Boolean flag controlling whether or not the routes specified in the ``routes`` attribute of the router will be advertised to the BGPVPN. in: body required: true type: boolean bgpvpn-advertise_extra_routes-request: description: | Boolean flag controlling whether or not the routes specified in the ``routes`` attribute of the router will be advertised to the BGPVPN (default: true). in: body required: false type: boolean bgpvpn-advertise_fixed_ips: description: | Boolean flag controlling whether or not the fixed IPs of a port will be advertised to the BGPVPN. in: body required: true type: boolean bgpvpn-advertise_fixed_ips-request: description: | Boolean flag controlling whether or not the fixed IPs of a port will be advertised to the BGPVPN (default: true). in: body required: false type: boolean bgpvpn-export_targets: description: | Additional Route Targets that will be used for export. in: body required: false type: array bgpvpn-export_targets-required: description: | Additional Route Targets that will be used for export. in: body required: true type: array bgpvpn-id-body: description: | The ID of the BGP VPN. in: body required: true type: string bgpvpn-import_targets: description: | Additional Route Targets that will be imported. in: body required: false type: array bgpvpn-import_targets-required: description: | Additional Route Targets that will be imported. in: body required: true type: array bgpvpn-local_pref: description: | The default BGP LOCAL_PREF of routes that will be advertised to the BGPVPN (unless overriden per-route). in: body required: true type: integer bgpvpn-local_pref-request: description: | The default BGP LOCAL_PREF of routes that will be advertised to the BGPVPN (unless overriden per-route). Defaults to ``null``. in: body required: false type: integer bgpvpn-name: description: | The user meaningful name of the BGP VPN. in: body required: false type: string bgpvpn-name-required: description: | The user meaningful name of the BGP VPN. in: body required: true type: string bgpvpn-network_association: description: | A ``network_association`` object represents the binding of a BGP VPN to a Neutron network. in: body required: true type: object bgpvpn-network_association_id: description: | The ID of an association between a network and a BGP VPN. in: body required: true type: string bgpvpn-network_associations: description: | A list of ``network_association`` objects which represent bindings of MPLS networks to Neutron networks. in: body required: true type: object bgpvpn-network_id: description: | The ID of a Neutron network with which to associate the BGP VPN. in: body required: true type: string bgpvpn-networks: description: | This read-only list of network IDs reflects the associations defined by Network association API resources. in: body required: false type: array bgpvpn-networks-required: description: | This read-only list of network IDs reflects the associations defined by Network association API resources. in: body required: true type: array bgpvpn-port_association: description: | A ``port_association`` object represents the binding of a BGP VPN to a Neutron port. in: body required: true type: object bgpvpn-port_association_id: description: | The ID of an association between a port and a BGP VPN. in: body required: true type: string bgpvpn-port_associations: description: | A list of ``port_association`` objects which represent bindings of MPLS networks to Neutron ports. in: body required: true type: array bgpvpn-port_id: description: | The ID of a Neutron port with which to associate the BGP VPN. in: body required: true type: string bgpvpn-ports: description: | This read-only list of port IDs reflects the associations defined by Port association API resources (only present if the ``bgpvpn-routes-control`` API extension is enabled). in: body required: true type: array bgpvpn-route_distinguishers: description: | List of route distinguisher strings. If this parameter is specified, one of these RDs will be used to advertise VPN routes. in: body required: false type: array bgpvpn-route_distinguishers-required: description: | List of route distinguisher strings. If this parameter is specified, one of these RDs will be used to advertise VPN routes. in: body required: true type: array bgpvpn-route_targets: description: | Route Targets that will be both imported and used for export. in: body required: false type: array bgpvpn-route_targets-required: description: | Route Targets that will be both imported and used for export. in: body required: true type: array bgpvpn-router_association: description: | A ``router_association`` object represents the binding of a BGP VPN to a Neutron router. in: body required: true type: object bgpvpn-router_association_id: description: | The ID of an association between a router and a BGP VPN. in: body required: true type: string bgpvpn-router_associations: description: | A list of ``router_association`` objects which represent bindings of MPLS networks to Neutron routers. in: body required: true type: object bgpvpn-router_id: description: | The ID of a Neutron router with which to associate the BGP VPN. in: body required: true type: string bgpvpn-routers: description: | This read-only list of router IDs reflects the associations defined by Router association API resources. in: body required: false type: array bgpvpn-routers-required: description: | This read-only list of router IDs reflects the associations defined by Router association API resources. in: body required: true type: array bgpvpn-routes: description: | List of routes, each route being a dict with at least a ``type`` key, which can be ``prefix`` or ``bgpvpn``. For the ``prefix`` type, the IP prefix (v4 or v6) to advertise is specified in the ``prefix`` key. For the ``bgpvpn`` type, the ``bgpvpn_id`` key specifies the BGPVPN from which routes will be readvertised with the association port as the nexthop (any route carrying an RT among ``route_targets`` or ``import_targets`` of this BGPVPN, will be re-announced toward the RTs of the associated BGPVPN (``export_targets`` + ``route_targets``), with their next-hop/label pointing to this port). For both types, the ``local_pref`` key can be used to control the value of the BGP LOCAL_PREF of the routes that will be advertised. in: body required: true type: array bgpvpn-routes-request: description: | List of routes, each route being a dict with at least a ``type`` key, which can be ``prefix`` or ``bgpvpn``. For the ``prefix`` type, the IP prefix (v4 or v6) to advertise is specified in the ``prefix`` key. For the ``bgpvpn`` type, the ``bgpvpn_id`` key specifies the BGPVPN from which routes will be readvertised with the association port as the nexthop (any route carrying an RT among ``route_targets`` or ``import_targets`` of this BGPVPN, will be re-announced toward the RTs of the associated BGPVPN (``export_targets`` + ``route_targets``), with their next-hop/label pointing to this port). For both types, the ``local_pref`` key can be used to control the value of the BGP LOCAL_PREF of the routes that will be advertised. in: body required: false type: array bgpvpn-type: description: | Selection of the type of VPN and the technology behind it. Allowed values are ``l2`` or ``l3``. The default is l3. ``l2`` indicates a Layer 2 (i.e. bridged) attachment and ``l3`` indicates a Layer 3 (i.e. routed) attachment. in: body required: false type: string bgpvpn-type-required: description: | Selection of the type of VPN and the technology behind it. Allowed values are ``l2`` or ``l3``. The default is l3. ``l2`` indicates a Layer 2 (i.e. bridged) attachment and ``l3`` indicates a Layer 3 (i.e. routed) attachment. in: body required: true type: string bgpvpn-vni: description: | The globally-assigned VXLAN ``vni`` for the BGP VPN. in: body required: false type: integer bgpvpn-vni-required: description: | The globally-assigned VXLAN ``vni`` for the BGP VPN. in: body required: true type: integer bgpvpns: description: | A list of ``bgpvpn`` objects. Each ``bgpvpn`` object represents an MPLS network with which Neutron routers and/or networks may be associated in: body required: true type: array binary: description: | The executable command used to start the agent such as ``neutron-openvswitch-agent`` or ``neutron-dhcp-agent``. in: body required: true type: string binding:host_id: description: | The ID of the host where the port resides. in: body required: true type: string binding:host_id-request: description: | The ID of the host where the port resides. The default is an empty string. in: body required: false type: string binding:profile: description: | A dictionary that enables the application running on the specific host to pass and receive vif port information specific to the networking back-end. The networking API does not define a specific format of this field. in: body required: true type: string binding:profile-request: description: | A dictionary that enables the application running on the specific host to pass and receive vif port information specific to the networking back-end. The networking API does not define a specific format of this field. The default is an empty dictionary. in: body required: false type: string binding:vif_details: description: | A dictionary which contains additional information on the port. Currently the following fields are defined: ``port_filter`` and ``ovs_hybrid_plug``. ``port_filter`` is a boolean indicating the networking service provides port filtering features such as security group and/or anti MAC/IP spoofing. ``ovs_hybrid_plug`` is a boolean used to inform an API consumer like nova that the hybrid plugging strategy for OVS should be used. in: body required: true type: object binding:vif_type: description: | The type of which mechanism is used for the port. An API consumer like nova can use this to determine an appropriate way to attach a device (for example an interface of a virtual server) to the port. Available values currently defined includes ``ovs``, ``bridge``, ``macvtap``, ``hw_veb``, ``hostdev_physical``, ``vhostuser``, ``distributed`` and ``other``. There are also special values: ``unbound`` and ``binding_failed``. ``unbound`` means the port is not bound to a networking back-end. ``binding_failed`` means an error that the port failed to be bound to a networking back-end. in: body required: true type: string binding:vnic_type: description: | The type of vNIC which this port should be attached to. This is used to determine which mechanism driver(s) to be used to bind the port. The valid values are ``normal``, ``macvtap``, ``direct``, ``baremetal``, ``direct-physical`` and ``virtio-forwarder``. What type of vNIC is actually available depends on deployments. in: body required: true type: string binding:vnic_type-request: description: | The type of vNIC which this port should be attached to. This is used to determine which mechanism driver(s) to be used to bind the port. The valid values are ``normal``, ``macvtap``, ``direct``, ``baremetal``, ``direct-physical`` and ``virtio-forwarder``. What type of vNIC is actually available depends on deployments. The default is ``normal``. in: body required: false type: string cidr: description: | The CIDR of the subnet. in: body required: true type: string configurations: description: | An object containing configuration specific key/value pairs; the semantics of which are determined by the binary name and type. in: body required: true type: object connection_id-body-response: description: | The ID of the IPSec site-to-site connection. in: body required: false type: string connection_limit: description: | The maximum number of connections permitted for this load balancer. Default is infinite. in: body required: false type: integer connection_limit-response: description: | The maximum number of connections allowed for the VIP. Value is ``-1`` if the limit is not set. Default is infinite. in: body required: true type: integer connection_limit_2: description: | The maximum number of connections permitted for this load balancer. Default is infinite. in: body required: true type: integer connection_limit_3: description: | The maximum number of connections allowed for the VIP. Default is ``-1``, meaning no limit. in: body required: true type: integer created_at: description: | Time at which the resource was created. in: body required: true type: string created_at_1: description: | Time at which subnetpool has been created. in: body required: true type: string created_at_resource: description: | Time at which the resource has been created (in UTC ISO8601 format). in: body required: true type: string data_plane_status: description: | Status of the underlying data plane of a port. in: body required: true type: string data_plane_status-request: description: | Status of the underlying data plane of a port. in: body required: false type: string default: description: | Defines whether the provider is the default for the service type. If this value is ``true``, the provider is the default. If this value is ``false``, the provider is not the default. in: body required: true type: boolean default_pool_id: description: | The ID of default pool. Must have compatible protocol with listener. in: body required: false type: string default_pool_id-response: description: | The ID of default pool. Must have compatible protocol with listener. in: body required: true type: string default_prefixlen: description: | The size of the prefix to allocate when the ``cidr`` or ``prefixlen`` attributes are omitted when you create the subnet. Default is ``min_prefixlen``. in: body required: false type: integer default_prefixlen_1: description: | The size of the prefix to allocate when the ``cidr`` or ``prefixlen`` attributes are omitted when you create the subnet. in: body required: true type: integer default_quota: description: | A per-project quota on the prefix space that can be allocated from the subnet pool for project subnets. Default is no quota is enforced on allocations from the subnet pool. For IPv4 subnet pools, ``default_quota`` is measured in units of /32. For IPv6 subnet pools, ``default_quota`` is measured units of /64. All projects that use the subnet pool have the same prefix quota applied. in: body required: false type: integer default_quota_1: description: | A per-project quota on the prefix space that can be allocated from the subnet pool for project subnets. For IPv4 subnet pools, ``default_quota`` is measured in units of /32. For IPv6 subnet pools, ``default_quota`` is measured units of /64. All projects that use the subnet pool have the same prefix quota applied. in: body required: true type: integer default_quota_2: description: | A per-project quota on the prefix space that can be allocated from the subnet pool for project subnets. Default is no quota is enforced on allocations from the subnet pool. For IPv4 subnet pools, ``default_quota`` is measured in units of /32. For IPv6 subnet pools, ``default_quota`` is measured units of /64. All projects that use the subnet pool have the same prefix quota applied. Updating this parameter has no effect on existing subnet allocations. The existing subnet allocations for each project are counted against the updated prefix space quota. in: body required: false type: integer default_tls_container_ref: description: | A reference to a container of TLS secrets. in: body required: false type: string default_tls_container_ref-response: description: | A reference to a container of TLS secrets. in: body required: true type: string delay: description: | The time, in seconds, between sending probes to members. in: body required: true type: integer delay_1: description: | The amount of time, in seconds, between sending probes to members. in: body required: true type: integer delay_2: description: | The amount of time, in seconds, between sending probes to members. in: body required: false type: integer description: description: | A human-readable description for the resource. in: body required: true type: string description-request: description: | A human-readable description for the resource. Default is an empty string. in: body required: false type: string description-request-put: description: | A human-readable description for the resource. in: body required: false type: string description_1: description: | A human-readable description for the firewall rule. The maximum length is 1024 characters. No default. in: body required: false type: string description_10: description: | The QoS policy description. in: body required: false type: string description_11: description: | A human-readable description for the pool. in: body required: false type: string description_12: description: | The security group description. in: body required: false type: string description_13: description: | A human-readable description for the service profile. in: body required: false type: string description_14: description: | A human-readable description for the VIP. in: body required: false type: string description_15: description: | A human-readable description for the VPN endpoint group. in: body required: false type: string description_16: description: | A human-readable description for the VPN service. in: body required: false type: string description_17: description: | A human-readable description for the firewall policy. in: body required: true type: string description_18: description: | The extension description. in: body required: true type: string description_19: description: | A human-readable description for the firewall rule. in: body required: true type: string description_2: description: | A human-readable description for the firewall service. in: body required: false type: string description_20: description: | A human-readable description for the firewall service. in: body required: true type: string description_21: description: | A human-readable description for the flavor. in: body required: true type: string description_22: description: | A human-readable description for the IKE policy. in: body required: true type: string description_23: description: | A human-readable description for the IPSec connection. in: body required: true type: string description_24: description: | Detailed description of the listener. in: body required: true type: string description_25: description: | The load balancer description. in: body required: true type: string description_26: description: | Description for the metering label. in: body required: true type: string description_27: description: | The description of the QoS policy. in: body required: true type: string description_28: description: | The description for the pool. in: body required: true type: string description_29: description: | The security group description. in: body required: true type: string description_3: description: | A human-readable description for the flavor. in: body required: false type: string description_30: description: | A human-readable description for the service profile. in: body required: true type: string description_31: description: | A human-readable description for the VIP. in: body required: true type: string description_32: description: | A human-readable description for the VPN endpoint group. in: body required: true type: string description_33: description: | A human-readable description for the VPN service. in: body required: true type: string description_34: description: | New human-readable description for the flavor. in: body required: false type: string description_35: description: | Security group description. in: body required: false type: string description_4: description: | A human-readable description for the IKE policy. in: body required: false type: string description_5: description: | A human-readable description for the IPSec policy. in: body required: true type: string description_6: description: | A human-readable description for the IPSec connection. in: body required: false type: string description_7: description: | Detailed description of the listener. in: body required: false type: string description_8: description: | The load balancer description. in: body required: false type: string description_9: description: | The description for the metering label. in: body required: false type: string description_resource: description: | The description for the resource. in: body required: true type: string destination_firewall_group_id-body-optional: description: | The ID of the remote destination firewall group. in: body required: false type: string destination_firewall_group_id-body-required: description: | The ID of the remote destination firewall group. in: body required: true type: string destination_ip_address: description: | The destination IPv4 or IPv6 address or CIDR. No default. in: body required: false type: string destination_ip_address-response: description: | The destination IPv4 or IPv6 address or CIDR. No default. in: body required: true type: string destination_ip_address_1: description: | The destination IPv4 or IPv6 address or CIDR. in: body required: true type: string destination_port: description: | The destination port or port range. A valid value is a port number, as an integer, or a port range, in the format of a ``:`` separated range. For a port range, include both ends of the range. For example, ``80:90``. in: body required: false type: string destination_port-response: description: | The destination port or port range. A valid value is a port number, as an integer, or a port range, in the format of a ``:`` separated range. For a port range, include both ends of the range. For example, ``80:90``. in: body required: true type: string destination_port_1: description: | The destination port or port range. in: body required: true type: string device_id: description: | The ID of the device that uses this port. For example, a server instance or a logical router. in: body required: true type: string device_id-request: description: | The ID of the device that uses this port. For example, a server instance or a logical router. in: body required: false type: string device_owner: description: | The entity type that uses this port. For example, ``compute:nova`` (server instance), ``network:dhcp`` (DHCP agent) or ``network:router_interface`` (router interface). in: body required: true type: string device_owner-request: description: | The entity type that uses this port. For example, ``compute:nova`` (server instance), ``network:dhcp`` (DHCP agent) or ``network:router_interface`` (router interface). in: body required: false type: string direction: description: | Ingress or egress, which is the direction in which the metering rule is applied. in: body required: true type: string direction_1: description: | Ingress or egress: The direction in which the security group rule is applied. For a compute instance, an ingress security group rule is applied to incoming (ingress) traffic for that instance. An egress rule is applied to traffic leaving the instance. in: body required: true type: string direction_2: description: | Ingress or egress: the direction in which the security group rule is applied. For a compute instance, an ingress security group rule is applied to incoming (ingress) traffic for that instance. An egress rule is applied to traffic leaving the instance. in: body required: true type: string dns_assignment: description: | Data assigned to a port by the Networking internal DNS including the ``hostname``, ``ip_address`` and ``fqdn``. in: body required: true type: object dns_domain: description: | A valid DNS domain. in: body required: true type: string dns_domain-request: description: | A valid DNS domain. in: body required: false type: string dns_name: description: | A valid DNS name. in: body required: true type: string dns_name-request: description: | A valid DNS name. in: body required: false type: string dpd: description: | A dictionary with dead peer detection (DPD) protocol controls. in: body required: false type: object driver: description: | Provider driver to use for this profile. Example: ``neutron_lbaas.drivers.octavia.driver.OctaviaDriver`` in: body required: false type: string driver_1: description: | Driver to associate with profile. in: body required: true type: string driver_2: description: | Provider driver to use for this profile. Ex: neutron_lbaas.drivers.octavia.driver.OctaviaDriver. in: body required: false type: string dscp_mark: description: | The DSCP mark value. in: body required: false type: integer dscp_mark-response: description: | The DSCP mark value. in: body required: true type: integer dscp_marking_rule: description: | A ``dscp_marking_rule`` object. in: body required: true type: object dscp_marking_rules: description: | A list of ``dscp_marking_rule`` objects. in: body required: true type: array egress_firewall_policy_id-body-optional: description: | The ID of the egress firewall policy for the firewall group. in: body required: false type: string egress_firewall_policy_id-body-required: description: | The ID of the egress firewall policy for the firewall group. in: body required: true type: string enabled: description: | Set to ``false`` to disable this rule in the firewall policy. Facilitates selectively turning off rules without having to disassociate the rule from the firewall policy. Valid value is ``true`` or ``false``. Default is ``true``. in: body required: false type: boolean enabled-body-required: description: | Indicates whether this resource is enabled or disabled. in: body required: true type: boolean enabled-response: description: | Set to ``false`` to disable this rule in the firewall policy. Facilitates selectively turning off rules without having to disassociate the rule from the firewall policy. Valid value is ``true`` or ``false``. Default is ``true``. in: body required: true type: boolean enabled_1: description: | Indicates whether this flavor is enabled or disabled. Default ``true``. in: body required: false type: boolean enabled_2: description: | Indicates whether this service profile is enabled or disabled. Default ``true``. in: body required: false type: boolean enabled_3: description: | Indicates whether this rule is enabled or disabled in the firewall policy. in: body required: true type: boolean enabled_4: description: | Indicates whether this flavor is enabled or disabled. in: body required: true type: boolean enabled_5: description: | Indicates whether this service profile is enabled or disabled. in: body required: true type: boolean enabled_6: description: | Indicates whether this flavor is enabled or disabled. in: body required: false type: boolean enabled_7: description: | Indicates whether this service profile is enabled or disabled. Default true. in: body required: false type: boolean encapsulation_mode: description: | The encapsulation mode. A valid value is ``tunnel`` or ``transport``. Default is ``tunnel``. in: body required: false type: string encryption_algorithm: description: | The encryption algorithm. A valid value is ``3des``, ``aes-128``, ``aes-192``, ``aes-256``, and so on. Default is ``aes-128``. in: body required: false type: string endpoint_group_id-body-response: description: | The ID of the VPN endpoint group. in: body required: true type: string endpoints: description: | List of endpoints of the same type, for the endpoint group. The values will depend on type. in: body required: true type: array ethertype: description: | Must be IPv4 or IPv6, and addresses represented in CIDR must match the ingress or egress rules. in: body required: false type: string ethertype_1: description: | Must be IPv4 or IPv6, and addresses represented in CIDR must match the ingress or egress rules. in: body required: true type: string excluded: description: | Indicates whether to count the traffic of a specific IP address with the ``remote_ip_prefix`` value. Default is ``false``. in: body required: false type: boolean 'excluded ': description: | Indicates whether to count the traffic of a specific IP address with the ``remote_ip_prefix`` value. Default is ``false``. in: body required: true type: boolean expected_codes: description: | The list of HTTP status codes expected in response from the member to declare it healthy. Specify one of the following values: - A single value, such as ``200`` - A list, such as ``200, 202`` - A range, such as ``200-204`` The default is 200. in: body required: false type: string expected_codes-response: description: | The list of HTTP status codes expected in response from the member to declare it healthy. Specify one of the following values: - A single value, such as ``200`` - A list, such as ``200, 202`` - A range, such as ``200-204`` The default is 200. in: body required: true type: string extension: description: | An ``extension`` object. in: body required: true type: object extension-alias-body: description: | The alias for the extension. For example "quotas" or "security-group". in: body required: true type: string extension-description: description: | The human-readable description for the resource. in: body required: true type: string extension-links: description: | List of links related to the extension. in: body required: true type: array extension-name: description: | Human-readable name of the resource. in: body required: true type: string extension-updated: description: | The date and timestamp when the extension was last updated. in: body required: true type: string extensions: description: | A list of ``extension`` objects. in: body required: true type: array external_v4_ip: description: | Read-only external (public) IPv4 address that is used for the VPN service. The VPN plugin sets this address if an IPv4 interface is available. in: body required: true type: string external_v6_ip: description: | Read-only external (public) IPv6 address that is used for the VPN service. The VPN plugin sets this address if an IPv6 interface is available. in: body required: true type: string extra_dhcp_opts: description: | A set of zero or more extra DHCP option pairs. An option pair consists of an option value and name. in: body required: true type: array extra_dhcp_opts-request: description: | A set of zero or more extra DHCP option pairs. An option pair consists of an option value and name. in: body required: false type: array firewall: description: | A ``firewall`` object. in: body required: true type: object firewall-status: description: | The status of the firewall service. Values are ``ACTIVE``, ``INACTIVE``, ``ERROR``, ``DOWN``, ``PENDING_CREATE``, ``PENDING_UPDATE``, or ``PENDING_DELETE``. in: body required: true type: string firewall_audited-body-required: description: | Each time that the firewall policy or its associated rules are changed, the API sets this attribute to ``false``. To audit the policy, explicitly set this attribute to ``true``. in: body required: true type: boolean firewall_group_admin_state_up-body-optional: description: | The administrative state of the firewall group, which is up (``true``) or down (``false``). Default is ``true``. in: body required: false type: boolean firewall_group_admin_state_up-body-required: description: | The administrative state of the firewall group, which is up (``true``) or down (``false``). Default is ``true``. in: body required: true type: boolean firewall_group_description-body-optional: description: | A human-readable description of the firewall group. in: body required: false type: object firewall_group_description-body-required: description: | A human-readable description of the firewall group. in: body required: true type: object firewall_group_id-body-required: description: | The ID of the firewall group. in: body required: true type: string firewall_group_list-body-required: description: | A list of the IDs of firewall groups associated with the firewall policy. in: body required: true type: array firewall_group_name-body-optional: description: | A human-readable name for the firewall group. in: body required: false type: string firewall_group_name-body-required: description: | A human-readable name for the firewall group. in: body required: true type: string firewall_group_object: description: | A ``firewall_group`` object. in: body required: true type: object firewall_group_ports-body-optional: description: | A list of the IDs of the ports associated with the firewall group. in: body required: false type: array firewall_group_ports-body-required: description: | A list of the IDs of the ports associated with the firewall group. in: body required: true type: array firewall_group_shared-body-optional: description: | Indicates whether this firewall group is shared across all projects. in: body required: false type: boolean firewall_group_shared-body-required: description: | Indicates whether this firewall group is shared across all projects. in: body required: true type: boolean firewall_group_status-body-optional: description: | The status of the firewall group. Valid values are ``ACTIVE``, ``INACTIVE``, ``ERROR``, ``PENDING_UPDATE``, or ``PENDING_DELETE``. in: body required: false type: string firewall_group_status-body-required: description: | The status of the firewall group. Valid values are ``ACTIVE``, ``INACTIVE``, ``ERROR``, ``PENDING_UPDATE``, or ``PENDING_DELETE``. in: body required: true type: string firewall_groups_object: description: | A list of ``firewall_group`` objects. in: body required: true type: array firewall_id-body: description: | The ID of the FWaaS v1 firewall. in: body required: true type: string firewall_list: description: | A list of the IDs of firewalls associated with the firewall policy. in: body required: true type: array firewall_log: description: | A ``firewall_log`` object. in: body required: true type: object firewall_log_id-body: description: | The ID of the firewall log resource. in: body required: true type: string firewall_logs: description: | A list of ``firewall_log`` objects. in: body required: true type: array firewall_policies: description: | A list of ``firewall_policy`` objects. in: body required: true type: array firewall_policies_object: description: | A list of ``firewall_policy`` objects. in: body required: true type: array firewall_policy: description: | A ``firewall_policy`` object. in: body required: true type: object firewall_policy_audited-body-optional: description: | Each time that the firewall policy or its associated rules are changed, the API sets this attribute to ``false``. To audit the policy, explicitly set this attribute to ``true``. in: body required: false type: boolean firewall_policy_audited-body-required: description: | Each time that the firewall policy or its associated rules are changed, the API sets this attribute to ``false``. To audit the policy, explicitly set this attribute to ``true``. in: body required: true type: boolean firewall_policy_description-body-optional: description: | A human-readable name of the firewall policy. in: body required: false type: string firewall_policy_description-body-required: description: | A human-readable name of the firewall policy. in: body required: true type: string firewall_policy_id: description: | Read-only attribute that the API populates with the ID of the firewall policy when you associate this firewall rule with a policy. You can associate a firewall rule with one policy at a time. You can update this association can to a different firewall policy. If you do not associate the rule with any policy, this attribute is ``null``. in: body required: false type: string firewall_policy_id-body: description: | The ID of the policy that is associated with the firewall. in: body required: true type: string firewall_policy_id-body-required: description: | The ID of the firewall policy. in: body required: true type: string firewall_policy_id_3: description: | The ID of the policy that is associated with the firewall. in: body required: false type: string firewall_policy_id_description-body-optional: description: | A human-readable description of the firewall policy. in: body required: false type: string firewall_policy_id_description-body-required: description: | A human-readable description of the firewall policy. in: body required: true type: string firewall_policy_name-body-optional: description: | A human-readable name of the firewall policy. in: body required: false type: string firewall_policy_name-body-required: description: | A human-readable name of the firewall policy. in: body required: true type: string firewall_policy_object: description: | A ``firewall_policy`` object. in: body required: true type: object firewall_policy_shared-body-optional: description: | Set to ``true`` to make this firewall policy visible to other projects. Default is ``false``. in: body required: false type: boolean firewall_policy_shared-body-required: description: | Set to ``true`` to make this firewall policy visible to other projects. Default is ``false``. in: body required: true type: boolean firewall_rule: description: | A ``firewall_rule`` object. in: body required: true type: object firewall_rule_action-body-optional: description: | The action that the API performs on traffic that matches the firewall rule. Valid values are ``allow`` or ``deny``. Default is ``deny``. in: body required: false type: string firewall_rule_action-body-required: description: | The action that the API performs on traffic that matches the firewall rule. Valid values are ``allow`` or ``deny``. Default is ``deny``. in: body required: true type: string firewall_rule_description-body-optional: description: | A human-readable description of the firewall rule. in: body required: false type: string firewall_rule_description-body-required: description: | A human-readable description of the firewall rule. in: body required: true type: string firewall_rule_destination_ip_address-body-optional: description: | The destination IPv4 or IPv6 address or CIDR for the firewall rule. No default. in: body required: false type: string firewall_rule_destination_ip_address-body-required: description: | The destination IPv4 or IPv6 address or CIDR for the firewall rule. No default. in: body required: true type: string firewall_rule_destination_port-body-optional: description: | The destination port or port range for the firewall rule. A valid value is a port number, as an integer, or a port range, in the format of a ``:`` separated range. For a port range, include both ends of the range. For example, ``80:90``. in: body required: false type: string firewall_rule_destination_port-body-required: description: | The destination port or port range for the firewall rule. A valid value is a port number, as an integer, or a port range, in the format of a ``:`` separated range. For a port range, include both ends of the range. For example, ``80:90``. in: body required: true type: string firewall_rule_enabled-body-optional: description: | Set to ``false`` to disable this rule in the firewall policy. Facilitates selectively turning off rules without having to disassociate the rule from the firewall policy. Valid values are ``true`` or ``false``. Default is ``true``. in: body required: false type: boolean firewall_rule_enabled-body-required: description: | Set to ``false`` to disable this rule in the firewall policy. Facilitates selectively turning off rules without having to disassociate the rule from the firewall policy. Valid values are ``true`` or ``false``. Default is ``true``. in: body required: true type: boolean firewall_rule_id-body: description: | The ID of the firewall rule. in: body required: true type: string firewall_rule_id-body-required: description: | The ID of the firewall rule. in: body required: true type: string firewall_rule_insert_after-body-required: description: | The ID of the firewall_rule to insert the new rule after. The new rule will be inserted immediately after the specified firewall_rule. If both ``before`` and ``after`` values are supplied, the ``after`` value will be ignored. To insert a rule into a policy with no rules yet, the both the ``before`` and the ``after`` values must be "". in: body required: true type: string firewall_rule_insert_before-body-required: description: | The ID of the firewall_rule to insert the new rule before. The new rule will be inserted immediately before the specified firewall_rule. If both ``before`` and ``after`` values are supplied, the ``after`` value will be ignored. To insert a rule into a policy with no rules yet, the both the ``before`` and the ``after`` values must be "". in: body required: true type: string firewall_rule_ip_version-body-optional: description: | The IP protocol version for the firewall rule. Valid values are ``4`` or ``6``. Default is ``4``. in: body required: false type: integer firewall_rule_ip_version-body-required: description: | The IP protocol version for the firewall rule. Valid values are ``4`` or ``6``. Default is ``4``. in: body required: true type: integer firewall_rule_name-body-optional: description: | A human-readable name of the firewall rule. in: body required: false type: string firewall_rule_name-body-required: description: | A human-readable name of the firewall rule. in: body required: true type: string firewall_rule_object: description: | A ``firewall_rule`` object. in: body required: true type: object firewall_rule_position-body-optional: description: | Read-only attribute that the API assigns to this rule when it associates it with a firewall policy. This value indicates the position of this rule in that firewall policy. This position number starts at 1. If the firewall rule is not associated with any policy, the position is ``null``. in: body required: false type: integer firewall_rule_position-body-required: description: | Read-only attribute that the API assigns to this rule when it associates it with a firewall policy. This value indicates the position of this rule in that firewall policy. This position number starts at 1. If the firewall rule is not associated with any policy, the position is ``null``. in: body required: true type: integer firewall_rule_protocol-body-optional: description: | The IP protocol for the firewall rule. Possible values are ``icmp``, ``tcp``, ``udp``, or ``null``. in: body required: false type: string firewall_rule_protocol-body-required: description: | The IP protocol for the firewall rule. Possible values are ``icmp``, ``tcp``, ``udp``, or ``null``. in: body required: true type: string firewall_rule_shared-body-optional: description: | Indicates whether this firewall rule is shared across all projects. in: body required: false type: boolean firewall_rule_shared-body-required: description: | Indicates whether this firewall rule is shared across all projects. in: body required: true type: boolean firewall_rule_source_ip_address-body-optional: description: | The source IPv4 or IPv6 address or CIDR for the firewall rule. No default. in: body required: false type: string firewall_rule_source_ip_address-body-required: description: | The source IPv4 or IPv6 address or CIDR for the firewall rule. No default. in: body required: true type: string firewall_rule_source_port-body-optional: description: | The source port or port range for the firewall rule. A valid value is a port number, as an integer, or a port range, in the format of a ``:`` separated range. For a port range, include both ends of the range. For example, ``80:90``. in: body required: false type: string firewall_rule_source_port-body-required: description: | The source port or port range for the firewall rule. A valid value is a port number, as an integer, or a port range, in the format of a ``:`` separated range. For a port range, include both ends of the range. For example, ``80:90``. in: body required: true type: string firewall_rules: description: | A list of the IDs for firewall rule associated with the firewall policy. in: body required: true type: array firewall_rules-body-optional: description: | A list of the IDs of the firewall rules associated with the firewall policy. in: body required: false type: array firewall_rules-body-required: description: | A list of the IDs of the firewall rules associated with the firewall policy. in: body required: true type: array firewall_rules_id: description: | A list of rules to associate with the firewall policy. in: body required: false type: array firewall_rules_object: description: | A list of ``firewall_rule`` objects. in: body required: true type: object firewalls: description: | A list of ``firewall_rule`` objects. in: body required: true type: array firewalls_1: description: | A list of ``firewall`` objects. in: body required: true type: array fixed_ips: description: | The IP addresses for the port. If the port has multiple IP addresses, this field has multiple entries. Each entry consists of IP address (``ip_address``) and the subnet ID from which the IP address is assigned (``subnet_id``). in: body required: true type: array fixed_ips-request: description: | The IP addresses for the port. If you would like to assign multiple IP addresses for the port, specify multiple entries in this field. Each entry consists of IP address (``ip_address``) and the subnet ID from which the IP address is assigned (``subnet_id``). * If you specify both a subnet ID and an IP address, OpenStack Networking tries to allocate the IP address on that subnet to the port. * If you specify only a subnet ID, OpenStack Networking allocates an available IP from that subnet to the port. * If you specify only an IP address, OpenStack Networking tries to allocate the IP address if the address is a valid IP for any of the subnets on the specified network. in: body required: false type: array flavor: description: | A ``flavor`` object. in: body required: true type: object flavor-description: description: | The human-readable description for the flavor. in: body required: true type: string flavor-description-request: description: | The human-readable description for the flavor. in: body required: false type: string flavor-enabled: description: | Indicates whether the flavor is enabled or not. Default is true. in: body required: true type: boolean flavor-enabled-request: description: | Indicates whether the flavor is enabled or not. Default is true. in: body required: false type: boolean flavor-id: description: | The ID of the flavor. in: body required: true type: string flavor-id-request: description: | The ID of the flavor. in: body required: false type: string flavor-id-response: description: | The ID of the flavor. in: body required: true type: string flavor-name: description: | Name of the flavor. in: body required: true type: string flavor-name-request: description: | Name of the flavor. in: body required: false type: string flavor-service_profiles: description: | Service profile UUIDs associated with this flavor. in: body required: true type: array flavor-service_profiles-request: description: | Service profile UUIDs associated with this flavor. in: body required: false type: array flavor-service_type: description: | Service type for the flavor. Example: LOADBALANCERV2. in: body required: true type: string flavor_1: description: | The UUID of a flavor. in: body required: false type: string flavor_2: description: | The UUID of a flavor if set. in: body required: false type: string flavors: description: | A list of ``flavor`` objects. in: body required: true type: array floating_ip_address: description: | The floating IP address. in: body required: true type: string floating_ip_address-request: description: | The floating IP address. in: body required: false type: string floating_network_id: description: | The ID of the network associated with the floating IP. in: body required: true type: string floatingip: description: | A ``floatingip`` object. When you associate a floating IP address with a VM, the instance has the same public IP address each time that it boots, basically to maintain a consistent IP address for maintaining DNS assignment. in: body required: true type: object floatingip-fixed_ip_address: description: | The fixed IP address that is associated with the floating IP address. in: body required: true type: string floatingip-fixed_ip_address-request: description: | The fixed IP address that is associated with the floating IP. If an internal port has multiple associated IP addresses, the service chooses the first IP address unless you explicitly define a fixed IP address in the ``fixed_ip_address`` parameter. in: body required: false type: string floatingip-id: description: | The ID of the floating IP address. in: body required: true type: string floatingip-port_id: description: | The ID of a port associated with the floating IP. in: body required: true type: string floatingip-port_id-post-request: description: | The ID of a port associated with the floating IP. To associate the floating IP with a fixed IP at creation time, you must specify the identifier of the internal port. in: body required: false type: string floatingip-port_id-put-request: description: | The ID of a port associated with the floating IP. To associate the floating IP with a fixed IP, you must specify the ID of the internal port. To disassociate the floating IP, ``null`` should be specified. in: body required: true type: string floatingip-router_id: description: | The ID of the router for the floating IP. in: body required: true type: string floatingip-status: description: | The status of the floating IP. Values are ``ACTIVE``, ``DOWN`` and ``ERROR``. in: body required: true type: string floatingip-subnet_id: description: | The subnet ID on which you want to create the floating IP. in: body required: false type: string floatingips: description: | A list of ``floatingip`` objects. in: body required: true type: array fw_event: description: | Type of firewall events to log. ``ACCEPT``, ``DROP``, or ``ALL``. in: body required: true type: string fw_event-request: description: | Type of firewall events to log. ``ACCEPT``, ``DROP``, or ``ALL``. Default is ``ALL``. in: body required: false type: string fw_event-request-put: description: | Type of firewall events to log. ``ACCEPT``, ``DROP``, or ``ALL``. in: body required: false type: string health_monitor: description: | A ``health_monitor`` object. in: body required: true type: object health_monitor-id: description: | The ID of the associated health monitor. in: body required: true type: string health_monitors-obj: description: | A list of ``health_monitor`` objects. in: body required: true type: array health_monitors-request: description: | List of health monitors to be associated with the pool. The default is an empty list. in: body required: false type: array health_monitors-response: description: | List of health monitors that are associated with the pool. in: body required: true type: array health_monitors_status: description: | The statuses of the health monitors that are associated with the pool. in: body required: true type: string healthmonitor: description: | A ``healthmonitor`` object. in: body required: true type: object healthmonitor-id: description: | The UUID of the health monitor. in: body required: false type: string healthmonitors-obj: description: | A list of ``healthmonitor`` objects. in: body required: true type: array healthmonitors-request: description: | List of health monitors to be associated with the pool. The default is an empty list. in: body required: false type: array healthmonitors-response: description: | List of health monitors that are associated with the pool. in: body required: true type: array healthmonitors_status: description: | A list of ``healthmonitors_status`` objects, one per healthmonitor that contains a ``monitor_id``, ``status`` and ``status_description`` in: body required: true type: array heartbeat_timestamp: description: | Time at which the last heartbeat was received. in: body required: true type: string host: description: | The hostname of the system the agent is running on. in: body required: true type: string http_method: description: | The HTTP method that the monitor uses for requests. in: body required: true type: string http_method-request: description: | The HTTP method that the monitor uses for requests. The default is ``GET``. in: body required: false type: string id: description: | The ID of the resource. in: body required: true type: string id_1: description: | The UUID of the port. in: body required: true type: string id_12: description: | The UUID of the listener. in: body required: true type: string id_14: description: | The UUID for the member. in: body required: true type: string id_15: description: | The UUID for the metering label rule. in: body required: true type: string id_16: description: | The UUID of the metering label. in: body required: true type: string id_17: description: | The UUID of the network. in: body required: true type: string id_19: description: | The UUID for the pool. in: body required: true type: string id_2: description: | The UUID for the health monitor. in: body required: true type: string id_20: description: | The UUID of the security group rule. in: body required: true type: string id_21: description: | The UUID of the subnet pool. in: body required: true type: string id_22: description: | The UUID for the VIP. in: body required: true type: string id_25: description: | The UUID of network. in: body required: true type: string id_26: description: | The UUID of the security group. in: body required: true type: string id_3: description: | The UUID of the QoS policy rule. in: body required: true type: string id_4: description: | The UUID for the firewall policy. in: body required: true type: string id_5: description: | The generated UUID for the firewall rule object. in: body required: true type: string id_6: description: | The UUID for the firewall service. in: body required: true type: string id_7: description: | The UUID of the flavor. in: body required: true type: string id_9: description: | The UUID for the IKE policy. in: body required: true type: string id_resource: description: | The ID for the resource. in: body required: true type: string ike_version: description: | The IKE version. A valid value is ``v1`` or ``v2``. Default is ``v1``. in: body required: false type: string ikepolicies: description: | A list of ``ikepolicy`` objects. in: body required: true type: array ikepolicy: description: | An ``ikepolicy`` object. in: body required: true type: object ikepolicy_id-body-request: description: | The ID of the IKE policy. in: body required: false type: string ikepolicy_id-body-response: description: | The ID of the IKE policy. in: body required: true type: string ingress_firewall_policy_id-body-optional: description: | The ID of the ingress firewall policy for the firewall group. in: body required: false type: string ingress_firewall_policy_id-body-required: description: | The ID of the ingress firewall policy for the firewall group. in: body required: true type: string initiator: description: | Indicates whether this VPN can only respond to connections or both respond to and initiate connections. A valid value is ``response- only`` or ``bi-directional``. Default is ``bi-directional``. in: body required: false type: string insert_after: description: | The ID of the firewall_rule. A new firewall_rule will be inserted after this firewall_rule. in: body required: false type: string insert_before: description: | The ID of the firewall_rule. A new firewall_rule will be inserted before this firewall_rule. in: body required: false type: string interval: description: | The dead peer detection (DPD) interval, in seconds. A valid value is a positive integer. Default is 30. in: body required: false type: integer interval_1: description: | The dead peer detection (DPD) interval, in seconds. A valid value is a positive integer. Default is 30. in: body required: true type: integer ip_address: description: | The IP address of an allowed address pair. in: body required: false type: string ip_address_1: description: | The fixed IP address of the port. in: body required: true type: string ip_version: description: | The IP protocol version. Valid value is ``4`` or ``6``. Default is ``4``. in: body required: false type: integer ip_version-response: description: | The IP protocol version. Valid value is ``4`` or ``6``. Default is ``4``. in: body required: true type: integer ip_version_1: description: | The IP address family of the list of prefixes passed to the ``prefixes`` attribute. in: body required: true type: integer ip_version_3: description: | The IP version (4 or 6) of the subnet. in: body required: true type: integer ipsec_site_connection: description: | An ``ipsec_site_connection`` object. in: body required: true type: object ipsec_site_connection-action: description: | The dead peer detection (DPD) action. A valid value is ``clear``, ``hold``, ``restart``, ``disabled``, or ``restart-by-peer``. Default value is ``hold``. in: body required: true type: string ipsec_site_connection-status: description: | Indicates whether the IPSec connection is currently operational. Values are ``ACTIVE``, ``DOWN``, ``BUILD``, ``ERROR``, ``PENDING_CREATE``, ``PENDING_UPDATE``, or ``PENDING_DELETE``. in: body required: true type: string ipsec_site_connection-timeout: description: | The dead peer detection (DPD) timeout in seconds. A valid value is a positive integer that is greater than the DPD ``interval`` value. Default is 120. in: body required: true type: integer ipsecpolicies: description: | A list of ``ipsecpolicy`` objects. in: body required: true type: array ipsecpolicy: description: | An ``ipsecpolicy`` object. in: body required: true type: object ipsecpolicy_id-body-request: description: | The ID of the IPSec policy. in: body required: false type: string ipsecpolicy_id-body-response: description: | The ID of the IPSec policy. in: body required: true type: string lb_algorithm: description: | The load-balancer algorithm, which is round-robin (``ROUND_ROBIN``), least-connections (``LEAST_CONNECTIONS``), source IP (``SOURCE_IP``), and so on, that is used to distribute traffic to the pool members. This value, which must be supported, is dependent on the load-balancer provider. The round-robin algorithm must be supported. in: body required: true type: string lb_method: description: | The load-balancer algorithm, which is round-robin (``ROUND_ROBIN``), least-connections (``LEAST_CONNECTIONS``), source IP (``SOURCE_IP``), and so on, that is used to distribute traffic to the pool members. This value, which must be supported, is dependent on the load-balancer provider. The round-robin algorithm must be supported. in: body required: true type: string lb_method-request-put: description: | The load-balancer algorithm, which is round-robin (``ROUND_ROBIN``), least-connections (``LEAST_CONNECTIONS``), source IP (``SOURCE_IP``), and so on, that is used to distribute traffic to the pool members. This value, which must be supported, is dependent on the load-balancer provider. The round-robin algorithm must be supported. in: body required: false type: string lifetime: description: | The lifetime of the security association. The lifetime consists of a unit and integer value. You can omit either the unit or value portion of the lifetime. Default unit is seconds and default value is 3600. in: body required: false type: object links: description: | The share links. in: body required: true type: array listener: description: | A ``listener`` object. in: body required: true type: object listener-id-response: description: | The ID of the listener. in: body required: true type: string listener_id: description: | The ID of the listener. in: body required: false type: string listeners: description: | The associated listeners, if any. in: body required: true type: array listeners-response: description: | A list of ``listeners`` objects. in: body required: true type: array loadbalancer: description: | A ``loadbalancer`` object. in: body required: true type: object loadbalancer-id: description: | The ID of the load balancer. in: body required: true type: string loadbalancer-provider: description: | Provider name of the load balancer service. in: body required: true type: string loadbalancer-provider-request: description: | Provider name of the load balancer service. in: body required: false type: string loadbalancer-statuses: description: | The status tree of a load balancer object contains all provisioning and operating statuses for its children. in: body required: true type: object loadbalancers: description: | A list of load balancer objects. in: body required: true type: array local_ep_group_id: description: | The ID for the endpoint group that contains private subnets for the local side of the connection. Yo must specify this parameter with the ``peer_ep_group_id`` parameter unless in backward- compatible mode where ``peer_cidrs`` is provided with a ``subnet_id`` for the VPN service. in: body required: false type: string local_id: description: | An ID to be used instead of the external IP address for a virtual router used in traffic between instances on different networks in east-west traffic. Most often, local ID would be domain name, email address, etc. If this is not configured then the external IP address will be used as the ID. in: body required: false type: string location: description: | Full URL to a service or server. format: uri in: body required: true type: string log: description: | A ``log`` object. in: body required: true type: object log_enabled: description: | Indicates whether this log object is enabled or disabled. in: body required: true type: boolean log_enabled-request: description: | Indicates whether this log object is enabled or disabled. Default is true. in: body required: false type: boolean log_enabled-request-put: description: | Indicates whether this log object is enabled or disabled. in: body required: false type: boolean log_event: description: | Type of security events to log. ``ACCEPT``, ``DROP``, or ``ALL``. in: body required: true type: string log_event-request: description: | Type of security events to log. ``ACCEPT``, ``DROP``, or ``ALL``. Default is ``ALL``. in: body required: false type: string log_id: description: | The ID of the log object. in: body required: true type: string loggable_resources: description: | A list of ``loggable_resource`` object. in: body required: true type: object logging_resource: description: | A ``logging_resource`` object. in: body required: true type: object logging_resource_enabled: description: | Indicates whether this logging resource is enabled or disabled. in: body required: true type: boolean logging_resource_enabled-request: description: | Indicates whether this logging resource is enabled or disabled. Default is false. in: body required: false type: boolean logging_resource_enabled-request-put: description: | Indicates whether this logging resource is enabled or disabled. in: body required: false type: boolean logging_resource_id-body: description: | The ID of the logging resource. in: body required: true type: string logging_resources: description: | A list of ``logging_resource`` objects. in: body required: true type: array logs: description: | A list of ``log`` objects. in: body required: true type: array mac_address: description: | The MAC address of the port. in: body required: true type: string mac_address-request: description: | The MAC address of the port. If unspecified, a MAC address is automatically generated. in: body required: false type: string mac_address-request-put: description: | The MAC address of the port. By default, only administrative users can change this value. in: body required: false type: string max_burst_kbps: description: | The maximum burst size (in kilobits). Default is ``0``. in: body required: false type: integer max_burst_kbps-response: description: | The maximum burst size (in kilobits). in: body required: true type: integer max_kbps: description: | The maximum KBPS (kilobits per second) value. If you specify this value, must be greater than 0 otherwise max_kbps will have no value. in: body required: false type: integer max_kbps-response: description: | The maximum KBPS (kilobits per second) value. If you specify this value, must be greater than 0 otherwise max_kbps will have no value. in: body required: true type: integer max_prefixlen: description: | The maximum prefix size that can be allocated from the subnet pool. For IPv4 subnet pools, default is ``32``. For IPv6 subnet pools, default is ``128``. in: body required: false type: integer max_prefixlen_1: description: | The maximum prefix size that can be allocated from the subnet pool. in: body required: true type: integer max_retries: description: | The number of allowed connection failures before changing the status of the member to ``INACTIVE``. A valid value is from 1 to 10. in: body required: true type: integer member: description: | A ``member`` object. in: body required: true type: object member-id-response: description: | The ID of the member. in: body required: true type: string member-pool_id: description: | The ID of the pool which the member belongs to. in: body required: true type: string member-pool_id-request: description: | The ID of the pool which the member belongs to. in: body required: false type: string member-status: description: | The status of the member. Indicates whether the member is operational. in: body required: true type: string member-weight: description: | The weight of a member determines the portion of requests or connections it services compared to the other members of the pool. For example, a member with a weight of 10 receives five times as much traffic as a member with a weight of 2. A value of 0 means the member does not participate in load- balancing but still accepts persistent connections. A valid value is from 0 to 256. in: body required: true type: integer member-weight-request: description: | The weight of a member determines the portion of requests or connections it services compared to the other members of the pool. For example, a member with a weight of 10 receives five times as much traffic as a member with a weight of 2. A value of 0 means the member does not participate in load- balancing but still accepts persistent connections. A valid value is from 0 to 256. The default is 1. in: body required: false type: integer members: description: | The list of members that belong to the pool. in: body required: true type: array members-obj: description: | A list of ``member`` objects. in: body required: true type: array members_2: description: | The associated members, if any. in: body required: true type: array metainfo: description: | JSON-formatted meta information. in: body required: false type: string metainfo_1: description: | JSON metainfo to associate with profile. in: body required: true type: string metering_label: description: | A ``metering_label`` object. in: body required: true type: object metering_label-id: description: | The ID of the metering label. in: body required: true type: string metering_label-id-response-body: description: | The metering label ID to associate with this metering rule. in: body required: true type: string metering_label-shared: description: | Indicates whether this metering label is shared across all projects. in: body required: true type: boolean metering_label-shared-request: description: | Indicates whether this metering label is shared across all projects. in: body required: true type: boolean metering_label_rule: description: | A ``metering_label_rule`` object. in: body required: true type: object metering_label_rule-id: description: | The ID of the metering label rule. in: body required: true type: string metering_label_rules: description: | A list of ``metering_label_rule`` objects. in: body required: true type: array metering_labels: description: | A list of ``metering_label`` objects. in: body required: true type: array min_kbps: description: | The minimum KBPS (kilobits per second) value which should be available for port. in: body required: true type: integer min_kbps-response: description: | The minimum KBPS (kilobits per second) value which should be available for port. in: body required: true type: integer min_prefixlen: description: | The smallest prefix that can be allocated from a subnet pool. For IPv4 subnet pools, default is ``8``. For IPv6 subnet pools, default is ``64``. in: body required: false type: integer min_prefixlen_1: description: | The smallest prefix that can be allocated from a subnet pool. in: body required: true type: integer minimum_bandwidth_rule: description: | A ``minimum_bandwidth_rule`` object. in: body required: true type: object minimum_bandwidth_rules: description: | A list of ``minimum_bandwidth_rule`` objects associated with the QoS policy. in: body required: true type: array mtu: description: | The maximum transmission unit (MTU) value to address fragmentation. Minimum value is 68 for IPv4, and 1280 for IPv6. in: body required: true type: integer mtu-request: description: | The maximum transmission unit (MTU) value to address fragmentation. Minimum value is 68 for IPv4, and 1280 for IPv6. in: body required: false type: integer name: description: | Human-readable name of the resource. in: body required: true type: string name-request: description: | Human-readable name of the resource. Default is an empty string. in: body required: false type: string name-request-put: description: | Human-readable name of the resource. in: body required: false type: string name-segment: description: | Human-readable name of the segment. in: body required: false type: string name_1: description: | A symbolic name for the port. in: body required: false type: string name_11: description: | The QoS policy name. in: body required: false type: string name_12: description: | The pool name. Does not have to be unique. in: body required: false type: string name_14: description: | A symbolic name for the security group. Does not have to be unique. in: body required: true type: string name_15: description: | A name for the subnet pool. in: body required: true type: string name_16: description: | Human-readable name for the VIP. Does not have to be unique. in: body required: false type: string name_17: description: | Human-readable name for the VPN endpoint group. Does not have to be unique. in: body required: false type: string name_18: description: | Human-readable name for the VPN service. Does not have to be unique. in: body required: false type: string name_19: description: | Human-readable name for the firewall policy. Does not have to be unique. in: body required: true type: string name_2: description: | The network name. in: body required: true type: string name_20: description: | The name of the extension. For example, "Fox In Socks." in: body required: true type: string name_21: description: | A human-readable name for the firewall rule. in: body required: true type: string name_22: description: | Human-readable name for the firewall service. Does not have to be unique. in: body required: true type: string name_23: description: | Human-readable name for the flavor. Can be "" and non-unique. in: body required: true type: string name_24: description: | Human-readable name for the IKE policy. Does not have to be unique. in: body required: true type: string name_25: description: | Human-readable name for the IPSec connection. Does not have to be unique. in: body required: true type: string name_26: description: | The load balancer name. in: body required: true type: string name_27: description: | The network name. in: body required: true type: string name_28: description: | The name of the subnet. in: body required: true type: string name_29: description: | The name of the QoS policy. in: body required: true type: string name_3: description: | The port name. in: body required: true type: string name_30: description: | The pool name. Does not have to be unique. in: body required: true type: string name_31: description: | The router name. in: body required: true type: string name_32: description: | The security group name. in: body required: true type: string name_33: description: | The subnet pool name. in: body required: true type: string name_34: description: | Human-readable name for the VIP. Does not have to be unique. in: body required: true type: string name_35: description: | Human-readable name for the VPN endpoint group. Does not have to be unique. in: body required: true type: string name_36: description: | Human-readable name for the VPN service. Does not have to be unique. in: body required: true type: string name_37: description: | New human-readable name for the flavor. Can be "" and non-unique. in: body required: false type: string name_38: description: | Human-readable name for the pool. Does not have to be unique. in: body required: false type: string name_39: description: | Human-readable name for the firewall policy. Does not have to be unique. in: body required: false type: string name_4: description: | User-facing provider name. in: body required: true type: string name_40: description: | A human-readable name for the firewall rule. Maximum length is 255 characters. Does not have to be unique. No default. in: body required: false type: string name_41: description: | A human-readable name for the flavor. Can be "" and non-unique. in: body required: false type: string name_42: description: | A human-readable name for the firewall service. Does not have to be unique. in: body required: false type: string name_43: description: | Human-readable name for the IKE policy. Does not have to be unique. in: body required: false type: string name_5: description: | A human-readable name for the IPSec policy. Does not have to be unique. in: body required: true type: string name_6: description: | Human-readable name for the IPSec connection. Does not have to be unique. in: body required: false type: string name_7: description: | The listener name. in: body required: true type: string name_8: description: | The load balancer name. Does not have to be unique. in: body required: false type: string name_9: description: | The name of the metering label. in: body required: true type: string name_resource: description: | The name of the resource. in: body required: false type: string network: description: | A ``network`` object. in: body required: true type: object network-admin_state_up: description: | The administrative state of the network, which is up (``true``) or down (``false``). in: body required: true type: boolean network-admin_state_up-request: description: | The administrative state of the network, which is up (``true``) or down (``false``). in: body required: false type: boolean network-count: description: | The number of networks allowed for each tenant. in: body required: true type: integer network-count-request: description: | The number of networks allowed for each tenant. in: body required: false type: integer network-id: description: | The ID of the network. in: body required: true type: string network-name: description: | Human-readable name of the network. in: body required: true type: string network-name-request: description: | Human-readable name of the network. in: body required: False type: string network-port_security_enabled: description: | The port security status of the network. Valid values are enabled (``true``) and disabled (``false``). This value is used as the default value of ``port_security_enabled`` field of a newly created port. in: body required: true type: boolean network-port_security_enabled-request: description: | The port security status of the network. Valid values are enabled (``true``) and disabled (``false``). This value is used as the default value of ``port_security_enabled`` field of a newly created port. in: body required: false type: boolean network-shared: description: | Indicates whether this network is shared across all tenants. By default, only administrative users can change this value. in: body required: true type: boolean network-shared-request: description: | Indicates whether this network is shared across all tenants. By default, only administrative users can change this value. in: body required: false type: boolean network-status: description: | The network status. Values are ``ACTIVE``, ``DOWN``, ``BUILD`` or ``ERROR``. in: body required: true type: string network-subnets: description: | The associated subnets. in: body required: true type: array network_id: description: | The ID of the attached network. in: body required: true type: string network_ip_availabilities: description: | The ``network_ip_availabilities`` object. in: body required: true type: array network_ip_availability: description: | A ``network_ip_availability`` object. in: body required: true type: object network_ip_availability-network_id: description: | The ID of the network whose IP availability detail is reported. in: body required: true type: string network_ip_availability-subnet_id: description: | The ID of the subnet whose IP availability detail is reported. in: body required: true type: string network_type: description: | The type of physical network that maps to this network resource. For example, ``flat``, ``vlan``, ``vxlan``, or ``gre``. in: body required: true type: string networks: description: | A list of ``network`` objects. in: body required: true type: array object_id: description: | The ID of the ``object_type`` resource. An ``object_type`` of ``network`` returns a network ID and an ``object_type`` of ``qos-policy`` returns a QoS ID. in: body required: true type: integer object_type: description: | The type of the object that the RBAC policy affects. Types include ``qos-policy`` or ``network``. in: body required: true type: integer operating_status: description: | The operating status of the load balancer. This value is ``ONLINE`` or ``OFFLINE``. in: body required: true type: string peer_address: description: | The peer gateway public IPv4 or IPv6 address or FQDN. in: body required: true type: string peer_cidrs: description: | (Deprecated) Unique list of valid peer private CIDRs in the form < net_address > / < prefix > . in: body required: false type: array peer_ep_group_id: description: | The ID for the endpoint group that contains private CIDRs in the form < net_address > / < prefix > for the peer side of the connection. You must specify this parameter with the ``local_ep_group_id`` parameter unless in backward-compatible mode where ``peer_cidrs`` is provided with a ``subnet_id`` for the VPN service. in: body required: false type: string peer_id: description: | The peer router identity for authentication. A valid value is an IPv4 address, IPv6 address, e-mail address, key ID, or FQDN. Typically, this value matches the ``peer_address`` value. in: body required: true type: string pfs: description: | Perfect forward secrecy (PFS). A valid value is ``Group2``, ``Group5``, ``Group14``, and so on. Default is ``Group5``. in: body required: false type: string phase1_negotiation_mode: description: | The IKE mode. A valid value is ``main``, which is the default. in: body required: false type: string policies: description: | A list of QoS ``policy`` objects. in: body required: true type: array policy: description: | A QoS ``policy`` object. in: body required: true type: object pool: description: | A ``pool`` object. in: body required: true type: object pool-id-response: description: | The ID of the pool. in: body required: true type: string pool-protocol: description: | The protocol of the pool, which is ``TCP``, ``HTTP``, or ``HTTPS``. in: body required: true type: string pool-provider: description: | The provider name of the load balancer pool. in: body required: true type: string pool-provider-request: description: | The provider name of the load balancer pool. in: body required: false type: string pool-status: description: | The status of the pool. Indicates whether the pool is operational. in: body required: true type: string pool-subnet_id: description: | The subnet on which the members of the pool will be located. in: body required: true type: string pool-subnet_id-request: description: | If you omit this parameter, LBaaS uses the ``vip_subnet_id`` parameter value for the subnet UUID. in: body required: false type: string pools: description: | List of pools that are associated with the health monitor. in: body required: true type: array pools-obj: description: | A list of ``pool`` objects. in: body required: true type: array pools_2: description: | The associated pools, if any. in: body required: true type: array port: description: | A ``port`` object. in: body required: true type: object port-security_groups: description: | The IDs of security groups applied to the port. in: body required: true type: array port-security_groups-request: description: | The IDs of security groups applied to the port. in: body required: false type: array port-status: description: | The port status. Values are ``ACTIVE``, ``DOWN``, ``BUILD`` and ``ERROR``. in: body required: true type: string port_id: description: | The ID of the port. in: body required: true type: string port_id-request: description: | The ID of the port. in: body required: false type: string port_id_4: description: | The UUID of the port. in: body required: true type: string port_id_subport: description: | The ID of the subport. in: body required: true type: string port_range_max: description: | The maximum port number in the range that is matched by the security group rule. If the protocol is TCP, UDP, DCCP, SCTP or UDP-Lite this value must be greater than or equal to the ``port_range_min`` attribute value. If the protocol is ICMP, this value must be an ICMP type. in: body required: false type: integer port_range_min: description: | The minimum port number in the range that is matched by the security group rule. If the protocol is TCP, UDP, DCCP, SCTP or UDP-Lite this value must be less than or equal to the ``port_range_max`` attribute value. If the protocol is ICMP, this value must be an ICMP type. in: body required: false type: integer port_security_enabled: description: | The port security status. A valid value is enabled (``true``) or disabled (``false``). If port security is enabled for the port, security group rules and anti-spoofing rules are applied to the traffic on the port. If disabled, no such rules are applied. in: body required: true type: boolean port_security_enabled-request: description: | The port security status. A valid value is enabled (``true``) or disabled (``false``). If port security is enabled for the port, security group rules and anti-spoofing rules are applied to the traffic on the port. If disabled, no such rules are applied. in: body required: false type: boolean ports: description: | A list of ``port`` objects. in: body required: true type: array position: description: | Read-only attribute that the API assigns to this rule when it associates it with a firewall policy. This value indicates the position of this rule in that firewall policy. This position number starts at 1. If the firewall rule is not associated with any policy, the position is ``null``. in: body required: true type: integer prefixes: description: | A list of subnet prefixes to assign to the subnet pool. The API merges adjacent prefixes and treats them as a single prefix. Each subnet prefix must be unique among all subnet prefixes in all subnet pools that are associated with the address scope. in: body required: true type: array prefixes_1: description: | A list of subnet prefixes that are assigned to the subnet pool. The API merges adjacent prefixes and treats them as a single prefix. in: body required: true type: array prefixes_2: description: | A list of subnet prefixes to assign to the subnet pool. The API merges adjacent prefixes and treats them as a single prefix. To update the subnet prefixes, pass a list that contains the existing set of prefixes and the new set of prefixes. You cannot shrink the prefix list of a subnet pool. You can only add prefixes to it to expand it. Ensure that each subnet prefix is unique among all subnet prefixes in all subnet pools that are associated with the address scope. in: body required: true type: array project_id: description: | The ID of the project. in: body required: true type: string project_id-body-optional: description: | The ID of the project that owns the resource. in: body required: false type: string project_id-body-required: description: | The ID of the project that owns the resource. in: body required: true type: string project_id-request: description: | The ID of the project that owns the resource. Only administrative users can specify a project ID other than their own. You cannot change this value through authorization policies. in: body required: false type: string protocol: description: | The IP protocol can be represented by a string, an integer, or ``null``. Valid string or integer values are ``any`` or ``0``, ``ah`` or ``51``, ``dccp`` or ``33``, ``egp`` or ``8``, ``esp`` or ``50``, ``gre`` or ``47``, ``icmp`` or ``1``, ``icmpv6`` or ``58``, ``igmp`` or ``2``, ``ipip`` or ``4``, ``ipv6-encap`` or ``41``, ``ipv6-frag`` or ``44``, ``ipv6-icmp`` or ``58``, ``ipv6-nonxt`` or ``59``, ``ipv6-opts`` or ``60``, ``ipv6-route`` or ``43``, ``ospf`` or ``89``, ``pgm`` or ``113``, ``rsvp`` or ``46``, ``sctp`` or ``132``, ``tcp`` or ``6``, ``udp`` or ``17``, ``udplite`` or ``136``, ``vrrp`` or ``112``. Additionally, any integer value between [0-255] is also valid. The string ``any`` (or integer ``0``) means ``all`` IP protocols. See the constants in ``neutron_lib.constants`` for the most up-to-date list of supported strings. in: body required: true type: string protocol-response: description: | The IP protocol. Valid value is ``icmp``, ``tcp``, ``udp``, or ``null``. No default. in: body required: true type: string protocol_port: description: | The TCP or UDP port on which to listen. in: body required: true type: integer protocol_port-request: description: | The TCP or UDP port on which to listen. in: body required: true type: integer provider:network_type: description: | The type of physical network that this network is mapped to. For example, ``flat``, ``vlan``, ``vxlan``, or ``gre``. Valid values depend on a networking back-end. in: body required: true type: string provider:network_type-request: description: | The type of physical network that this network should be mapped to. For example, ``flat``, ``vlan``, ``vxlan``, or ``gre``. Valid values depend on a networking back-end. in: body required: false type: string provider:physical_network: description: | The physical network where this network is implemented. in: body required: true type: string provider:physical_network-request: description: | The physical network where this network should be implemented. The Networking API v2.0 does not provide a way to list available physical networks. For example, the Open vSwitch plug-in configuration file defines a symbolic name that maps to specific bridges on each compute host. in: body required: false type: string provider:segmentation_id: description: | The ID of the isolated segment on the physical network. The ``network_type`` attribute defines the segmentation model. For example, if the ``network_type`` value is vlan, this ID is a vlan identifier. If the ``network_type`` value is gre, this ID is a gre key. in: body required: true type: integer provider:segmentation_id-request: description: | The ID of the isolated segment on the physical network. The ``network_type`` attribute defines the segmentation model. For example, if the ``network_type`` value is vlan, this ID is a vlan identifier. If the ``network_type`` value is gre, this ID is a gre key. in: body required: false type: integer provider_1: description: | The load-balancer provider. in: body required: true type: string provider_2: description: | The name of the provider. in: body required: true type: string provisioning_status: description: | The provisioning status of the load balancer. This value is ``ACTIVE``, ``PENDING_CREATE`` or ``ERROR``. in: body required: true type: string psk: description: | The pre-shared key. A valid value is any string. in: body required: true type: string qos-backend-drivers: description: | List of loaded QoS drivers with supported rule type parameters with possible values for each. Each driver is represented by a dict with the keys ``name`` and ``supported_parameters``. Field ``name`` contains the name of a backend driver. Field ``supported_parameters`` contains a list of dicts with ``parameter_name``, ``parameter_type`` and ``parameter_values`` fields. The valid values for ``parameter_type`` are ``choices`` or ``range``. If ``parameter_type`` is ``choices`` then ``parameter_values`` contains a list of acceptable values, otherwise it contains a dict with keys of ``start`` and ``end`` which define the range of acceptable values. in: body required: true type: list qos-rule-direction: description: | The direction of the traffic to which the QoS rule is applied, as seen from the point of view of the ``port``. Valid values are ``egress`` and ``ingress``. Default value is ``egress``. in: body required: false type: string qos-rule-direction-response: description: | The direction of the traffic to which the QoS rule is applied, as seen from the point of view of the ``port``. Valid values are ``egress`` and ``ingress``. Default value is ``egress``. in: body required: true type: string qos-rule-direction-update: description: | The direction of the traffic to which the QoS rule is applied, as seen from the point of view of the ``port``. Valid values are ``egress`` and ``ingress``. in: body required: false type: string qos-rule-direction-update-response: description: | The direction of the traffic to which the QoS rule is applied, as seen from the point of view of the ``port``. Valid values are ``egress`` and ``ingress``. in: body required: true type: string qos-rule-type: description: | The type of QoS rule. in: body required: true type: string qos-rule-types: description: | A list of QoS ``rule_type`` objects. in: body required: true type: array qos-rules: description: | A set of zero or more policy rules. in: body required: true type: array qos-shared: description: | Indicates whether this policy is shared across all projects. in: body required: true type: boolean qos-shared-request: description: | Set to ``true`` to share this policy with other projects. Default is ``false``. in: body required: false type: boolean qos_bandwidth_limit_rule-id: description: | The ID of the QoS Bandwidth limit rule. in: body required: true type: string qos_dscp_marking_rule-id: description: | The ID of the QoS DSCP marking rule. in: body required: true type: string qos_minimum_bandwidth_rule-id: description: | The ID of the QoS minimum bandwidth rule. in: body required: true type: string qos_policy-name: description: | Human-readable name of the resource. in: body required: false type: string qos_policy_id: description: | The ID of the QoS policy. in: body required: true type: string qos_policy_id-body: description: | The ID of the QoS policy. in: body required: true type: string qos_policy_id-request: description: | The ID of the QoS policy. in: body required: false type: string quota: description: | A ``quota`` object. in: body required: true type: object quota-detail: description: | A ``quota`` detail object. Each key in the object corresponds to a resource type (``network``, ``port``, etc.) having a quota. The value for each resource type is itself an object (the quota set) containing the quota's ``used``, ``limit`` and ``reserved`` integer values. in: body required: true type: object quota-floatingip: description: | The number of floating IP addresses allowed for each project. A value of ``-1`` means no limit. in: body required: true type: integer quota-floatingip-request: description: | The number of floating IP addresses allowed for each project. A value of ``-1`` means no limit. in: body required: false type: integer quota-network: description: | The number of networks allowed for each project. A value of ``-1`` means no limit. in: body required: true type: integer quota-network-request: description: | The number of networks allowed for each project. A value of ``-1`` means no limit. in: body required: false type: integer quota-port: description: | The number of ports allowed for each project. A value of ``-1`` means no limit. in: body required: true type: integer quota-port-request: description: | The number of ports allowed for each project. A value of ``-1`` means no limit. in: body required: false type: integer quota-rbac_policy: description: | The number of role-based access control (RBAC) policies for each project. A value of ``-1`` means no limit. in: body required: true type: integer quota-rbac_policy-request: description: | The number of role-based access control (RBAC) policies for each project. A value of ``-1`` means no limit. in: body required: false type: integer quota-router: description: | The number of routers allowed for each project. A value of ``-1`` means no limit. in: body required: true type: integer quota-router-request: description: | The number of routers allowed for each project. A value of ``-1`` means no limit. in: body required: false type: integer quota-security_group: description: | The number of security groups allowed for each project. A value of ``-1`` means no limit. in: body required: true type: integer quota-security_group-request: description: | The number of security groups allowed for each project. A value of ``-1`` means no limit. in: body required: false type: integer quota-security_group_rule: description: | The number of security group rules allowed for each project. A value of ``-1`` means no limit. in: body required: true type: integer quota-security_group_rule-request: description: | The number of security group rules allowed for each project. A value of ``-1`` means no limit. in: body required: false type: integer quota-subnet: description: | The number of subnets allowed for each project. A value of ``-1`` means no limit. in: body required: true type: integer quota-subnet-request: description: | The number of subnets allowed for each project. A value of ``-1`` means no limit. in: body required: false type: integer quota-subnetpool: description: | The number of subnet pools allowed for each project. A value of ``-1`` means no limit. in: body required: true type: integer quota-subnetpool-request: description: | The number of subnet pools allowed for each project. A value of ``-1`` means no limit. in: body required: false type: integer quotas: description: | A list of quota objects. in: body required: true type: array rbac_action: description: | Action for the RBAC policy which is ``access_as_external`` or ``access_as_shared``. in: body required: true type: string rbac_policy_id: description: | The ID of the RBAC policy. in: body required: true type: integer remote_group_id: description: | The remote group UUID to associate with this security group rule. You can specify either the ``remote_group_id`` or ``remote_ip_prefix`` attribute in the request body. in: body required: false type: string remote_group_id_1: description: | The remote group UUID to associate with this security group rule. You can specify either the ``remote_group_id`` or ``remote_ip_prefix`` attribute in the request body. in: body required: true type: string remote_ip_prefix: description: | The remote IP prefix to associate with this metering rule packet. in: body required: true type: string remote_ip_prefix_1: description: | The remote IP prefix to associate with this security group rule. You can specify either the ``remote_group_id`` or ``remote_ip_prefix`` attribute in the request body. This attribute matches the IP prefix as the source IP address of the IP packet. in: body required: false type: string remote_ip_prefix_2: description: | The remote IP prefix to associate with this security group rule. You can specify either the ``remote_group_id`` or ``remote_ip_prefix`` attribute in the request body. This attribute value matches the IP prefix as the source IP address of the IP packet. in: body required: true type: string resource-collection: description: | Collection name of the resource. in: body required: true type: string resource-href: description: | Link to the resource. in: body required: true type: string resource-links: description: | List of links related to the resource. Each link is a dict with 'href' and 'rel'. in: body required: true type: array resource-name: description: | Name of the resource. in: body required: true type: string resource-rel: description: | Relationship between link and the resource. in: body required: true type: string resource_log_id: description: | The ID of resource log (e.g security group ID). in: body required: true type: string resource_log_id-request: description: | The ID of resource log (e.g security group ID). in: body required: false type: string resource_log_type: description: | The resource log type such as 'security_group'. in: body required: true type: string resource_target_log_id: description: | The ID of resource target log such as port ID. in: body required: true type: string resource_target_log_id-request: description: | The ID of resource target log such as port ID. in: body required: false type: string resources: description: | List of resource objects. in: body required: true type: array revision_number: description: | The revision number of the resource. in: body required: true type: integer route_mode: description: | The route mode. A valid value is ``static``, which is the default. in: body required: false type: string route_mode_1: description: | The route mode. A valid value is ``static``, which is the default. in: body required: true type: string router: description: | A ``router`` object. in: body required: true type: object router-availability_zone_hints: description: | The availability zone candidates for the router. It is available when ``router_availability_zone`` extension is enabled. in: body required: true type: array router-availability_zone_hints-request: description: | The availability zone candidates for the router. It is available when ``router_availability_zone`` extension is enabled. in: body required: false type: array router-availability_zones: description: | The availability zone(s) for the router. It is available when ``router_availability_zone`` extension is enabled. in: body required: true type: array router-destination: description: | The destination CIDR. in: body required: true type: string router-distributed: description: | ``true`` indicates a distributed router. It is available when ``dvr`` extension is enabled. in: body required: true type: boolean router-distributed-request: description: | ``true`` indicates a distributed router. It is available when ``dvr`` extension is enabled. in: body required: false type: boolean router-enable_snat: description: | Enable Source NAT (SNAT) attribute. ``true`` means Network Address Translation (NAT) is enabled for traffic generated by subnets attached to the router when the traffic is sent to/received from the external network. ``false`` means no NAT is applied for traffic from/to the external network. It is available when ``ext-gw-mode`` extension is enabled. in: body required: true type: boolean router-enable_snat-request: description: | Enable Source NAT (SNAT) attribute. Default is ``true``. To persist this attribute value, set the ``enable_snat_by_default`` option in the ``neutron.conf`` file. It is available when ``ext-gw-mode`` extension is enabled. in: body required: false type: boolean router-external_fixed_ips: description: | IP address(es) of the external gateway of the router. It is a list of IP addresses. Each element of the list is a dictionary of ``ip_address`` and ``subnet_id``. in: body required: true type: array router-external_fixed_ips-request: description: | IP address(es) of the external gateway interface of the router. It is a list of IP addresses you would like to assign to the external gateway interface. Each element of ths list is a dictionary of ``ip_address`` and ``subnet_id``. in: body required: false type: array router-external_gateway_info: description: | The external gateway information of the router. If the router has an external gateway, this would be a dict with ``network_id``, ``enable_snat`` and ``external_fixed_ips``. Otherwise, this would be ``null``. in: body required: true type: object router-external_gateway_info-request: description: | The external gateway information of the router. If the router has an external gateway, this would be a dict with ``network_id``, ``enable_snat`` and ``external_fixed_ips``. Otherwise, this would be ``null``. in: body required: false type: object router-ha: description: | ``true`` indicates a highly-available router. It is available when ``l3-ha`` extension is enabled. in: body required: true type: boolean router-ha-request: description: | ``true`` indicates a highly-available router. It is available when ``l3-ha`` extension is enabled. in: body required: false type: boolean router-id-body: description: | The ID of the router. in: body required: true type: string router-name-request: description: | The router name. in: body required: false type: string router-network_id: description: | Network ID which the router gateway is connected to. in: body required: true type: string router-network_id-interface: description: | Network ID which the router interface is connected to. in: body required: true type: string router-nexthop: description: | The IP address of the next hop for the corresponding destination. The next hop IP address must be a part of one of the subnets to which the router interfaces are connected. in: body required: true type: string router-port_id: description: | The ID of the port which represents the router interface. in: body required: true type: string router-port_id-request: description: | The ID of the port. One of ``subnet_id`` or ``port_id`` must be specified. in: body required: false type: string router-project_id-interface: description: | The ID of the project who owns the router interface. in: body required: true type: string router-routes: description: | The extra routes configuration for L3 router. A list of dictionaries with ``destination`` and ``nexthop`` parameters. It is available when ``extraroute`` extension is enabled. in: body required: true type: array router-routes-request: description: | The extra routes configuration for L3 router. A list of dictionaries with ``destination`` and ``nexthop`` parameters. It is available when ``extraroute`` extension is enabled. Default is an empty list (``[]``). in: body required: false type: array router-status: description: | The router status. in: body required: true type: string router-subnet_id: description: | The ID of the subnet which the router interface belongs to. in: body required: true type: string router-subnet_id-request: description: | The ID of the subnet. One of ``subnet_id`` or ``port_id`` must be specified. in: body required: false type: string router-subnet_ids: description: | A list of the ID of the subnet which the router interface belongs to. The list contains only one member. in: body required: true type: array router:external: description: | Indicates whether the network has an external routing facility that's not managed by the networking service. in: body required: true type: boolean router:external-request: description: | Indicates whether the network has an external routing facility that's not managed by the networking service. in: body required: false type: boolean router_id_1: description: | The UUID of the router. in: body required: true type: string router_id_2: description: | The UUID of the router to which the VPN service is inserted. in: body required: true type: string router_id_3: description: | The UUID of the router into which the VPN service is inserted. in: body required: true type: string router_ids: description: | A list of IDs for routers that are associated with the firewall. in: body required: false type: array router_ids-1: description: | A list of IDs for routers that are associated with the firewall. in: body required: true type: array router_ids-response: description: | A list of IDs for routers that are associated with the firewall. in: body required: true type: array routers: description: | A list of ``router`` objects. in: body required: true type: array security_group: description: | A ``security_group`` object. in: body required: true type: object security_group-id: description: | The ID of the security group. in: body required: true type: string security_group_id: description: | The security group UUID to associate with this security group rule. in: body required: true type: string security_group_rule: description: | A ``security_group_rule`` object. in: body required: true type: object security_group_rule-id: description: | The ID of the security group rule. in: body required: true type: string security_group_rule-security_group_id: description: | The security group ID to associate with this security group rule. in: body required: true type: string security_group_rules: description: | A list of ``security_group_rule`` objects. Refer to :ref:`Security group rules ` for details. in: body required: true type: array security_groups: description: | One or more security group UUIDs. in: body required: false type: array security_groups-obj: description: | A list of ``security_group`` objects. in: body required: true type: array segment_id: description: | The UUID of the segment. in: body required: true type: string segmentation_id: description: | The segmentation ID for the subport. in: body required: false type: integer segmentation_type: description: | The segmentation type for the subport. Possible values include ``vlan`` and ``inherit``. When ``inherit`` is specified, a port gets its segmentation type from the network its connected to. in: body required: true type: string segmentation_type-request: description: | The segmentation type for the subport. Possible values include ``vlan`` and ``inherit``. When ``inherit`` is specified, a port gets its segmentation type from the network its connected to. in: body required: false type: string segments: description: | A list of provider ``segment`` objects. in: body required: true type: array segments-request: description: | A list of provider ``segment`` objects. in: body required: false type: array service_profile: description: | A ``service_profile`` object. in: body required: true type: object service_profile-description: description: | The human-readable description for the service profile. in: body required: true type: string service_profile-description-request: description: | The human-readable description for the service profile. in: body required: false type: string service_profile-driver: description: | Provider driver to use for this profile. Example: ``neutron_lbaas.drivers.octavia.driver.OctaviaDriver`` in: body required: true type: string service_profile-driver-request: description: | Provider driver to use for this profile. Example: ``neutron_lbaas.drivers.octavia.driver.OctaviaDriver`` in: body required: false type: string service_profile-enabled: description: | Indicates whether this service profile is enabled or not. Default is ``true``. in: body required: true type: boolean service_profile-enabled-request: description: | Indicates whether this service profile is enabled or not. Default is ``true``. in: body required: false type: boolean service_profile-id: description: | The UUID of the service profile. in: body required: true type: string service_profile-metainfo: description: | JSON-formatted meta information of the service profile. in: body required: true type: string service_profile-metainfo-request: description: | JSON-formatted meta information of the service profile. in: body required: false type: string service_profiles: description: | Service profile UUIDs associated with this flavor. in: body required: true type: array service_profiles_1: description: | A list of ``service_profile`` objects. in: body required: true type: array service_providers: description: | A list of ``service_provider`` objects. in: body required: true type: array service_type: description: | The service type, which is ``CORE``, ``DUMMY``, ``FIREWALL``, ``FLAVORS``, ``L3_ROUTER_NAT``, ``LOADBALANCER``, ``LOADBALANCERV2``, ``METERING``, ``QOS``, or ``VPN``. in: body required: true type: string service_type_1: description: | Service type (ex: LOADBALANCERV2) for the flavor. in: body required: true type: string shared: description: | Admin-only. Indicates whether this network is shared across all projects. in: body required: false type: boolean shared-response: description: | Admin-only. Indicates whether this network is shared across all tenants. in: body required: true type: boolean shared_11: description: | Indicates whether this subnet pool is shared across all projects. in: body required: true type: boolean shared_12: description: | Set to ``true`` to make this firewall policy visible to other projects. Default is ``false``. in: body required: false type: boolean shared_13: description: | Set to ``true`` to share this firewall rule with other projects. Other projects can use a shared rule in firewall policies that this project does not own. Valid value is ``true`` or ``false``. Default is ``false``. in: body required: false type: boolean shared_3: description: | Admin-only. Indicates whether this network is shared across all projects. in: body required: true type: boolean shared_5: description: | Admin-only. Indicates whether this subnet pool is shared across all projects. in: body required: false type: boolean shared_6: description: | Indicates whether the firewall policy is shared across all projects. in: body required: true type: boolean shared_7: description: | Indicates whether this firewall rule is shared with other projects. Other projects can use a shared rule in firewall policies that this project does not own. in: body required: true type: boolean shared_9: description: | Indicates whether this network is shared across all projects. in: body required: true type: boolean sni_container_refs: description: | A list of references to TLS secrets. in: body required: false type: array sni_container_refs-response: description: | A list of references to TLS secrets. in: body required: true type: array source_firewall_group_id-body-optional: description: | The ID of the remote source firewall group. in: body required: no type: string source_firewall_group_id-body-required: description: | The ID of the remote source firewall group. in: body required: true type: string source_ip_address: description: | The source IPv4 or IPv6 address or CIDR. in: body required: false type: string source_port: description: | The source port or port range. A valid value is a port number, as an integer, or a port range, in the format of a ``:`` separated range. For a port range, include both ends of the range. For example, ``80:90``. in: body required: true type: string source_port-response: description: | The source port or port range. A valid value is a port number, as an integer, or a port range, in the format of a ``:`` separated range. For a port range, include both ends of the range. For example, ``80:90``. in: body required: false type: string source_port_1: description: | The source port or port range. in: body required: true type: string started_at: description: | Time at which the agent was started. in: body required: true type: string status_description: description: | Human-readable description of the status. in: body required: true type: string sub_ports: description: | A list of ports associated with the trunk. in: body required: true type: array subnet-allocation_pools: description: | Allocation pools with ``start`` and ``end`` IP addresses for this subnet. in: body required: true type: array subnet-allocation_pools-request: description: | Allocation pools with ``start`` and ``end`` IP addresses for this subnet. If allocation_pools are not specified, OpenStack Networking automatically allocates pools for covering all IP addresses in the CIDR, excluding the address reserved for the subnet gateway by default. in: body required: false type: array subnet-created_at: description: | Time at which the subnet has been created. in: body required: true type: string subnet-dns_nameservers: description: | List of dns name servers associated with the subnet. in: body required: true type: array subnet-dns_nameservers-request: description: | List of dns name servers associated with the subnet. Default is an empty list. in: body required: false type: array subnet-enable_dhcp: description: | Indicates whether dhcp is enabled or disabled for the subnet. in: body required: true type: boolean subnet-enable_dhcp-request: description: | Indicates whether dhcp is enabled or disabled for the subnet. Default is ``true``. in: body required: false type: boolean subnet-gateway_ip: description: | Gateway IP of this subnet. If the value is ``null`` that implies no gateway is associated with the subnet. in: body required: true type: string subnet-gateway_ip-request: description: | Gateway IP of this subnet. If the value is ``null`` that implies no gateway is associated with the subnet. If the gateway_ip is not specified, OpenStack Networking allocates an address from the CIDR for the gateway for the subnet by default. in: body required: false type: string subnet-host_routes: description: | Additional routes for the subnet. A list of dictionaries with ``destination`` and ``nexthop`` parameters. in: body required: true type: array subnet-host_routes-request: description: | Additional routes for the subnet. A list of dictionaries with ``destination`` and ``nexthop`` parameters. Default value is an empty list. in: body required: false type: array subnet-id-body: description: | The ID of the subnet. in: body required: true type: string subnet-ip_version: description: | The IP protocol version. Value is ``4`` or ``6``. in: body required: true type: integer subnet-ipv6_address_mode: description: | The IPv6 address modes specifies mechanisms for assigning IP addresses. Value is ``slaac``, ``dhcpv6-stateful``, ``dhcpv6-stateless`` or ``null``. in: body required: true type: string subnet-ipv6_address_mode-request: description: | The IPv6 address modes specifies mechanisms for assigning IP addresses. Value is ``slaac``, ``dhcpv6-stateful``, ``dhcpv6-stateless``. in: body required: false type: string subnet-ipv6_ra_mode: description: | The IPv6 router advertisement specifies whether the networking service should transmit ICMPv6 packets, for a subnet. Value is ``slaac``, ``dhcpv6-stateful``, ``dhcpv6-stateless`` or ``null``. in: body required: true type: string subnet-ipv6_ra_mode-request: description: | The IPv6 router advertisement specifies whether the networking service should transmit ICMPv6 packets, for a subnet. Value is ``slaac``, ``dhcpv6-stateful``, ``dhcpv6-stateless``. in: body required: false type: string subnet-name: description: | Human-readable name of the resource. in: body required: true type: string subnet-name-request: description: | Human-readable name of the resource. Default is an empty string. in: body required: false type: string subnet-name-update-request: description: | Human-readable name of the resource. in: body required: false type: string subnet-network_id: description: | The ID of the network to which the subnet belongs. in: body required: true type: string subnet-obj: description: | A ``subnet`` object. in: body required: true type: string subnet-segment_id: description: | The ID of a network segment the subnet is associated with. It is available when ``segment`` extension is enabled. in: body required: true type: string subnet-segment_id-request: description: | The ID of a network segment the subnet is associated with. It is available when ``segment`` extension is enabled. in: body required: false type: string subnet-service_types: description: | The service types associated with the subnet. in: body required: true type: string subnet-subnetpool_id: description: | The ID of the subnet pool associated with the subnet. in: body required: true type: string subnet-subnetpool_id-request: description: | The ID of the subnet pool associated with the subnet. in: body required: false type: string subnet-updated_at: description: | Time at which the subnet has been updated. in: body required: true type: string subnet_id: description: | If you specify only a subnet UUID, OpenStack Networking allocates an available IP from that subnet to the port. If you specify both a subnet UUID and an IP address, OpenStack Networking tries to allocate the address to the port. in: body required: false type: string subnet_ip_availability: description: | A list of dictionaries showing subnet IP availability. It contains information for every subnet associated to the network. in: body required: true type: array subnet_name: description: | The name of the subnet. in: body required: true type: string subnetpool: description: | A ``subnetpool`` object. in: body required: true type: object subnetpool_id_body: description: | The ID of the subnet. in: body required: true type: string subnetpool_is_default: description: | The subnetpool is default pool or not. in: body required: true type: boolean subnetpool_updated_at: description: | Time at which subnetpool has been updated. in: body required: true type: string subnetpools: description: | A list of ``subnetpool`` objects. in: body required: true type: array subnets-obj: description: | A list of ``subnet`` objects. in: body required: true type: array tags: description: | The list of tags on the resource. in: body required: true type: array target_tenant: description: | The ID of the tenant to which the RBAC policy will be enforced. in: body required: true type: string tenant_id: description: | The ID of the project that owns the resource. in: body required: false type: string tenant_id-request: description: | The ID of the tenant who owns the resource. Only administrative users can specify a tenant ID other than their own. You cannot change this value through authorization policies. in: body required: false type: string tenant_id_1: description: | The UUID of the tenant. in: body required: true type: string tenant_id_10: description: | The UUID of the tenant who owns the load balancer. Only administrative users can specify a tenant UUID other than their own. in: body required: true type: string tenant_id_11: description: | The UUID of the tenant who owns the member. Only administrative users can specify a tenant UUID other than their own. in: body required: true type: string tenant_id_12: description: | The UUID of the tenant who owns the member. Only administrative users can specify a tenant UUID other than their own. in: body required: false type: string tenant_id_13: description: | The tenant UUID for the metering label. in: body required: true type: string tenant_id_15: description: | The tenant UUID of QoS policy owner. Only administrative users can specify a tenant UUID other than their own. You cannot change this value through authorization policies. in: body required: false type: string tenant_id_16: description: | The UUID of the tenant who owns the pool. Only administrative users can specify a tenant UUID other than their own. in: body required: false type: string tenant_id_17: description: | The UUID of the tenant who owns the security group rule. Only administrative users can specify a tenant UUID other than their own. in: body required: true type: string tenant_id_18: description: | The UUID of the tenant who owns the security group. Only administrative users can specify a tenant UUID other than their own. in: body required: false type: string tenant_id_19: description: | The UUID of the tenant who owns the subnet pool. Only administrative users can specify a tenant UUID other than their own. You cannot change this value through authorization policies. in: body required: false type: string tenant_id_20: description: | The UUID of the tenant who owns the VIP. Only administrative users can specify a tenant UUID other than their own. in: body required: false type: string tenant_id_21: description: | Owner of the VPN endpoint group. Only administrative users can specify a tenant UUID other than their own. in: body required: true type: string tenant_id_22: description: | Owner of the VPN service. Only administrative users can specify a tenant UUID other than their own. in: body required: false type: string tenant_id_23: description: | The UUID of the tenant who owns the firewall policy. in: body required: true type: string tenant_id_24: description: | The UUID of the tenant who owns the firewall rule. in: body required: true type: string tenant_id_25: description: | The UUID of the tenant who owns the health monitor. Only administrative users can specify a tenant UUID other than their own. in: body required: true type: string tenant_id_26: description: | The owner of the VPN service. Only administrative users can specify a tenant UUID other than their own. in: body required: true type: string tenant_id_27: description: | Owner of the VPN service. Only administrative users can specify a tenant UUID other than their own. in: body required: true type: string tenant_id_28: description: | The UUID of the tenant who owns the VIP. Only administrative users can specify a tenant UUID other than their own. in: body required: true type: string tenant_id_29: description: | The UUID of the tenant who owns the network. in: body required: true type: string tenant_id_3: description: | The owner of the firewall service. Only administrative users can specify a tenant UUID other than their own. in: body required: true type: string tenant_id_30: description: | The UUID of tenant or project. in: body required: true type: string tenant_id_31: description: | The UUID of the tenant who owns the QoS policy. in: body required: true type: string tenant_id_32: description: | The UUID of the tenant who owns the pool. Only administrative users can specify a tenant UUID other than their own. in: body required: true type: string tenant_id_34: description: | The UUID of the tenant who owns the subnet pool. in: body required: true type: string tenant_id_35: description: | The UUID of the tenant. in: body required: true type: string tenant_id_36: description: | The owner of the firewall policy. Only administrative users can specify a tenant UUID other than their own. in: body required: false type: string tenant_id_37: description: | The UUID of the tenant who owns the firewall rule. Only administrative users can specify a tenant UUID other than their own. in: body required: true type: string tenant_id_4: description: | The UUID of the tenant. Only administrative users can specify a tenant UUID other than their own. in: body required: false type: string tenant_id_5: description: | The UUID of the tenant who owns the health monitor. Only administrative users can specify a tenant UUID other than their own. in: body required: false type: string tenant_id_6: description: | The owner of the IKE policy. Only administrative users can specify a tenant UUID other than their own. in: body required: true type: string tenant_id_7: description: | Owner of the IPSec policy. Only administrative users can specify a tenant UUID other than their own. in: body required: true type: string tenant_id_8: description: | Owner of the IPSec connection. Only administrative users can specify a tenant UUID other than their own. in: body required: true type: string tenant_id_9: description: | The UUID of the tenant who owns the listener. Only administrative users can specify a tenant UUID other than their own. in: body required: true type: string timeout: description: | The maximum time, in seconds, that a monitor waits to connect before it times out. This value must be less than the delay value. in: body required: true type: integer topic: description: | The name of AMQP topic the agent is listening on such as ``dhcp_agent``. A special value of ``N/A`` is used when the agent doesn't use an AMQP topic. in: body required: true type: string total_ips: description: | The total number of IP addresses in a network. in: body required: true type: integer transform_protocol: description: | The transform protocol. A valid value is ``ESP``, ``AH``, or ``AH- ESP``. Default is ``ESP``. in: body required: false type: string trunk-status: description: | The status for the trunk. Possible values are ``ACTIVE``, ``DOWN``, ``BUILD``, ``DEGRADED``, and ``ERROR``. in: body required: true type: string trunk_details: description: | The details about the trunk. in: body required: false type: dict trunk_port_id: description: | The ID of the parent port. in: body required: true type: string type: description: | The type of probe sent by the load balancer to verify the member state. A valid value is ``PING``, ``TCP``, ``HTTP``, or ``HTTPS``. in: body required: true type: string type_2: description: | The type of the endpoints in the group. A valid value is ``subnet``, ``cidr``, ``network``, ``router``, or ``vlan``. in: body required: true type: string type_3: description: | The type of probe sent by the load balancer to verify the member state, which is ``PING``, ``TCP``, ``HTTP``, or ``HTTPS``. in: body required: true type: string units: description: | The units for the lifetime of the security association. The lifetime consists of a unit and integer value. You can omit either the unit or value portion of the lifetime. Default unit is seconds and default value is 3600. in: body required: false type: string updated: description: | The date and time stamp when the extension was last updated. in: body required: true type: string updated_at: description: | Time at which port has been updated. in: body required: true type: string updated_at_2: description: | Time at which subnetpool has been updated. in: body required: true type: string updated_at_resource: description: | Time at which the resource has been updated (in UTC ISO8601 format). in: body required: true type: string url_path: description: | The HTTP path of the request sent by the monitor to test the health of a member. A valid value is a string that begins with a forward slash (``/``). in: body required: false type: string url_path-response: description: | The HTTP path of the request sent by the monitor to test the health of a member. Must be a string that begins with a forward slash (``/``). The default is ``/``. in: body required: true type: string use_default_subnetpool: description: | Whether to allocate this subnet from the default subnet pool. in: body required: false type: boolean used_ips: description: | The number of used IP addresses of all subnets in a network. in: body required: true type: integer value: description: | The lifetime value, as a positive integer. The lifetime consists of a unit and integer value. You can omit either the unit or value portion of the lifetime. Default unit is seconds and default value is 3600. in: body required: false type: integer value_1: description: | The lifetime value, as a positive integer. The lifetime consists of a unit and integer value. You can omit either the unit or value portion of the lifetime. Default unit is seconds and default value is 3600. in: body required: true type: integer version-href: description: | Link to the API. in: body required: true type: string version-id: description: | Version of the API. in: body required: true type: string version-links: description: | List of version links. Each link is a dict with 'href' and 'rel'. in: body required: true type: array version-rel: description: | Relationship of link with the version. in: body required: true type: string version-status: description: | Status of the API, which can be ``CURRENT``, ``STABLE`` or ``DEPRECATED``. in: body required: true type: string versions: description: | List of versions. in: body required: true type: array vip: description: | A ``vip`` object. in: body required: true type: object vip-address: description: | The IP address of the VIP. format: ipv4 in: body required: true type: string vip-address-request: description: | The IP address of the VIP. format: ipv4 in: body required: false type: string vip-id: description: | The ID of the virtual IP (VIP) address. in: body required: true type: string vip-pool_id: description: | The ID of the pool which the VIP belongs to. in: body required: true type: string vip-pool_id-request: description: | The ID of the pool which the VIP belongs to. in: body required: false type: string vip-port_id: description: | The ID of the VIP port. in: body required: true type: string vip-protocol: description: | The protocol of the virtual IP (VIP) address. A valid value is ``TCP``, ``HTTP``, or ``HTTPS``. in: body required: true type: string vip-session_persistence: description: | Session persistence parameters for the VIP. Omit the ``session_persistence`` parameter to prevent session persistence. When no session persistence is used, the ``session_persistence`` parameter does not appear in the API response. in: body required: true type: object vip-session_persistence-request: description: | Session persistence parameters for the VIP. Omit the ``session_persistence`` parameter to prevent session persistence. When no session persistence is used, the ``session_persistence`` parameter does not appear in the API response. To clear session persistence for the VIP, set the ``session_persistence`` parameter to ``null`` in a VIP update request. The default is no session persistence. in: body required: false type: object vip-status: description: | The status of the VIP. Indicates whether the VIP is operational. in: body required: true type: string vip-subnet_id: description: | The ID of the subnet on which to allocate the virtual IP (VIP) address. in: body required: true type: string vip_address: description: | The IP address of the VIP . format: ipv4 in: body required: true type: string vip_address-request: description: | The IP address of the VIP . format: ipv4 in: body required: false type: string vip_id: description: | The ID of the virtual IP (VIP) address. in: body required: true type: string vip_network_id: description: | The ID of the network on which to allocate the virtual IP (VIP) address. This option is required if no vip_subnet_id is given. in: body required: false type: string vip_subnet_id: description: | The ID of the subnet on which to allocate the virtual IP (VIP) address. This option is required if no vip_network_id is given. in: body required: false type: string vips: description: | A list of ``vip`` objects. in: body required: true type: array vlan_transparent: description: | Indicates the VLAN transparency mode of the network, which is VLAN transparent (``true``) or not VLAN transparent (``false``). in: body required: true type: boolean vlan_transparent-request: description: | Indicates the VLAN transparency mode of the network, which is VLAN transparent (``true``) or not VLAN transparent (``false``). in: body required: false type: boolean vpnservice: description: | A ``vpnservice`` object. in: body required: true type: object vpnservice-status: description: | Indicates whether IPSec VPN service is currently operational. Values are ``ACTIVE``, ``DOWN``, ``BUILD``, ``ERROR``, ``PENDING_CREATE``, ``PENDING_UPDATE``, or ``PENDING_DELETE``. in: body required: true type: string vpnservice_id-body-request: description: | The ID of the VPN service. in: body required: false type: string vpnservice_id-body-response: description: | The ID of the VPN service. in: body required: true type: string vpnservices: description: | A list of VPN service objects. in: body required: true type: array neutron-lib-1.13.0/api-ref/source/v2/bgpvpn-overview.inc0000666000175100017510000001424613231472055023076 0ustar zuulzuul00000000000000======================= BGP - MPLS VPN Overview ======================= The ``bgpvpn`` extension implements the BGP VPN Interconnection API which provides the ability to associate OpenStack networks and/or routers with Multiprotocol Label Switching (MPLS) Virtual Private Networks (VPNs) via Border Gateway Protocol (BGP) peering. BGP-MPLS VPNs are commonly provided by telecommunications service providers to customers in addition to or instead of Internet connectivity for Wide Area Networking. This API enables the interconnection with these WAN VPNs using *Route Targets* to indicate the desired network(s). On Route Targets ================ ``route_targets``, ``import_targets``, ``export_targets`` attributes - The set of RTs used for import is the union of ``route_targets`` and ``import_targets``. - The set of RTs used for export is the union of ``route_targets`` and ``export_targets``. At least one of ``route_targets``, ``import_targets`` or ``export_targets`` options will typically be defined, but the API will not enforce that and all lists can be empty. For instance, in the very typical use case where the BGP VPN uses a single Route Target for both import and export, the route_targets parameter alone is enough and will contain one Route target. On Route Distinguishers (RDs) ============================= The ``route_distinguishers`` parameter is optional and provides an indication of the RDs that shall be used for routes announced for Neutron networks. The contract is that when a list of RDs is specified, the backend will use, for a said advertisement of a route, one of these RDs. The motivation for having a list rather than only one RD is to allow the support for multihoming a VPN prefix (typically for resiliency, load balancing or anycast). A backend may or may not support this behavior, and should report an API error in the latter case. When not specified, the backend will use automatically-assigned RDs (for instance : RDs derived from the Provider Edge (PE) IP). Valid strings for Route Distinguishers and Route Targets ======================================================== Valid strings for a Route Target or a Route Distinguisher are the following: - <2-byte AS#>:<32bit-number> - <4-byte AS#>:<16bit-number> - <4-byte IPv4>:<16bit-number> On VXLAN VNI ============ .. note:: This feature is under development in the Queens release VXLAN is one option among others that could be used for BGP E-VPNs. When VXLAN is used on a hardware platform the use of a locally-assigned id may not be always possible which introduces the need to configure a globally-assigned VXLAN VNI. The optional ``vni`` attribute is an admin-only parameter and allows the admin to enforce the use of a chosen globally-assigned VXLAN VNI for the said BGPVPN. The default when no VNI is specified and the VXLAN encapsulation is used, is to let the backend choose the VNI in advertised routes, and use the VNI in received routes for transmitted traffic. The backend will conform to E-VPN overlay specs. Valid range for the ``vni`` attribute is [1, 2\ :sup:`24`\ -1]. Control of routes advertised to BGPVPNs ======================================= .. note:: this feature is under development in the Queens release With the ``bgpvpn`` extension, when associations between networks or routers and BGVPNs are defined, the routes corresponding to fixed IPs of neutron ports will be advertised to BGPVPNs. For router associations, extra routes of the router ('routes' attribute of a ``router`` resource) may also be advertised to BGPVPNs. To provide more flexibility, the ``bgpvpn-routes-control`` extension provides a way to: - advertise other routes to a BGPVPN, for instances a prefix that is reachable via a neutron port, or routes leaked from another BGPVPN; this is implemented thanks to the ``routes`` attribute of a BGPVPN port association - not advertise the fixed IPs of a neutron port to a BGPVPN, which can be particularly relevant when other IP prefixes are reachable via the port; this is implemented thanks to the ``advertise_fixed_ips`` attribute of a BGPVPN port association - explicitly control whether extra routes of a router are to be advertised to a BGPVPN; this is implemented thanks to the ``advertise_extra_routes`` attribute of a BGPVPN router association - optionally control the value of the LOCAL_PREF BGP attribute of advertised routes, for all routes of a BGPVPN (thanks to the ``local_pref`` attribute of a BGPVPN resource) and/or per route (thanks to the ``local_pref`` in a port association route) ====================== BGP - MPLS VPN Caveats ====================== Association constraints ======================= A given BGP VPN can be associated to multiple networks and/or multiple routers. To avoid any ambiguity on semantics in particular the context of processing associated to a router (e.g. NAT or FWaaS), if a given subnet in a network is bound to a router, this API does not allow to both associate the network to an L3 BGP VPN and the router to the same or to a distinct L3 BGP VPN. Moreover, for BGP VPNs of type L3, there are possible cases of IP prefix overlaps that can't be detected by the service plugin before BGP routes are received, for which the behavior is left undefined by these specifications (i.e. which of the overlapping routes is being used) and will depend on the backend. This applies for both router associations and network associations in the case where traffic is forwarded by a router and the destination IP belongs both to a prefix of a BGP VPN associated with the router or with the network originating the traffic, and to a prefix of a subnet bound to the router; in such a case whether the traffic will be delivered to the subnet or to the BGP VPN is not defined by this API. Connectivity Impact inside Openstack Neutron ============================================ Creating two BGP VPNs with RTs resulting in both VPNs to exchange routes, and then associating these two BGP VPNs to two networks, will result in establishing interconnectivity between these two networks, this simply being the result of applying BGP VPN Route Target semantics (i.e. without making prefixes to OpenStack networks a particular case). This similarly applies to router associations. neutron-lib-1.13.0/api-ref/source/v2/segments.inc0000666000175100017510000001046213231472055021557 0ustar zuulzuul00000000000000.. -*- rst -*- ======== Segments ======== Lists, shows details for, creates, updates, and deletes segments. The segments API is admin-only. Show segment details ==================== .. rest_method:: GET /v2.0/segments/{segment_id} Shows details for a segment. You can control which response parameters are returned by using the fields query parameter. For information, see `Filtering and column selection `__. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - segment_id: segment_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - id: segment_id - network_id: network_id - physical_network: provider:physical_network - network_type: network_type - revision_number: revision_number - segmentation_id: provider:segmentation_id - name: name - description: description Response Example ---------------- .. literalinclude:: samples/segments/segment-show-response.json :language: javascript Update segment ============== .. rest_method:: PUT /v2.0/segments/{segment_id} Updates a segment. Normal response codes: 200 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - segment_id: segment_id-path - name: name-segment - description: description-request Request Example --------------- .. literalinclude:: samples/segments/segment-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - id: segment_id - network_id: network_id - physical_network: provider:physical_network - network_type: network_type - revision_number: revision_number - segmentation_id: provider:segmentation_id - name: name - description: description Response Example ---------------- .. literalinclude:: samples/segments/segment-update-response.json :language: javascript Delete segment ============== .. rest_method:: DELETE /v2.0/segments/{segment_id} Deletes a segment and its associated resources. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - segment_id: segment_id-path Response -------- There is no body content for the response of a successful DELETE request. List segments ============= .. rest_method:: GET /v2.0/segments Lists segments to which the project has access. Use the ``fields`` query parameter to filter the response. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - id: segment_id - network_id: network_id - physical_network: provider:physical_network - network_type: network_type - revision_number: revision_number - segmentation_id: provider:segmentation_id - name: name - description: description Response Example ---------------- .. literalinclude:: samples/segments/segments-list-response.json :language: javascript Create segment ============== .. rest_method:: POST /v2.0/segments Creates a segment. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - network_id: network_id - physical_network: provider:physical_network - network_type: network_type - segmentation_id: provider:segmentation_id - name: name-segment - description: description-request Request Example --------------- .. literalinclude:: samples/segments/segment-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - id: segment_id - network_id: network_id - physical_network: provider:physical_network - network_type: network_type - revision_number: revision_number - segmentation_id: provider:segmentation_id - name: name - description: description Response Example ---------------- .. literalinclude:: samples/segments/segment-create-response.json :language: javascript neutron-lib-1.13.0/api-ref/source/v2/quota_details.inc0000666000175100017510000000160113231472055022563 0ustar zuulzuul00000000000000.. -*- rst -*- ======================================== Quotas details extension (quota_details) ======================================== Extends the ``quotas`` API to show a quota set for each project that includes the quota's used, limit and reserved counts per resource. A quota value of ``-1`` means that quota has no limit. Show quota details for a tenant =============================== .. rest_method:: GET /v2.0/quotas/{project_id}/details.json Shows quota details for a project. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - project_id: project_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - quota: quota-detail Response Example ---------------- .. literalinclude:: samples/quota_details/quota-details-show-for-project-response.json :language: javascript neutron-lib-1.13.0/api-ref/source/v2/metering.inc0000666000175100017510000001717013231472055021547 0ustar zuulzuul00000000000000.. -*- rst -*- ================================================================= Metering labels and rules (metering-labels, metering-label-rules) ================================================================= Creates, modifies, and deletes OpenStack Layer3 metering labels and rules. List metering labels ==================== .. rest_method:: GET /v2.0/metering/metering-labels Lists all L3 metering labels that belong to the project. The list shows the ID for each metering label. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - metering_labels: metering_labels - description: description - tenant_id: project_id - project_id: project_id - shared: metering_label-shared - id: metering_label-id - name: name Response Example ---------------- .. literalinclude:: samples/metering/metering-labels-list-response.json :language: javascript Create metering label ===================== .. rest_method:: POST /v2.0/metering/metering-labels Creates an L3 metering label. Normal response codes: 201 Error response codes: 400, 401, 403 Request ------- .. rest_parameters:: parameters.yaml - metering_label: metering_label - shared: metering_label-shared-request - description: description - name: name - tenant_id: project_id - project_id: project_id Request Example --------------- .. literalinclude:: samples/metering/metering-label-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - metering_label: metering_label - description: description - tenant_id: project_id - project_id: project_id - shared: metering_label-shared - id: metering_label-id - name: name Response Example ---------------- .. literalinclude:: samples/metering/metering-label-create-response.json :language: javascript Show metering label details =========================== .. rest_method:: GET /v2.0/metering/metering-labels/{metering_label_id} Shows details for a metering label. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - metering_label_id: metering_label-id-path Request Example --------------- .. literalinclude:: samples/metering/metering-label-show-request-json-http.txt :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - metering_label: metering_label - description: description - tenant_id: project_id - project_id: project_id - shared: metering_label-shared - id: metering_label-id - name: name Response Example ---------------- .. literalinclude:: samples/metering/metering-label-show-response.json :language: javascript Delete metering label ===================== .. rest_method:: DELETE /v2.0/metering/metering-labels/{metering_label_id} Deletes an L3 metering label. Normal response codes: 204 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - metering_label_id: metering_label-id-path Request Example --------------- .. literalinclude:: samples/metering/metering-label-delete-request-json-http.txt :language: javascript Response -------- There is no body content for the response of a successful DELETE request. List metering label rules ========================= .. rest_method:: GET /v2.0/metering/metering-label-rules Lists a summary of all L3 metering label rules that belong to the project. The list shows the ID for each metering label rule. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - metering_label_rules: metering_label_rules - direction: direction - remote_ip_prefix: remote_ip_prefix - excluded : excluded - metering_label_id: metering_label-id-response-body - id: metering_label_rule-id Response Example ---------------- .. literalinclude:: samples/metering/metering-label-rules-list-response.json :language: javascript Create metering label rule ========================== .. rest_method:: POST /v2.0/metering/metering-label-rules Creates an L3 metering label rule. Normal response codes: 201 Error response codes: 400, 401, 403, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - metering_label_rule: metering_label_rule - remote_ip_prefix: remote_ip_prefix - direction: direction - metering_label_id: metering_label-id-response-body - excluded: excluded Request Example --------------- .. literalinclude:: samples/metering/metering-label-rule-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - metering_label_rule: metering_label_rule - direction: direction - remote_ip_prefix: remote_ip_prefix - excluded : excluded - metering_label_id: metering_label-id-response-body - id: metering_label_rule-id Response Example ---------------- .. literalinclude:: samples/metering/metering-label-rule-create-response.json :language: javascript Show metering label rule details ================================ .. rest_method:: GET /v2.0/metering/metering-label-rules/{metering_label_rule_id} Shows details for a metering label rule. The response body shows this information for each metering label rule: - ``direction``. Either ingress or egress. - ``excluded``. Either ``true`` or ``false``. - The ID for the metering label rule. - The remote IP prefix. - The metering label ID for the metering label with which the rule is associated. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - metering_label_rule_id: metering_label_rule-id-path Request Example --------------- .. literalinclude:: samples/metering/metering-label-rule-show-request-json-http.txt :language: javascript Response Paramters ------------------ .. rest_parameters:: parameters.yaml - metering_label_rule: metering_label_rule - direction: direction - remote_ip_prefix: remote_ip_prefix - excluded : excluded - metering_label_id: metering_label-id-response-body - id: metering_label_rule-id Response Example ---------------- .. literalinclude:: samples/metering/metering-label-rule-show-response.json :language: javascript Delete metering label rule ========================== .. rest_method:: DELETE /v2.0/metering/metering-label-rules/{metering_label_rule_id} Deletes an L3 metering label rule. Normal response codes: 204 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - metering_label_rule_id: metering_label_rule-id-path Request Example --------------- .. literalinclude:: samples/metering/metering-label-rule-delete-request-json-http.txt :language: javascript Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/tags.inc0000666000175100017510000000756713231472055020704 0ustar zuulzuul00000000000000 ==================== Tag extension (tags) ==================== Shows details for, updates, and deletes tags. The maximum number of characters allowed in a tag is 60. If the length is longer than 60, the API returns the HTTP ``Bad Request (400)`` response code with 'invalid input for operation' error message. Tag Extension ============= .. note:: NOTE: This extension is deprecated in favor of ``standard-attr-tag``. The ``tag`` extension allows users to set tags on their networks. This extension supports networks only. Enhanced Tag Extension ====================== .. note:: NOTE: This extension is deprecated in favor of ``standard-attr-tag``. The ``tag-ext`` extension allows users to set tags on their resources. This extension supports subnets, ports, routers, and subnet pools. Standard Attributes Tag Extension ================================= The ``standard-attr-tag`` extends tagging support to all resources that support standard attributes. This includes networks, ports, subnets, subnet pools, floating IPs, routers, logs, security groups/rules, network segments, QoS policies and trunks. Replace all tags ================ .. rest_method:: PUT /v2.0/{resource_type}/{resource_id}/tags Replaces all tags on the resource. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - resource_type: resource_type - resource_id: resource_id - tags: tags Request Example --------------- .. literalinclude:: samples/tag/tag-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - tags: tags Response Example ---------------- .. literalinclude:: samples/tag/tag-update-response.json :language: javascript Remove all tags =============== .. rest_method:: DELETE /v2.0/{resource_type}/{resource_id}/tags Removes all tags on the resource. Normal response codes: 204 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - resource_type: resource_type - resource_id: resource_id Response -------- There is no body content for the response of a successful DELETE request. Confirm a tag ============= .. rest_method:: GET /v2.0/{resource_type}/{resource_id}/tags/{tag} Confirms a given tag is set on the resource. Normal response codes: 204 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - resource_type: resource_type - resource_id: resource_id - tag: tag Response -------- There is no body content for the response of a successful GET request. Add a tag ========= .. rest_method:: PUT /v2.0/{resource_type}/{resource_id}/tags/{tag} Adds a tag on the resource. Normal response codes: 201 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - resource_type: resource_type - resource_id: resource_id - tag: tag Response -------- There is no body content for the response of a successful PUT request. Obtain Tag List =============== .. rest_method:: GET /v2.0/{resource_type}/{resource_id}/tags Obtains the tags for a resource. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - resource_type: resource_type - resource_id: resource_id Response -------- .. rest_parameters:: parameters.yaml - tags: tags Response Example ---------------- .. literalinclude:: samples/tag/tag-obtain-response.json :language: javascript Remove a tag ============ .. rest_method:: DELETE /v2.0/{resource_type}/{resource_id}/tags/{tag} Removes a tag on the resource. Normal response codes: 204 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - resource_type: resource_type - resource_id: resource_id - tag: tag Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/router-interface-fip.inc0000666000175100017510000000075713231472055023772 0ustar zuulzuul00000000000000.. -*- rst -*- ============================ Router Interface floating IP ============================ .. note:: Currently this extension ``router-interface-fip`` is only available for networking-midonet. This extension ``router-interface-fip`` indicates the ability to associate floating IPs to internal interfaces of a router. (Without this extension, floating IPs can be associated only to the gateway interface of a router.) This extension does not introduce any resources or attributes. neutron-lib-1.13.0/api-ref/source/v2/networks.inc0000666000175100017510000004063213231472055021610 0ustar zuulzuul00000000000000.. -*- rst -*- .. needs:method_verification .. NOTE(amotoki): method_verification will be removed after sorting methods in the recommended order. ======== Networks ======== Lists, shows details for, creates, updates, and deletes networks. provider extended attributes ============================ The ``provider`` extension allows administrative users to define a physical binding of a logical network. This extension provides three additional attributes: ``provider:network_type``, ``provider:physical_network`` and ``provider:segmentation_id``. The validation rules for these attributes vary across ``provider:network_type``. For example, ``vlan`` and ``flat`` network types require ``provider:physical_network`` attribute, but ``vxlan`` network type does not. Most Networking plug-ins (e.g. ML2 Plugin) and drivers do not support updating any provider related attributes. Check your plug-in whether it supports updating. multiple provider extension =========================== The ``multi-provider`` extension allows administrative users to define multiple physical bindings for a logical network. To define multiple physical bindings for a network, include a ``segments`` list in the request body of network creation request. Each element in the ``segments`` list has the same structure as the provider network attributes. These attributes are ``provider:network_type``, ``provider:physical_network``, and ``provider:segmentation_id``. The same validation rules are applied to each element in the ``segments`` list. Note that you cannot use the provider extension and the multiple provider extension for a single logical network. VLAN transparency extension =========================== The ``vlan-transparent`` extension enables plug-ins that support VLAN transparency to deliver VLAN transparent trunk networks. This extension introduces a ``vlan_transparent`` attribute to control the VLAN transparency of the network. If the service does not support VLAN transparency and a user requests a VLAN transparent network, the plug-in refuses to create one and returns an appropriate error to the user. MTU extensions ============== The ``net-mtu`` extension allows plug-ins to expose the MTU that is guaranteed to pass through the data path of the segments in the network. This extension introduces a read-only ``mtu`` attribute. A newer ``net-mtu-writable`` extension enhances ``net-mtu`` in that now the ``mtu`` attribute is available for write (both when creating as well as updating networks). DNS integration =============== The ``dns-integration`` extension adds the ``dns_domain`` attribute to networks. The ``dns_domain`` of a network in conjunction with the ``dns_name`` attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service. Port security ============= The ``port-security`` extension adds the ``port_security_enabled`` boolean attribute to networks. At the network level, ``port_security_enabled`` defines the default value for new ports attached to the network; they will inherit the value of their network's ``port_security_enabled`` unless explicitly set on the port itself. While the default value for ``port_security_enabled`` is ``true``, this can be changed by updating the respective network. Note that changing a value of ``port_security_enabled`` on a network, does not cascade the value to ports attached to the network. External network ================ The ``external-net`` extension adds the ``router:external`` attribute to networks. This boolean attribute indicates the network has an external routing facility that's not managed by the networking service. Show network details ==================== .. rest_method:: GET /v2.0/networks/{network_id} Shows details for a network. Use the ``fields`` query parameter to control which fields are returned in the response body. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - network_id: network_id-path - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - network: network - admin_state_up: network-admin_state_up - availability_zone_hints: availability_zone_hints - availability_zones: availability_zones - created_at: created_at_resource - dns_domain: dns_domain - id: network-id - mtu: mtu - name: network-name - port_security_enabled: network-port_security_enabled - project_id: project_id - provider:network_type: provider:network_type - provider:physical_network: provider:physical_network - provider:segmentation_id: provider:segmentation_id - qos_policy_id: qos_policy_id - revision_number: revision_number - router:external: router:external - segments: segments - shared: network-shared - status: network-status - subnets: network-subnets - tenant_id: project_id - updated_at: updated_at_resource - vlan_transparent: vlan_transparent - description: description Response Example ---------------- .. literalinclude:: samples/networks/network-show-response.json :language: javascript Response Example (admin user; single segment mapping) ----------------------------------------------------- .. literalinclude:: samples/networks/network-provider-show-response.json :language: javascript Response Example (admin user; multiple segment mappings) -------------------------------------------------------- .. literalinclude:: samples/networks/network-multi-show-response.json :language: javascript Update network ============== .. rest_method:: PUT /v2.0/networks/{network_id} Updates a network. Normal response codes: 200 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - network_id: network_id-path - network: network - admin_state_up: network-admin_state_up-request - dns_domain: dns_domain-request - mtu: mtu-request - name: network-name-request - port_security_enabled: network-port_security_enabled-request - provider:network_type: provider:network_type - provider:physical_network: provider:physical_network - provider:segmentation_id: provider:segmentation_id - qos_policy_id: qos_policy_id-request - router:external: router:external-request - segments: segments - shared: network-shared-request - description: description-request Request Example --------------- .. literalinclude:: samples/networks/network-update-request.json :language: javascript Request Example (admin user; single segment mapping) ---------------------------------------------------- .. literalinclude:: samples/networks/network-provider-update-request.json :language: javascript Request Example (admin user; multiple segment mappings) ------------------------------------------------------- .. literalinclude:: samples/networks/network-multi-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - network: network - admin_state_up: network-admin_state_up - availability_zone_hints: availability_zone_hints - availability_zones: availability_zones - dns_domain: dns_domain - id: network-id - mtu: mtu - name: network-name - port_security_enabled: network-port_security_enabled - project_id: project_id - provider:network_type: provider:network_type - provider:physical_network: provider:physical_network - provider:segmentation_id: provider:segmentation_id - qos_policy_id: qos_policy_id - revision_number: revision_number - router:external: router:external - segments: segments - shared: network-shared - status: network-status - subnets: network-subnets - tenant_id: project_id - description: description Response Example ---------------- This is an example when a regular user without administrative roles sends a PUT request. Response examples for administrative users are similar to responses of `Show network details <#show-network-details>`__ and `Create network <#create-network>`__. See them for details. .. literalinclude:: samples/networks/network-update-response.json :language: javascript Delete network ============== .. rest_method:: DELETE /v2.0/networks/{network_id} Deletes a network and its associated resources. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - network_id: network_id-path Response -------- There is no body content for the response of a successful DELETE request. List networks ============= .. rest_method:: GET /v2.0/networks Lists networks to which the project has access. Default policy settings return only networks that the project who submits the request owns, unless an administrative user submits the request. In addition, networks shared with the project who submits the request are also returned. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. .. TODO(amotoki): Add description on tag filtering to the general API overview. You can also use the ``tags``, ``tags-any``, ``not-tags``, ``not-tags-any`` query parameter to filter the response with tags. For information, see `REST API Impact `__. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - networks: networks - admin_state_up: network-admin_state_up - availability_zone_hints: availability_zone_hints - availability_zones: availability_zones - dns_domain: dns_domain - id: network-id - mtu: mtu - name: network-name - port_security_enabled: network-port_security_enabled - project_id: project_id - provider:network_type: provider:network_type - provider:physical_network: provider:physical_network - provider:segmentation_id: provider:segmentation_id - qos_policy_id: qos_policy_id - revision_number: revision_number - router:external: router:external - segments: segments - shared: network-shared - status: network-status - subnets: network-subnets - tenant_id: project_id - vlan_transparent: vlan_transparent - description: description Response Example ---------------- .. literalinclude:: samples/networks/networks-list-response.json :language: javascript Response Example (admin user) ----------------------------- When Administrative users request to list networks, physical segment information bound to the networks are also returned in a response. In this example, a network ``net1`` is mapped to a single network segment and a network ``net2`` is mapped to multiple network segments. .. literalinclude:: samples/networks/networks-provider-list-response.json :language: javascript Create network ============== .. rest_method:: POST /v2.0/networks Creates a network. A request body is optional. An administrative user can specify another project ID, which is the project that owns the network, in the request body. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - network: network - admin_state_up: network-admin_state_up-request - dns_domain: dns_domain-request - mtu: mtu-request - name: network-name-request - port_security_enabled: network-port_security_enabled-request - project_id: project_id-request - provider:network_type: provider:network_type-request - provider:physical_network: provider:physical_network-request - provider:segmentation_id: provider:segmentation_id-request - qos_policy_id: qos_policy_id-request - router:external: router:external-request - segments: segments-request - shared: network-shared-request - tenant_id: project_id-request - vlan_transparent: vlan_transparent-request - description: description-request Request Example --------------- .. literalinclude:: samples/networks/network-create-request.json :language: javascript Request Example (admin user; single segment mapping) ---------------------------------------------------- .. literalinclude:: samples/networks/network-provider-create-request.json :language: javascript Request Example (admin user; multiple segment mappings) ------------------------------------------------------- .. literalinclude:: samples/networks/network-multi-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - network: network - admin_state_up: network-admin_state_up - availability_zone_hints: availability_zone_hints - availability_zones: availability_zones - dns_domain: dns_domain - id: network-id - mtu: mtu - name: network-name - port_security_enabled: network-port_security_enabled - project_id: project_id - provider:network_type: provider:network_type - provider:physical_network: provider:physical_network - provider:segmentation_id: provider:segmentation_id - qos_policy_id: qos_policy_id - revision_number: revision_number - router:external: router:external - segments: segments - shared: network-shared - status: network-status - subnets: network-subnets - tenant_id: project_id - vlan_transparent: vlan_transparent - description: description Response Example ---------------- .. literalinclude:: samples/networks/network-create-response.json :language: javascript Response Example (admin user; single segment mapping) ----------------------------------------------------- .. literalinclude:: samples/networks/network-provider-create-response.json :language: javascript Response Example (admin user; multiple segment mappings) -------------------------------------------------------- .. literalinclude:: samples/networks/network-multi-create-response.json :language: javascript Bulk create networks ==================== .. rest_method:: POST /v2.0/networks Creates multiple networks in a single request. In the request body, specify a list of networks. The bulk create operation is always atomic. Either all or no networks in the request body are created. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - networks: networks - admin_state_up: network-admin_state_up-request - dns_domain: dns_domain-request - mtu: mtu-request - name: network-name-request - port_security_enabled: network-port_security_enabled-request - project_id: project_id-request - provider:network_type: provider:network_type-request - provider:physical_network: provider:physical_network-request - provider:segmentation_id: provider:segmentation_id-request - qos_policy_id: qos_policy_id-request - router:external: router:external-request - segments: segments-request - shared: network-shared-request - tenant_id: project_id-request - vlan_transparent: vlan_transparent-request - description: description-request Request Example --------------- .. literalinclude:: samples/networks/networks-bulk-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - networks: networks - admin_state_up: network-admin_state_up - availability_zone_hints: availability_zone_hints - availability_zones: availability_zones - dns_domain: dns_domain - id: network-id - mtu: mtu - name: network-name - port_security_enabled: network-port_security_enabled - project_id: project_id - provider:network_type: provider:network_type - provider:physical_network: provider:physical_network - provider:segmentation_id: provider:segmentation_id - qos_policy_id: qos_policy_id - revision_number: revision_number - router:external: router:external - segments: segments - shared: network-shared - status: network-status - subnets: network-subnets - tenant_id: project_id - vlan_transparent: vlan_transparent - description: description Response Example ---------------- .. literalinclude:: samples/networks/networks-bulk-create-response.json :language: javascript neutron-lib-1.13.0/api-ref/source/v2/index.rst0000666000175100017510000000410613231472055021076 0ustar zuulzuul00000000000000:tocdepth: 2 ################### Networking API v2.0 ################### .. rest_expand_all:: #################### General API Overview #################### .. include:: intro.inc .. include:: versions.inc .. include:: extensions.inc ################## Layer 2 Networking ################## .. include:: networks.inc .. include:: ports.inc .. include:: segments.inc .. include:: trunk.inc .. include:: trunk-details.inc ################## Layer 3 Networking ################## .. include:: floatingips.inc .. include:: routers.inc .. include:: subnetpools.inc .. include:: subnets.inc ######## Security ######## .. include:: fwaas.inc .. include:: fwaas-v2.inc .. include:: rbac-policy.inc .. include:: security-group-rules.inc .. include:: security-groups.inc .. include:: vpnaas.inc ################### Resource Management ################### .. include:: flavors.inc .. include:: metering.inc .. include:: network-ip-availability.inc .. include:: quotas.inc .. include:: quota_details.inc .. include:: service-providers.inc .. include:: tags.inc ################## Quality of Service ################## .. include:: qos.inc ########################## Load Balancer as a Service ########################## .. include:: lbaas-v2.inc ##################################### Logging Resource (networking-midonet) ##################################### .. include:: logging_resource.inc .. include:: firewall_log.inc ################################################# Router interface floating IP (networking-midonet) ################################################# .. include:: router-interface-fip.inc ########################## FIP64 (networking-midonet) ########################## .. include:: fip64.inc ############################ BGP/MPLS VPN Interconnection ############################ .. include:: bgpvpn-overview.inc .. include:: bgpvpn-bgpvpns.inc .. include:: bgpvpn-network_associations.inc .. include:: bgpvpn-router_associations.inc .. include:: bgpvpn-port_associations.inc ####### Logging ####### .. include:: logging.inc ################# Networking Agents ################# .. include:: agents.inc neutron-lib-1.13.0/api-ref/source/v2/security-groups.inc0000666000175100017510000001254413231472055023121 0ustar zuulzuul00000000000000.. -*- rst -*- ================================= Security groups (security-groups) ================================= Lists, creates, shows information for, updates, and deletes security groups. List security groups ==================== .. rest_method:: GET /v2.0/security-groups Lists OpenStack Networking security groups to which the project has access. The response is an array of ``security_group`` objects which contains a list of ``security_group_rules`` objects. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - security_groups: security_groups-obj - id: security_group-id - tenant_id: project_id - project_id: project_id - revision_number: revision_number - name: name - description: description - security_group_rules: security_group_rules Response Example ---------------- .. literalinclude:: samples/security-groups/security-groups-list-response.json :language: javascript Create security group ===================== .. rest_method:: POST /v2.0/security-groups Creates an OpenStack Networking security group. This operation creates a security group with default security group rules for the IPv4 and IPv6 ether types. Normal response codes: 201 Error response codes: 400, 401, 409 Request ------- .. rest_parameters:: parameters.yaml - security_group: security_group - tenant_id: project_id - project_id: project_id - description: description-request - name: name Request Example --------------- .. literalinclude:: samples/security-groups/security-group-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - security_group: security_group - id: security_group-id - tenant_id: project_id - project_id: project_id - revision_number: revision_number - name: name - description: description - security_group_rules: security_group_rules Response Example ---------------- .. literalinclude:: samples/security-groups/security-group-create-response.json :language: javascript Show security group =================== .. rest_method:: GET /v2.0/security-groups/{security_group_id} Shows details for a security group. The associated security group rules are contained in the response. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - security_group_id: security_group-id-path - verbose: verbose - fields: fields Request Example --------------- .. literalinclude:: samples/security-groups/security-group-show-request-json-http.txt :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - security_group: security_group - id: security_group-id - tenant_id: project_id - project_id: project_id - revision_number: revision_number - name: name - description: description - security_group_rules: security_group_rules Response Example ---------------- .. literalinclude:: samples/security-groups/security-group-show-response.json :language: javascript Update security group ===================== .. rest_method:: PUT /v2.0/security-groups/{security_group_id} Updates a security group. Normal response codes: 200 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - security_group_id: security_group-id-path - security_group: security_group - description: description-request - name: name Request Example --------------- .. literalinclude:: samples/security-groups/security-group-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - security_group: security_group - id: security_group-id - tenant_id: project_id - project_id: project_id - revision_number: revision_number - name: name - description: description - security_group_rules: security_group_rules Response Example ---------------- .. literalinclude:: samples/security-groups/security-group-update-response.json :language: javascript Delete security group ===================== .. rest_method:: DELETE /v2.0/security-groups/{security_group_id} Deletes an OpenStack Networking security group. This operation deletes an OpenStack Networking security group and its associated security group rules, provided that a port is not associated with the security group. If a port is associated with the security group 409 (Conflict) is returned. This operation does not require a request body. This operation does not return a response body. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - security_group_id: security_group-id-path Request Example --------------- .. literalinclude:: samples/security-groups/security-group-delete-request-json-http.txt :language: javascript Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/fip64.inc0000666000175100017510000000062513231472055020662 0ustar zuulzuul00000000000000.. -*- rst -*- ===== FIP64 ===== .. note:: Currently this extension ``fip64`` is only available for networking-midonet. This extension ``fip64`` provides `NAT64 `__ functionality by allowing to associate IPv6 floating IPs to IPv4 fixed IPs. (Without this extension, floating IPs are limited to IPv4.) This extension does not introduce any resources or attributes. neutron-lib-1.13.0/api-ref/source/v2/subnets.inc0000666000175100017510000002710313231472055021415 0ustar zuulzuul00000000000000.. -*- rst -*- ======= Subnets ======= Lists, shows details for, creates, updates, and deletes subnet resources. Default subnetpool extension ============================ The default subnetpool extension (``default-subnetpools``) allows administrative users to specify default subnetpools (one per IP version). Then users can specify the ``use_default_subnetpool`` attribute when creating a subnet, instead of having to specify the ``subnetpool_id`` attribute referencing the default subnetpool. List subnets ============ .. rest_method:: GET /v2.0/subnets Lists subnets that the project has access to. Default policy settings return only subnets owned by the project of the user submitting the request, unless the user has administrative role. You can control which attributes are returned by using the fields query parameter. You can filter results by using query string parameters. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - subnets: subnets-obj - id: subnet-id-body - tenant_id: project_id - project_id: project_id - name: subnet-name - enable_dhcp: subnet-enable_dhcp - network_id: subnet-network_id - dns_nameservers: subnet-dns_nameservers - allocation_pools: subnet-allocation_pools - host_routes: subnet-host_routes - ip_version: subnet-ip_version - gateway_ip: subnet-gateway_ip - cidr: cidr - created_at: subnet-created_at - description: description - ipv6_address_mode: subnet-ipv6_address_mode - ipv6_ra_mode: subnet-ipv6_ra_mode - revision_number: revision_number - segment_id: subnet-segment_id - service_types: subnet-service_types - subnetpool_id: subnet-subnetpool_id - updated_at: subnet-updated_at Response Example ---------------- .. literalinclude:: samples/subnets/subnets-list-response.json :language: javascript Create subnet ============= .. rest_method:: POST /v2.0/subnets Creates a subnet on a network. OpenStack Networking does not try to derive the correct IP version from the CIDR. If you do not specify the ``gateway_ip`` attribute, OpenStack Networking allocates an address from the CIDR for the gateway for the subnet. To specify a subnet without a gateway, set the ``gateway_ip`` attribute to ``null`` in the request body. If you do not specify the ``allocation_pools`` attribute, OpenStack Networking automatically allocates pools for covering all IP addresses in the CIDR, excluding the address reserved for the subnet gateway. Otherwise, you can explicitly specify allocation pools as shown in the following example. When you specify both the ``allocation_pools`` and ``gateway_ip`` attributes, you must ensure that the gateway IP does not overlap with the allocation pools; otherwise, the call returns the ``Conflict (409)`` response code. A subnet can have one or more name servers and host routes. Hosts in this subnet use the name servers. Devices with IP addresses from this subnet, not including the local subnet route, use the host routes. Specify the ``ipv6_ra_mode`` and ``ipv6_address_mode`` attributes to create subnets that support IPv6 configurations, such as stateless address autoconfiguration (SLAAC), DHCPv6 stateful, and DHCPv6 stateless configurations. A subnet can optionally be associated with a network segment when it is created by specifying the ``segment_id`` of a valid segment on the specified network. A network with subnets associated in this way is called a routed network. On any given network, all of the subnets must be associated with segments or none of them can be. Neutron enforces this invariant. Currently, routed networks are only supported for provider networks. Normal response codes: 201 Error response codes: 400, 401, 403, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - subnet: subnet-obj - tenant_id: project_id-request - project_id: project_id-request - name: subnet-name-request - enable_dhcp: subnet-enable_dhcp-request - network_id: subnet-network_id - dns_nameservers: subnet-dns_nameservers-request - allocation_pools: subnet-allocation_pools-request - host_routes: subnet-host_routes-request - ip_version: subnet-ip_version - gateway_ip: subnet-gateway_ip-request - cidr: cidr - description: description-request - ipv6_address_mode: subnet-ipv6_address_mode-request - ipv6_ra_mode: subnet-ipv6_ra_mode-request - segment_id: subnet-segment_id-request - subnetpool_id: subnet-subnetpool_id-request - use_default_subnetpool: use_default_subnetpool Request Example --------------- .. literalinclude:: samples/subnets/subnet-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - subnet: subnet-obj - id: subnet-id-body - tenant_id: project_id - project_id: project_id - name: subnet-name - enable_dhcp: subnet-enable_dhcp - network_id: subnet-network_id - dns_nameservers: subnet-dns_nameservers - allocation_pools: subnet-allocation_pools - host_routes: subnet-host_routes - ip_version: subnet-ip_version - gateway_ip: subnet-gateway_ip - cidr: cidr - created_at: subnet-created_at - description: description - ipv6_address_mode: subnet-ipv6_address_mode - ipv6_ra_mode: subnet-ipv6_ra_mode - revision_number: revision_number - service_types: subnet-service_types - subnetpool_id: subnet-subnetpool_id - segment_id: subnet-segment_id - updated_at: subnet-updated_at Response Example ---------------- .. literalinclude:: samples/subnets/subnet-create-response.json :language: javascript Bulk create subnet ================== .. rest_method:: POST /v2.0/subnets Creates multiple subnets in a single request. Specify a list of subnets in the request body. The bulk create operation is always atomic. Either all or no subnets in the request body are created. Normal response codes: 201 Error response codes: 400, 401, 403, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - subnets: subnets-obj - tenant_id: project_id-request - project_id: project_id-request - name: subnet-name-request - enable_dhcp: subnet-enable_dhcp-request - network_id: subnet-network_id - dns_nameservers: subnet-dns_nameservers-request - allocation_pools: subnet-allocation_pools-request - host_routes: subnet-host_routes-request - ip_version: subnet-ip_version - gateway_ip: subnet-gateway_ip-request - cidr: cidr - description: description-request - ipv6_address_mode: subnet-ipv6_address_mode-request - ipv6_ra_mode: subnet-ipv6_ra_mode-request - segment_id: subnet-segment_id-request - subnetpool_id: subnet-subnetpool_id-request - use_default_subnetpool: use_default_subnetpool Request Example --------------- .. literalinclude:: samples/subnets/subnets-create-bulk-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - subnets: subnets-obj - id: subnet-id-body - tenant_id: project_id - project_id: project_id - name: subnet-name - enable_dhcp: subnet-enable_dhcp - network_id: subnet-network_id - dns_nameservers: subnet-dns_nameservers - allocation_pools: subnet-allocation_pools - host_routes: subnet-host_routes - ip_version: subnet-ip_version - gateway_ip: subnet-gateway_ip - cidr: cidr - created_at: subnet-created_at - description: description - ipv6_address_mode: subnet-ipv6_address_mode - ipv6_ra_mode: subnet-ipv6_ra_mode - revision_number: revision_number - segment_id: subnet-segment_id - service_types: subnet-service_types - subnetpool_id: subnet-subnetpool_id - updated_at: subnet-updated_at Response Example ---------------- .. literalinclude:: samples/subnets/subnets-create-bulk-response.json :language: javascript Show subnet details =================== .. rest_method:: GET /v2.0/subnets/{subnet_id} Shows details for a subnet. Use the fields query parameter to filter the results. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - subnet_id: subnet_id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - subnet: subnet-obj - id: subnet-id-body - tenant_id: project_id - project_id: project_id - created_at: subnet-created_at - name: subnet-name - enable_dhcp: subnet-enable_dhcp - network_id: subnet-network_id - dns_nameservers: subnet-dns_nameservers - allocation_pools: subnet-allocation_pools - host_routes: subnet-host_routes - ip_version: subnet-ip_version - gateway_ip: subnet-gateway_ip - cidr: cidr - updated_at: subnet-updated_at - description: description - ipv6_address_mode: subnet-ipv6_address_mode - ipv6_ra_mode: subnet-ipv6_ra_mode - revision_number: revision_number - segment_id: subnet-segment_id - service_types: subnet-service_types - subnetpool_id: subnet-subnetpool_id Response Example ---------------- .. literalinclude:: samples/subnets/subnet-show-response.json :language: javascript Update subnet ============= .. rest_method:: PUT /v2.0/subnets/{subnet_id} Updates a subnet. Some attributes, such as IP version (ip_version), CIDR (cidr), and segment (segment_id) cannot be updated. Attempting to update these attributes results in a ``400 Bad Request`` error. Normal response codes: 200 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - subnet_id: subnet_id-path - name: subnet-name-update-request - enable_dhcp: subnet-enable_dhcp-request - dns_nameservers: subnet-dns_nameservers-request - allocation_pools: subnet-allocation_pools-request - host_routes: subnet-host_routes-request - gateway_ip: subnet-gateway_ip-request - description: description-request Request Example --------------- .. literalinclude:: samples/subnets/subnet-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - subnet: subnet-obj - id: subnet-id-body - tenant_id: project_id - project_id: project_id - name: subnet-name - enable_dhcp: subnet-enable_dhcp - network_id: subnet-network_id - dns_nameservers: subnet-dns_nameservers - allocation_pools: subnet-allocation_pools - host_routes: subnet-host_routes - ip_version: subnet-ip_version - gateway_ip: subnet-gateway_ip - cidr: cidr - created_at: subnet-created_at - description: description - ipv6_address_mode: subnet-ipv6_address_mode - ipv6_ra_mode: subnet-ipv6_ra_mode - revision_number: revision_number - segment_id: subnet-segment_id - service_types: subnet-service_types - subnetpool_id: subnet-subnetpool_id - updated_at: subnet-updated_at Response Example ---------------- .. literalinclude:: samples/subnets/subnet-update-response.json :language: javascript Delete subnet ============= .. rest_method:: DELETE /v2.0/subnets/{subnet_id} Deletes a subnet. The operation fails if subnet IP addresses are still allocated. Normal response codes: 204 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - subnet_id: subnet_id-path Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/qos.inc0000666000175100017510000004640213231472055020537 0ustar zuulzuul00000000000000.. -*- rst -*- ============== QoS rule types ============== Lists and shows information for QoS rule types available in current deployment. Rule type details ================= The ``qos-rule-type-details`` extension adds the ``drivers`` attribute to QoS rule types. The ``drivers`` attribute's value is a list of driver objects. Each driver object represents a loaded backend QoS driver and includes the driver's ``name`` as well as a list of its ``supported_parameters`` and acceptable values. List QoS rule types =================== .. rest_method:: GET /v2.0/qos/rule-types Lists available qos rule types. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401 Response Parameters ------------------- .. rest_parameters:: parameters.yaml - rule_types: qos-rule-types - type: qos-rule-type Response Example ---------------- .. literalinclude:: samples/qos/rule_types-list-response.json :language: javascript Show QoS rule type details ========================== .. rest_method:: GET /v2.0/qos/rule-types/{rule_type} Shows details for an available QoS rule type. You can control which response parameters are returned by using the fields query parameter. For information, see `Filtering and column selection `__. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - rule_type: qos-rule_type Response Parameters ------------------- .. rest_parameters:: parameters.yaml - type: qos-rule-type - drivers: qos-backend-drivers Response Example ---------------- .. literalinclude:: samples/qos/rule_type-details-response.json :language: javascript ================== QoS policies (qos) ================== Lists, creates, deletes, shows information for, and updates QoS policies. List QoS policies ================= .. rest_method:: GET /v2.0/qos/policies Lists all QoS policies associated with your project. The list might be empty. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - policies: policies - description: description - tenant_id: project_id - project_id: project_id - revision_number: revision_number - shared: qos-shared - id: qos_policy_id - rules: qos-rules - name: name Response Example ---------------- .. literalinclude:: samples/qos/policies-list-response.json :language: javascript Create QoS policy ================= .. rest_method:: POST /v2.0/qos/policies Creates a QoS policy. Creates a QoS policy by using the configuration that you define in the request object. A response object is returned. The object contains a unique ID. By the default policy configuration, if the caller is not an administrative user, this call returns the HTTP ``Forbidden (403)`` response code. Users with an administrative role can create policies on behalf of other projects by specifying a project ID that is different than their own. Normal response codes: 201 Error response codes: 401, 403, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - policy: policy - description: description-request - tenant_id: project_id-request - project_id: project_id-request - shared: qos-shared-request - name: qos_policy-name Request Example --------------- .. literalinclude:: samples/qos/policy-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - policy: policy - description: description - tenant_id: project_id - project_id: project_id - revision_number: revision_number - shared: qos-shared - rules: qos-rules - id: qos_policy_id - name: name Response Example ---------------- .. literalinclude:: samples/qos/policy-create-response.json :language: javascript Show QoS policy details ======================= .. rest_method:: GET /v2.0/qos/policies/{policy_id} Shows details for a QoS policy. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - policy: policy - description: description - tenant_id: project_id - project_id: project_id - revision_number: revision_number - shared: qos-shared - rules: qos-rules - id: qos_policy_id - name: name Response Example ---------------- .. literalinclude:: samples/qos/policy-show-response.json :language: javascript Update QoS policy ================= .. rest_method:: PUT /v2.0/qos/policies/{policy_id} Updates a QoS policy. If the request is valid, the service returns the ``Accepted (202)`` response code. Normal response codes: 202 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path - policy: policy - description: description-request - shared: qos-shared-request - name: qos_policy-name Request Example --------------- .. literalinclude:: samples/qos/policy-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - policy: policy - description: description - tenant_id: project_id - project_id: project_id - revision_number: revision_number - shared: qos-shared - id: qos_policy_id - rules: qos-rules - name: name Response Example ---------------- .. literalinclude:: samples/qos/policy-update-response.json :language: javascript Delete QoS policy ================= .. rest_method:: DELETE /v2.0/qos/policies/{policy_id} Deletes a QoS policy. Normal response codes: 204 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path Response -------- There is no body content for the response of a successful DELETE request. ========================= QoS bandwidth limit rules ========================= Lists, creates, deletes, shows information for, and updates QoS bandwidth limit rules. List bandwidth limit rules for QoS policy ========================================= .. rest_method:: GET /v2.0/qos/policies/{policy_id}/bandwidth_limit_rules Lists all bandwidth limit rules for a QoS policy. The list might be empty. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - bandwidth_limit_rules: bandwidth_limit_rules - max_kbps: max_kbps-response - id: qos_bandwidth_limit_rule-id - max_burst_kbps: max_burst_kbps-response - direction: qos-rule-direction-response Response Example ---------------- .. literalinclude:: samples/qos/bandwidth_limit_rules-list-response.json :language: javascript Create bandwidth limit rule =========================== .. rest_method:: POST /v2.0/qos/policies/{policy_id}/bandwidth_limit_rules Creates a bandwidth limit rule for a QoS policy. Normal response codes: 201 Error response codes: 400, 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path - bandwidth_limit_rule: bandwidth_limit_rule - max_kbps: max_kbps - max_burst_kbps: max_burst_kbps - direction: qos-rule-direction Request Example --------------- .. literalinclude:: samples/qos/bandwidth_limit_rule-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - bandwidth_limit_rule: bandwidth_limit_rule - max_kbps: max_kbps-response - id: qos_bandwidth_limit_rule-id - max_burst_kbps: max_burst_kbps-response - direction: qos-rule-direction-response Response Example ---------------- .. literalinclude:: samples/qos/bandwidth_limit_rule-create-response.json :language: javascript Show bandwidth limit rule details ================================= .. rest_method:: GET /v2.0/qos/policies/{policy_id}/bandwidth_limit_rules/{rule_id} Shows details for a bandwidth limit rule for a QoS policy. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path - rule_id: qos-rule_id Response Parameters ------------------- .. rest_parameters:: parameters.yaml - bandwidth_limit_rule: bandwidth_limit_rule - max_kbps: max_kbps-response - id: qos_bandwidth_limit_rule-id - max_burst_kbps: max_burst_kbps-response - direction: qos-rule-direction-response Response Example ---------------- .. literalinclude:: samples/qos/bandwidth_limit_rule-show-response.json :language: javascript Update bandwidth limit rule =========================== .. rest_method:: PUT /v2.0/qos/policies/{policy_id}/bandwidth_limit_rules/{rule_id} Updates a bandwidth limit rule for a QoS policy. If the request is valid, the service returns the ``Accepted (202)`` response code. Normal response codes: 202 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path - rule_id: qos-rule_id - bandwidth_limit_rule: bandwidth_limit_rule - max_kbps: max_kbps - max_burst_kbps: max_burst_kbps - direction: qos-rule-direction-update Request Example --------------- .. literalinclude:: samples/qos/bandwidth_limit_rule-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - bandwidth_limit_rule: bandwidth_limit_rule - max_kbps: max_kbps-response - id: qos_bandwidth_limit_rule-id - max_burst_kbps: max_burst_kbps-response - direction: qos-rule-direction-update-response Response Example ---------------- .. literalinclude:: samples/qos/bandwidth_limit_rule-update-response.json :language: javascript Delete bandwidth limit rule =========================== .. rest_method:: DELETE /v2.0/qos/policies/{policy_id}/bandwidth_limit_rules/{rule_id} Deletes a bandwidth limit rule for a QoS policy. Normal response codes: 204 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path - rule_id: qos-rule_id Response -------- There is no body content for the response of a successful DELETE request. ====================== QoS DSCP marking rules ====================== Lists, creates, deletes, shows information for, and updates QoS DSCP marking rules. List DSCP marking rules for QoS policy ====================================== .. rest_method:: GET /v2.0/qos/policies/{policy_id}/dscp_marking_rules Lists all DSCP marking rules for a QoS policy. The list may be empty. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - dscp_marking_rules: dscp_marking_rules - dscp_mark: dscp_mark-response - id: qos_dscp_marking_rule-id Response Example ---------------- .. literalinclude:: samples/qos/dscp_marking_rules-list-response.json :language: javascript Create DSCP marking rule ======================== .. rest_method:: POST /v2.0/qos/policies/{policy_id}/dscp_marking_rules Creates a DSCP marking rule for a QoS policy. Normal response codes: 201 Error response codes: 400, 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path - dscp_marking_rule: dscp_marking_rule - dscp_mark: dscp_mark Request Example --------------- .. literalinclude:: samples/qos/dscp_marking_rule-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - dscp_marking_rule: dscp_marking_rule - dscp_mark: dscp_mark-response - id: qos_dscp_marking_rule-id Response Example ---------------- .. literalinclude:: samples/qos/dscp_marking_rule-create-response.json :language: javascript Show DSCP marking rule details ============================== .. rest_method:: GET /v2.0/qos/policies/{policy_id}/dscp_marking_rules/{dscp_rule_id} Shows details for a DSCP marking rule for a QoS policy. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path - dscp_rule_id: dscp_rule_id Response Parameters ------------------- .. rest_parameters:: parameters.yaml - dscp_marking_rule: dscp_marking_rule - dscp_mark: dscp_mark - id: qos_dscp_marking_rule-id Response Example ---------------- .. literalinclude:: samples/qos/dscp_marking_rule-show-response.json :language: javascript Update DSCP marking rule ======================== .. rest_method:: PUT /v2.0/qos/policies/{policy_id}/dscp_marking_rules/{dscp_rule_id} Updates a DSCP marking rule for a QoS policy. If the request is valid, the service returns the ``Accepted (202)`` response code. Normal response codes: 202 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path - dscp_rule_id: dscp_rule_id - dscp_marking_rule: dscp_marking_rule - dscp_mark: dscp_mark Request Example --------------- .. literalinclude:: samples/qos/dscp_marking_rule-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - dscp_marking_rule: dscp_marking_rule - dscp_mark: dscp_mark-response - id: qos_dscp_marking_rule-id Response Example ---------------- .. literalinclude:: samples/qos/dscp_marking_rule-update-response.json :language: javascript Delete DSCP marking rule ======================== .. rest_method:: DELETE /v2.0/qos/policies/{policy_id}/dscp_marking_rules/{dscp_rule_id} Deletes a DSCP marking rule for a QoS policy. Normal response codes: 204 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path - dscp_rule_id: dscp_rule_id Response -------- There is no body content for the response of a successful DELETE request. =========================== QoS minimum bandwidth rules =========================== Lists, creates, deletes, shows information for, and updates QoS minimum bandwidth rules. List minimum bandwidth rules for QoS policy =========================================== .. rest_method:: GET /v2.0/qos/policies/{policy_id}/minimum_bandwidth_rules Lists all minimum bandwidth rules for a QoS policy. The list might be empty. You can control which response parameters are returned by using the fields query parameter. For information, see `Filtering and column selection `__. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path Response Parameters ------------------- .. rest_parameters:: parameters.yaml - minimum_bandwidth_rules: minimum_bandwidth_rules - min_kbps: min_kbps-response - id: qos_minimum_bandwidth_rule-id - direction: qos-rule-direction-response Response Example ---------------- .. literalinclude:: samples/qos/minimum_bandwidth_rules-list-response.json :language: javascript Create minimum bandwidth rule ============================= .. rest_method:: POST /v2.0/qos/policies/{policy_id}/minimum_bandwidth_rules Creates a minimum bandwidth rule for a QoS policy. Normal response codes: 201 Error response codes: 400, 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path - minimum_bandwidth_rule: minimum_bandwidth_rule - min_kbps: min_kbps - direction: qos-rule-direction Request Example --------------- .. literalinclude:: samples/qos/minimum_bandwidth_rule-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - minimum_bandwidth_rule: minimum_bandwidth_rule - min_kbps: min_kbps-response - id: qos_minimum_bandwidth_rule-id - direction: qos-rule-direction-response Response Example ---------------- .. literalinclude:: samples/qos/minimum_bandwidth_rule-create-response.json :language: javascript Show minimum bandwidth rule details =================================== .. rest_method:: GET /v2.0/qos/policies/{policy_id}/minimum_bandwidth_rules/{rule_id} Shows details for a minimum bandwidth rule for a QoS policy. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path - rule_id: qos-rule_id Response Parameters ------------------- .. rest_parameters:: parameters.yaml - minimum_bandwidth_rule: minimum_bandwidth_rule - min_kbps: min_kbps-response - id: qos_minimum_bandwidth_rule-id - direction: qos-rule-direction-response Response Example ---------------- .. literalinclude:: samples/qos/minimum_bandwidth_rule-show-response.json :language: javascript Update minimum bandwidth rule ============================= .. rest_method:: PUT /v2.0/qos/policies/{policy_id}/minimum_bandwidth_rules/{rule_id} Updates a minimum bandwidth rule for a QoS policy. If the request is valid, the service returns the ``Accepted (202)`` response code. Normal response codes: 202 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path - rule_id: qos-rule_id - minimum_bandwidth_rule: minimum_bandwidth_rule - min_kbps: min_kbps - direction: qos-rule-direction-update Request Example --------------- .. literalinclude:: samples/qos/minimum_bandwidth_rule-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - minimum_bandwidth_rule: minimum_bandwidth_rule - min_kbps: min_kbps-response - id: qos_minimum_bandwidth_rule-id - direction: qos-rule-direction-update-response Response Example ---------------- .. literalinclude:: samples/qos/minimum_bandwidth_rule-update-response.json :language: javascript Delete minimum bandwidth rule ============================= .. rest_method:: DELETE /v2.0/qos/policies/{policy_id}/minimum_bandwidth_rules/{rule_id} Deletes a minimum bandwidth rule for a QoS policy. Normal response codes: 204 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - policy_id: qos-policy-id-path - rule_id: qos-rule_id Response -------- There is no body content for the response of a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/security-group-rules.inc0000666000175100017510000001134113231472055024060 0ustar zuulzuul00000000000000.. -*- rst -*- .. _security_group_rules: =========================================== Security group rules (security-group-rules) =========================================== Lists, creates, shows information for, and deletes security group rules. List security group rules ========================= .. rest_method:: GET /v2.0/security-group-rules Lists a summary of all OpenStack Networking security group rules that the project can access. The list provides the ID for each security group rule. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - security_group_rules: security_group_rules - remote_group_id: remote_group_id - direction: direction - protocol: protocol - ethertype: ethertype - port_range_max: port_range_max - security_group_id: security_group_rule-security_group_id - tenant_id: project_id - project_id: project_id - port_range_min: port_range_min - remote_ip_prefix: remote_ip_prefix - revision_number: revision_number - id: security_group_rule-id - description: description Response Example ---------------- .. literalinclude:: samples/security-groups/security-group-rules-list-response.json :language: javascript Create security group rule ========================== .. rest_method:: POST /v2.0/security-group-rules Creates an OpenStack Networking security group rule. Normal response codes: 201 Error response codes: 400, 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - security_group_rule: security_group_rule - remote_group_id: remote_group_id - direction: direction - protocol: protocol - ethertype: ethertype - port_range_max: port_range_max - security_group_id: security_group_rule-security_group_id - port_range_min: port_range_min - remote_ip_prefix: remote_ip_prefix - description: description-request Request Example --------------- .. literalinclude:: samples/security-groups/security-group-rule-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - security_group_rule: security_group_rule - remote_group_id: remote_group_id - direction: direction - protocol: protocol - ethertype: ethertype - port_range_max: port_range_max - security_group_id: security_group_rule-security_group_id - tenant_id: project_id - project_id: project_id - port_range_min: port_range_min - remote_ip_prefix: remote_ip_prefix - revision_number: revision_number - id: security_group_rule-id - description: description Response Example ---------------- .. literalinclude:: samples/security-groups/security-group-rule-create-response.json :language: javascript Show security group rule ======================== .. rest_method:: GET /v2.0/security-group-rules/{security_group_rule_id} Shows detailed information for a security group rule. The response body contains the following information about the security group rule: Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - security_group_rule_id: security_group_rule-id-path - verbose: verbose - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - security_group_rule: security_group_rule - remote_group_id: remote_group_id - direction: direction - protocol: protocol - ethertype: ethertype - port_range_max: port_range_max - security_group_id: security_group_rule-security_group_id - tenant_id: project_id - project_id: project_id - port_range_min: port_range_min - remote_ip_prefix: remote_ip_prefix - revision_number: revision_number - id: security_group_rule-id - description: description Response Example ---------------- .. literalinclude:: samples/security-groups/security-group-rule-show-response.json :language: javascript Delete security group rule ========================== .. rest_method:: DELETE /v2.0/security-group-rules/{security_group_rule_id} Deletes a rule from an OpenStack Networking security group. Normal response codes: 204 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - security_group_rule_id: security_group_rule-id-path Response -------- There is no body content is returned on a successful DELETE request. neutron-lib-1.13.0/api-ref/source/v2/ports.inc0000666000175100017510000003741513231472055021110 0ustar zuulzuul00000000000000.. -*- rst -*- ===== Ports ===== Lists, shows details for, creates, updates, and deletes ports. Port binding extended attributes ================================ The port binding extension (``binding``) allows administrative users to specify and retrieve physical binding information of ports. The extension defines several attributes whose names have a prefix ``binding:`` including ``binding:host_id``, ``binding:vnic_type``, ``binding:vif_type``, ``binding:vif_details``, and ``binding:profile``. Data plane status extension =========================== The data plane port extension (``data-plane-status``) adds a new attribute ``data_plane_status`` to represent the status of the underlying data plane. This attribute is to be managed by entities outside of the Networking service, while the ``status`` attribute is managed by Networking service. Both status attributes are independent from one another. Supported data plane status values: - ``null``: no status being reported; default value - ``ACTIVE``: the underlying data plane is up and running - ``DOWN``: no traffic can flow from/to the port DNS integration =============== The ``dns-integration`` extension adds the ``dns_name`` and ``dns_assignment`` attributes to port resources. While the ``dns_name`` can be set on create and update operations, the ``dns_assignment`` is read-only and shows the ``hostname``, ``ip_address`` and ``fqdn`` for the port's internal DNS assignment. To enable the ``dns_domain`` on port resources, the ``dns-domain-ports`` extension must be used in conjunction with the ``dns-integration`` extension. When enabled and set, a port level ``dns_domain`` take precedence over a ``dns_domain`` specified in the port's network allowing per-port DNS domains. Port security ============= The ``port-security`` extension adds the ``port_security_enabled`` boolean attribute to ports. If a ``port-security`` value is not specified during port creation, a port will inherit the ``port_security_enabled`` from the network its connected to. Allowed address pairs ===================== The ``allowed-address-pairs`` extension adds an ``allowed_address_pairs`` attribute to ports. The value of ``allowed_address_pairs`` is an array of allowed address pair objects, each having an ``ip_address`` and a ``mac_address``. The set of allowed address pairs defines IP and MAC address that the port can use when sending packets if ``port_security_enabled`` is ``true`` (see the ``port-security`` extension). Note that while the ``ip_address`` is required in each allowed address pair, the ``mac_address`` is optional and will be taken from the port if not specified. IP Substring Filtering ====================== The ``ip-substring-filtering`` extension adds support for filtering ports by using part of an IP address. Show port details ================= .. rest_method:: GET /v2.0/ports/{port_id} Shows details for a port. Use the ``fields`` query parameter to control which fields are returned in the response body. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 404 Request ------- .. rest_parameters:: parameters.yaml - port_id: port_id-path - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - port: port - admin_state_up: admin_state_up - allowed_address_pairs: allowed_address_pairs - binding:host_id: binding:host_id - binding:profile: binding:profile - binding:vif_details: binding:vif_details - binding:vif_type: binding:vif_type - binding:vnic_type: binding:vnic_type - created_at: created_at - data_plane_status: data_plane_status - description: description - device_id: device_id - device_owner: device_owner - dns_assignment: dns_assignment - dns_domain: dns_domain - dns_name: dns_name - extra_dhcp_opts: extra_dhcp_opts - fixed_ips: fixed_ips - id: id - mac_address: mac_address - name: name - network_id: network_id - port_security_enabled: port_security_enabled - project_id: project_id - revision_number: revision_number - security_groups: port-security_groups - status: port-status - tenant_id: project_id - updated_at: updated_at Response Example ---------------- .. literalinclude:: samples/ports/port-show-response.json :language: javascript Response Example (admin user) ----------------------------- .. literalinclude:: samples/ports/port-bind-show-response.json :language: javascript Update port =========== .. rest_method:: PUT /v2.0/ports/{port_id} Updates a port. You can update information for a port, such as its symbolic name and associated IPs. When you update IPs for a port, any previously associated IPs are removed, returned to the respective subnet allocation pools, and replaced by the IPs in the request body. Therefore, this operation replaces the ``fixed_ip`` attribute when you specify it in the request body. If the updated IP addresses are not valid or are already in use, the operation fails and the existing IP addresses are not removed from the port. When you update security groups for a port and the operation succeeds, any associated security groups are removed and replaced by the security groups in the request body. Therefore, this operation replaces the ``security_groups`` attribute when you specify it in the request body. If the security groups are not valid, the operation fails and the existing security groups are not removed from the port. Only admins and users with a specific role can update the data plane status (default role: ``data_plane_integrator``). Normal response codes: 200 Error response codes: 400, 401, 403, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - port_id: port_id-path - port: port - admin_state_up: admin_state_up-request - allowed_address_pairs: allowed_address_pairs-request - binding:host_id: binding:host_id-request - binding:profile: binding:profile-request - binding:vnic_type: binding:vnic_type-request - data_plane_status: data_plane_status-request - description: description-request - device_id: device_id-request - device_owner: device_owner-request - dns_domain: dns_domain-request - dns_name: dns_name-request - extra_dhcp_opts: extra_dhcp_opts-request - fixed_ips: fixed_ips-request - mac_address: mac_address-request-put - name: name-request - port_security_enabled: port_security_enabled-request - security_groups: port-security_groups-request Request Example --------------- .. literalinclude:: samples/ports/port-update-request.json :language: javascript Request Example (admin user) ---------------------------- .. literalinclude:: samples/ports/port-bind-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - port: port - admin_state_up: admin_state_up - allowed_address_pairs: allowed_address_pairs - binding:host_id: binding:host_id - binding:profile: binding:profile - binding:vif_details: binding:vif_details - binding:vif_type: binding:vif_type - binding:vnic_type: binding:vnic_type - created_at: created_at - data_plane_status: data_plane_status - description: description - device_id: device_id - device_owner: device_owner - dns_assignment: dns_assignment - dns_domain: dns_domain - dns_name: dns_name - extra_dhcp_opts: extra_dhcp_opts - fixed_ips: fixed_ips - id: id - mac_address: mac_address - name: name - network_id: network_id - port_security_enabled: port_security_enabled - project_id: project_id - revision_number: revision_number - security_groups: port-security_groups - status: port-status - tenant_id: project_id - updated_at: updated_at Response Example ---------------- .. literalinclude:: samples/ports/port-update-response.json :language: javascript Response Example (admin user) ----------------------------- .. literalinclude:: samples/ports/port-bind-update-response.json :language: javascript Delete port =========== .. rest_method:: DELETE /v2.0/ports/{port_id} Deletes a port. Any IP addresses that are associated with the port are returned to the respective subnets allocation pools. Normal response codes: 204 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - port_id: port_id-path Response -------- There is no body content for the response of a successful DELETE request. List ports ========== .. rest_method:: GET /v2.0/ports Lists ports to which the user has access. Default policy settings return only those ports that are owned by the project of the user who submits the request, unless the request is submitted by a user with administrative rights. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. If the ``ip-substring-filtering`` extension is enabled, the Neutron API supports IP address substring filtering on the ``fixed_ips`` attribute. If you specify an IP address substring (``ip_address_substr``) in an entry of the ``fixed_ips`` attribute, the Neutron API will list all ports that have an IP address matching the substring. Normal response codes: 200 Error response codes: 401 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - ports: ports - admin_state_up: admin_state_up - allowed_address_pairs: allowed_address_pairs - binding:host_id: binding:host_id - binding:profile: binding:profile - binding:vif_details: binding:vif_details - binding:vif_type: binding:vif_type - binding:vnic_type: binding:vnic_type - created_at: created_at - data_plane_status: data_plane_status - description: description - device_id: device_id - device_owner: device_owner - dns_assignment: dns_assignment - dns_domain: dns_domain - dns_name: dns_name - extra_dhcp_opts: extra_dhcp_opts - fixed_ips: fixed_ips - id: id - mac_address: mac_address - name: name - network_id: network_id - port_security_enabled: port_security_enabled - project_id: project_id - revision_number: revision_number - security_groups: port-security_groups - status: port-status - tenant_id: project_id - updated_at: updated_at Response Example ---------------- .. literalinclude:: samples/ports/ports-list-response.json :language: javascript Response Example (admin user) ----------------------------- .. literalinclude:: samples/ports/ports-bind-list-response.json :language: javascript Create port =========== .. rest_method:: POST /v2.0/ports Creates a port on a network. To define the network in which to create the port, specify the ``network_id`` attribute in the request body. Normal response codes: 201 Error response codes: 400, 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - port: port - admin_state_up: admin_state_up-request - allowed_address_pairs: allowed_address_pairs-request - binding:host_id: binding:host_id-request - binding:profile: binding:profile-request - binding:vnic_type: binding:vnic_type-request - description: description-request - device_id: device_id-request - device_owner: device_owner-request - dns_domain: dns_domain-request - dns_name: dns_name-request - extra_dhcp_opts: extra_dhcp_opts-request - fixed_ips: fixed_ips-request - mac_address: mac_address-request - name: name-request - network_id: network_id - port_security_enabled: port_security_enabled-request - project_id: project_id-request - security_groups: port-security_groups-request - tenant_id: project_id-request Request Example --------------- .. literalinclude:: samples/ports/port-create-request.json :language: javascript Request Example (admin user) ---------------------------- .. literalinclude:: samples/ports/port-bind-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - port: port - admin_state_up: admin_state_up - allowed_address_pairs: allowed_address_pairs - binding:host_id: binding:host_id - binding:profile: binding:profile - binding:vif_details: binding:vif_details - binding:vif_type: binding:vif_type - binding:vnic_type: binding:vnic_type - created_at: created_at - data_plane_status: data_plane_status - description: description - device_id: device_id - device_owner: device_owner - dns_assignment: dns_assignment - dns_domain: dns_domain - dns_name: dns_name - extra_dhcp_opts: extra_dhcp_opts - fixed_ips: fixed_ips - id: id - mac_address: mac_address - name: name - network_id: network_id - port_security_enabled: port_security_enabled - project_id: project_id - revision_number: revision_number - security_groups: port-security_groups - status: port-status - tenant_id: project_id - updated_at: updated_at Response Example ---------------- .. literalinclude:: samples/ports/port-create-response.json :language: javascript Response Example (admin user) ----------------------------- .. literalinclude:: samples/ports/port-bind-create-response.json :language: javascript Bulk create ports ================= .. rest_method:: POST /v2.0/ports Creates multiple ports in a single request. Specify a list of ports in the request body. Guarantees the atomic completion of the bulk operation. Normal response codes: 201 Error response codes: 400, 401, 403, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - ports: ports - admin_state_up: admin_state_up-request - allowed_address_pairs: allowed_address_pairs-request - binding:host_id: binding:host_id-request - binding:profile: binding:profile-request - binding:vnic_type: binding:vnic_type-request - description: description-request - device_id: device_id-request - device_owner: device_owner-request - dns_domain: dns_domain-request - dns_name: dns_name-request - extra_dhcp_opts: extra_dhcp_opts-request - fixed_ips: fixed_ips-request - mac_address: mac_address-request - name: name-request - network_id: network_id - port_security_enabled: port_security_enabled-request - project_id: project_id-request - security_groups: port-security_groups-request - tenant_id: project_id-request Request Example --------------- .. literalinclude:: samples/ports/ports-bulk-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - ports: ports - admin_state_up: admin_state_up - allowed_address_pairs: allowed_address_pairs - binding:host_id: binding:host_id - binding:profile: binding:profile - binding:vif_details: binding:vif_details - binding:vif_type: binding:vif_type - binding:vnic_type: binding:vnic_type - created_at: created_at - data_plane_status: data_plane_status - description: description - device_id: device_id - device_owner: device_owner - dns_assignment: dns_assignment - dns_domain: dns_domain - dns_name: dns_name - extra_dhcp_opts: extra_dhcp_opts - fixed_ips: fixed_ips - id: id - mac_address: mac_address - name: name - network_id: network_id - port_security_enabled: port_security_enabled - project_id: project_id - revision_number: revision_number - security_groups: port-security_groups - status: port-status - tenant_id: project_id - updated_at: updated_at Response Example ---------------- .. literalinclude:: samples/ports/ports-bulk-create-response.json :language: javascript neutron-lib-1.13.0/api-ref/source/v2/fwaas-v2.inc0000666000175100017510000006260013231472055021361 0ustar zuulzuul00000000000000.. -*- rst -*- ================================================================================ FWaaS v2.0 (CURRENT) (fwaas, firewall_groups, firewall_policies, firewall_rules) ================================================================================ Use the Firewall-as-a-Service (FWaaS) v2.0 extension to deploy firewall groups to protect your networks. The FWaaS extension enables you to: - Apply firewall rules on traffic entering and leaving project networks. - Apply TCP, UDP, ICMP, or protocol-agnostic rules. - Create and share firewall policies that hold an ordered collection of firewall rules. - Audit firewall rules and policies. This extension introduces the following resources: - ``firewall_group``. A logical firewall resource that a project can create and manage. A firewall group can have a firewall policy for ingress traffic and/or a firewall policy for egress traffic. - ``firewall_policy``. An ordered collection of firewall rules. You can share a firewall policy across projects. You can include a firewall policy as part of an audit workflow so that an authorized relevant entity can audit the firewall policy. This entity can differ from the user who created, or the projects that use, the firewall policy. - ``firewall_rule``. A collection of attributes, such as source and destination ports, source and destination IP addresses, protocol, and IP version. These attributes define match criteria and an action to take, such as allow, reject, or deny, on matched data traffic. List firewall groups ==================== .. rest_method:: GET /v2.0/fwaas/firewall_groups Lists all firewall groups. The list might be empty. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_groups: firewall_groups_object - admin_state_up: firewall_group_admin_state_up-body-required - description: firewall_group_description-body-required - egress_firewall_policy_id: egress_firewall_policy_id-body-required - id: firewall_group_id-body-required - ingress_firewall_policy_id: ingress_firewall_policy_id-body-required - name: firewall_group_name-body-required - ports: firewall_group_ports-body-required - project_id: project_id-body-required - shared: firewall_group_shared-body-required - status: firewall_group_status-body-required - tenant_id: project_id-body-required Response Example ---------------- .. literalinclude:: samples/firewall-v2/firewall-groups-list-response.json :language: javascript Show firewall group details =========================== .. rest_method:: GET /v2.0/fwaas/firewall_groups/{firewall_group_id} Shows details for a firewall group. If the user is not an administrative user and the firewall group object does not belong to the project, this call returns the ``FirewallGroupNotFound (404)`` response code. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - firewall_group_id: firewall_group_id-path-required Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_group: firewall_group_object - admin_state_up: firewall_group_admin_state_up-body-required - description: firewall_group_description-body-required - egress_firewall_policy_id: egress_firewall_policy_id-body-required - id: firewall_group_id-body-required - ingress_firewall_policy_id: ingress_firewall_policy_id-body-required - name: firewall_group_name-body-required - ports: firewall_group_ports-body-required - project_id: project_id-body-required - shared: firewall_group_shared-body-required - status: firewall_group_status-body-required - tenant_id: project_id-body-required Response Example ---------------- .. literalinclude:: samples/firewall-v2/firewall-group-show-response.json :language: javascript Create firewall group ===================== .. rest_method:: POST /v2.0/fwaas/firewall_groups Creates a firewall group. The firewall group may be associated with an ingress firewall policy and/or an egress firewall policy. If ``admin_state_up`` is ``false``, the firewall group will block all traffic. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - firewall_group: firewall_group_object - admin_state_up: firewall_group_admin_state_up-body-optional - description: firewall_group_description-body-optional - egress_firewall_policy_id: egress_firewall_policy_id-body-optional - ingress_firewall_policy_id: ingress_firewall_policy_id-body-optional - name: firewall_group_name-body-optional - ports: firewall_group_ports-body-optional - project_id: project_id-body-optional - shared: firewall_group_shared-body-optional - status: firewall_group_status-body-optional - tenant_id: project_id-body-optional Request Example --------------- .. literalinclude:: samples/firewall-v2/firewall-group-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_group: firewall_group_object - admin_state_up: firewall_group_admin_state_up-body-required - description: firewall_group_description-body-required - egress_firewall_policy_id: egress_firewall_policy_id-body-required - id: firewall_group_id-body-required - ingress_firewall_policy_id: ingress_firewall_policy_id-body-required - name: firewall_group_name-body-required - ports: firewall_group_ports-body-required - project_id: project_id-body-required - shared: firewall_group_shared-body-required - status: firewall_group_status-body-required - tenant_id: project_id-body-required Response Example ---------------- .. literalinclude:: samples/firewall-v2/firewall-group-create-response.json :language: javascript Update firewall group ===================== .. rest_method:: PUT /v2.0/fwaas/firewall_groups/{firewall_group_id} Updates a firewall group. The firewall group cannot be updated if its status is a PENDING_* status. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - firewall_group_id: firewall_group_id-path-required - firewall_group: firewall_group_object - admin_state_up: firewall_group_admin_state_up-body-optional - description: firewall_group_description-body-optional - egress_firewall_policy_id: egress_firewall_policy_id-body-optional - ingress_firewall_policy_id: ingress_firewall_policy_id-body-optional - name: firewall_group_name-body-optional - ports: firewall_group_ports-body-optional - shared: firewall_group_shared-body-optional - status: firewall_group_status-body-optional Request Example --------------- .. literalinclude:: samples/firewall-v2/firewall-group-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_group: firewall_group_object - admin_state_up: firewall_group_admin_state_up-body-required - description: firewall_group_description-body-required - egress_firewall_policy_id: egress_firewall_policy_id-body-required - id: firewall_group_id-body-required - ingress_firewall_policy_id: ingress_firewall_policy_id-body-required - name: firewall_group_name-body-required - ports: firewall_group_ports-body-required - project_id: project_id-body-required - shared: firewall_group_shared-body-required - status: firewall_group_status-body-required - tenant_id: project_id-body-required Response Example ---------------- .. literalinclude:: samples/firewall-v2/firewall-group-update-response.json :language: javascript Delete firewall group ===================== .. rest_method:: DELETE /v2.0/fwaas/firewall_groups/{firewall_group_id} Deletes a firewall group. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - firewall_group_id: firewall_group_id-path-required Response -------- There is no body content for the response of a successful DELETE request. List firewall policies ====================== .. rest_method:: GET /v2.0/fwaas/firewall_policies Lists all firewall policies. The list might be empty. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_policies: firewall_policies_object - audited: firewall_policy_audited-body-required - description: firewall_policy_description-body-required - id: firewall_policy_id-body-required - firewall_rules: firewall_rules-body-required - name: firewall_policy_name-body-required - project_id: project_id-body-required - shared: firewall_policy_shared-body-required - tenant_id: project_id-body-required Response Example ---------------- .. literalinclude:: samples/firewall-v2/firewall-policies-list-response.json :language: javascript Show firewall policy details ============================ .. rest_method:: GET /v2.0/fwaas/firewall_policies/{firewall_policy_id} Shows details of a firewall policy. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - firewall_policy_id: firewall_policy_id-path-required Response Parameters ------------------- .. rest_parameters:: parameters.yaml - audited: firewall_policy_audited-body-required - description: firewall_policy_description-body-required - firewall_rules: firewall_rules-body-required - id: firewall_policy_id-body-required - name: firewall_policy_name-body-required - project_id: project_id-body-required - shared: firewall_policy_shared-body-required - tenant_id: project_id-body-required Response Example ---------------- .. literalinclude:: samples/firewall-v2/firewall-policy-show-response.json :language: javascript Create firewall policy ====================== .. rest_method:: POST /v2.0/fwaas/firewall_policies Creates a firewall policy. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - firewall_policy: firewall_policy_object - audited: firewall_policy_audited-body-optional - description: firewall_policy_description-body-optional - firewall_rules: firewall_rules-body-optional - name: firewall_policy_name-body-optional - project_id: project_id-body-optional - shared: firewall_policy_shared-body-optional - tenant_id: project_id-body-optional Request Example --------------- .. literalinclude:: samples/firewall-v2/firewall-policy-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_policy: firewall_policy_object - audited: firewall_policy_audited-body-required - description: firewall_policy_description-body-required - firewall_rules: firewall_rules-body-required - id: firewall_policy_id-body-required - name: firewall_policy_name-body-required - project_id: project_id-body-required - shared: firewall_policy_shared-body-required - tenant_id: project_id-body-required Response Example ---------------- .. literalinclude:: samples/firewall-v2/firewall-policy-create-response.json :language: javascript Update firewall policy ====================== .. rest_method:: PUT /v2.0/fwaas/firewall_policies/{firewall_policy_id} Updates a firewall policy. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - firewall_policy_id: firewall_policy_id-path-required - firewall_policy: firewall_policy_object - audited: firewall_policy_audited-body-optional - description: firewall_policy_description-body-optional - firewall_rules: firewall_rules-body-optional - name: firewall_policy_name-body-optional - project_id: project_id-body-optional - shared: firewall_policy_shared-body-optional - tenant_id: project_id-body-optional Request Example --------------- .. literalinclude:: samples/firewall-v2/firewall-policy-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_policy: firewall_policy_object - audited: firewall_policy_audited-body-required - description: firewall_policy_description-body-required - firewall_rules: firewall_rules-body-required - id: firewall_policy_id-body-required - name: firewall_policy_name-body-required - shared: firewall_policy_shared-body-required - project_id: project_id-body-required - tenant_id: project_id-body-required Response Example ---------------- .. literalinclude:: samples/firewall-v2/firewall-policy-update-response.json :language: javascript Delete firewall policy ====================== .. rest_method:: DELETE /v2.0/fwaas/firewall_policies/{firewall_policy_id} Deletes a firewall policy. Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - firewall_policy_id: firewall_policy_id-path-required Response -------- There is no body content for the response of a successful DELETE request. List firewall rules =================== .. rest_method:: GET /v2.0/fwaas/firewall_rules Lists all firewall rules. The list might be empty. Use the ``fields`` query parameter to control which fields are returned in the response body. Additionally, you can filter results by using query string parameters. For information, see `Filtering and Column Selection `__. Normal response codes: 200 Error response codes: 401, 403 Request ------- .. rest_parameters:: parameters.yaml - fields: fields Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_rules: firewall_rules_object - action: firewall_rule_action-body-required - description: firewall_rule_description-body-required - destination_firewall_group_id: destination_firewall_group_id-body-required - destination_ip_address: firewall_rule_destination_ip_address-body-required - destination_port: firewall_rule_destination_port-body-required - enabled: firewall_rule_enabled-body-required - firewall_policy_id: firewall_policy_id-body-required - id: firewall_rule_id-body-required - ip_version: firewall_rule_ip_version-body-required - name: firewall_rule_name-body-required - project_id: project_id-body-required - protocol: firewall_rule_protocol-body-required - shared: firewall_rule_shared-body-required - source_firewall_group_id: source_firewall_group_id-body-required - source_ip_address: firewall_rule_source_ip_address-body-required - source_port: firewall_rule_source_port-body-required - tenant_id: project_id-body-required Response Example ---------------- .. literalinclude:: samples/firewall-v2/firewall-rules-list-response.json :language: javascript Show firewall rule details ========================== .. rest_method:: GET /v2.0/fwaas/firewall_rules/{firewall_rule_id} Shows details for a firewall rule. If the user is not an administrative user and the firewall rule object does not belong to the project, this call returns the ``Forbidden (403)`` response code. Normal response codes: 200 Error response codes: 401, 403, 404 Request ------- .. rest_parameters:: parameters.yaml - firewall_rule_id: firewall_rule_id-path-required Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_rule: firewall_rule_object - action: firewall_rule_action-body-required - description: firewall_rule_description-body-required - destination_firewall_group_id: destination_firewall_group_id-body-required - destination_ip_address: firewall_rule_destination_ip_address-body-required - destination_port: firewall_rule_destination_port-body-required - enabled: firewall_rule_enabled-body-required - firewall_policy_id: firewall_policy_id-body-required - id: firewall_rule_id-body-required - ip_version: firewall_rule_ip_version-body-required - name: firewall_rule_name-body-required - project_id: project_id-body-required - protocol: firewall_rule_protocol-body-required - shared: firewall_rule_shared-body-required - source_firewall_group_id: source_firewall_group_id-body-required - source_ip_address: firewall_rule_source_ip_address-body-required - source_port: firewall_rule_source_port-body-required - tenant_id: project_id-body-required Response Example ---------------- .. literalinclude:: samples/firewall-v2/firewall-rule-show-response.json :language: javascript Create firewall rule ==================== .. rest_method:: POST /v2.0/fwaas/firewall_rules Creates a firewall rule. Normal response codes: 201 Error response codes: 400, 401 Request ------- .. rest_parameters:: parameters.yaml - firewall_rule: firewall_rule_object - action: firewall_rule_action-body-optional - description: firewall_rule_description-body-optional - destination_firewall_group_id: destination_firewall_group_id-body-optional - destination_ip_address: firewall_rule_destination_ip_address-body-optional - destination_port: firewall_rule_destination_port-body-optional - enabled: firewall_rule_enabled-body-optional - ip_version: firewall_rule_ip_version-body-optional - name: firewall_rule_name-body-optional - project_id: project_id-body-optional - protocol: firewall_rule_protocol-body-optional - shared: firewall_rule_shared-body-optional - source_firewall_group_id: source_firewall_group_id-body-optional - source_ip_address: firewall_rule_source_ip_address-body-optional - source_port: firewall_rule_source_port-body-optional - tenant_id: project_id-body-optional Request Example --------------- .. literalinclude:: samples/firewall-v2/firewall-rule-create-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_rule: firewall_rule_object - action: firewall_rule_action-body-required - description: firewall_rule_description-body-required - destination_firewall_group_id: destination_firewall_group_id-body-required - destination_ip_address: firewall_rule_destination_ip_address-body-required - destination_port: firewall_rule_destination_port-body-required - enabled: firewall_rule_enabled-body-required - firewall_policy_id: firewall_policy_id-body-required - id: firewall_rule_id-body-required - ip_version: firewall_rule_ip_version-body-required - name: firewall_rule_name-body-required - project_id: project_id-body-required - protocol: firewall_rule_protocol-body-required - shared: firewall_rule_shared-body-required - source_firewall_group_id: source_firewall_group_id-body-required - source_ip_address: firewall_rule_source_ip_address-body-required - source_port: firewall_rule_source_port-body-required - tenant_id: project_id-body-required Response Example ---------------- .. literalinclude:: samples/firewall-v2/firewall-rule-create-response.json :language: javascript Update firewall rule ==================== .. rest_method:: PUT /v2.0/fwaas/firewall_rules/{firewall_rule_id} Updates a firewall rule. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - firewall_rule_id: firewall_rule_id-path-required - firewall_rule: firewall_rule_object - action: firewall_rule_action-body-optional - description: firewall_rule_description-body-optional - destination_firewall_group_id: destination_firewall_group_id-body-optional - destination_ip_address: firewall_rule_destination_ip_address-body-optional - destination_port: firewall_rule_destination_port-body-optional - enabled: firewall_rule_enabled-body-optional - firewall_policy_id: firewall_policy_id-body-required - ip_version: firewall_rule_ip_version-body-optional - name: firewall_rule_name-body-optional - project_id: project_id-body-optional - protocol: firewall_rule_protocol-body-optional - shared: firewall_rule_shared-body-optional - source_firewall_group_id: source_firewall_group_id-body-optional - source_ip_address: firewall_rule_source_ip_address-body-optional - source_port: firewall_rule_source_port-body-optional - tenant_id: project_id-body-optional Request Example --------------- .. literalinclude:: samples/firewall-v2/firewall-rule-update-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - firewall_rule: firewall_rule_object - action: firewall_rule_action-body-required - description: firewall_rule_description-body-required - destination_firewall_group_id: destination_firewall_group_id-body-required - destination_ip_address: firewall_rule_destination_ip_address-body-required - destination_port: firewall_rule_destination_port-body-required - enabled: firewall_rule_enabled-body-required - firewall_policy_id: firewall_policy_id-body-required - id: firewall_rule_id-body-required - ip_version: firewall_rule_ip_version-body-required - name: firewall_rule_name-body-required - project_id: project_id-body-required - protocol: firewall_rule_protocol-body-required - shared: firewall_rule_shared-body-required - source_firewall_group_id: source_firewall_group_id-body-required - source_ip_address: firewall_rule_source_ip_address-body-required - source_port: firewall_rule_source_port-body-required - tenant_id: project_id-body-required Response Example ---------------- .. literalinclude:: samples/firewall-v2/firewall-rule-update-response.json :language: javascript Delete firewall rule ==================== .. rest_method:: DELETE /v2.0/fwaas/firewall_rules/{firewall_rule_id} Deletes a firewall rule. samples/firewall-v2/firewall-policy-create-response.json Normal response codes: 204 Error response codes: 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - firewall_rule_id: firewall_rule_id-path-required Insert rule into a firewall policy ================================== .. rest_method:: PUT /v2.0/fwaas/firewall_policies/{firewall_policy_id}/insert_rule Insert firewall rule into a policy. A firewall_rule_id is inserted relative to the position of the firewall_rule_id set in ``insert_before`` or ``insert_after``. If ``insert_before`` is set, ``insert_after`` is ignored. If both ``insert_before`` and ``insert_after`` are not set, the new firewall_rule_id is inserted as the first rule of the policy. Normal response codes: 200 Error response codes: 400, 401, 404, 409 Request ------- .. rest_parameters:: parameters.yaml - firewall_policy_id: firewall_policy_id-path-required - firewall_rule_id: firewall_rule_id-body-required - insert_after: firewall_rule_insert_after-body-required - insert_before: firewall_rule_insert_before-body-required Request Example --------------- .. literalinclude:: samples/firewall-v2/firewall-policy-insert-rule-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - audited: firewall_policy_audited-body-required - description: firewall_policy_description-body-required - firewall_rules: firewall_rules-body-required - id: firewall_policy_id-body-required - name: firewall_policy_name-body-required - project_id: project_id-body-required - shared: firewall_policy_shared-body-required - tenant_id: project_id-body-required Response Example ---------------- .. literalinclude:: samples/firewall-v2/firewall-policy-insert-rule-response.json :language: javascript Remove rule from firewall policy ================================ .. rest_method:: PUT /v2.0/fwaas/firewall_policies/{firewall_policy_id}/remove_rule Remove firewall rule from a policy. Normal response codes: 200 Error response codes: 400, 401, 404 Request ------- .. rest_parameters:: parameters.yaml - firewall_policy_id: firewall_policy_id-path-required - firewall_rule_id: firewall_rule_id-body-required Request Example --------------- .. literalinclude:: samples/firewall-v2/firewall-policy-remove-rule-request.json :language: javascript Response Parameters ------------------- .. rest_parameters:: parameters.yaml - audited: firewall_policy_audited-body-required - description: firewall_policy_description-body-required - firewall_rules: firewall_rules-body-required - id: firewall_policy_id-body-required - name: firewall_policy_name-body-required - project_id: project_id-body-required - shared: firewall_policy_shared-body-required - tenant_id: project_id-body-required Response Example ---------------- .. literalinclude:: samples/firewall-v2/firewall-policy-remove-rule-response.json :language: javascript neutron-lib-1.13.0/api-ref/source/index.rst0000666000175100017510000000016313231472055020546 0ustar zuulzuul00000000000000======================= Networking Service APIs ======================= .. toctree:: :maxdepth: 2 v2/index neutron-lib-1.13.0/.mailmap0000666000175100017510000000013113231472055015476 0ustar zuulzuul00000000000000# Format is: # # neutron-lib-1.13.0/tools/0000775000175100017510000000000013231472430015215 5ustar zuulzuul00000000000000neutron-lib-1.13.0/tools/pyir.py0000777000175100017510000013241413231472055016567 0ustar zuulzuul00000000000000#!/usr/bin/env python # Copyright 2016 VMware, Inc. # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # import abc import contextlib import imp import inspect import os from os import path import re import shutil import sys import tempfile import argparse import six from oslo_serialization import jsonutils __version__ = '0.0.2' # NOTE(boden): This is a prototype and needs additional love _MOCK_SRC = ''' class _PyIREmptyMock_(object): def __init__(self, *args, **kwargs): self._args_ = args self._kwargs_ = kwargs def __or__(self, o): return o def __ror__(self, o): return o def __xor__(self, o): return o def __rxor__(self, o): return o def __and__(self, o): return o def __rand__(self, o): return o def __rshift__(self, o): return o def __rrshift__(self, o): return o def __lshift__(self, o): return o def __rlshift__(self, o): return o def __pow__(self, o): return o def __rpow__(self, o): return o def __divmod__(self, o): return o def __rdivmod__(self, o): return o def __mod__(self, o): return o def __rmod__(self, o): return o def __floordiv__(self, o): return o def __rfloordiv__(self, o): return o def __truediv__(self, o): return o def __rtrudiv__(self, o): return o def __add__(self, o): return o def __radd__(self, o): return o def __sub__(self, o): return o def __rsub__(self, o): return o def __mul__(self, o): return o def __rmul__(self, o): return o def __matmul__(self, o): return o def __rmatmul__(self, o): return o def __getattribute__(self, name): return _PyIREmptyMock_() def __call__(self, *args, **kwargs): return _PyIREmptyMock_() def __iter__(self): return [].__iter__() def __getitem__(self, item): return _PyIREmptyMock_() def __setitem__(self, key, value): pass def __delitem__(self, key): pass def __enter__(self): return self def __exit__(self, type, value, traceback): pass class _PyIREmptyImport_(_PyIREmptyMock_): pass ''' _MOCK_CLASS_NAME = '_PyIREmptyMock_' _MOCK_IMPORT_CLASS_NAME = '_PyIREmptyImport_' UNKNOWN_VAL = 'PYIR UNKNOWN VALUE' _BLACKLIST = [re.compile(".*\.%s" % _MOCK_CLASS_NAME), re.compile(".*\.%s" % _MOCK_IMPORT_CLASS_NAME)] def blacklist_filter(value): for pattern in _BLACKLIST: if pattern.match(value): return False return True def add_blacklist_from_csv_str(csv_str): global _BLACKLIST _BLACKLIST.extend([re.compile(p) for p in split_on_token(csv_str, ',')]) def for_tokens(the_str, tokens, callback): in_str = [] tokens = list(tokens) index = 0 def _compare_tokens(idx): hits = [] for token in tokens: if the_str[idx:].startswith(token): hits.append(token) return hits for c in the_str: if c == '\'' or c == '\"': if in_str and in_str[len(in_str) - 1] == c: in_str.pop() else: in_str.append(c) elif not in_str: matching_tokens = _compare_tokens(index) if matching_tokens: callback(matching_tokens, index, the_str[index:]) index += 1 def token_indexes(the_str, tokens): indexes = [] def _count(toks, idx, substring): indexes.append(idx) for_tokens(the_str, tokens, _count) return indexes def split_on_token(the_str, token): indexes = token_indexes(the_str, [token]) if not indexes: return [the_str] strs = [] indexes.insert(0, None) for start, end in zip(indexes, indexes[1:] + [None]): start = 0 if start is None else start + 1 if end is None: end = len(the_str) strs.append(the_str[start:end]) return strs def count_tokens(the_str, tokens): return len(token_indexes(the_str, tokens)) def remove_tokens(the_str, tokens): in_str = [] tokens = list(tokens) index = 0 new_str = '' def _token(idx): for token in tokens: if the_str[idx:].startswith(token): return token return None while index < len(the_str): c = the_str[index] if c == '\'' or c == '\"': if in_str and in_str[len(in_str) - 1] == c: in_str.pop() else: in_str.append(c) elif not in_str: tok = _token(index) if tok: index += len(tok) continue new_str += c index += 1 return new_str def remove_brackets(the_str): return remove_tokens(the_str, ['(', ')']) def parent_path(file_path): if not file_path or file_path == '/': return None return path.abspath(path.join(file_path, '..')) def is_py_file(file_path): file_path = file_path if filter(blacklist_filter, [file_path]) else None return (file_path and path.isfile(file_path) and file_path.endswith('.py')) def is_py_dir(dir_path): if not filter(blacklist_filter, [dir_path]): return False if path.isdir(dir_path): for f in os.listdir(dir_path): f = path.join(dir_path, f) if is_py_file(f): return True return False def is_py_package_dir(dir_path): if not filter(blacklist_filter, [dir_path]): return False if path.isdir(dir_path): return '__init__.py' in os.listdir(dir_path) return False def parent_package_names(file_or_dir_path): pkg_names = [] file_or_dir_path = parent_path(file_or_dir_path) while file_or_dir_path: if is_py_package_dir(file_or_dir_path): pkg_names.append(os.path.basename(file_or_dir_path)) else: break file_or_dir_path = parent_path(file_or_dir_path) return None if not pkg_names else reversed(pkg_names) def whitespace(line): if line.isspace(): return line, '' char_index = 0 for char_index in range(len(line)): if not line[char_index].isspace(): break return line[:char_index], line[char_index:].strip() def ordered(obj): if isinstance(obj, dict): return sorted((k, ordered(v)) for k, v in obj.items()) if isinstance(obj, list): return sorted(ordered(x) for x in obj) else: return obj def json_primitive(val): if isinstance(val, (six.string_types, six.text_type, six.integer_types, bool)): return str(val) elif str(val).startswith('<') or type(val) in [dict, list, set, tuple]: return str(type(val)) elif (str(val).count(_MOCK_CLASS_NAME) or str(val).count(_MOCK_IMPORT_CLASS_NAME)): return UNKNOWN_VAL return val def is_mock_import(obj): return _MOCK_IMPORT_CLASS_NAME in str(obj) def _member_filter(obj): return not inspect.isbuiltin(obj) and not inspect.ismodule(obj) class PyFiles(object): def __init__(self, files): self._files = set(PyFiles.check_py_paths(files)) @staticmethod def check_py_paths(py_paths): checked = [] for f in py_paths: f = path.abspath(f) assert path.exists(f) if path.isfile(f): if not is_py_file(f): raise IOError("'%s' is not a .py file." % f) else: if not is_py_package_dir(f): raise IOError("'%s' doesn't contain __init__.py." % f) checked.append(f) return checked @property def files(self): return set(self._files) @property def has_files(self): return len(self._files) > 0 def _path_to_tmp_tree(self, tree_dir, src_path): tree_dest = path.join(tree_dir, path.basename(src_path)) parent_dirs = list(parent_package_names(src_path) or []) if parent_dirs: tree_dest = path.join(tree_dir, *tuple(parent_dirs)) os.makedirs(tree_dest) subpath = tree_dir for subdir in parent_dirs: subpath = path.join(subpath, subdir) open(path.join(subpath, '__init__.py'), 'a').close() tree_dest = path.join(tree_dest, path.basename(src_path)) copy_fn = shutil.copytree if path.isdir(src_path) else shutil.copyfile copy_fn(src_path, tree_dest) return tree_dest def to_tmp_tree(self, tree_dir=None): tree_dir = tree_dir or tempfile.mkdtemp() assert path.isdir(tree_dir) subtrees = [] for f in self._files: subtrees.append(self._path_to_tmp_tree(tree_dir, f)) return tree_dir, subtrees @contextlib.contextmanager def tmp_tree(self, delete_on_exit=True): tree = None try: tree, subtress = self.to_tmp_tree() yield tree finally: if tree and delete_on_exit: shutil.rmtree(tree) @staticmethod def filter_all_py_files(root_dir, filters): for child in os.listdir(root_dir): child_path = path.join(root_dir, child) if is_py_file(child_path): PyFile.rewrite(child_path, filters) elif is_py_dir(child_path): PyFiles.filter_all_py_files(child_path, filters) class PyLine(object): def __init__(self, ws, logical_line, py_file): self.ws = '' if ws is None else ws if ws == "\n": self.ws = '' self.logical = '' if logical_line is None else logical_line self._py_file = py_file @property def is_str_line(self): return ((self.logical.startswith('\'') and self.logical.endswith('\'')) or (self.logical.startswith('\"') and self.logical.endswith('\"'))) @property def is_empty_line(self): return len(self.logical.strip()) == 0 @property def indent(self): return self.ws.count(' ') + (self.ws.count("\t") * 4) @property def bracket_tics(self): return (count_tokens(self.logical, PyLineTokens.OPEN_B) - count_tokens(self.logical, PyLineTokens.CLOSED_B)) @property def physical_line(self): return str(self) @property def is_comment(self): return self.logical.startswith(PyLineTokens.COMMENT) def comment_out(self): if not self.is_comment: self.logical = PyLineTokens.COMMENT + self.logical @property def has_unmatched_brackets(self): return self.bracket_tics != 0 @property def is_continuation(self): return (self.logical.endswith(PyLineTokens.BACKSLASH) or self.has_unmatched_brackets) @property def is_space(self): if self.logical == '': return self.ws.isspace() return self.logical.isspace() @property def file_path(self): return self._py_file.name @staticmethod def from_string_lines(lines, py_file=None): py_lines = [] for l in lines: ws, logical = whitespace(l) py_lines.append(PyLine(ws, logical, py_file)) return py_lines def __str__(self): return self.ws + self.logical class FilterMarker(object): def __init__(self, filt, markers=None): self._filter = filt self.markers = markers or [] def mark(self, line): if self._filter.mark(line): self.markers.append(line) def filter(self, py_file): for marker in self.markers: self._filter.filter(marker, py_file) def reset(self): self.markers = [] class PyFile(object): def __init__(self, py_filters): self._markers = [] self._add_filters(py_filters) self._lines = [] def prepend_lines(self, lines): lines = list(lines) lines.extend(self._lines) self._lines = lines def reset(self): self._lines = [] for m in self._markers: m.reset() def first_line(self): return self._lines[0] if self._lines else None def next_line(self, py_line): if py_line not in self._lines: return None index = self._lines.index(py_line) + 1 if index >= len(self._lines): return None return self._lines[index] def prev_line(self, py_line): if py_line not in self._lines: return None index = self._lines.index(py_line) - 1 if index <= 0: return None return self._lines[index] def del_line(self, py_line): self._lines.remove(py_line) def get_line(self, py_line): return (None if not self.contains_line(py_line) else self._lines[self._lines.index(py_line)]) def contains_line(self, py_line): return py_line in self._lines def _add_filters(self, filters): self._markers.extend([FilterMarker(f) for f in filters]) def _mark_line_filter(self, line): for marker in self._markers: marker.mark(line) def load_path(self, py_path): with open(py_path, 'r') as py_file: for line in py_file: ws, logical = whitespace(line) line = PyLine(ws, logical, py_file) self._lines.append(line) self._mark_line_filter(line) def filter(self): if not self._lines or not self._markers: return None for marker in self._markers: marker.filter(self) def insert_after(self, py_line, py_line_to_add): if py_line not in self._lines: return False self._lines.insert(self._lines.index(py_line) + 1, py_line_to_add) return True def to_file_str(self): buff = '' for line in self._lines: buff += str(line) + "\n" return buff def save(self, py_path): with open(py_path, 'w') as py_file: py_file.write(self.to_file_str()) @staticmethod def filter_to_file_str(py_path, filters): py_file = PyFile(filters) py_file.load_path(py_path) py_file.filter() return py_file.to_file_str() @staticmethod def rewrite(py_path, filters): py_file = PyFile(filters) py_file.load_path(py_path) py_file.filter() py_file.save(py_path) class ImportParser(object): def __init__(self): self.names = [] self.modules = [] def _segs(self, the_str, token=' '): return [s.strip() for s in the_str.split(token) if s and not s.isspace()] def _lstrip(self, the_str, to_strip): return the_str[len(to_strip):].strip() def _next_token(self, the_str, delim=' ', strip=True): try: idx = the_str.index(delim) content = the_str[:idx] remainder = the_str[idx:] if strip: content.strip() remainder.strip() return content, remainder except ValueError: return None, None def _parse_from(self, import_str): import_str = self._lstrip(import_str, 'from ') module_name, import_str = self._next_token(import_str) import_str = self._lstrip(import_str, 'import ') for name_def in self._segs(import_str, token=','): if name_def.count(' as '): segs = self._segs(name_def, token=' as ') self.names.append(segs[1]) self.modules.append(module_name + '.' + segs[0]) else: self.names.extend(self._segs(name_def, '.')) self.modules.append(module_name) def _parse_import(self, import_str): import_str = self._lstrip(import_str, 'import ') for name_def in self._segs(import_str, token=','): if name_def.count(' as '): segs = self._segs(name_def, token=' as ') self.names.append(segs[1]) self.modules.append(segs[0]) else: self.names.extend(self._segs(name_def, '.')) self.modules.append(name_def) def reset(self): self.names = [] self.modules = [] def is_statement(self, import_str): return import_str.startswith(('import ', 'from ', )) def parse(self, import_str): self.reset() import_str = import_str.replace('(', '').replace(')', '') if import_str.startswith('import '): self._parse_import(import_str) elif import_str.startswith('from '): self._parse_from(import_str) else: raise IOError("Invalid import string: %s" % import_str) return self class PyLineTokens(object): COMMENT = '#' BACKSLASH = '\\' DECORATOR = '@' OPEN_B = '(' CLOSED_B = ')' @six.add_metaclass(abc.ABCMeta) class AbstractFilter(object): @abc.abstractmethod def mark(self, py_line): pass @abc.abstractmethod def filter(self, py_line, py_file): pass @six.add_metaclass(abc.ABCMeta) class AbstractPerFileFilter(AbstractFilter): def __init__(self): self._marked = [] def mark(self, py_line): if py_line.file_path not in self._marked: self._marked.append(py_line.file_path) return True return False @abc.abstractmethod def _filter(self, py_line, py_file): pass def filter(self, py_line, py_file): if py_line.file_path not in self._marked: return self._marked.remove(py_line.file_path) return self._filter(py_line, py_file) class CommentOutDecorators(AbstractFilter): def mark(self, py_line): if py_line.is_str_line: return False if py_line.logical.startswith(PyLineTokens.DECORATOR): return True return False def filter(self, py_line, py_file): if not py_file.get_line(py_line): return py_line.comment_out() class StripTrailingComments(AbstractFilter): _RE = re.compile('^([^#]*)#(.*)$') def mark(self, py_line): if (py_line.is_str_line or not count_tokens(py_line.logical, PyLineTokens.COMMENT)): return False m = StripTrailingComments._RE.match(py_line.logical) return True if m else False def filter(self, py_line, py_file): if not py_file.get_line(py_line): return m = StripTrailingComments._RE.match(py_line.logical) py_line.logical = m.group(1).strip() class AddMockDefinitions(AbstractPerFileFilter): _LINES = PyLine.from_string_lines(_MOCK_SRC.split("\n")) def _filter(self, py_line, py_file): py_file.prepend_lines(AddMockDefinitions._LINES) class PassEmptyDef(AbstractPerFileFilter): def _has_body(self, def_py_line, py_file): indent = def_py_line.indent line = py_file.next_line(def_py_line) while line: if line.is_empty_line: line = py_file.next_line(line) continue elif line.indent > indent: return True elif line.indent <= indent: return False else: line = py_file.next_line(line) return False def _filter(self, py_line, py_file): line = py_file.first_line() while line: if (line.logical.startswith(('class ', 'def ',)) and not self._has_body(line, py_file)): pass_line = PyLine(line.ws + " ", 'pass', py_file) py_file.insert_after(line, pass_line) line = py_file.next_line(pass_line) else: line = py_file.next_line(line) class RemoveDocStrings(AbstractPerFileFilter): _COMMENT = '"""' def _comment_count(self, py_line): return count_tokens(py_line.logical, RemoveDocStrings._COMMENT) def _safe_delete_line(self, py_line, py_file): if py_line.logical.endswith((',', ')',)): return py_file.del_line(py_line) def _filter(self, py_line, py_file): in_comment = False last_line = line = py_file.first_line() while line: comment_count = self._comment_count(line) if comment_count: if in_comment: in_comment = False elif comment_count == 1: in_comment = True py_file.del_line(line) elif in_comment: py_file.del_line(line) if not py_file.contains_line(line): if not py_file.contains_line(last_line): last_line = line = py_file.first_line() else: line = py_file.next_line(last_line) else: next_line = py_file.next_line(line) last_line = line line = next_line class RemoveCommentLines(AbstractFilter): def mark(self, py_line): return py_line.logical.startswith(PyLineTokens.COMMENT) def filter(self, py_line, py_file): py_line = py_file.get_line(py_line) if py_line and self.mark(py_line): py_file.del_line(py_line) @six.add_metaclass(abc.ABCMeta) class AbstractMultiLineCollector(AbstractFilter): def __init__(self): self._comment_stripper = StripTrailingComments() def _strip_backslash(self, py_line): if py_line.logical.endswith(PyLineTokens.BACKSLASH): py_line.logical = py_line.logical[:-1].strip() return True return False def _collect(self, py_line, py_file, continue_fn): self._strip_backslash(py_line) next_line = py_file.next_line(py_line) while next_line: if not next_line.is_comment: if self._comment_stripper.mark(next_line): self._comment_stripper.filter(next_line, py_file) if not next_line.is_space: py_line.logical += ' ' + next_line.logical py_file.del_line(next_line) if continue_fn(py_line): next_line = py_file.next_line(py_line) continue else: break def _collect_backslash(self, py_line, py_file): self._strip_backslash(py_line) self._collect(py_line, py_file, self._strip_backslash) def _collect_brackets(self, py_line, py_file): self._collect(py_line, py_file, lambda l: l.has_unmatched_brackets) def filter(self, py_line, py_file): if py_line.logical.endswith(PyLineTokens.BACKSLASH): self._collect_backslash(py_line, py_file) else: self._collect_brackets(py_line, py_file) class MergeMultiLineImports(AbstractMultiLineCollector): def mark(self, py_line): if py_line.is_str_line: return False logical = py_line.logical return (logical.startswith(('import ', 'from ',)) and py_line.is_continuation) def filter(self, py_line, py_file): super(MergeMultiLineImports, self).filter(py_line, py_file) py_line.logical = remove_brackets(py_line.logical) class MergeMultiLineClass(AbstractMultiLineCollector): def mark(self, py_line): if py_line.is_str_line: return False return py_line.logical.startswith('class ') and py_line.is_continuation class MergeMultiLineDef(AbstractMultiLineCollector): def mark(self, py_line): if py_line.is_str_line: return False return py_line.logical.startswith('def ') and py_line.is_continuation class MergeMultiLineDecorator(AbstractMultiLineCollector): def mark(self, py_line): if py_line.is_str_line: return False return (py_line.logical.startswith(PyLineTokens.DECORATOR) and py_line.is_continuation) class MockParentClass(AbstractFilter): _PARENT_RE = re.compile('class \w*\((.*)\)\:$') def mark(self, py_line): return (py_line.logical.startswith('class ') and not py_line.is_str_line) def filter(self, py_line, py_file): if not py_file.get_line(py_line): return m = MockParentClass._PARENT_RE.match(py_line.logical) if m: py_line.logical = py_line.logical.replace( "(%s):" % m.group(1), "(%s):" % _MOCK_CLASS_NAME) class MockImports(AbstractFilter): def __init__(self): self._parser = ImportParser() def mark(self, py_line): return self._parser.is_statement(remove_brackets(py_line.logical)) def filter(self, py_line, py_file): if not py_file.contains_line(py_line) or not self.mark(py_line): return py_line.logical = remove_brackets(py_line.logical) self._parser.parse(py_line.logical) if '*' in self._parser.names: inferred_names = [] for module in self._parser.modules: if not module.startswith('.'): inferred_names.extend(module.split('.')) self._parser.names = inferred_names if not self._parser.names: py_line.comment_out() return py_line.logical = ', '.join(self._parser.names) + ' = ' + ', '.join( [_MOCK_IMPORT_CLASS_NAME + '()' for n in self._parser.names]) if '_' in self._parser.names: # TODO(boden): one off mock_translate = PyLine(py_line.ws, '_ = lambda s: str(s)', py_file) py_file.insert_after(py_line, mock_translate) class APISignature(object): class SignatureType(object): CLASS = 'class' FUNCTION = 'function' METHOD = 'method' CLASS_ATTR = 'class_attribute' MODULE_ATTR = 'module_attribute' def __init__(self, signature_type, qualified_name, member, arg_spec): self.signature_type = signature_type self.qualified_name = qualified_name self.member = member self.arg_spec = arg_spec def to_dict(self): defaults = ([json_primitive(d) for d in self.arg_spec.defaults] if self.arg_spec.defaults else None) return { 'member_type': self.signature_type, 'qualified_name': self.qualified_name, 'member_value': json_primitive(self.member), 'arg_spec': { 'args': self.arg_spec.args, 'varargs': self.arg_spec.varargs, 'keywords': self.arg_spec.keywords, 'defaults': defaults } } @staticmethod def arg_spec_from_dict(arg_spec_dict): defaults = arg_spec_dict['defaults'] if defaults is not None: defaults = tuple(defaults) return inspect.ArgSpec(arg_spec_dict['args'], arg_spec_dict['varargs'], arg_spec_dict['keywords'], defaults) @staticmethod def from_dict(api_dict): return APISignature( api_dict['member_type'], api_dict['qualified_name'], api_dict['member_value'], APISignature.arg_spec_from_dict(api_dict['arg_spec'])) @property def signature(self): return self._build_signature(self.to_dict()) @staticmethod def get_signature(signature): if isinstance(signature, dict): signature = APISignature.from_dict(signature) return signature.signature def _build_callable_signature(self, signature_dict): arg_spec = signature_dict['arg_spec'] arg_str = '' defaults = arg_spec['defaults'] or [] named_args = arg_spec['args'] or [] named_kwargs = [] if defaults: named_args = arg_spec['args'][:-len(defaults)] named_kwargs = arg_spec['args'][-len(defaults):] if named_args: arg_str += ", ".join(named_args) if named_kwargs: kw_args = [] for kw_name, kw_default in zip(named_kwargs, defaults): kw_args.append("%s=%s" % (kw_name, kw_default)) arg_str += ", %s" % ", ".join(kw_args) if arg_spec['varargs'] is not None: arg_str = "*%s%s" % (arg_spec['varargs'], '' if not arg_str else ', ' + arg_str) if arg_spec['keywords'] is not None: arg_str += "%s**%s" % (', ' if arg_str else '', arg_spec['keywords']) if arg_str.startswith(','): arg_str = arg_str[1:] return "%s(%s)" % (signature_dict['qualified_name'], arg_str.strip()) def _build_variable_signature(self, signature_dict): return "%s = %s" % (signature_dict['qualified_name'], signature_dict['member_value']) def _build_class_signature(self, signature_dict): return signature_dict['qualified_name'] def _build_signature(self, signature_dict): if (signature_dict['member_type'] in [APISignature.SignatureType.FUNCTION, APISignature.SignatureType.METHOD]): return self._build_callable_signature(signature_dict) elif signature_dict['member_type'] == APISignature.SignatureType.CLASS: return self._build_class_signature(signature_dict) else: return self._build_variable_signature(signature_dict) class ModuleParser(object): def __init__(self, listeners, abort_on_load_failure=False): self.listeners = listeners self.abort_on_load_failure = abort_on_load_failure def _notify(self, signature_type, qualified_name, member, arg_spec=None): for listener in self.listeners: notify = getattr(listener, 'parse_' + signature_type) notify(APISignature(signature_type, qualified_name, member, arg_spec or inspect.ArgSpec(None, None, None, None))) def _collect_paths(self, paths, recurse=True): inits, mods = [], [] if not paths: return inits, mods for py_path in paths: if is_py_file(py_path): if path.basename(py_path) == '__init__.py': inits.append(py_path) else: mods.append(py_path) elif is_py_dir(py_path) and recurse: c_inits, c_mods = self._collect_paths( [path.join(py_path, c) for c in os.listdir(py_path)], recurse=recurse) inits.extend(c_inits) mods.extend(c_mods) return inits, mods def _load_path(self, module_path): module_name = path.basename(path.splitext(module_path)[0]) pkg_name = '.'.join(parent_package_names(module_path) or '') defined_name = ('%s.%s' % (pkg_name, module_name) if pkg_name else module_name) if module_name == '__init__': defined_name = pkg_name search_paths = [parent_path(module_path)] f = None try: if defined_name in sys.modules: del sys.modules[defined_name] f, p, d = imp.find_module(module_name, search_paths) module = imp.load_module(defined_name, f, p, d) if defined_name == '__init__': setattr(module, '__path__', search_paths) return module except Exception as e: sys.stderr.write("Failed to load module '%s' due to: %s" % (module_path, e)) if self.abort_on_load_failure: raise e finally: if f: f.close() def load_modules(self, init_paths, module_paths): init_mods, mods = [], [] failed_to_load = [] def _load(paths, store): for m_path in paths: module = self._load_path(m_path) if module: store.append(module) else: failed_to_load.append(m_path) _load(init_paths, init_mods) _load(module_paths, mods) return init_mods, mods, failed_to_load def _fully_qualified_name(self, parent, name): if inspect.isclass(parent): prefix = parent.__module__ + '.' + parent.__name__ else: prefix = parent.__name__ return prefix + '.' + name def parse_modules(self, modules): for module in modules: for member_name, member in inspect.getmembers( module, _member_filter): if member_name.startswith('__') and member_name.endswith('__'): continue fqn = self._fully_qualified_name(module, member_name) if inspect.isclass(member): self._notify(APISignature.SignatureType.CLASS, fqn, member) self.parse_modules([member]) elif inspect.isfunction(member): self._notify(APISignature.SignatureType.FUNCTION, fqn, member, arg_spec=inspect.getargspec(member)) elif inspect.ismethod(member): self._notify(APISignature.SignatureType.METHOD, fqn, member, arg_spec=inspect.getargspec(member)) else: event = (APISignature.SignatureType.MODULE_ATTR if inspect.ismodule(module) else APISignature.SignatureType.CLASS_ATTR) self._notify(event, fqn, member) def parse_paths(self, py_paths, recurse=True): init_paths, mod_paths = self._collect_paths( py_paths, recurse=recurse) init_mods, pkg_mods, failed_mods = self.load_modules( init_paths, mod_paths) self.parse_modules(init_mods) self.parse_modules(pkg_mods) class APIReport(object): def __init__(self, abort_on_load_failure=False): self._api = {} self._parser = ModuleParser( [self], abort_on_load_failure=abort_on_load_failure) def _add(self, event): if is_mock_import(event.member): return uuid = str(event.qualified_name) if uuid in self._api: # TODO(boden): configurable bail on duplicate flag sys.stderr.write("Duplicate API signature: %s" % uuid) return if not filter(blacklist_filter, [uuid]): return self._api[uuid] = event.to_dict() def parse_method(self, event): self._add(event) def parse_function(self, event): self._add(event) def parse_class(self, event): self._add(event) def parse_class_attribute(self, event): self._add(event) def parse_module_attribute(self, event): self._add(event) def parse_api_paths(self, api_paths, recurse=True): self._parser.parse_paths(api_paths, recurse=recurse) def parse_api_path(self, api_path, recurse=True): self.parse_api_paths([api_path], recurse=recurse) @property def api(self): return dict(self._api) def to_json(self): return jsonutils.dumps(self._api) @staticmethod def from_json(json_str): api = APIReport() api._api = jsonutils.loads(json_str) return api @staticmethod def from_json_file(file_path): with open(file_path, 'r') as json_file: data = json_file.read() return APIReport.from_json(data) @staticmethod def api_diff_files(new_api, old_api): new_api = APIReport.from_json_file(new_api) old_api = APIReport.from_json_file(old_api) return new_api.api_diff(old_api) def get_filtered_signatures(self): return filter(blacklist_filter, self.get_signatures()) def get_signatures(self): return sorted([APISignature.get_signature(s) for s in self._api.values()]) def api_diff(self, other_api): our_keys = sorted(self.api.keys()) other_keys = sorted(other_api.api.keys()) new_keys = set(our_keys) - set(other_keys) removed_keys = set(other_keys) - set(our_keys) common_keys = set(our_keys) & set(other_keys) common_key_changes = [k for k in common_keys if ordered(self.api[k]) != ordered(other_api.api[k])] for k in common_key_changes: if (not blacklist_filter(self.api[k]['member_value']) and not blacklist_filter(other_api.api[k]['member_value'])): common_key_changes.remove(k) def _build_report(new_api): apis = APIReport() apis._api = new_api return apis return { 'new': _build_report({k: self.api[k] for k in new_keys}), 'removed': _build_report({k: other_api.api[k] for k in removed_keys}), 'unchanged': _build_report({k: self.api[k] for k in set(common_keys) - set(common_key_changes)}), 'new_changed': _build_report({k: self.api[k] for k in common_key_changes}), 'old_changed': _build_report({k: other_api.api[k] for k in common_key_changes}) } @six.add_metaclass(abc.ABCMeta) class AbstractCommand(object): @abc.abstractmethod def get_parser(self): pass @abc.abstractmethod def run(self, args): pass def _add_blacklist_opt(parser): parser.add_argument( '--blacklist', help='One or more regular expressions used to filter out ' 'API paths from the report. File path segments, module ' 'names, class names, etc. are all subject to filtering. ' 'Multiple regexes can be specified using a comma in the ' '--blacklist argument.') class GenerateReportCommand(AbstractCommand): PY_LINE_FILTERS = [RemoveDocStrings(), RemoveCommentLines(), StripTrailingComments(), MergeMultiLineImports(), MergeMultiLineClass(), MergeMultiLineDef(), MergeMultiLineDecorator(), CommentOutDecorators(), PassEmptyDef(), MockParentClass(), AddMockDefinitions(), MockImports()] def __init__(self): self._parser = argparse.ArgumentParser( prog='generate', description='Generate an interface report for python ' 'source. The paths given can be a python ' 'package or project directory, or a single ' 'python source file. The program replaces ' 'your imports with mocks, so no dependencies ' 'are needed in the python env.') _add_blacklist_opt(self._parser) self._parser.add_argument( '--debug', help='Exit parsing on failure to load a module and ' 'leave temp staging dir intact..', action='store_const', const=True) self._parser.add_argument('PATH', nargs='+', metavar='PATH') def get_parser(self): return self._parser def run(self, args): if args.blacklist: add_blacklist_from_csv_str(args.blacklist) files = PyFiles(args.PATH) with files.tmp_tree(delete_on_exit=( not args.debug)) as tmp_root: PyFiles.filter_all_py_files( tmp_root, GenerateReportCommand.PY_LINE_FILTERS) report = APIReport(abort_on_load_failure=args.debug) for child in os.listdir(tmp_root): child_path = path.join(tmp_root, child) report.parse_api_paths([child_path]) print("%s" % report.to_json()) class PrintReportCommand(AbstractCommand): def __init__(self): self._parser = argparse.ArgumentParser( prog='print', description='Given a JSON API file, print the API signatures ' 'to STDOUT.') _add_blacklist_opt(self._parser) self._parser.add_argument('REPORT_FILE', help='Path to JSON report file.') def get_parser(self): return self._parser def run(self, args): if args.blacklist: add_blacklist_from_csv_str(args.blacklist) report = APIReport.from_json_file(args.REPORT_FILE) for signature in report.get_filtered_signatures(): print(signature) class DiffReportCommand(AbstractCommand): def __init__(self): self._parser = argparse.ArgumentParser( prog='diff', description='Given a new and old JSON interface report ' 'files, calculate the changes between new ' 'and old and echo them to STDOUT.') _add_blacklist_opt(self._parser) self._parser.add_argument( '--unchanged', help='Used with --diff to specify that unchanged ' 'public APIs should be reported in addition to ' 'new and removed.', action='store_const', const=True) self._parser.add_argument('NEW_REPORT_FILE', help='Path to new report file.') self._parser.add_argument('OLD_REPORT_FILE', help='Path to old report file.') def get_parser(self): return self._parser def _print_row(self, heading, content_list): print(heading) print("-----------------------------------------------------") for content in content_list: print(str(content)) print("-----------------------------------------------------\n") def run(self, args): if args.blacklist: add_blacklist_from_csv_str(args.blacklist) api_diff = APIReport.api_diff_files( args.NEW_REPORT_FILE, args.OLD_REPORT_FILE) self._print_row("New API Signatures", api_diff['new'].get_filtered_signatures()) self._print_row("Removed API Signatures", api_diff['removed'].get_filtered_signatures()) new_sigs = api_diff['new_changed'].get_filtered_signatures() old_sigs = api_diff['old_changed'].get_filtered_signatures() if len(new_sigs) != len(old_sigs): new_sigs = [] old_sigs = [] new_changed = api_diff['new_changed'].api old_changed = api_diff['old_changed'].api for n, new_spec in new_changed.items(): display_old = blacklist_filter(old_changed[n]['member_value']) display_new = blacklist_filter(new_spec['member_value']) if display_old and display_new: new_sigs.append(APISignature.get_signature(new_spec)) old_sigs.append(APISignature.get_signature(old_changed[n])) elif not display_old: new_sigs.append(APISignature.get_signature(new_spec)) old_sigs.append(n) else: new_sigs.append('UNKNOWN') old_sigs.append(n) self._print_row("Changed API Signatures", ["%s [is now] %s" % (old_sigs[i], new_sigs[i]) for i in range(len(new_sigs))]) if args.unchanged: self._print_row("Unchanged API Signatures", api_diff['unchanged'].get_filtered_signatures()) class CLI(object): def __init__(self, commands): self._commands = {c.get_parser().prog: c for c in commands} self.parser = argparse.ArgumentParser( prog='pyir', description='Python API report tooling.', usage="pyir <%s> [args]" % "|".join(self._commands.keys()), add_help=True) self.parser.add_argument( 'command', help='The command to run. Known commands: ' '%s . Try \'pyir --help\' for more info ' 'on a specific command. ' % ", ".join(self._commands.keys())) args = self.parser.parse_args(sys.argv[1:2]) if args.command not in self._commands.keys(): print("Unknown command: %s" % args.command) self.parser.print_help() exit(1) cmd = self._commands[args.command] cmd.get_parser().prog = self.parser.prog + ' ' + cmd.get_parser().prog cmd.run(cmd.get_parser().parse_args(sys.argv[2:])) def main(): CLI([DiffReportCommand(), GenerateReportCommand(), PrintReportCommand()]) if __name__ == '__main__': main() exit(0) neutron-lib-1.13.0/tools/migration_report.sh0000777000175100017510000000226313231472055021150 0ustar zuulzuul00000000000000#!/bin/bash function count_imports() { local module="$1" local path="$2" egrep -R -w "^(import|from) $module" --exclude-dir=".*tox" $your_project | wc -l } if [ $# -eq 0 ]; then echo "Please specify path to your project." exit 1 else your_project="$1" fi command -v bc >/dev/null 2>&1 || { echo "I require bc but it's not installed. Aborting." >&2; exit 1; } total_imports=$(egrep -R -w "^(import|from)" --exclude-dir=".*tox" $your_project | wc -l) neutron_imports=$(count_imports neutron $your_project) lib_imports=$(count_imports neutron_lib $your_project) total_neutron_related_imports=$((neutron_imports + lib_imports)) echo "You have $total_imports total imports" echo "You imported Neutron $neutron_imports times" echo "You imported Neutron-Lib $lib_imports times" if [ "$lib_imports" -eq 0 ]; then echo "Your project does not import neutron-lib once, you suck!" fi goal=$(bc -l <<< "scale=4; ($lib_imports/$total_neutron_related_imports*100)") target=$(bc <<< "$goal>50") if [ "$target" -eq 0 ]; then echo "You need to get to 100%, you are this far: $goal%, get on with it!" else echo "You need to get to 100%, you are close: $goal%, good job!" fi neutron-lib-1.13.0/tools/tox_install.sh0000777000175100017510000000300113231472055020113 0ustar zuulzuul00000000000000#!/usr/bin/env bash # Library constraint file contains this library version pin that is in conflict # with installing the library from source. ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner BRANCH_NAME=master LIB_NAME=neutron-lib requirements_installed=$(echo "import openstack_requirements" | python 2>/dev/null ; echo $?) set -e CONSTRAINTS_FILE=$1 shift install_cmd="pip install" mydir=$(mktemp -dt "$LIB_NAME-tox_install-XXXXXXX") trap "rm -rf $mydir" EXIT localfile=$mydir/upper-constraints.txt if [[ $CONSTRAINTS_FILE != http* ]]; then CONSTRAINTS_FILE=file://$CONSTRAINTS_FILE fi curl $CONSTRAINTS_FILE -k -o $localfile install_cmd="$install_cmd -c$localfile" if [ $requirements_installed -eq 0 ]; then echo "Requirements already installed; using existing package" elif [ -x "$ZUUL_CLONER" ]; then pushd $mydir $ZUUL_CLONER --cache-dir \ /opt/git \ --branch $BRANCH_NAME \ git://git.openstack.org \ openstack/requirements cd openstack/requirements $install_cmd -e . popd else if [ -z "$REQUIREMENTS_PIP_LOCATION" ]; then REQUIREMENTS_PIP_LOCATION="git+https://git.openstack.org/openstack/requirements@$BRANCH_NAME#egg=requirements" fi $install_cmd -U -e ${REQUIREMENTS_PIP_LOCATION} fi # This is the main purpose of the script: Allow local installation of # the current repo. It is listed in constraints file and thus any # install will be constrained and we need to unconstrain it. edit-constraints $localfile $LIB_NAME $install_cmd -U $* exit $? neutron-lib-1.13.0/tools/api_report.sh0000777000175100017510000000517313231472055017733 0ustar zuulzuul00000000000000#!/usr/bin/env bash # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. set -eu TMPDIR=`mktemp -d /tmp/${0##*/}.XXXXXX` || exit 1 trap "rm -rf $TMPDIR" EXIT PROJECT="neutron-lib" PACKAGE="neutron_lib" PYIR_PATH="tools/pyir.py" TAG_RELEASE='' usage() { echo "Usage: $0 [OPTION]..." echo "Generate a python API report between current and the said release tag." echo "" echo " -t, --tag=[] Release tag to generate API report difference with." echo " Defaults to the latest git tag." echo " -h, --help Print this usage message" echo exit 0 } install_project() { git clone -b ${TAG_RELEASE} https://github.com/openstack/${PROJECT}.git ${TMPDIR}/${PROJECT} || (echo "Failed to install ${TAG_RELEASE}" && exit 2) } parse_args() { while [ "$1" != "" ]; do PARAM=`echo $1 | awk -F= '{print $1}'` VALUE=`echo $1 | awk -F= '{print $2}'` case ${PARAM} in -h | --help) usage exit ;; -t | --tag) TAG_RELEASE=${VALUE} break ;; *) echo "ERROR: unknown parameter \"${PARAM}\"" usage exit 1 ;; esac shift done } if [ $# -ne 0 ]; then parse_args $@ fi if [[ ${TAG_RELEASE} == '' ]]; then echo "Finding latest git tag..." TAG_RELEASE=`git tag | tail -n1` if [[ $? -ne 0 ]]; then echo "Failed to find latest git tag! Exiting." exit 1 fi echo "Set tag to: ${TAG_RELEASE}" fi ${PYIR_PATH} generate --blacklist '.*\/tests\/.*','.*\._(\w*)' ${PACKAGE} > "${TMPDIR}/${PACKAGE}.master.json.txt" install_project ${PYIR_PATH} generate --blacklist '.*\/tests\/.*','.*\._(\w*)' ${TMPDIR}/${PROJECT}/${PACKAGE} > "${TMPDIR}/${PACKAGE}.${TAG_RELEASE}.json.txt" echo "===========================================================" echo "Changes between current commit and release tag ${TAG_RELEASE}" echo "===========================================================" ${PYIR_PATH} diff "${TMPDIR}/${PACKAGE}.master.json.txt" "${TMPDIR}/${PACKAGE}.${TAG_RELEASE}.json.txt" neutron-lib-1.13.0/tools/check_samples.sh0000777000175100017510000000150313231472055020361 0ustar zuulzuul00000000000000#! /bin/sh # Copyright (C) 2017 Midokura SARL. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. set -e DIR=api-ref/source/v2/samples find $DIR -name "*.json" | while read f; do if ! python -m json.tool $f > /dev/null; then echo "$f had errors." exit 1 fi done neutron-lib-1.13.0/.stestr.conf0000666000175100017510000000011113231472055016324 0ustar zuulzuul00000000000000[DEFAULT] test_path=${OS_TEST_PATH:-./neutron_lib/tests/unit} top_dir=./ neutron-lib-1.13.0/tox.ini0000666000175100017510000000344713231472055015405 0ustar zuulzuul00000000000000[tox] minversion = 2.0 envlist = py35,py27,pep8 skipsdist = True [testenv] usedevelop = True passenv = TRACE_FAILONLY install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} setenv = VIRTUAL_ENV={envdir} PYTHONWARNINGS=default::DeprecationWarning deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = ostestr --regex '{posargs}' [testenv:pep8] commands = flake8 {toxinidir}/tools/check_samples.sh [testenv:releasenotes] commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:venv] commands = {posargs} [testenv:cover] commands = python setup.py test --coverage --coverage-package-name=neutron_lib --testr-args='{posargs}' coverage report [testenv:docs] commands = python setup.py build_sphinx [testenv:api-ref] whitelist_externals = rm commands = rm -rf api-ref/build sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html [testenv:linkcheck] whitelist_externals = rm commands = rm -rf api-ref/build sphinx-build -W -b linkcheck api-ref/source api-ref/build/linkcheck rm -rf doc/build python setup.py build_sphinx sphinx-build -W -b linkcheck doc/source doc/build/linkcheck [testenv:debug] commands = oslo_debug_helper -t neutron_lib/tests/unit {posargs} [testenv:api-report] commands = {toxinidir}/tools/api_report.sh [flake8] # H904: Delay string interpolations at logging calls enable-extensions=H904 show-source = True exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools import-order-style = pep8 [hacking] import_exceptions = neutron_lib._i18n local-check-factory = neutron_lib.hacking.checks._neutron_lib_factory