python-openstackclient 9.0.0__py3-none-any.whl → 10.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openstackclient/__init__.py +2 -6
- openstackclient/api/api.py +41 -23
- openstackclient/api/compute_v2.py +44 -25
- openstackclient/api/object_store_v1.py +75 -97
- openstackclient/api/volume_v2.py +2 -1
- openstackclient/api/volume_v3.py +2 -1
- openstackclient/common/availability_zone.py +59 -43
- openstackclient/common/clientmanager.py +56 -29
- openstackclient/common/configuration.py +10 -3
- openstackclient/common/envvars.py +2 -2
- openstackclient/common/extension.py +14 -5
- openstackclient/common/limits.py +10 -5
- openstackclient/common/module.py +36 -34
- openstackclient/common/pagination.py +50 -6
- openstackclient/common/progressbar.py +7 -6
- openstackclient/common/project_cleanup.py +11 -6
- openstackclient/common/quota.py +105 -103
- openstackclient/common/versions.py +8 -2
- openstackclient/compute/client.py +7 -3
- openstackclient/compute/v2/agent.py +17 -10
- openstackclient/compute/v2/aggregate.py +36 -22
- openstackclient/compute/v2/console.py +14 -8
- openstackclient/compute/v2/console_connection.py +11 -3
- openstackclient/compute/v2/flavor.py +42 -22
- openstackclient/compute/v2/host.py +14 -6
- openstackclient/compute/v2/hypervisor.py +16 -5
- openstackclient/compute/v2/hypervisor_stats.py +10 -2
- openstackclient/compute/v2/keypair.py +35 -16
- openstackclient/compute/v2/server.py +268 -179
- openstackclient/compute/v2/server_backup.py +10 -4
- openstackclient/compute/v2/server_event.py +28 -12
- openstackclient/compute/v2/server_group.py +23 -11
- openstackclient/compute/v2/server_image.py +19 -10
- openstackclient/compute/v2/server_migration.py +27 -10
- openstackclient/compute/v2/server_share.py +274 -0
- openstackclient/compute/v2/server_volume.py +13 -5
- openstackclient/compute/v2/service.py +17 -8
- openstackclient/compute/v2/usage.py +28 -23
- openstackclient/identity/client.py +8 -3
- openstackclient/identity/common.py +82 -47
- openstackclient/identity/v2_0/catalog.py +14 -7
- openstackclient/identity/v2_0/ec2creds.py +21 -10
- openstackclient/identity/v2_0/endpoint.py +23 -11
- openstackclient/identity/v2_0/project.py +25 -14
- openstackclient/identity/v2_0/role.py +28 -14
- openstackclient/identity/v2_0/role_assignment.py +9 -3
- openstackclient/identity/v2_0/service.py +23 -11
- openstackclient/identity/v2_0/token.py +12 -5
- openstackclient/identity/v2_0/user.py +26 -15
- openstackclient/identity/v3/access_rule.py +32 -12
- openstackclient/identity/v3/application_credential.py +66 -24
- openstackclient/identity/v3/catalog.py +14 -7
- openstackclient/identity/v3/consumer.py +22 -11
- openstackclient/identity/v3/credential.py +39 -17
- openstackclient/identity/v3/domain.py +40 -19
- openstackclient/identity/v3/ec2creds.py +25 -12
- openstackclient/identity/v3/endpoint.py +98 -64
- openstackclient/identity/v3/endpoint_group.py +28 -17
- openstackclient/identity/v3/federation_protocol.py +44 -20
- openstackclient/identity/v3/group.py +64 -40
- openstackclient/identity/v3/identity_provider.py +95 -57
- openstackclient/identity/v3/implied_role.py +21 -9
- openstackclient/identity/v3/limit.py +42 -17
- openstackclient/identity/v3/mapping.py +58 -28
- openstackclient/identity/v3/policy.py +23 -12
- openstackclient/identity/v3/project.py +59 -26
- openstackclient/identity/v3/region.py +39 -17
- openstackclient/identity/v3/registered_limit.py +41 -16
- openstackclient/identity/v3/role.py +62 -31
- openstackclient/identity/v3/role_assignment.py +25 -7
- openstackclient/identity/v3/service.py +39 -17
- openstackclient/identity/v3/service_provider.py +40 -16
- openstackclient/identity/v3/tag.py +23 -6
- openstackclient/identity/v3/token.py +30 -14
- openstackclient/identity/v3/trust.py +39 -18
- openstackclient/identity/v3/unscoped_saml.py +10 -2
- openstackclient/identity/v3/user.py +86 -36
- openstackclient/image/client.py +7 -3
- openstackclient/image/v1/image.py +33 -26
- openstackclient/image/v2/cache.py +16 -11
- openstackclient/image/v2/image.py +88 -56
- openstackclient/image/v2/info.py +7 -1
- openstackclient/image/v2/metadef_namespaces.py +117 -20
- openstackclient/image/v2/metadef_objects.py +32 -19
- openstackclient/image/v2/metadef_properties.py +30 -16
- openstackclient/image/v2/metadef_resource_type_association.py +14 -7
- openstackclient/image/v2/metadef_resource_types.py +7 -1
- openstackclient/image/v2/task.py +25 -27
- openstackclient/locale/tr_TR/LC_MESSAGES/openstackclient.po +7 -192
- openstackclient/network/client.py +7 -2
- openstackclient/network/common.py +16 -241
- openstackclient/network/utils.py +27 -54
- openstackclient/network/v2/address_group.py +39 -16
- openstackclient/network/v2/address_scope.py +36 -20
- openstackclient/network/v2/bgpvpn/bgpvpn.py +477 -0
- openstackclient/network/v2/bgpvpn/constants.py +30 -0
- openstackclient/network/v2/bgpvpn/network_association.py +226 -0
- openstackclient/network/v2/bgpvpn/port_association.py +504 -0
- openstackclient/network/v2/bgpvpn/router_association.py +301 -0
- openstackclient/network/v2/default_security_group_rule.py +31 -14
- openstackclient/network/v2/floating_ip.py +121 -162
- openstackclient/network/v2/floating_ip_port_forwarding.py +41 -19
- openstackclient/network/v2/fwaas/__init__.py +0 -0
- openstackclient/network/v2/fwaas/group.py +499 -0
- openstackclient/network/v2/fwaas/policy.py +518 -0
- openstackclient/network/v2/fwaas/rule.py +610 -0
- openstackclient/network/v2/ip_availability.py +25 -8
- openstackclient/network/v2/l3_conntrack_helper.py +35 -13
- openstackclient/network/v2/local_ip.py +27 -13
- openstackclient/network/v2/local_ip_association.py +17 -7
- openstackclient/network/v2/ndp_proxy.py +23 -11
- openstackclient/network/v2/network.py +213 -213
- openstackclient/network/v2/network_agent.py +77 -34
- openstackclient/network/v2/network_auto_allocated_topology.py +27 -15
- openstackclient/network/v2/network_flavor.py +45 -21
- openstackclient/network/v2/network_flavor_profile.py +42 -17
- openstackclient/network/v2/network_meter.py +39 -15
- openstackclient/network/v2/network_meter_rule.py +40 -12
- openstackclient/network/v2/network_qos_policy.py +39 -21
- openstackclient/network/v2/network_qos_rule.py +48 -18
- openstackclient/network/v2/network_qos_rule_type.py +28 -9
- openstackclient/network/v2/network_rbac.py +34 -16
- openstackclient/network/v2/network_segment.py +32 -11
- openstackclient/network/v2/network_segment_range.py +70 -31
- openstackclient/network/v2/network_service_provider.py +7 -1
- openstackclient/network/v2/network_trunk.py +41 -22
- openstackclient/network/v2/port.py +141 -40
- openstackclient/network/v2/router.py +101 -67
- openstackclient/network/v2/security_group.py +97 -198
- openstackclient/network/v2/security_group_rule.py +115 -282
- openstackclient/network/v2/subnet.py +63 -34
- openstackclient/network/v2/subnet_pool.py +42 -24
- openstackclient/network/v2/taas/tap_flow.py +35 -14
- openstackclient/network/v2/taas/tap_mirror.py +28 -14
- openstackclient/network/v2/taas/tap_service.py +26 -12
- openstackclient/object/client.py +7 -2
- openstackclient/object/v1/account.py +13 -6
- openstackclient/object/v1/container.py +28 -16
- openstackclient/object/v1/object.py +28 -16
- openstackclient/py.typed +0 -0
- openstackclient/shell.py +46 -10
- openstackclient/tests/functional/base.py +55 -20
- openstackclient/tests/functional/common/test_extension.py +4 -0
- openstackclient/tests/functional/common/test_quota.py +3 -1
- openstackclient/tests/functional/compute/v2/common.py +14 -13
- openstackclient/tests/functional/compute/v2/test_flavor.py +3 -1
- openstackclient/tests/functional/compute/v2/test_server.py +3 -0
- openstackclient/tests/functional/identity/v2/common.py +10 -6
- openstackclient/tests/functional/identity/v2/test_role.py +4 -4
- openstackclient/tests/functional/identity/v3/common.py +59 -19
- openstackclient/tests/functional/identity/v3/test_application_credential.py +1 -1
- openstackclient/tests/functional/identity/v3/test_group.py +20 -20
- openstackclient/tests/functional/identity/v3/test_idp.py +3 -1
- openstackclient/tests/functional/identity/v3/test_mapping.py +81 -0
- openstackclient/tests/functional/identity/v3/test_project.py +10 -10
- openstackclient/tests/functional/identity/v3/test_role.py +18 -18
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +12 -12
- openstackclient/tests/functional/identity/v3/test_user.py +8 -8
- openstackclient/tests/functional/image/base.py +1 -6
- openstackclient/tests/functional/network/v2/common.py +5 -2
- openstackclient/tests/functional/network/v2/test_floating_ip.py +10 -4
- openstackclient/tests/functional/network/v2/test_ip_availability.py +4 -0
- openstackclient/tests/functional/network/v2/test_network_meter_rule.py +3 -2
- openstackclient/tests/functional/network/v2/test_network_segment.py +5 -0
- openstackclient/tests/functional/network/v2/test_subnet.py +13 -9
- openstackclient/tests/functional/object/v1/common.py +4 -0
- openstackclient/tests/functional/volume/v2/common.py +4 -0
- openstackclient/tests/functional/volume/v2/test_volume_snapshot.py +27 -11
- openstackclient/tests/functional/volume/v2/test_volume_type.py +2 -2
- openstackclient/tests/functional/volume/v3/common.py +4 -0
- openstackclient/tests/functional/volume/v3/test_volume_group.py +163 -0
- openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +11 -7
- openstackclient/tests/functional/volume/v3/test_volume_type.py +2 -2
- openstackclient/tests/unit/common/test_availability_zone.py +35 -49
- openstackclient/tests/unit/common/test_extension.py +2 -2
- openstackclient/tests/unit/common/test_limits.py +1 -1
- openstackclient/tests/unit/common/test_module.py +82 -44
- openstackclient/tests/unit/common/test_project_cleanup.py +3 -1
- openstackclient/tests/unit/common/test_quota.py +15 -26
- openstackclient/tests/unit/compute/v2/fakes.py +26 -57
- openstackclient/tests/unit/compute/v2/test_agent.py +4 -4
- openstackclient/tests/unit/compute/v2/test_aggregate.py +1 -1
- openstackclient/tests/unit/compute/v2/test_console.py +2 -2
- openstackclient/tests/unit/compute/v2/test_console_connection.py +1 -1
- openstackclient/tests/unit/compute/v2/test_flavor.py +29 -3
- openstackclient/tests/unit/compute/v2/test_host.py +3 -3
- openstackclient/tests/unit/compute/v2/test_hypervisor.py +2 -2
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +1 -1
- openstackclient/tests/unit/compute/v2/test_keypair.py +7 -7
- openstackclient/tests/unit/compute/v2/test_server.py +26 -111
- openstackclient/tests/unit/compute/v2/test_server_backup.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_event.py +2 -2
- openstackclient/tests/unit/compute/v2/test_server_group.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_image.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_migration.py +4 -4
- openstackclient/tests/unit/compute/v2/test_server_share.py +287 -0
- openstackclient/tests/unit/compute/v2/test_server_volume.py +2 -2
- openstackclient/tests/unit/compute/v2/test_service.py +3 -3
- openstackclient/tests/unit/compute/v2/test_usage.py +1 -1
- openstackclient/tests/unit/identity/v2_0/fakes.py +3 -7
- openstackclient/tests/unit/identity/v2_0/test_endpoint.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_project.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_role.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_role_assignment.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_service.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_token.py +2 -2
- openstackclient/tests/unit/identity/v2_0/test_user.py +1 -1
- openstackclient/tests/unit/identity/v3/fakes.py +8 -38
- openstackclient/tests/unit/identity/v3/test_access_rule.py +3 -3
- openstackclient/tests/unit/identity/v3/test_application_credential.py +4 -4
- openstackclient/tests/unit/identity/v3/test_credential.py +5 -5
- openstackclient/tests/unit/identity/v3/test_domain.py +5 -5
- openstackclient/tests/unit/identity/v3/test_endpoint.py +6 -6
- openstackclient/tests/unit/identity/v3/test_endpoint_group.py +1 -1
- openstackclient/tests/unit/identity/v3/test_group.py +12 -22
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +303 -299
- openstackclient/tests/unit/identity/v3/test_implied_role.py +1 -1
- openstackclient/tests/unit/identity/v3/test_limit.py +5 -5
- openstackclient/tests/unit/identity/v3/test_mappings.py +163 -79
- openstackclient/tests/unit/identity/v3/test_project.py +28 -5
- openstackclient/tests/unit/identity/v3/test_protocol.py +3 -3
- openstackclient/tests/unit/identity/v3/test_region.py +5 -5
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +5 -5
- openstackclient/tests/unit/identity/v3/test_role.py +8 -8
- openstackclient/tests/unit/identity/v3/test_role_assignment.py +1 -1
- openstackclient/tests/unit/identity/v3/test_service.py +5 -5
- openstackclient/tests/unit/identity/v3/test_token.py +2 -2
- openstackclient/tests/unit/identity/v3/test_trust.py +4 -4
- openstackclient/tests/unit/identity/v3/test_user.py +77 -10
- openstackclient/tests/unit/image/v2/test_image.py +11 -11
- openstackclient/tests/unit/image/v2/test_metadef_namespaces.py +105 -6
- openstackclient/tests/unit/network/test_common.py +0 -155
- openstackclient/tests/unit/network/v2/bgpvpn/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/bgpvpn/fakes.py +179 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_bgpvpn.py +584 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_network_association.py +285 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_port_association.py +384 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_router_association.py +297 -0
- openstackclient/tests/unit/network/v2/fakes.py +5 -77
- openstackclient/tests/unit/network/v2/fwaas/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/fwaas/test_group.py +923 -0
- openstackclient/tests/unit/network/v2/fwaas/test_policy.py +869 -0
- openstackclient/tests/unit/network/v2/fwaas/test_rule.py +1005 -0
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_flow.py → test_tap_flow.py} +18 -25
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_mirror.py → test_tap_mirror.py} +19 -29
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_service.py → test_tap_service.py} +19 -29
- openstackclient/tests/unit/network/v2/test_address_group.py +26 -2
- openstackclient/tests/unit/network/v2/test_address_scope.py +24 -0
- openstackclient/tests/unit/network/v2/{test_floating_ip_network.py → test_floating_ip.py} +27 -2
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +37 -13
- openstackclient/tests/unit/network/v2/test_ip_availability.py +25 -0
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +29 -3
- openstackclient/tests/unit/network/v2/test_network.py +74 -12
- openstackclient/tests/unit/network/v2/test_network_agent.py +58 -5
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +3 -3
- openstackclient/tests/unit/network/v2/test_network_flavor.py +26 -2
- openstackclient/tests/unit/network/v2/test_network_flavor_profile.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_meter.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_rbac.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_segment.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +31 -10
- openstackclient/tests/unit/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/unit/network/v2/test_port.py +166 -0
- openstackclient/tests/unit/network/v2/test_router.py +36 -16
- openstackclient/tests/unit/network/v2/{test_security_group_network.py → test_security_group.py} +11 -8
- openstackclient/tests/unit/network/v2/{test_security_group_rule_network.py → test_security_group_rule.py} +28 -37
- openstackclient/tests/unit/network/v2/test_subnet.py +30 -5
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +26 -1
- openstackclient/tests/unit/object/v1/fakes.py +8 -7
- openstackclient/tests/unit/object/v1/test_container.py +65 -101
- openstackclient/tests/unit/object/v1/test_container_all.py +8 -1
- openstackclient/tests/unit/object/v1/test_object.py +44 -84
- openstackclient/tests/unit/object/v1/test_object_all.py +8 -1
- openstackclient/tests/unit/test_hacking.py +108 -0
- openstackclient/tests/unit/volume/v2/fakes.py +21 -140
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +6 -14
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +8 -1
- openstackclient/tests/unit/volume/v2/test_volume_type.py +2 -4
- openstackclient/tests/unit/volume/v3/fakes.py +205 -100
- openstackclient/tests/unit/volume/v3/test_backup_record.py +114 -0
- openstackclient/tests/unit/volume/v3/test_consistency_group.py +720 -0
- openstackclient/tests/unit/volume/v3/test_consistency_group_snapshot.py +354 -0
- openstackclient/tests/unit/volume/v3/test_qos_specs.py +455 -0
- openstackclient/tests/unit/volume/v3/test_volume.py +60 -3
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +3 -1
- openstackclient/tests/unit/volume/v3/test_volume_backend.py +158 -0
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +6 -14
- openstackclient/tests/unit/volume/v3/test_volume_group_type.py +65 -0
- openstackclient/tests/unit/volume/v3/test_volume_host.py +115 -0
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +61 -1
- openstackclient/tests/unit/volume/v3/test_volume_type.py +2 -4
- openstackclient/volume/client.py +7 -3
- openstackclient/volume/v2/backup_record.py +15 -6
- openstackclient/volume/v2/consistency_group.py +29 -17
- openstackclient/volume/v2/consistency_group_snapshot.py +25 -10
- openstackclient/volume/v2/qos_specs.py +28 -17
- openstackclient/volume/v2/service.py +17 -6
- openstackclient/volume/v2/volume.py +60 -30
- openstackclient/volume/v2/volume_backend.py +19 -6
- openstackclient/volume/v2/volume_backup.py +48 -23
- openstackclient/volume/v2/volume_host.py +6 -4
- openstackclient/volume/v2/volume_snapshot.py +49 -24
- openstackclient/volume/v2/volume_transfer_request.py +31 -13
- openstackclient/volume/v2/volume_type.py +43 -24
- openstackclient/volume/v3/backup_record.py +94 -0
- openstackclient/volume/v3/block_storage_cleanup.py +11 -3
- openstackclient/volume/v3/block_storage_cluster.py +19 -7
- openstackclient/volume/v3/block_storage_log_level.py +15 -6
- openstackclient/volume/v3/block_storage_manage.py +10 -4
- openstackclient/volume/v3/block_storage_resource_filter.py +17 -5
- openstackclient/volume/v3/consistency_group.py +400 -0
- openstackclient/volume/v3/consistency_group_snapshot.py +225 -0
- openstackclient/volume/v3/qos_specs.py +389 -0
- openstackclient/volume/v3/service.py +16 -6
- openstackclient/volume/v3/volume.py +92 -40
- openstackclient/volume/v3/volume_attachment.py +47 -21
- openstackclient/volume/v3/volume_backend.py +130 -0
- openstackclient/volume/v3/volume_backup.py +55 -27
- openstackclient/volume/v3/volume_group.py +23 -13
- openstackclient/volume/v3/volume_group_snapshot.py +34 -17
- openstackclient/volume/v3/volume_group_type.py +27 -14
- openstackclient/volume/v3/volume_host.py +74 -0
- openstackclient/volume/v3/volume_message.py +18 -8
- openstackclient/volume/v3/volume_snapshot.py +70 -32
- openstackclient/volume/v3/volume_transfer_request.py +31 -13
- openstackclient/volume/v3/volume_type.py +42 -24
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/METADATA +7 -8
- python_openstackclient-10.1.0.dist-info/RECORD +524 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/entry_points.txt +77 -25
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/licenses/AUTHORS +9 -0
- python_openstackclient-10.1.0.dist-info/pbr.json +1 -0
- openstackclient/api/image_v1.py +0 -69
- openstackclient/api/image_v2.py +0 -79
- openstackclient/network/v2/floating_ip_pool.py +0 -38
- openstackclient/tests/functional/image/v1/test_image.py +0 -97
- openstackclient/tests/unit/api/test_image_v1.py +0 -96
- openstackclient/tests/unit/api/test_image_v2.py +0 -96
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +0 -248
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +0 -49
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_network.py +0 -39
- openstackclient/tests/unit/network/v2/test_network_compute.py +0 -404
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +0 -392
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +0 -555
- python_openstackclient-9.0.0.dist-info/RECORD +0 -499
- python_openstackclient-9.0.0.dist-info/pbr.json +0 -1
- /openstackclient/{tests/functional/image/v1 → network/v2/bgpvpn}/__init__.py +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/top_level.txt +0 -0
|
@@ -13,26 +13,31 @@
|
|
|
13
13
|
|
|
14
14
|
"""Network agent action implementations"""
|
|
15
15
|
|
|
16
|
+
import argparse
|
|
16
17
|
import logging
|
|
18
|
+
from collections.abc import Iterable, Sequence
|
|
19
|
+
from typing import Any
|
|
17
20
|
|
|
18
21
|
from cliff import columns as cliff_columns
|
|
22
|
+
from openstack.network.v2 import agent as _agent
|
|
19
23
|
from osc_lib.cli import format_columns
|
|
20
24
|
from osc_lib import exceptions
|
|
21
25
|
from osc_lib import utils
|
|
22
26
|
|
|
23
27
|
from openstackclient import command
|
|
28
|
+
from openstackclient.common import pagination
|
|
24
29
|
from openstackclient.i18n import _
|
|
25
30
|
|
|
26
31
|
LOG = logging.getLogger(__name__)
|
|
27
32
|
|
|
28
33
|
|
|
29
34
|
class AliveColumn(cliff_columns.FormattableColumn[bool]):
|
|
30
|
-
def human_readable(self):
|
|
35
|
+
def human_readable(self) -> str:
|
|
31
36
|
return ":-)" if self._value else "XXX"
|
|
32
37
|
|
|
33
38
|
|
|
34
39
|
class AdminStateColumn(cliff_columns.FormattableColumn[bool]):
|
|
35
|
-
def human_readable(self):
|
|
40
|
+
def human_readable(self) -> str:
|
|
36
41
|
return 'UP' if self._value else 'DOWN'
|
|
37
42
|
|
|
38
43
|
|
|
@@ -45,21 +50,37 @@ _formatters = {
|
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
|
|
48
|
-
def _get_network_columns(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
def _get_network_columns(
|
|
54
|
+
item: _agent.Agent,
|
|
55
|
+
) -> tuple[tuple[str, ...], tuple[str, ...]]:
|
|
56
|
+
column_data_mapping = {
|
|
57
|
+
'admin_state_up': 'is_admin_state_up',
|
|
58
|
+
'agent_type': 'agent_type',
|
|
59
|
+
'alive': 'is_alive',
|
|
60
|
+
'availability_zone': 'availability_zone',
|
|
61
|
+
'binary': 'binary',
|
|
62
|
+
'configuration': 'configuration',
|
|
63
|
+
'created_at': 'created_at',
|
|
64
|
+
'description': 'description',
|
|
65
|
+
'ha_chassis_priority': 'ha_chassis_priority',
|
|
66
|
+
'ha_state': 'ha_state',
|
|
67
|
+
'host': 'host',
|
|
68
|
+
'id': 'id',
|
|
69
|
+
'last_heartbeat_at': 'last_heartbeat_at',
|
|
70
|
+
'resources_synced': 'resources_synced',
|
|
71
|
+
'started_at': 'started_at',
|
|
72
|
+
'topic': 'topic',
|
|
52
73
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
74
|
+
return (
|
|
75
|
+
tuple(column_data_mapping.keys()),
|
|
76
|
+
tuple(column_data_mapping.values()),
|
|
56
77
|
)
|
|
57
78
|
|
|
58
79
|
|
|
59
80
|
class AddNetworkToAgent(command.Command):
|
|
60
81
|
_description = _("Add network to an agent")
|
|
61
82
|
|
|
62
|
-
def get_parser(self, prog_name):
|
|
83
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
63
84
|
parser = super().get_parser(prog_name)
|
|
64
85
|
parser.add_argument(
|
|
65
86
|
'--dhcp',
|
|
@@ -79,7 +100,7 @@ class AddNetworkToAgent(command.Command):
|
|
|
79
100
|
|
|
80
101
|
return parser
|
|
81
102
|
|
|
82
|
-
def take_action(self, parsed_args):
|
|
103
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
83
104
|
client = self.app.client_manager.network
|
|
84
105
|
agent = client.get_agent(parsed_args.agent_id)
|
|
85
106
|
network = client.find_network(
|
|
@@ -96,11 +117,20 @@ class AddNetworkToAgent(command.Command):
|
|
|
96
117
|
class AddRouterToAgent(command.Command):
|
|
97
118
|
_description = _("Add router to an agent")
|
|
98
119
|
|
|
99
|
-
def get_parser(self, prog_name):
|
|
120
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
100
121
|
parser = super().get_parser(prog_name)
|
|
101
122
|
parser.add_argument(
|
|
102
123
|
'--l3', action='store_true', help=_('Add router to an L3 agent')
|
|
103
124
|
)
|
|
125
|
+
parser.add_argument(
|
|
126
|
+
'--ha-chassis-priority',
|
|
127
|
+
metavar='<ha-chassis-priority>',
|
|
128
|
+
type=int,
|
|
129
|
+
help=_(
|
|
130
|
+
"HA Chassis priority, ranging from [0, 32767]. "
|
|
131
|
+
"Only used with --l3 and for ML2/OVN L3 agents"
|
|
132
|
+
),
|
|
133
|
+
)
|
|
104
134
|
parser.add_argument(
|
|
105
135
|
'agent_id',
|
|
106
136
|
metavar='<agent-id>',
|
|
@@ -114,18 +144,22 @@ class AddRouterToAgent(command.Command):
|
|
|
114
144
|
|
|
115
145
|
return parser
|
|
116
146
|
|
|
117
|
-
def take_action(self, parsed_args):
|
|
147
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
118
148
|
client = self.app.client_manager.network
|
|
119
149
|
agent = client.get_agent(parsed_args.agent_id)
|
|
120
150
|
router = client.find_router(parsed_args.router, ignore_missing=False)
|
|
121
151
|
if parsed_args.l3:
|
|
122
|
-
client.add_router_to_agent(
|
|
152
|
+
client.add_router_to_agent(
|
|
153
|
+
agent,
|
|
154
|
+
router,
|
|
155
|
+
ha_chassis_priority=parsed_args.ha_chassis_priority,
|
|
156
|
+
)
|
|
123
157
|
|
|
124
158
|
|
|
125
159
|
class DeleteNetworkAgent(command.Command):
|
|
126
160
|
_description = _("Delete network agent(s)")
|
|
127
161
|
|
|
128
|
-
def get_parser(self, prog_name):
|
|
162
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
129
163
|
parser = super().get_parser(prog_name)
|
|
130
164
|
parser.add_argument(
|
|
131
165
|
'network_agent',
|
|
@@ -135,7 +169,7 @@ class DeleteNetworkAgent(command.Command):
|
|
|
135
169
|
)
|
|
136
170
|
return parser
|
|
137
171
|
|
|
138
|
-
def take_action(self, parsed_args):
|
|
172
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
139
173
|
client = self.app.client_manager.network
|
|
140
174
|
result = 0
|
|
141
175
|
|
|
@@ -160,8 +194,6 @@ class DeleteNetworkAgent(command.Command):
|
|
|
160
194
|
raise exceptions.CommandError(msg)
|
|
161
195
|
|
|
162
196
|
|
|
163
|
-
# TODO(huanxuan): Use the SDK resource mapped attribute names once the
|
|
164
|
-
# OSC minimum requirements include SDK 1.0.
|
|
165
197
|
class ListNetworkAgent(command.Lister):
|
|
166
198
|
_description = _("List network agents")
|
|
167
199
|
_supported_agents = {
|
|
@@ -183,7 +215,7 @@ class ListNetworkAgent(command.Lister):
|
|
|
183
215
|
'ovn-agent': 'OVN Neutron agent',
|
|
184
216
|
}
|
|
185
217
|
|
|
186
|
-
def get_parser(self, prog_name):
|
|
218
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
187
219
|
parser = super().get_parser(prog_name)
|
|
188
220
|
supported_agents = ','.join(self._supported_agents.keys())
|
|
189
221
|
parser.add_argument(
|
|
@@ -218,10 +250,13 @@ class ListNetworkAgent(command.Lister):
|
|
|
218
250
|
default=False,
|
|
219
251
|
help=_("List additional fields in output"),
|
|
220
252
|
)
|
|
253
|
+
pagination.add_marker_pagination_option_to_parser(parser)
|
|
221
254
|
|
|
222
255
|
return parser
|
|
223
256
|
|
|
224
|
-
def take_action(
|
|
257
|
+
def take_action(
|
|
258
|
+
self, parsed_args: argparse.Namespace
|
|
259
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
225
260
|
client = self.app.client_manager.network
|
|
226
261
|
columns: tuple[str, ...] = (
|
|
227
262
|
'id',
|
|
@@ -243,12 +278,19 @@ class ListNetworkAgent(command.Lister):
|
|
|
243
278
|
)
|
|
244
279
|
|
|
245
280
|
filters = {}
|
|
246
|
-
|
|
281
|
+
if parsed_args.marker is not None:
|
|
282
|
+
filters['marker'] = parsed_args.marker
|
|
283
|
+
if parsed_args.limit is not None:
|
|
284
|
+
filters['limit'] = parsed_args.limit
|
|
285
|
+
if parsed_args.max_items is not None:
|
|
286
|
+
filters['max_items'] = parsed_args.max_items
|
|
287
|
+
|
|
288
|
+
data: list[_agent.Agent]
|
|
247
289
|
if parsed_args.network is not None:
|
|
248
290
|
network = client.find_network(
|
|
249
291
|
parsed_args.network, ignore_missing=False
|
|
250
292
|
)
|
|
251
|
-
data = client.network_hosting_dhcp_agents(network)
|
|
293
|
+
data = list(client.network_hosting_dhcp_agents(network))
|
|
252
294
|
elif parsed_args.router is not None:
|
|
253
295
|
if parsed_args.long:
|
|
254
296
|
columns += ('ha_state',)
|
|
@@ -256,7 +298,7 @@ class ListNetworkAgent(command.Lister):
|
|
|
256
298
|
router = client.find_router(
|
|
257
299
|
parsed_args.router, ignore_missing=False
|
|
258
300
|
)
|
|
259
|
-
data = client.routers_hosting_l3_agents(router)
|
|
301
|
+
data = list(client.routers_hosting_l3_agents(router))
|
|
260
302
|
else:
|
|
261
303
|
if parsed_args.agent_type is not None:
|
|
262
304
|
filters['agent_type'] = self._supported_agents[
|
|
@@ -265,7 +307,8 @@ class ListNetworkAgent(command.Lister):
|
|
|
265
307
|
if parsed_args.host is not None:
|
|
266
308
|
filters['host'] = parsed_args.host
|
|
267
309
|
|
|
268
|
-
data = client.agents(**filters)
|
|
310
|
+
data = list(client.agents(**filters))
|
|
311
|
+
|
|
269
312
|
return (
|
|
270
313
|
column_headers,
|
|
271
314
|
(
|
|
@@ -282,7 +325,7 @@ class ListNetworkAgent(command.Lister):
|
|
|
282
325
|
class RemoveNetworkFromAgent(command.Command):
|
|
283
326
|
_description = _("Remove network from an agent.")
|
|
284
327
|
|
|
285
|
-
def get_parser(self, prog_name):
|
|
328
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
286
329
|
parser = super().get_parser(prog_name)
|
|
287
330
|
parser.add_argument(
|
|
288
331
|
'--dhcp',
|
|
@@ -301,7 +344,7 @@ class RemoveNetworkFromAgent(command.Command):
|
|
|
301
344
|
)
|
|
302
345
|
return parser
|
|
303
346
|
|
|
304
|
-
def take_action(self, parsed_args):
|
|
347
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
305
348
|
client = self.app.client_manager.network
|
|
306
349
|
agent = client.get_agent(parsed_args.agent_id)
|
|
307
350
|
network = client.find_network(
|
|
@@ -318,7 +361,7 @@ class RemoveNetworkFromAgent(command.Command):
|
|
|
318
361
|
class RemoveRouterFromAgent(command.Command):
|
|
319
362
|
_description = _("Remove router from an agent")
|
|
320
363
|
|
|
321
|
-
def get_parser(self, prog_name):
|
|
364
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
322
365
|
parser = super().get_parser(prog_name)
|
|
323
366
|
parser.add_argument(
|
|
324
367
|
'--l3',
|
|
@@ -338,7 +381,7 @@ class RemoveRouterFromAgent(command.Command):
|
|
|
338
381
|
|
|
339
382
|
return parser
|
|
340
383
|
|
|
341
|
-
def take_action(self, parsed_args):
|
|
384
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
342
385
|
client = self.app.client_manager.network
|
|
343
386
|
agent = client.get_agent(parsed_args.agent_id)
|
|
344
387
|
router = client.find_router(parsed_args.router, ignore_missing=False)
|
|
@@ -346,12 +389,10 @@ class RemoveRouterFromAgent(command.Command):
|
|
|
346
389
|
client.remove_router_from_agent(agent, router)
|
|
347
390
|
|
|
348
391
|
|
|
349
|
-
# TODO(huanxuan): Use the SDK resource mapped attribute names once the
|
|
350
|
-
# OSC minimum requirements include SDK 1.0.
|
|
351
392
|
class SetNetworkAgent(command.Command):
|
|
352
393
|
_description = _("Set network agent properties")
|
|
353
394
|
|
|
354
|
-
def get_parser(self, prog_name):
|
|
395
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
355
396
|
parser = super().get_parser(prog_name)
|
|
356
397
|
parser.add_argument(
|
|
357
398
|
'network_agent',
|
|
@@ -372,7 +413,7 @@ class SetNetworkAgent(command.Command):
|
|
|
372
413
|
)
|
|
373
414
|
return parser
|
|
374
415
|
|
|
375
|
-
def take_action(self, parsed_args):
|
|
416
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
376
417
|
client = self.app.client_manager.network
|
|
377
418
|
obj = client.get_agent(parsed_args.network_agent)
|
|
378
419
|
attrs = {}
|
|
@@ -390,7 +431,7 @@ class SetNetworkAgent(command.Command):
|
|
|
390
431
|
class ShowNetworkAgent(command.ShowOne):
|
|
391
432
|
_description = _("Display network agent details")
|
|
392
433
|
|
|
393
|
-
def get_parser(self, prog_name):
|
|
434
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
394
435
|
parser = super().get_parser(prog_name)
|
|
395
436
|
parser.add_argument(
|
|
396
437
|
'network_agent',
|
|
@@ -399,7 +440,9 @@ class ShowNetworkAgent(command.ShowOne):
|
|
|
399
440
|
)
|
|
400
441
|
return parser
|
|
401
442
|
|
|
402
|
-
def take_action(
|
|
443
|
+
def take_action(
|
|
444
|
+
self, parsed_args: argparse.Namespace
|
|
445
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
403
446
|
client = self.app.client_manager.network
|
|
404
447
|
obj = client.get_agent(parsed_args.network_agent)
|
|
405
448
|
display_columns, columns = _get_network_columns(obj)
|
|
@@ -13,8 +13,14 @@
|
|
|
13
13
|
|
|
14
14
|
"""Auto-allocated Topology Implementations"""
|
|
15
15
|
|
|
16
|
+
import argparse
|
|
16
17
|
import logging
|
|
18
|
+
from collections.abc import Iterable, Sequence
|
|
19
|
+
from typing import Any
|
|
17
20
|
|
|
21
|
+
from openstack.network.v2 import (
|
|
22
|
+
auto_allocated_topology as _auto_allocated_topology,
|
|
23
|
+
)
|
|
18
24
|
from osc_lib import utils
|
|
19
25
|
|
|
20
26
|
from openstackclient import command
|
|
@@ -24,26 +30,30 @@ from openstackclient.identity import common as identity_common
|
|
|
24
30
|
LOG = logging.getLogger(__name__)
|
|
25
31
|
|
|
26
32
|
|
|
27
|
-
def _get_columns(
|
|
33
|
+
def _get_columns(
|
|
34
|
+
item: _auto_allocated_topology.AutoAllocatedTopology,
|
|
35
|
+
) -> tuple[tuple[str, ...], tuple[str, ...]]:
|
|
28
36
|
hidden_columns = ['name', 'location', 'tenant_id']
|
|
29
37
|
return utils.get_osc_show_columns_for_sdk_resource(
|
|
30
38
|
item, {}, hidden_columns
|
|
31
39
|
)
|
|
32
40
|
|
|
33
41
|
|
|
34
|
-
def _format_check_resource_columns():
|
|
42
|
+
def _format_check_resource_columns() -> tuple[str, ...]:
|
|
35
43
|
return ('dry_run',)
|
|
36
44
|
|
|
37
45
|
|
|
38
|
-
def _format_check_resource(item):
|
|
46
|
+
def _format_check_resource(item: Any) -> Any:
|
|
39
47
|
item_id = getattr(item, 'id', False)
|
|
40
48
|
if item_id == 'dry-run=pass':
|
|
41
49
|
item.check_resource = 'pass'
|
|
42
50
|
return item
|
|
43
51
|
|
|
44
52
|
|
|
45
|
-
def _get_attrs(
|
|
46
|
-
|
|
53
|
+
def _get_attrs(
|
|
54
|
+
client_manager: Any, parsed_args: argparse.Namespace
|
|
55
|
+
) -> dict[str, Any]:
|
|
56
|
+
attrs: dict[str, Any] = {}
|
|
47
57
|
if parsed_args.project:
|
|
48
58
|
identity_client = client_manager.identity
|
|
49
59
|
project_id = identity_common.find_project(
|
|
@@ -58,12 +68,10 @@ def _get_attrs(client_manager, parsed_args):
|
|
|
58
68
|
return attrs
|
|
59
69
|
|
|
60
70
|
|
|
61
|
-
# TODO(ankur-gupta-f): Use the SDK resource mapped attribute names once the
|
|
62
|
-
# OSC minimum requirements include SDK 1.0.
|
|
63
71
|
class CreateAutoAllocatedTopology(command.ShowOne):
|
|
64
72
|
_description = _("Create the auto allocated topology for project")
|
|
65
73
|
|
|
66
|
-
def get_parser(self, prog_name):
|
|
74
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
67
75
|
parser = super().get_parser(prog_name)
|
|
68
76
|
parser.add_argument(
|
|
69
77
|
'--project',
|
|
@@ -94,7 +102,9 @@ class CreateAutoAllocatedTopology(command.ShowOne):
|
|
|
94
102
|
|
|
95
103
|
return parser
|
|
96
104
|
|
|
97
|
-
def check_resource_topology(
|
|
105
|
+
def check_resource_topology(
|
|
106
|
+
self, client: Any, parsed_args: argparse.Namespace
|
|
107
|
+
) -> tuple[tuple[str, ...], Any]:
|
|
98
108
|
obj = client.validate_auto_allocated_topology(parsed_args.project)
|
|
99
109
|
|
|
100
110
|
columns = _format_check_resource_columns()
|
|
@@ -104,13 +114,17 @@ class CreateAutoAllocatedTopology(command.ShowOne):
|
|
|
104
114
|
|
|
105
115
|
return (columns, data)
|
|
106
116
|
|
|
107
|
-
def get_topology(
|
|
117
|
+
def get_topology(
|
|
118
|
+
self, client: Any, parsed_args: argparse.Namespace
|
|
119
|
+
) -> tuple[tuple[str, ...], Any]:
|
|
108
120
|
obj = client.get_auto_allocated_topology(parsed_args.project)
|
|
109
121
|
display_columns, columns = _get_columns(obj)
|
|
110
122
|
data = utils.get_item_properties(obj, columns, formatters={})
|
|
111
123
|
return (display_columns, data)
|
|
112
124
|
|
|
113
|
-
def take_action(
|
|
125
|
+
def take_action(
|
|
126
|
+
self, parsed_args: argparse.Namespace
|
|
127
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
114
128
|
client = self.app.client_manager.network
|
|
115
129
|
if parsed_args.check_resources:
|
|
116
130
|
columns, data = self.check_resource_topology(client, parsed_args)
|
|
@@ -119,12 +133,10 @@ class CreateAutoAllocatedTopology(command.ShowOne):
|
|
|
119
133
|
return (columns, data)
|
|
120
134
|
|
|
121
135
|
|
|
122
|
-
# TODO(ankur-gupta-f): Use the SDK resource mapped attribute names once the
|
|
123
|
-
# OSC minimum requirements include SDK 1.0.
|
|
124
136
|
class DeleteAutoAllocatedTopology(command.Command):
|
|
125
137
|
_description = _("Delete auto allocated topology for project")
|
|
126
138
|
|
|
127
|
-
def get_parser(self, prog_name):
|
|
139
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
128
140
|
parser = super().get_parser(prog_name)
|
|
129
141
|
parser.add_argument(
|
|
130
142
|
'--project',
|
|
@@ -138,6 +150,6 @@ class DeleteAutoAllocatedTopology(command.Command):
|
|
|
138
150
|
|
|
139
151
|
return parser
|
|
140
152
|
|
|
141
|
-
def take_action(self, parsed_args):
|
|
153
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
142
154
|
client = self.app.client_manager.network
|
|
143
155
|
client.delete_auto_allocated_topology(parsed_args.project)
|
|
@@ -13,12 +13,17 @@
|
|
|
13
13
|
|
|
14
14
|
"""Flavor action implementations"""
|
|
15
15
|
|
|
16
|
+
import argparse
|
|
16
17
|
import logging
|
|
18
|
+
from collections.abc import Iterable, Sequence
|
|
19
|
+
from typing import Any
|
|
17
20
|
|
|
21
|
+
from openstack.network.v2 import flavor as _flavor
|
|
18
22
|
from osc_lib import exceptions
|
|
19
23
|
from osc_lib import utils
|
|
20
24
|
|
|
21
25
|
from openstackclient import command
|
|
26
|
+
from openstackclient.common import pagination
|
|
22
27
|
from openstackclient.i18n import _
|
|
23
28
|
from openstackclient.identity import common as identity_common
|
|
24
29
|
from openstackclient.network import common
|
|
@@ -26,7 +31,9 @@ from openstackclient.network import common
|
|
|
26
31
|
LOG = logging.getLogger(__name__)
|
|
27
32
|
|
|
28
33
|
|
|
29
|
-
def _get_columns(
|
|
34
|
+
def _get_columns(
|
|
35
|
+
item: _flavor.Flavor,
|
|
36
|
+
) -> tuple[tuple[str, ...], tuple[str, ...]]:
|
|
30
37
|
column_map = {
|
|
31
38
|
'is_enabled': 'enabled',
|
|
32
39
|
}
|
|
@@ -37,8 +44,10 @@ def _get_columns(item):
|
|
|
37
44
|
)
|
|
38
45
|
|
|
39
46
|
|
|
40
|
-
def _get_attrs(
|
|
41
|
-
|
|
47
|
+
def _get_attrs(
|
|
48
|
+
client_manager: Any, parsed_args: argparse.Namespace
|
|
49
|
+
) -> dict[str, Any]:
|
|
50
|
+
attrs: dict[str, Any] = {}
|
|
42
51
|
attrs['name'] = parsed_args.name
|
|
43
52
|
attrs['service_type'] = parsed_args.service_type
|
|
44
53
|
if parsed_args.description is not None:
|
|
@@ -62,7 +71,7 @@ def _get_attrs(client_manager, parsed_args):
|
|
|
62
71
|
class AddNetworkFlavorToProfile(command.Command):
|
|
63
72
|
_description = _("Add a service profile to a network flavor")
|
|
64
73
|
|
|
65
|
-
def get_parser(self, prog_name):
|
|
74
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
66
75
|
parser = super().get_parser(prog_name)
|
|
67
76
|
parser.add_argument(
|
|
68
77
|
'flavor', metavar="<flavor>", help=_("Network flavor (name or ID)")
|
|
@@ -74,7 +83,7 @@ class AddNetworkFlavorToProfile(command.Command):
|
|
|
74
83
|
)
|
|
75
84
|
return parser
|
|
76
85
|
|
|
77
|
-
def take_action(self, parsed_args):
|
|
86
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
78
87
|
client = self.app.client_manager.network
|
|
79
88
|
obj_flavor = client.find_flavor(
|
|
80
89
|
parsed_args.flavor, ignore_missing=False
|
|
@@ -87,12 +96,10 @@ class AddNetworkFlavorToProfile(command.Command):
|
|
|
87
96
|
)
|
|
88
97
|
|
|
89
98
|
|
|
90
|
-
# TODO(dasanind): Use the SDK resource mapped attribute names once the
|
|
91
|
-
# OSC minimum requirements include SDK 1.0.
|
|
92
99
|
class CreateNetworkFlavor(command.ShowOne, common.NeutronCommandWithExtraArgs):
|
|
93
100
|
_description = _("Create new network flavor")
|
|
94
101
|
|
|
95
|
-
def get_parser(self, prog_name):
|
|
102
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
96
103
|
parser = super().get_parser(prog_name)
|
|
97
104
|
parser.add_argument(
|
|
98
105
|
'name', metavar="<name>", help=_("Name for the flavor")
|
|
@@ -129,7 +136,9 @@ class CreateNetworkFlavor(command.ShowOne, common.NeutronCommandWithExtraArgs):
|
|
|
129
136
|
|
|
130
137
|
return parser
|
|
131
138
|
|
|
132
|
-
def take_action(
|
|
139
|
+
def take_action(
|
|
140
|
+
self, parsed_args: argparse.Namespace
|
|
141
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
133
142
|
client = self.app.client_manager.network
|
|
134
143
|
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
|
135
144
|
attrs.update(
|
|
@@ -145,7 +154,7 @@ class CreateNetworkFlavor(command.ShowOne, common.NeutronCommandWithExtraArgs):
|
|
|
145
154
|
class DeleteNetworkFlavor(command.Command):
|
|
146
155
|
_description = _("Delete network flavors")
|
|
147
156
|
|
|
148
|
-
def get_parser(self, prog_name):
|
|
157
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
149
158
|
parser = super().get_parser(prog_name)
|
|
150
159
|
|
|
151
160
|
parser.add_argument(
|
|
@@ -156,7 +165,7 @@ class DeleteNetworkFlavor(command.Command):
|
|
|
156
165
|
)
|
|
157
166
|
return parser
|
|
158
167
|
|
|
159
|
-
def take_action(self, parsed_args):
|
|
168
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
160
169
|
client = self.app.client_manager.network
|
|
161
170
|
result = 0
|
|
162
171
|
|
|
@@ -185,7 +194,14 @@ class DeleteNetworkFlavor(command.Command):
|
|
|
185
194
|
class ListNetworkFlavor(command.Lister):
|
|
186
195
|
_description = _("List network flavors")
|
|
187
196
|
|
|
188
|
-
def
|
|
197
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
198
|
+
parser = super().get_parser(prog_name)
|
|
199
|
+
pagination.add_marker_pagination_option_to_parser(parser)
|
|
200
|
+
return parser
|
|
201
|
+
|
|
202
|
+
def take_action(
|
|
203
|
+
self, parsed_args: argparse.Namespace
|
|
204
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
189
205
|
client = self.app.client_manager.network
|
|
190
206
|
|
|
191
207
|
columns = ('id', 'name', 'is_enabled', 'service_type', 'description')
|
|
@@ -197,7 +213,15 @@ class ListNetworkFlavor(command.Lister):
|
|
|
197
213
|
'Description',
|
|
198
214
|
)
|
|
199
215
|
|
|
200
|
-
|
|
216
|
+
filters = {}
|
|
217
|
+
if parsed_args.marker is not None:
|
|
218
|
+
filters['marker'] = parsed_args.marker
|
|
219
|
+
if parsed_args.limit is not None:
|
|
220
|
+
filters['limit'] = parsed_args.limit
|
|
221
|
+
if parsed_args.max_items is not None:
|
|
222
|
+
filters['max_items'] = parsed_args.max_items
|
|
223
|
+
|
|
224
|
+
data = client.flavors(**filters)
|
|
201
225
|
return (
|
|
202
226
|
column_headers,
|
|
203
227
|
(
|
|
@@ -213,7 +237,7 @@ class ListNetworkFlavor(command.Lister):
|
|
|
213
237
|
class RemoveNetworkFlavorFromProfile(command.Command):
|
|
214
238
|
_description = _("Remove service profile from network flavor")
|
|
215
239
|
|
|
216
|
-
def get_parser(self, prog_name):
|
|
240
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
217
241
|
parser = super().get_parser(prog_name)
|
|
218
242
|
parser.add_argument(
|
|
219
243
|
'flavor', metavar="<flavor>", help=_("Network flavor (name or ID)")
|
|
@@ -225,7 +249,7 @@ class RemoveNetworkFlavorFromProfile(command.Command):
|
|
|
225
249
|
)
|
|
226
250
|
return parser
|
|
227
251
|
|
|
228
|
-
def take_action(self, parsed_args):
|
|
252
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
229
253
|
client = self.app.client_manager.network
|
|
230
254
|
obj_flavor = client.find_flavor(
|
|
231
255
|
parsed_args.flavor, ignore_missing=False
|
|
@@ -238,12 +262,10 @@ class RemoveNetworkFlavorFromProfile(command.Command):
|
|
|
238
262
|
)
|
|
239
263
|
|
|
240
264
|
|
|
241
|
-
# TODO(dasanind): Use only the SDK resource mapped attribute names once the
|
|
242
|
-
# OSC minimum requirements include SDK 1.0.
|
|
243
265
|
class SetNetworkFlavor(common.NeutronCommandWithExtraArgs):
|
|
244
266
|
_description = _("Set network flavor properties")
|
|
245
267
|
|
|
246
|
-
def get_parser(self, prog_name):
|
|
268
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
247
269
|
parser = super().get_parser(prog_name)
|
|
248
270
|
parser.add_argument(
|
|
249
271
|
'flavor',
|
|
@@ -266,7 +288,7 @@ class SetNetworkFlavor(common.NeutronCommandWithExtraArgs):
|
|
|
266
288
|
|
|
267
289
|
return parser
|
|
268
290
|
|
|
269
|
-
def take_action(self, parsed_args):
|
|
291
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
270
292
|
client = self.app.client_manager.network
|
|
271
293
|
obj = client.find_flavor(parsed_args.flavor, ignore_missing=False)
|
|
272
294
|
attrs = {}
|
|
@@ -287,7 +309,7 @@ class SetNetworkFlavor(common.NeutronCommandWithExtraArgs):
|
|
|
287
309
|
class ShowNetworkFlavor(command.ShowOne):
|
|
288
310
|
_description = _("Display network flavor details")
|
|
289
311
|
|
|
290
|
-
def get_parser(self, prog_name):
|
|
312
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
291
313
|
parser = super().get_parser(prog_name)
|
|
292
314
|
parser.add_argument(
|
|
293
315
|
'flavor',
|
|
@@ -296,7 +318,9 @@ class ShowNetworkFlavor(command.ShowOne):
|
|
|
296
318
|
)
|
|
297
319
|
return parser
|
|
298
320
|
|
|
299
|
-
def take_action(
|
|
321
|
+
def take_action(
|
|
322
|
+
self, parsed_args: argparse.Namespace
|
|
323
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
300
324
|
client = self.app.client_manager.network
|
|
301
325
|
obj = client.find_flavor(parsed_args.flavor, ignore_missing=False)
|
|
302
326
|
display_columns, columns = _get_columns(obj)
|