├── .coveragerc ├── .gitignore ├── .gitreview ├── .mailmap ├── .pre-commit-config.yaml ├── .stestr.conf ├── .zuul.yaml ├── CONTRIBUTING.rst ├── HACKING.rst ├── LICENSE ├── README.rst ├── bindep.txt ├── doc ├── requirements.txt ├── source │ ├── _extra │ │ └── .htaccess │ ├── cli │ │ ├── index.rst │ │ └── nova.rst │ ├── conf.py │ ├── contributor │ │ ├── contributing.rst │ │ ├── deprecation-policy.rst │ │ ├── index.rst │ │ ├── microversions.rst │ │ └── testing.rst │ ├── index.rst │ ├── reference │ │ └── index.rst │ └── user │ │ ├── index.rst │ │ ├── python-api.rst │ │ └── shell.rst └── test │ └── redirect-tests.txt ├── novaclient ├── __init__.py ├── api_versions.py ├── base.py ├── client.py ├── crypto.py ├── exceptions.py ├── extension.py ├── i18n.py ├── shell.py ├── tests │ ├── __init__.py │ ├── functional │ │ ├── README.rst │ │ ├── __init__.py │ │ ├── api │ │ │ ├── __init__.py │ │ │ └── test_servers.py │ │ ├── base.py │ │ ├── clouds.yaml.sample │ │ ├── hooks │ │ │ └── check_resources.py │ │ ├── test_auth.py │ │ └── v2 │ │ │ ├── __init__.py │ │ │ ├── fake_crypto.py │ │ │ ├── legacy │ │ │ ├── __init__.py │ │ │ ├── test_consoles.py │ │ │ ├── test_extended_attributes.py │ │ │ ├── test_flavor_access.py │ │ │ ├── test_hypervisors.py │ │ │ ├── test_instances.py │ │ │ ├── test_keypairs.py │ │ │ ├── test_os_services.py │ │ │ ├── test_quotas.py │ │ │ ├── test_readonly_nova.py │ │ │ ├── test_server_groups.py │ │ │ ├── test_servers.py │ │ │ └── test_usage.py │ │ │ ├── test_aggregates.py │ │ │ ├── test_consoles.py │ │ │ ├── test_device_tagging.py │ │ │ ├── test_extended_attributes.py │ │ │ ├── test_flavor.py │ │ │ ├── test_flavor_access.py │ │ │ ├── test_hypervisors.py │ │ │ ├── test_image_meta.py │ │ │ ├── test_instance_action.py │ │ │ ├── test_instance_usage_audit_log.py │ │ │ ├── test_instances.py │ │ │ ├── test_keypairs.py │ │ │ ├── test_migrations.py │ │ │ ├── test_networks.py │ │ │ ├── test_os_services.py │ │ │ ├── test_quota_classes.py │ │ │ ├── test_quotas.py │ │ │ ├── test_resize.py │ │ │ ├── test_server_groups.py │ │ │ ├── test_servers.py │ │ │ ├── test_trigger_crash_dump.py │ │ │ └── test_usage.py │ └── unit │ │ ├── __init__.py │ │ ├── fake_actions_module.py │ │ ├── fakes.py │ │ ├── fixture_data │ │ ├── __init__.py │ │ ├── agents.py │ │ ├── aggregates.py │ │ ├── availability_zones.py │ │ ├── base.py │ │ ├── client.py │ │ ├── floatingips.py │ │ ├── hypervisors.py │ │ ├── images.py │ │ ├── keypairs.py │ │ ├── limits.py │ │ ├── quotas.py │ │ ├── server_groups.py │ │ ├── server_migrations.py │ │ └── servers.py │ │ ├── idfake.pem │ │ ├── test_api_versions.py │ │ ├── test_base.py │ │ ├── test_client.py │ │ ├── test_crypto.py │ │ ├── test_discover.py │ │ ├── test_exceptions.py │ │ ├── test_shell.py │ │ ├── test_utils.py │ │ ├── utils.py │ │ └── v2 │ │ ├── __init__.py │ │ ├── fakes.py │ │ ├── test_agents.py │ │ ├── test_aggregates.py │ │ ├── test_assisted_volume_snapshots.py │ │ ├── test_availability_zone.py │ │ ├── test_client.py │ │ ├── test_flavor_access.py │ │ ├── test_flavors.py │ │ ├── test_hypervisors.py │ │ ├── test_images.py │ │ ├── test_instance_actions.py │ │ ├── test_instance_usage_audit_log.py │ │ ├── test_keypairs.py │ │ ├── test_limits.py │ │ ├── test_migrations.py │ │ ├── test_quota_classes.py │ │ ├── test_quotas.py │ │ ├── test_server_external_events.py │ │ ├── test_server_groups.py │ │ ├── test_server_migrations.py │ │ ├── test_servers.py │ │ ├── test_services.py │ │ ├── test_shell.py │ │ ├── test_usage.py │ │ ├── test_versions.py │ │ ├── test_volumes.py │ │ └── testfile.txt ├── utils.py └── v2 │ ├── __init__.py │ ├── agents.py │ ├── aggregates.py │ ├── assisted_volume_snapshots.py │ ├── availability_zones.py │ ├── client.py │ ├── flavor_access.py │ ├── flavors.py │ ├── hypervisors.py │ ├── images.py │ ├── instance_action.py │ ├── instance_usage_audit_log.py │ ├── keypairs.py │ ├── limits.py │ ├── migrations.py │ ├── networks.py │ ├── quota_classes.py │ ├── quotas.py │ ├── server_external_events.py │ ├── server_groups.py │ ├── server_migrations.py │ ├── servers.py │ ├── services.py │ ├── shell.py │ ├── usage.py │ ├── versions.py │ └── volumes.py ├── pyproject.toml ├── releasenotes ├── notes │ ├── .placeholder │ ├── add-filter-to-nova-list-831dcbb34420fb29.yaml │ ├── add-osprofiler-support-cc9dd228242e9919.yaml │ ├── add-support-for-volume-backed-rebuild-6a32d9d88fed6b4a.yaml │ ├── add-user-agent-string-db77210dfd3ec671.yaml │ ├── bp-add-locked-reason-3f136db97b820c73.yaml │ ├── bp-cold-migration-with-target-queens-e361d4ae977aa396.yaml │ ├── bp-deprecate-image-meta-proxy-api-1483b75cf73b021e.yaml │ ├── bp-handling-down-cell-728cdb1efd1ea75b.yaml │ ├── bp-keypair-generation-removal-1b5d84a8906d3918.yaml │ ├── bp-more-migration-list-filters-6c801896c7ee5cdc.yaml │ ├── bp-unshelve-to-host-b220131a00dff8a2.yaml │ ├── bug-1669140-c21d045491201352.yaml │ ├── bug-1744118-0b064d7062117317.yaml │ ├── bug-1764420-flavor-delete-output-7b80f73deee5a869.yaml │ ├── bug-1767287-cc28d60d9e59f9bd.yaml │ ├── bug-1778536-a1b5d65a0d4ad622.yaml │ ├── bug-1825061-2beb95db4d6df0cb.yaml │ ├── bug-1845322-463ee407b60131c9.yaml │ ├── clarify-project-id-variable-5832698315000438.yaml │ ├── deprecate-agent-d0f58718ad1782f6.yaml │ ├── deprecate-baremetal-d67f58a2986b3565.yaml │ ├── deprecate-cellsv1-extension-16482759993d112f.yaml │ ├── deprecate-certs-1558d8e3b7888938.yaml │ ├── deprecate-cli-75074850847a8452.yaml │ ├── deprecate-cloudpipe-670202797fdf97b6.yaml │ ├── deprecate-connection-pool-arg-cef35346d5ebf40c.yaml │ ├── deprecate-force-option-7116d792bba17f09.yaml │ ├── deprecate-instance-name-option-bc76629d28f1d456.yaml │ ├── deprecate-network-cli-f0a539528be594d3.yaml │ ├── deprecate-no-cache-arg-7814806b4f79c1b9.yaml │ ├── deprecate-proxy-args-a3f4e224f7664ff8.yaml │ ├── deprecate-service-binary-arg-2d5c446f5a2409a7.yaml │ ├── deprecate-volume-service-name-arg-4c65e8866f9624dd.yaml │ ├── deprecate_cell_name_arg-eb34cb7c43cfcb89.yaml │ ├── deprecate_contrib_extensions-0ec70c070b09eedb.yaml │ ├── drop-deprecated-aggregate-update-args-17bd019f4be34b18.yaml │ ├── drop-python2-support-d3a1bedc75445edc.yaml │ ├── fix-booting-with-multiple-nics-c6e5885b948d35ba.yaml │ ├── fix-raw-python-error-debd3edb17c2f675.yaml │ ├── fix-rebuild-userdata-9315e5784feb8ba9.yaml │ ├── fix-tag-attribute-disappearing-25483a80f548ef35.yaml │ ├── fix-token-auth-6c48c63a759f51d5.yaml │ ├── fixed-ListExtResource-given-in-place-of-ListExtManager-a759a27079d16a44.yaml │ ├── get-list-metadata-8afcc8f32ad82dda.yaml │ ├── get-rid-off-redundant-methods-47e679c13e88f28a.yaml │ ├── global_request_id-26f4e4301f84d403.yaml │ ├── image-api-deprecation-41944dc6fc024918.yaml │ ├── instance-uuid-flag-in-migration-list-5d2fed7657d3def5.yaml │ ├── interface-attach-output-02d633d9b2a60da1.yaml │ ├── keystoneauth-8ec1e6be14cdbae3.yaml │ ├── log-request-id-ce106497e0520fad.yaml │ ├── make-console-public-0c776bfda240cd9d.yaml │ ├── microversion-2.37-d03da96406a45e67.yaml │ ├── microversion-v2_28-abf653ae5cf5c4a9.yaml │ ├── microversion-v2_31-3e1a16eb5eb53f59.yaml │ ├── microversion-v2_33-10d12ea3b25839e8.yaml │ ├── microversion-v2_34-a9c5601811152964.yaml │ ├── microversion-v2_35-537619a43278fbb5.yaml │ ├── microversion-v2_38-0618fe2b3c7f96f9.yaml │ ├── microversion-v2_40-484adba0806b08bf.yaml │ ├── microversion-v2_41-6df7a5a66a9ded35.yaml │ ├── microversion-v2_43-76db2ac463b431e4.yaml │ ├── microversion-v2_44-d60c8834e436ad3d.yaml │ ├── microversion-v2_45-1bfcae3914280534.yaml │ ├── microversion-v2_47-4aa54fbbd519e421.yaml │ ├── microversion-v2_49-56bde596ee13366d.yaml │ ├── microversion-v2_50-4f484658d66d01aa.yaml │ ├── microversion-v2_52-2fe81b3bf2e4b4ea.yaml │ ├── microversion-v2_53-3463b546a38c5f84.yaml │ ├── microversion-v2_54-6c7ccb61eff6cb6d.yaml │ ├── microversion-v2_55-flavor-description-a93718b31f1f0f39.yaml │ ├── microversion-v2_57-acae2ee11ddae4fb.yaml │ ├── microversion-v2_58-327c1031ebfe4a3a.yaml │ ├── microversion-v2_59-4160c852d7d8812d.yaml │ ├── microversion-v2_61-9a8faa02fddf9ed6.yaml │ ├── microversion-v2_62-479a23f0d4307500.yaml │ ├── microversion-v2_63-cd058a9145550cae.yaml │ ├── microversion-v2_64-66366829ec65bea4.yaml.yaml │ ├── microversion-v2_65-3c89c5932f4391cb.yaml │ ├── microversion-v2_66-cda5d6dc31b56b46.yaml │ ├── microversion-v2_67-da6d9b12730b8562.yaml │ ├── microversion-v2_71-a87b4bb4205c46e2.yaml │ ├── microversion-v2_72-d910ce07ec3948d6.yaml │ ├── microversion-v2_74-43b128fe6b84b630.yaml │ ├── microversion-v2_75-ea7fa3ba1396edea.yaml │ ├── microversion-v2_77-ffee30c180aa4dbe.yaml │ ├── microversion-v2_78-77a12630e668c2ae.yaml │ ├── microversion-v2_79-f13bc0414743dc16.yaml │ ├── microversion-v2_80-c2394316f9212865.yaml │ ├── microversion-v2_81-3ddd8e2fc7e45030.yaml │ ├── microversion-v2_85-230931f88c4f1d52.yaml │ ├── microversion-v2_88-d91136020e3a3621.yaml │ ├── microversion-v2_90-259779668e67dfb5.yaml │ ├── microversion-v2_94-5368d5dd7c5f6484.yaml │ ├── microversion-v2_95-3c6ad46be2656684.yaml │ ├── microversion-v2_96-a50af976133de0ab.yaml │ ├── microversion_v2_70-09cbe0933b3a9335.yaml │ ├── microversion_v2_89-af6223273b2bdfb0.yaml │ ├── no-glance-proxy-5c13001a4b13e8ce.yaml │ ├── no-neutron-proxy-18fd54febe939a6b.yaml │ ├── pike-rm-deprecated-img-d58e9ae2d774cbfc.yaml │ ├── pike-rm-deprecated-net-272aeb62b329a5bc.yaml │ ├── remove-auth-system-b2cd247b8a312b72.yaml │ ├── remove-certs-4333342189200d91.yaml │ ├── remove-cloudpipe-6c790c57dc3796eb.yaml │ ├── remove-contrib-8b5e35ac8dddbab3.yaml │ ├── remove-deprecated-cellsv1-extentions-commands-4b26c826ad5194ca.yaml │ ├── remove-deprecated-methods-train-c450fe317c90d7f0.yaml │ ├── remove-deprecated-option-14.0.0-c6d7189938f5f063.yaml │ ├── remove-deprecated-option-in-3.3.0-82a413157838570d.yaml │ ├── remove-deprecated-option-in-9.0.0-bc76629d28f1d4c4.yaml │ ├── remove-hosts-d08855550c40b9c6.yaml │ ├── remove-py26-support-f31379e86f40d975.yaml │ ├── remove-py38-ae196c568a1577db.yaml │ ├── remove-run_tests.sh-3bdcaee4d388177a.yaml │ ├── remove-service-binary-arg-ec2838214c8c7abc.yaml │ ├── remove-virt-interfaces-add-rm-fixed-floating-398c905d9c91cca8.yaml │ ├── remove_api_v_1_1-88b3f18ce1423b46.yaml │ ├── rename-apikey-to-password-735588d841efa49e.yaml │ ├── rename-bypass-url-42cd96956a6bc6dc.yaml │ ├── restrict-args-for-novaclient-ep-491098c3634365be.yaml │ ├── restrict-direct-use-of-v2client-c8e1ee2afefec5a1.yaml │ ├── restrict-interface-parameter-e5fe166f39ba0935.yaml │ ├── return-request-id-to-caller-52c5423794b33f8b.yaml │ ├── rm-baremetal-cli-api-fbc8c242d48cd2fb.yaml │ ├── rm-deprecated-commands-options-ocata-00f249810e5bdf97.yaml │ ├── search-hypervisor-detailed-352f3ac70d42fe6e.yaml │ ├── server-networks-sorted-1d3a7f1c1f88e846.yaml │ ├── show-instance-usage-audit-logs-7826b411fac1283b.yaml │ ├── strict_hostname_match-f37243f0520a09a2.yaml │ ├── switch-to-sessionclient-aa49d16599fea570.yaml │ └── volume-cli-removal-ffcb94421a356042.yaml └── source │ ├── 2023.1.rst │ ├── 2023.2.rst │ ├── 2024.1.rst │ ├── 2024.2.rst │ ├── 2025.1.rst │ ├── _static │ └── .placeholder │ ├── _templates │ └── .placeholder │ ├── conf.py │ ├── index.rst │ ├── liberty.rst │ ├── locale │ ├── en_GB │ │ └── LC_MESSAGES │ │ │ └── releasenotes.po │ └── fr │ │ └── LC_MESSAGES │ │ └── releasenotes.po │ ├── mitaka.rst │ ├── newton.rst │ ├── ocata.rst │ ├── pike.rst │ ├── queens.rst │ ├── rocky.rst │ ├── stein.rst │ ├── train.rst │ ├── unreleased.rst │ ├── ussuri.rst │ ├── victoria.rst │ ├── wallaby.rst │ ├── xena.rst │ ├── yoga.rst │ └── zed.rst ├── requirements.txt ├── setup.cfg ├── setup.py ├── test-requirements.txt ├── tools ├── nova.bash_completion └── nova.zsh_completion └── tox.ini /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | source = novaclient 4 | omit = novaclient/tests/* 5 | 6 | [report] 7 | ignore_errors = True 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .coverage 2 | .venv 3 | .stestr/ 4 | subunit.log 5 | .tox 6 | *,cover 7 | cover 8 | *.pyc 9 | .idea 10 | *.sw? 11 | *~ 12 | build 13 | dist 14 | AUTHORS 15 | ChangeLog 16 | novaclient/versioninfo 17 | *.egg 18 | *egg-info 19 | .eggs 20 | 21 | # Files created by documentation build 22 | /doc/build/ 23 | /doc/source/reference/api/ 24 | 25 | # Files created by releasenotes build 26 | /releasenotes/build 27 | -------------------------------------------------------------------------------- /.gitreview: -------------------------------------------------------------------------------- 1 | [gerrit] 2 | host=review.opendev.org 3 | port=29418 4 | project=openstack/python-novaclient.git 5 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Antony Messerli root 2 | 3 | 4 | Chris Behrens comstud 5 | 6 | 7 | Joe Gordon 8 | Johannes Erdfelt jerdfelt 9 | 10 | 11 | 12 | 13 | 14 | Andy Smith termie 15 | 16 | 17 | 18 | 19 | 20 | hwbi 21 | Nikolay Sokolov Nokolay Sokolov 22 | Nikolay Sokolov Nokolay Sokolov 23 | 24 | 25 | zhangguoqing 26 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | default_language_version: 3 | # force all unspecified python hooks to run python3 4 | python: python3 5 | repos: 6 | - repo: https://github.com/pre-commit/pre-commit-hooks 7 | rev: v4.1.0 8 | hooks: 9 | - id: trailing-whitespace 10 | - id: mixed-line-ending 11 | args: ['--fix', 'lf'] 12 | - id: check-byte-order-marker 13 | - id: check-executables-have-shebangs 14 | - id: check-merge-conflict 15 | - id: debug-statements 16 | - id: check-yaml 17 | files: .*\.(yaml|yml)$ 18 | - repo: https://github.com/Lucas-C/pre-commit-hooks 19 | rev: v1.1.13 20 | hooks: 21 | - id: remove-tabs 22 | exclude: '.*\.(svg)$' 23 | - repo: local 24 | hooks: 25 | - id: flake8 26 | name: flake8 27 | additional_dependencies: 28 | - hacking>=6.1.0,<6.2.0 29 | language: python 30 | entry: flake8 31 | files: '^.*\.py$' 32 | exclude: '^(doc|releasenotes|tools)/.*$' 33 | -------------------------------------------------------------------------------- /.stestr.conf: -------------------------------------------------------------------------------- 1 | [DEFAULT] 2 | test_path=${OS_TEST_PATH:-./novaclient/tests/unit} 3 | top_dir=./ 4 | -------------------------------------------------------------------------------- /.zuul.yaml: -------------------------------------------------------------------------------- 1 | - job: 2 | name: python-novaclient-functional 3 | parent: devstack-tox-functional 4 | timeout: 7200 5 | required-projects: 6 | - openstack/nova 7 | - openstack/python-novaclient 8 | vars: 9 | openrc_enable_export: true 10 | devstack_localrc: 11 | KEYSTONE_ADMIN_ENDPOINT: true 12 | NEUTRON_ENFORCE_SCOPE: false 13 | irrelevant-files: 14 | - ^.*\.rst$ 15 | - ^doc/.*$ 16 | - ^releasenotes/.*$ 17 | 18 | - project: 19 | templates: 20 | - check-requirements 21 | - lib-forward-testing-python3 22 | - openstack-cover-jobs 23 | - openstack-python3-jobs 24 | - publish-openstack-docs-pti 25 | - release-notes-jobs-python3 26 | check: 27 | jobs: 28 | - python-novaclient-functional 29 | gate: 30 | jobs: 31 | - python-novaclient-functional 32 | -------------------------------------------------------------------------------- /CONTRIBUTING.rst: -------------------------------------------------------------------------------- 1 | The source repository for this project can be found at: 2 | 3 | https://opendev.org/openstack/python-novaclient 4 | 5 | Pull requests submitted through GitHub are not monitored. 6 | 7 | To start contributing to OpenStack, follow the steps in the contribution guide 8 | to set up and use Gerrit: 9 | 10 | https://docs.openstack.org/contributors/code-and-documentation/quick-start.html 11 | 12 | Bugs should be filed on Launchpad: 13 | 14 | https://bugs.launchpad.net/python-novaclient 15 | 16 | For more specific information about contributing to this repository, see the 17 | python-novaclient contributor guide: 18 | 19 | https://docs.openstack.org/python-novaclient/latest/contributor/contributing.html 20 | -------------------------------------------------------------------------------- /HACKING.rst: -------------------------------------------------------------------------------- 1 | Nova Client Style Commandments 2 | ============================== 3 | 4 | - Step 1: Read the OpenStack Style Commandments 5 | https://docs.openstack.org/hacking/latest 6 | - Step 2: Read on 7 | 8 | Nova Client Specific Commandments 9 | --------------------------------- 10 | None so far 11 | 12 | Text encoding 13 | ------------- 14 | 15 | - Transitions between internal unicode and external strings should always 16 | be immediately and explicitly encoded or decoded. 17 | 18 | - All external text that is not explicitly encoded (database storage, 19 | commandline arguments, etc.) should be presumed to be encoded as utf-8. 20 | 21 | Wrong:: 22 | 23 | mystring = infile.readline() 24 | myreturnstring = do_some_magic_with(mystring) 25 | outfile.write(myreturnstring) 26 | 27 | Right:: 28 | 29 | mystring = infile.readline() 30 | mytext = s.decode('utf-8') 31 | returntext = do_some_magic_with(mytext) 32 | returnstring = returntext.encode('utf-8') 33 | outfile.write(returnstring) 34 | 35 | Running Tests 36 | ------------- 37 | 38 | The testing system is based on a combination of tox and stestr. If you just 39 | want to run the whole suite, run ``tox`` and all will be fine. However, if 40 | you'd like to dig in a bit more, you might want to learn some things about 41 | stestr itself. 42 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | Team and repository tags 3 | ======================== 4 | 5 | .. image:: https://governance.openstack.org/tc/badges/python-novaclient.svg 6 | :target: https://governance.openstack.org/tc/reference/tags/index.html 7 | 8 | .. Change things from this point on 9 | 10 | ============================================ 11 | Python bindings to the OpenStack Compute API 12 | ============================================ 13 | 14 | .. image:: https://img.shields.io/pypi/v/python-novaclient.svg 15 | :target: https://pypi.org/project/python-novaclient/ 16 | :alt: Latest Version 17 | 18 | This is a client for the OpenStack Compute API. It provides a Python API (the 19 | ``novaclient`` module) and a deprecated command-line script (``nova``). The 20 | Python API implements 100% of the OpenStack Compute API. 21 | 22 | * License: Apache License, Version 2.0 23 | * `PyPi`_ - package installation 24 | * `Online Documentation`_ 25 | * `Launchpad project`_ - release management 26 | * `Blueprints`_ - feature specifications 27 | * `Bugs`_ - issue tracking 28 | * `Source`_ 29 | * `Specs`_ 30 | * `How to Contribute`_ 31 | * `Release Notes`_ 32 | 33 | .. _PyPi: https://pypi.org/project/python-novaclient 34 | .. _Online Documentation: https://docs.openstack.org/python-novaclient/latest 35 | .. _Launchpad project: https://launchpad.net/python-novaclient 36 | .. _Blueprints: https://blueprints.launchpad.net/python-novaclient 37 | .. _Bugs: https://bugs.launchpad.net/python-novaclient 38 | .. _Source: https://opendev.org/openstack/python-novaclient 39 | .. _How to Contribute: https://docs.opendev.org/opendev/infra-manual/latest/developers.html 40 | .. _Specs: https://specs.openstack.org/openstack/nova-specs/ 41 | .. _Release Notes: https://docs.openstack.org/releasenotes/python-novaclient 42 | -------------------------------------------------------------------------------- /bindep.txt: -------------------------------------------------------------------------------- 1 | # This is a cross-platform list tracking distribution packages needed by tests; 2 | # see https://docs.opendev.org/opendev/bindep/latest/ for additional information. 3 | 4 | build-essential [platform:dpkg] 5 | dbus-devel [platform:rpm] 6 | dbus-glib-devel [platform:rpm] 7 | gettext 8 | language-pack-en [platform:ubuntu] 9 | libdbus-1-dev [platform:dpkg] 10 | libdbus-glib-1-dev [platform:dpkg] 11 | libffi-dev [platform:dpkg] 12 | libffi-devel [platform:rpm] 13 | libssl-dev [platform:ubuntu] 14 | libuuid-devel [platform:rpm] 15 | locales [platform:debian] 16 | openssl 17 | python3-all-dev [platform:ubuntu !platform:ubuntu-precise] 18 | python3-dev [platform:dpkg] 19 | python3-devel [platform:fedora] 20 | uuid-dev [platform:dpkg] 21 | -------------------------------------------------------------------------------- /doc/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx>=2.1.1 # BSD 2 | openstackdocstheme>=2.2.0 # Apache-2.0 3 | reno>=3.1.0 # Apache-2.0 4 | sphinxcontrib-apidoc>=0.2.0 # BSD 5 | 6 | # redirect tests in docs 7 | whereto>=0.3.0 # Apache-2.0 8 | -------------------------------------------------------------------------------- /doc/source/_extra/.htaccess: -------------------------------------------------------------------------------- 1 | # The following is generated with: 2 | # 3 | # git log --follow --name-status --format='%H' ac25ae6fee.. -- doc/source/ | \ 4 | # grep ^R | grep .rst | cut -f2- | \ 5 | # sed -e 's|doc/source/|redirectmatch 301 ^/python-novaclient/([^/]+)/|' -e 's|doc/source/|/python-novaclient/$1/|' -e 's/.rst/.html$/' -e 's/.rst/.html/' | \ 6 | # sort 7 | 8 | redirectmatch 301 ^/python-novaclient/([^/]+)/api.html$ /python-novaclient/$1/reference/api/index.html 9 | redirectmatch 301 ^/python-novaclient/([^/]+)/man/nova.html$ /python-novaclient/$1/cli/nova.html 10 | redirectmatch 301 ^/python-novaclient/([^/]+)/shell.html$ /python-novaclient/$1/user/shell.html 11 | -------------------------------------------------------------------------------- /doc/source/cli/index.rst: -------------------------------------------------------------------------------- 1 | =============== 2 | CLI Reference 3 | =============== 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | 8 | nova 9 | -------------------------------------------------------------------------------- /doc/source/conf.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | # 13 | # python-novaclient documentation build configuration file 14 | 15 | # -- General configuration ---------------------------------------------------- 16 | 17 | # Add any Sphinx extension module names here, as strings. They can be 18 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 19 | extensions = [ 20 | 'openstackdocstheme', 21 | 'sphinx.ext.autodoc', 22 | 'sphinxcontrib.apidoc', 23 | ] 24 | 25 | # sphinxcontrib.apidoc options 26 | apidoc_module_dir = '../../novaclient' 27 | apidoc_output_dir = 'reference/api' 28 | apidoc_excluded_paths = [ 29 | 'tests/*'] 30 | apidoc_separate_modules = True 31 | 32 | # The content that will be inserted into the main body of an autoclass 33 | # directive. 34 | autoclass_content = 'both' 35 | 36 | # The master toctree document. 37 | master_doc = 'index' 38 | 39 | copyright = 'OpenStack Contributors' 40 | 41 | 42 | # -- Options for HTML output -------------------------------------------------- 43 | 44 | # The theme to use for HTML and HTML Help pages. Major themes that come with 45 | # Sphinx are currently 'default' and 'sphinxdoc'. 46 | html_theme = 'openstackdocs' 47 | 48 | # Add any paths that contain "extra" files, such as .htaccess or 49 | # robots.txt. 50 | html_extra_path = ['_extra'] 51 | 52 | 53 | # -- Options for LaTeX output ------------------------------------------------- 54 | 55 | latex_documents = [ 56 | ('index', 'doc-python-novaclient.tex', 'python-novaclient Documentation', 57 | 'OpenStack Foundation', 'manual'), 58 | ] 59 | 60 | latex_elements = { 61 | 'extraclassoptions': 'openany,oneside', 62 | 'preamble': r'\setcounter{tocdepth}{4}', 63 | 'makeindex': '', 64 | 'printindex': '', 65 | } 66 | 67 | # -- Options for openstackdocstheme ------------------------------------------- 68 | 69 | openstackdocs_repo_name = 'openstack/python-novaclient' 70 | openstackdocs_bug_project = 'python-novaclient' 71 | openstackdocs_bug_tag = '' 72 | openstackdocs_pdf_link = True 73 | openstackdocs_projects = [ 74 | 'keystoneauth', 75 | 'nova', 76 | 'os-client-config', 77 | 'python-openstackclient', 78 | ] 79 | 80 | # -- Options for manual page output ------------------------------------------ 81 | 82 | # One entry per manual page. List of tuples 83 | # (source start file, name, description, authors, manual section). 84 | man_pages = [ 85 | ('cli/nova', 'nova', 'OpenStack Nova command line client', 86 | ['OpenStack Contributors'], 1), 87 | ] 88 | -------------------------------------------------------------------------------- /doc/source/contributor/contributing.rst: -------------------------------------------------------------------------------- 1 | ============================ 2 | So You Want to Contribute... 3 | ============================ 4 | 5 | For general information on contributing to OpenStack, please check out the 6 | `contributor guide `_ to get started. 7 | It covers all the basics that are common to all OpenStack projects: the accounts 8 | you need, the basics of interacting with our Gerrit review system, how we 9 | communicate as a community, etc. 10 | 11 | Below will cover the more project specific information you need to get started 12 | with python-novaclient. 13 | 14 | .. important:: 15 | 16 | The ``nova`` CLI has been deprecated in favour of the unified ``openstack`` 17 | CLI. Changes to the Python bindings are still welcome, however, no further 18 | changes should be made to the shell. 19 | 20 | Communication 21 | ~~~~~~~~~~~~~ 22 | 23 | Please refer `how-to-get-involved `_. 24 | 25 | Contacting the Core Team 26 | ~~~~~~~~~~~~~~~~~~~~~~~~ 27 | 28 | The easiest way to reach the core team is via IRC, using the ``openstack-nova`` 29 | OFTC IRC channel. 30 | 31 | New Feature Planning 32 | ~~~~~~~~~~~~~~~~~~~~ 33 | 34 | If you want to propose a new feature please read the 35 | `blueprints `_ page. 36 | 37 | Task Tracking 38 | ~~~~~~~~~~~~~ 39 | 40 | We track our tasks in `Launchpad `__. 41 | 42 | If you're looking for some smaller, easier work item to pick up and get started 43 | on, search for the 'low-hanging-fruit' tag. 44 | 45 | Reporting a Bug 46 | ~~~~~~~~~~~~~~~ 47 | 48 | You found an issue and want to make sure we are aware of it? You can do so on 49 | `Launchpad `__. 50 | More info about Launchpad usage can be found on `OpenStack docs page 51 | `_. 52 | 53 | Getting Your Patch Merged 54 | ~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | 56 | All changes proposed to the python-novaclient requires two ``Code-Review +2`` 57 | votes from ``python-novaclient`` core reviewers before one of the core reviewers 58 | can approve patch by giving ``Workflow +1`` vote.. 59 | -------------------------------------------------------------------------------- /doc/source/contributor/deprecation-policy.rst: -------------------------------------------------------------------------------- 1 | Deprecating commands 2 | ==================== 3 | 4 | There are times when commands need to be deprecated due to rename or removal. 5 | The process for command deprecation is: 6 | 7 | 1. Push up a change for review which deprecates the command(s). 8 | 9 | - The change should print a deprecation warning to ``stderr`` each time a 10 | deprecated command is used. 11 | - That warning message should include a rough timeline for when the command 12 | will be removed and what should be used instead, if anything. 13 | - The description in the help text for the deprecated command should mark 14 | that it is deprecated. 15 | - The change should include a release note with the ``deprecations`` section 16 | filled out. 17 | - The deprecation cycle is typically the first client release *after* the 18 | next *full* nova server release so that there is at least six months of 19 | deprecation. 20 | 21 | 2. Once the change is approved, have a member of the `nova-release`_ team 22 | release a new version of `python-novaclient`. 23 | 24 | .. _nova-release: https://review.opendev.org/#/admin/groups/147,members 25 | 26 | 3. Example: ``_ 27 | 28 | This change was made while the nova 12.0.0 Liberty release was in 29 | development. The current version of `python-novaclient` at the time was 30 | 2.25.0. Once the change was merged, `python-novaclient` 2.26.0 was released. 31 | Since there was less than six months before 12.0.0 would be released, the 32 | deprecation cycle ran through the 13.0.0 nova server release. 33 | -------------------------------------------------------------------------------- /doc/source/contributor/index.rst: -------------------------------------------------------------------------------- 1 | =================== 2 | Contributor Guide 3 | =================== 4 | 5 | Basic Information 6 | ================= 7 | 8 | .. toctree:: 9 | :maxdepth: 2 10 | 11 | contributing 12 | 13 | Developer Guide 14 | =============== 15 | .. toctree:: 16 | :maxdepth: 2 17 | 18 | microversions 19 | testing 20 | deprecation-policy 21 | -------------------------------------------------------------------------------- /doc/source/contributor/microversions.rst: -------------------------------------------------------------------------------- 1 | ===================================== 2 | Adding support for a new microversion 3 | ===================================== 4 | 5 | If a new microversion is added on the nova side, 6 | then support must be added on the *python-novaclient* side also. 7 | The following procedure describes how to add support for a new microversion 8 | in *python-novaclient*. 9 | 10 | #. Update ``API_MAX_VERSION`` 11 | 12 | Set ``API_MAX_VERSION`` in ``novaclient/__init__.py`` to the version 13 | you are going to support. 14 | 15 | .. note:: 16 | 17 | Microversion support should be added one by one in order. 18 | For example, microversion 2.74 should be added right after 19 | microversion 2.73. Microversion 2.74 should not be added right 20 | after microversion 2.72 or earlier. 21 | 22 | #. Update CLI and Python API 23 | 24 | Update CLI (``novaclient/v2/shell.py``) and/or Python API 25 | (``novaclient/v2/*.py``) to support the microversion. 26 | 27 | #. Add tests 28 | 29 | Add unit tests for the change. Add unit tests for the previous microversion 30 | to check raising an error or an exception when new arguments or parameters 31 | are specified. Add functional tests if necessary. 32 | 33 | Add the microversion in the ``exclusions`` in the ``test_versions`` 34 | method of the ``novaclient.tests.unit.v2.test_shell.ShellTest`` class 35 | if there are no versioned wrapped method changes for the microversion. 36 | The versioned wrapped methods have ``@api_versions.wraps`` decorators. 37 | 38 | For example (microversion 2.72 example):: 39 | 40 | exclusions = set([ 41 | (snipped...) 42 | 72, # There are no version-wrapped shell method changes for this. 43 | ]) 44 | 45 | #. Update the CLI reference 46 | 47 | Update the CLI reference (``doc/source/cli/nova.rst``) 48 | if the CLI commands and/or arguments are modified. 49 | 50 | #. Add a release note 51 | 52 | Add a release note for the change. The release note should include a link 53 | to the description for the microversion in the 54 | :nova-doc:`Compute API Microversion History 55 | `. 56 | 57 | #. Commit message 58 | 59 | The description of the blueprint and dependency on the patch in nova side 60 | should be added in the commit message. For example:: 61 | 62 | Implements: blueprint remove-force-flag-from-live-migrate-and-evacuate 63 | Depends-On: https://review.opendev.org/#/c/634600/ 64 | 65 | See the following examples: 66 | 67 | - `Microversion 2.71 - show server group `_ 68 | - `API microversion 2.69: Handles Down Cells `_ 69 | - `Microversion 2.68: Remove 'forced' live migrations, evacuations `_ 70 | - `Add support changes-before for microversion 2.66 `_ 71 | - `Microversion 2.64 - Use new format policy in server group `_ 72 | -------------------------------------------------------------------------------- /doc/source/contributor/testing.rst: -------------------------------------------------------------------------------- 1 | ========= 2 | Testing 3 | ========= 4 | 5 | The preferred way to run the unit tests is using ``tox``. There are multiple 6 | test targets that can be run to validate the code. 7 | 8 | ``tox -e pep8`` 9 | Style guidelines enforcement. 10 | 11 | ``tox -e py38`` 12 | Traditional unit testing (Python 3.8). 13 | 14 | ``tox -e functional`` 15 | Live functional testing against an existing OpenStack instance. (Python 3.8) 16 | 17 | ``tox -e cover`` 18 | Generate a coverage report on unit testing. 19 | 20 | Functional testing assumes the existence of a `clouds.yaml` file as supported 21 | by :os-client-config-doc:`os-client-config <>`. 22 | It assumes the existence of a cloud named `devstack` that behaves like a normal 23 | DevStack installation with a demo and an admin user/tenant - or clouds named 24 | `functional_admin` and `functional_nonadmin`. 25 | 26 | Refer to `Consistent Testing Interface`__ for more details. 27 | 28 | __ https://governance.openstack.org/tc/reference/project-testing-interface.html 29 | -------------------------------------------------------------------------------- /doc/source/index.rst: -------------------------------------------------------------------------------- 1 | =========================================== 2 | Python bindings to the OpenStack Nova API 3 | =========================================== 4 | 5 | This is a client for OpenStack Nova API. There's a :doc:`Python API 6 | ` (the :mod:`novaclient` module), and a deprecated 7 | :doc:`command-line script ` (installed as :program:`nova`). 8 | Each implements the entire OpenStack Nova API. 9 | 10 | You'll need credentials for an OpenStack cloud that implements the Compute API 11 | in order to use the nova client. 12 | 13 | .. seealso:: 14 | 15 | You may want to read the `OpenStack Compute API Guide`__ 16 | to get an idea of the concepts. By understanding the concepts 17 | this library should make more sense. 18 | 19 | __ https://docs.openstack.org/api-guide/compute/index.html 20 | 21 | .. toctree:: 22 | :maxdepth: 2 23 | 24 | user/index 25 | cli/index 26 | reference/index 27 | contributor/index 28 | -------------------------------------------------------------------------------- /doc/source/reference/index.rst: -------------------------------------------------------------------------------- 1 | ========= 2 | Reference 3 | ========= 4 | 5 | .. toctree:: 6 | :maxdepth: 6 7 | 8 | api/modules 9 | -------------------------------------------------------------------------------- /doc/source/user/index.rst: -------------------------------------------------------------------------------- 1 | ============ 2 | User Guide 3 | ============ 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | 8 | shell 9 | python-api 10 | -------------------------------------------------------------------------------- /doc/source/user/shell.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | The :program:`nova` Shell Utility 3 | =================================== 4 | 5 | .. program:: nova 6 | .. highlight:: bash 7 | 8 | The :program:`nova` shell utility interacts with OpenStack Nova API from the 9 | command line. It supports the entirety of the OpenStack Nova API. 10 | 11 | You'll need to provide :program:`nova` with your OpenStack Keystone user 12 | information. You can do this with the `--os-username`, `--os-password`, 13 | `--os-project-name` (`--os-project-id`), `--os-project-domain-name` 14 | (`--os-project-domain-id`) and `--os-user-domain-name` (`--os-user-domain-id`) 15 | options, but it's easier to just set them as environment variables by setting 16 | some environment variables: 17 | 18 | .. deprecated:: 17.8.0 19 | 20 | The ``nova`` CLI has been deprecated in favour of the unified 21 | ``openstack`` CLI. For information on using the ``openstack`` CLI, see 22 | :python-openstackclient-doc:`OpenStackClient <>`. 23 | 24 | .. envvar:: OS_USERNAME 25 | 26 | Your OpenStack Keystone user name. 27 | 28 | .. envvar:: OS_PASSWORD 29 | 30 | Your password. 31 | 32 | .. envvar:: OS_PROJECT_NAME 33 | 34 | The name of project for work. 35 | 36 | .. envvar:: OS_PROJECT_ID 37 | 38 | The ID of project for work. 39 | 40 | .. envvar:: OS_PROJECT_DOMAIN_NAME 41 | 42 | The name of domain containing the project. 43 | 44 | .. envvar:: OS_PROJECT_DOMAIN_ID 45 | 46 | The ID of domain containing the project. 47 | 48 | .. envvar:: OS_USER_DOMAIN_NAME 49 | 50 | The user's domain name. 51 | 52 | .. envvar:: OS_USER_DOMAIN_ID 53 | 54 | The user's domain ID. 55 | 56 | .. envvar:: OS_AUTH_URL 57 | 58 | The OpenStack Keystone endpoint URL. 59 | 60 | .. envvar:: OS_COMPUTE_API_VERSION 61 | 62 | The OpenStack Nova API version (microversion). 63 | 64 | .. envvar:: OS_REGION_NAME 65 | 66 | The Keystone region name. Defaults to the first region if multiple regions 67 | are available. 68 | 69 | .. envvar:: OS_TRUSTED_IMAGE_CERTIFICATE_IDS 70 | 71 | A comma-delimited list of trusted image certificate IDs. Only used 72 | with the ``nova boot`` and ``nova rebuild`` commands starting with the 73 | 2.63 microversion. 74 | 75 | For example:: 76 | 77 | export OS_TRUSTED_IMAGE_CERTIFICATE_IDS=trusted-cert-id1,trusted-cert-id2 78 | 79 | For example, in Bash you'd use:: 80 | 81 | export OS_USERNAME=yourname 82 | export OS_PASSWORD=yadayadayada 83 | export OS_PROJECT_NAME=myproject 84 | export OS_PROJECT_DOMAIN_NAME=default 85 | export OS_USER_DOMAIN_NAME=default 86 | export OS_AUTH_URL=http:///identity 87 | export OS_COMPUTE_API_VERSION=2.1 88 | 89 | From there, all shell commands take the form:: 90 | 91 | nova [arguments...] 92 | 93 | Run :program:`nova help` to get a full list of all possible commands, and run 94 | :program:`nova help ` to get detailed help for that command. 95 | 96 | For more information, see :doc:`the command reference `. 97 | -------------------------------------------------------------------------------- /doc/test/redirect-tests.txt: -------------------------------------------------------------------------------- 1 | /python-novaclient/latest/api.html 301 /python-novaclient/latest/reference/api/index.html 2 | /python-novaclient/latest/man/nova.html 301 /python-novaclient/latest/cli/nova.html 3 | /python-novaclient/latest/shell.html 301 /python-novaclient/latest/user/shell.html 4 | -------------------------------------------------------------------------------- /novaclient/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2012 OpenStack Foundation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | import pbr.version 16 | 17 | from novaclient import api_versions 18 | 19 | 20 | __version__ = pbr.version.VersionInfo('python-novaclient').version_string() 21 | 22 | API_MIN_VERSION = api_versions.APIVersion("2.1") 23 | # The max version should be the latest version that is supported in the client, 24 | # not necessarily the latest that the server can provide. This is only bumped 25 | # when client supported the max version, and bumped sequentially, otherwise 26 | # the client may break due to server side new version may include some 27 | # backward incompatible change. 28 | API_MAX_VERSION = api_versions.APIVersion("2.96") 29 | -------------------------------------------------------------------------------- /novaclient/crypto.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013 Nebula, Inc. 2 | # All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | # not use this file except in compliance with the License. You may obtain 6 | # a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations 14 | # under the License. 15 | 16 | import base64 17 | import subprocess 18 | 19 | 20 | class DecryptionFailure(Exception): 21 | pass 22 | 23 | 24 | def decrypt_password(private_key, password): 25 | """Base64 decodes password and unencrypts it with private key. 26 | 27 | Requires openssl binary available in the path. 28 | """ 29 | unencoded = base64.b64decode(password) 30 | cmd = ['openssl', 'rsautl', '-decrypt', '-inkey', private_key] 31 | proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, 32 | stdout=subprocess.PIPE, 33 | stderr=subprocess.PIPE) 34 | out, err = proc.communicate(unencoded) 35 | proc.stdin.close() 36 | if proc.returncode: 37 | raise DecryptionFailure(err) 38 | 39 | if isinstance(out, bytes): 40 | return out.decode('utf-8') 41 | return out 42 | -------------------------------------------------------------------------------- /novaclient/extension.py: -------------------------------------------------------------------------------- 1 | # Copyright 2011 OpenStack Foundation 2 | # All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | # not use this file except in compliance with the License. You may obtain 6 | # a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations 14 | # under the License. 15 | 16 | from novaclient import base 17 | from novaclient import utils 18 | 19 | 20 | class Extension(base.HookableMixin): 21 | """Extension descriptor.""" 22 | 23 | SUPPORTED_HOOKS = ('__pre_parse_args__', '__post_parse_args__') 24 | 25 | def __init__(self, name, module): 26 | self.name = name 27 | self.module = module 28 | self._parse_extension_module() 29 | 30 | def _parse_extension_module(self): 31 | self.manager_class = None 32 | for attr_name, attr_value in self.module.__dict__.items(): 33 | if attr_name in self.SUPPORTED_HOOKS: 34 | self.add_hook(attr_name, attr_value) 35 | elif utils.safe_issubclass(attr_value, base.Manager): 36 | self.manager_class = attr_value 37 | 38 | def __repr__(self): 39 | return "" % self.name 40 | -------------------------------------------------------------------------------- /novaclient/i18n.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | """oslo_i18n integration module for novaclient. 14 | 15 | See https://docs.openstack.org/oslo.i18n/latest/user/usage.html . 16 | 17 | """ 18 | 19 | import oslo_i18n 20 | 21 | 22 | _translators = oslo_i18n.TranslatorFactory(domain='novaclient') 23 | 24 | # The primary translation function using the well-known name "_" 25 | _ = _translators.primary 26 | -------------------------------------------------------------------------------- /novaclient/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/python-novaclient/b2481a6f9739afe0e68327fc58c5bc208f69c052/novaclient/tests/__init__.py -------------------------------------------------------------------------------- /novaclient/tests/functional/README.rst: -------------------------------------------------------------------------------- 1 | ==================================== 2 | python-novaclient functional testing 3 | ==================================== 4 | 5 | Idea 6 | ---- 7 | 8 | Over time we have noticed two issues with novaclient unit tests. 9 | 10 | * Does not exercise the CLI 11 | * We can get the expected server behavior wrong, and test the wrong thing. 12 | 13 | We are using functional tests, run against a running cloud 14 | (primarily devstack), to address these two cases. 15 | 16 | Additionally these functional tests can be considered example uses 17 | of python-novaclient. 18 | 19 | These tests started out in tempest as read only nova CLI tests, to make sure 20 | the CLI didn't simply stacktrace when being used (which happened on 21 | multiple occasions). 22 | 23 | 24 | Testing Theory 25 | -------------- 26 | 27 | We are treating python-novaclient as legacy code, so we do not want to spend a 28 | lot of effort adding in missing features. In the future the CLI will move to 29 | python-openstackclient, and the python API will be based on the OpenStack 30 | SDK project. But until that happens we still need better functional testing, 31 | to prevent regressions etc. 32 | 33 | 34 | Since python-novaclient has two uses, CLI and python API, we should have two 35 | sets of functional tests. CLI and python API. The python API tests should 36 | never use the CLI. But the CLI tests can use the python API where adding 37 | native support to the CLI for the required functionality would involve a 38 | non trivial amount of work. 39 | 40 | Functional Test Guidelines 41 | -------------------------- 42 | 43 | * Consume credentials via standard client environmental variables:: 44 | 45 | OS_USERNAME 46 | OS_PASSWORD 47 | OS_TENANT_NAME 48 | OS_AUTH_URL 49 | 50 | * Usage of insecure SSL can be configured via the standard client environment 51 | variable:: 52 | 53 | OS_INSECURE 54 | 55 | * Try not to require an additional configuration file 56 | -------------------------------------------------------------------------------- /novaclient/tests/functional/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/python-novaclient/b2481a6f9739afe0e68327fc58c5bc208f69c052/novaclient/tests/functional/__init__.py -------------------------------------------------------------------------------- /novaclient/tests/functional/api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/python-novaclient/b2481a6f9739afe0e68327fc58c5bc208f69c052/novaclient/tests/functional/api/__init__.py -------------------------------------------------------------------------------- /novaclient/tests/functional/api/test_servers.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | import time 14 | 15 | from novaclient.tests.functional import base 16 | 17 | 18 | class TestServersAPI(base.ClientTestBase): 19 | def test_server_ips(self): 20 | server_name = "test_server" 21 | initial_server = self.client.servers.create( 22 | server_name, self.image, self.flavor, 23 | nics=[{"net-id": self.network.id}]) 24 | self.addCleanup(initial_server.delete) 25 | 26 | for x in range(60): 27 | server = self.client.servers.get(initial_server) 28 | if server.status == "ACTIVE": 29 | break 30 | else: 31 | time.sleep(1) 32 | else: 33 | self.fail("Server %s did not go ACTIVE after 60s" % server) 34 | 35 | ips = self.client.servers.ips(server) 36 | self.assertIn(self.network.name, ips) 37 | -------------------------------------------------------------------------------- /novaclient/tests/functional/clouds.yaml.sample: -------------------------------------------------------------------------------- 1 | clouds: 2 | devstack: 3 | auth: 4 | username: admin 5 | password: change_me 6 | project_name: admin 7 | auth_url: http://localhost:5000/v3 8 | user_domain_id: default 9 | project_domain_id: default 10 | -------------------------------------------------------------------------------- /novaclient/tests/functional/hooks/check_resources.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from novaclient.tests.functional import base 14 | 15 | 16 | class ResourceChecker(base.ClientTestBase): 17 | 18 | def runTest(self): 19 | pass 20 | 21 | def check(self): 22 | self.setUp() 23 | 24 | print("$ nova list --all-tenants") 25 | print(self.nova("list", params="--all-tenants")) 26 | print("\n") 27 | 28 | 29 | if __name__ == "__main__": 30 | ResourceChecker().check() 31 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/python-novaclient/b2481a6f9739afe0e68327fc58c5bc208f69c052/novaclient/tests/functional/v2/__init__.py -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/fake_crypto.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Cloudbase Solutions 2 | # All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | # not use this file except in compliance with the License. You may obtain 6 | # a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations 14 | # under the License. 15 | 16 | 17 | def get_x509_cert_and_fingerprint(): 18 | fingerprint = "a1:6f:6d:ea:a6:36:d0:3a:c6:eb:b6:ee:07:94:3e:2a:90:98:2b:c9" 19 | certif = ( 20 | "-----BEGIN CERTIFICATE-----\n" 21 | "MIIDIjCCAgqgAwIBAgIJAIE8EtWfZhhFMA0GCSqGSIb3DQEBCwUAMCQxIjAgBgNV\n" 22 | "BAMTGWNsb3VkYmFzZS1pbml0LXVzZXItMTM1NTkwHhcNMTUwMTI5MTgyMzE4WhcN\n" 23 | "MjUwMTI2MTgyMzE4WjAkMSIwIAYDVQQDExljbG91ZGJhc2UtaW5pdC11c2VyLTEz\n" 24 | "NTU5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv4lv95ofkXLIbALU\n" 25 | "UEb1f949TYNMUvMGNnLyLgGOY+D61TNG7RZn85cRg9GVJ7KDjSLN3e3LwH5rgv5q\n" 26 | "pU+nM/idSMhG0CQ1lZeExTsMEJVT3bG7LoU5uJ2fJSf5+hA0oih2M7/Kap5ggHgF\n" 27 | "h+h8MWvDC9Ih8x1aadkk/OEmJsTrziYm0C/V/FXPHEuXfZn8uDNKZ/tbyfI6hwEj\n" 28 | "nLz5Zjgg29n6tIPYMrnLNDHScCwtNZOcnixmWzsxCt1bxsAEA/y9gXUT7xWUf52t\n" 29 | "2+DGQbLYxo0PHjnPf3YnFXNavfTt+4c7ZdHhOQ6ZA8FGQ2LJHDHM1r2/8lK4ld2V\n" 30 | "qgNTcQIDAQABo1cwVTATBgNVHSUEDDAKBggrBgEFBQcDAjA+BgNVHREENzA1oDMG\n" 31 | "CisGAQQBgjcUAgOgJQwjY2xvdWRiYXNlLWluaXQtdXNlci0xMzU1OUBsb2NhbGhv\n" 32 | "c3QwDQYJKoZIhvcNAQELBQADggEBAHHX/ZUOMR0ZggQnfXuXLIHWlffVxxLOV/bE\n" 33 | "7JC/dtedHqi9iw6sRT5R6G1pJo0xKWr2yJVDH6nC7pfxCFkby0WgVuTjiu6iNRg2\n" 34 | "4zNJd8TGrTU+Mst+PPJFgsxrAY6vjwiaUtvZ/k8PsphHXu4ON+oLurtVDVgog7Vm\n" 35 | "fQCShx434OeJj1u8pb7o2WyYS5nDVrHBhlCAqVf2JPKu9zY+i9gOG2kimJwH7fJD\n" 36 | "xXpMIwAQ+flwlHR7OrE0L8TNcWwKPRAY4EPcXrT+cWo1k6aTqZDSK54ygW2iWtni\n" 37 | "ZBcstxwcB4GIwnp1DrPW9L2gw5eLe1Sl6wdz443TW8K/KPV9rWQ=\n" 38 | "-----END CERTIFICATE-----\n") 39 | return certif, fingerprint 40 | 41 | 42 | def get_ssh_pub_key_and_fingerprint(): 43 | fingerprint = "1e:2c:9b:56:79:4b:45:77:f9:ca:7a:98:2c:b0:d5:3c" 44 | public_key = ("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGg" 45 | "B4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0l" 46 | "RE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv" 47 | "9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYc" 48 | "pSxsIbECHw== Generated-by-Nova") 49 | return public_key, fingerprint 50 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/legacy/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/python-novaclient/b2481a6f9739afe0e68327fc58c5bc208f69c052/novaclient/tests/functional/v2/legacy/__init__.py -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/legacy/test_consoles.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 IBM Corp. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | from tempest.lib import exceptions 15 | 16 | from novaclient.tests.functional import base 17 | 18 | 19 | class TestConsolesNovaClient(base.ClientTestBase): 20 | """Consoles functional tests.""" 21 | 22 | COMPUTE_API_VERSION = "2.1" 23 | 24 | def _test_console_get(self, command, expected_response_type): 25 | server = self._create_server() 26 | completed_command = command % server.id 27 | 28 | try: 29 | output = self.nova(completed_command) 30 | # if we didn't fail, check that the expected response type is in 31 | # the output 32 | console_type = self._get_column_value_from_single_row_table( 33 | output, 'Type') 34 | self.assertEqual(expected_response_type, console_type, output) 35 | except exceptions.CommandFailed as cf: 36 | self.assertIn('HTTP 400', str(cf.stderr)) 37 | 38 | def _test_vnc_console_get(self): 39 | self._test_console_get('get-vnc-console %s novnc', 'novnc') 40 | 41 | def _test_spice_console_get(self): 42 | self._test_console_get('get-spice-console %s spice-html5', 43 | 'spice-html5') 44 | 45 | def _test_rdp_console_get(self): 46 | self._test_console_get('get-rdp-console %s rdp-html5', 'rdp-html5') 47 | 48 | def _test_serial_console_get(self): 49 | self._test_console_get('get-serial-console %s', 'serial') 50 | 51 | def test_vnc_console_get(self): 52 | self._test_vnc_console_get() 53 | 54 | def test_spice_console_get(self): 55 | self._test_spice_console_get() 56 | 57 | def test_rdp_console_get(self): 58 | self._test_rdp_console_get() 59 | 60 | def test_serial_console_get(self): 61 | self._test_serial_console_get() 62 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/legacy/test_extended_attributes.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from oslo_serialization import jsonutils 14 | 15 | from novaclient.tests.functional import base 16 | 17 | 18 | class TestExtAttrNovaClient(base.ClientTestBase): 19 | """Functional tests for os-extended-server-attributes""" 20 | 21 | COMPUTE_API_VERSION = "2.1" 22 | 23 | def _create_server_and_attach_volume(self): 24 | server = self._create_server() 25 | volume = self.cinder.volumes.create(1) 26 | self.addCleanup(volume.delete) 27 | self.wait_for_volume_status(volume, 'available') 28 | self.nova('volume-attach', params="%s %s" % (server.name, volume.id)) 29 | self.addCleanup(self._release_volume, server, volume) 30 | self.wait_for_volume_status(volume, 'in-use') 31 | return server, volume 32 | 33 | def _release_volume(self, server, volume): 34 | self.nova('volume-detach', params="%s %s" % (server.id, volume.id)) 35 | self.wait_for_volume_status(volume, 'available') 36 | 37 | def test_extended_server_attributes(self): 38 | server, volume = self._create_server_and_attach_volume() 39 | table = self.nova('show %s' % server.id) 40 | # Check that attributes listed below exist in 'nova show' table and 41 | # they are exactly Property attributes (not an instance's name, e.g.) 42 | # The _get_value_from_the_table() will raise an exception 43 | # if attr is not a key (first column) of the table dict 44 | for attr in ['OS-EXT-SRV-ATTR:host', 45 | 'OS-EXT-SRV-ATTR:hypervisor_hostname', 46 | 'OS-EXT-SRV-ATTR:instance_name']: 47 | self._get_value_from_the_table(table, attr) 48 | # Check that attribute given below also exists in 'nova show' table 49 | # as a key (first column) of table dict 50 | volume_attr = self._get_value_from_the_table( 51 | table, 'os-extended-volumes:volumes_attached') 52 | # Check that 'id' exists as a key of volume_attr dict 53 | self.assertIn('id', jsonutils.loads(volume_attr)[0]) 54 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/legacy/test_hypervisors.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from novaclient.tests.functional import base 14 | from novaclient import utils 15 | 16 | 17 | class TestHypervisors(base.ClientTestBase): 18 | 19 | COMPUTE_API_VERSION = "2.1" 20 | 21 | def _test_list(self, cpu_info_type, uuid_as_id=False): 22 | hypervisors = self.client.hypervisors.list() 23 | if not len(hypervisors): 24 | self.fail("No hypervisors detected.") 25 | for hypervisor in hypervisors: 26 | self.assertIsInstance(hypervisor.cpu_info, cpu_info_type) 27 | if uuid_as_id: 28 | # microversion >= 2.53 returns a uuid for the id 29 | self.assertFalse(utils.is_integer_like(hypervisor.id), 30 | 'Expected hypervisor.id to be a UUID.') 31 | self.assertFalse( 32 | utils.is_integer_like(hypervisor.service['id']), 33 | 'Expected hypervisor.service.id to be a UUID.') 34 | else: 35 | self.assertTrue(utils.is_integer_like(hypervisor.id), 36 | 'Expected hypervisor.id to be an integer.') 37 | self.assertTrue( 38 | utils.is_integer_like(hypervisor.service['id']), 39 | 'Expected hypervisor.service.id to be an integer.') 40 | 41 | def test_list(self): 42 | self._test_list(str) 43 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/legacy/test_quotas.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from novaclient.tests.functional import base 14 | 15 | 16 | class TestQuotasNovaClient(base.ClientTestBase): 17 | """Nova quotas functional tests.""" 18 | 19 | COMPUTE_API_VERSION = "2.1" 20 | 21 | _quota_resources = ['instances', 'cores', 'ram', 22 | 'floating_ips', 'fixed_ips', 'metadata_items', 23 | 'injected_files', 'injected_file_content_bytes', 24 | 'injected_file_path_bytes', 'key_pairs', 25 | 'security_groups', 'security_group_rules', 26 | 'server_groups', 'server_group_members'] 27 | 28 | def test_quotas_update(self): 29 | # `nova quota-update` requires tenant-id. 30 | tenant_id = self._get_project_id(self.cli_clients.tenant_name) 31 | 32 | self.addCleanup(self.client.quotas.delete, tenant_id) 33 | 34 | original_quotas = self.client.quotas.get(tenant_id) 35 | 36 | difference = 10 37 | params = [tenant_id] 38 | for quota_name in self._quota_resources: 39 | params.append("--%(name)s %(value)s" % { 40 | "name": quota_name.replace("_", "-"), 41 | "value": getattr(original_quotas, quota_name) + difference}) 42 | 43 | self.nova("quota-update", params=" ".join(params)) 44 | 45 | updated_quotas = self.client.quotas.get(tenant_id) 46 | 47 | for quota_name in self._quota_resources: 48 | self.assertEqual(getattr(original_quotas, quota_name), 49 | getattr(updated_quotas, quota_name) - difference) 50 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/legacy/test_server_groups.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Huawei Technology corp. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | from novaclient.tests.functional import base 15 | 16 | 17 | class TestServerGroupClient(base.ClientTestBase): 18 | """Server groups v2.1 functional tests.""" 19 | 20 | COMPUTE_API_VERSION = "2.1" 21 | 22 | def _create_sg(self, policy): 23 | sg_name = self.name_generate() 24 | output = self.nova('server-group-create %s %s' % (sg_name, policy)) 25 | sg_id = self._get_column_value_from_single_row_table(output, "Id") 26 | return sg_id 27 | 28 | def test_create_server_group(self): 29 | sg_id = self._create_sg("affinity") 30 | self.addCleanup(self.nova, 'server-group-delete %s' % sg_id) 31 | sg = self.nova('server-group-get %s' % sg_id) 32 | result = self._get_column_value_from_single_row_table(sg, "Id") 33 | self.assertEqual(sg_id, result) 34 | 35 | def test_list_server_group(self): 36 | sg_id = self._create_sg("affinity") 37 | self.addCleanup(self.nova, 'server-group-delete %s' % sg_id) 38 | sg = self.nova('server-group-list') 39 | result = self._get_column_value_from_single_row_table(sg, "Id") 40 | self.assertEqual(sg_id, result) 41 | 42 | def test_delete_server_group(self): 43 | sg_id = self._create_sg("affinity") 44 | sg = self.nova('server-group-get %s' % sg_id) 45 | result = self._get_column_value_from_single_row_table(sg, "Id") 46 | self.assertIsNotNone(result) 47 | self.nova('server-group-delete %s' % sg_id) 48 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/test_aggregates.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | from novaclient.tests.functional import base 15 | 16 | 17 | class TestAggregatesNovaClient(base.ClientTestBase): 18 | COMPUTE_API_VERSION = '2.1' 19 | 20 | def setUp(self): 21 | super(TestAggregatesNovaClient, self).setUp() 22 | self.agg1 = self.name_generate() 23 | self.agg2 = self.name_generate() 24 | self.addCleanup(self._clean_aggregates) 25 | 26 | def _clean_aggregates(self): 27 | for a in (self.agg1, self.agg2): 28 | try: 29 | self.nova('aggregate-delete', params=a) 30 | except Exception: 31 | pass 32 | 33 | def test_aggregate_update_name(self): 34 | self.nova('aggregate-create', params=self.agg1) 35 | self.nova('aggregate-update', 36 | params='--name=%s %s' % (self.agg2, self.agg1)) 37 | output = self.nova('aggregate-show', params=self.agg2) 38 | self.assertIn(self.agg2, output) 39 | self.nova('aggregate-delete', params=self.agg2) 40 | 41 | def test_aggregate_update_az(self): 42 | self.nova('aggregate-create', params=self.agg2) 43 | self.nova('aggregate-update', 44 | params='--availability-zone=myaz %s' % self.agg2) 45 | output = self.nova('aggregate-show', params=self.agg2) 46 | self.assertIn('myaz', output) 47 | self.nova('aggregate-delete', params=self.agg2) 48 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/test_consoles.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 IBM Corp. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | from novaclient.tests.functional.v2.legacy import test_consoles 15 | 16 | 17 | class TestConsolesNovaClientV26(test_consoles.TestConsolesNovaClient): 18 | """Consoles functional tests for >=v2.6 api microversions.""" 19 | 20 | COMPUTE_API_VERSION = "2.6" 21 | 22 | def test_vnc_console_get(self): 23 | self._test_vnc_console_get() 24 | 25 | def test_spice_console_get(self): 26 | self._test_spice_console_get() 27 | 28 | def test_rdp_console_get(self): 29 | self._test_rdp_console_get() 30 | 31 | def test_serial_console_get(self): 32 | self._test_serial_console_get() 33 | 34 | 35 | class TestConsolesNovaClientV28(test_consoles.TestConsolesNovaClient): 36 | """Consoles functional tests for >=v2.8 api microversions.""" 37 | 38 | COMPUTE_API_VERSION = "2.8" 39 | 40 | def test_webmks_console_get(self): 41 | self._test_console_get('get-mks-console %s ', 'webmks') 42 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/test_extended_attributes.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from oslo_serialization import jsonutils 14 | 15 | from novaclient.tests.functional.v2.legacy import test_extended_attributes 16 | 17 | 18 | class TestExtAttrNovaClientV23(test_extended_attributes.TestExtAttrNovaClient): 19 | """Functional tests for os-extended-server-attributes, microversion 2.3""" 20 | 21 | COMPUTE_API_VERSION = "2.3" 22 | 23 | def test_extended_server_attributes(self): 24 | server, volume = self._create_server_and_attach_volume() 25 | table = self.nova('show %s' % server.id) 26 | # Check that attributes listed below exist in 'nova show' table and 27 | # they are exactly Property attributes (not an instance's name, e.g.) 28 | # The _get_value_from_the_table() will raise an exception 29 | # if attr is not a key of the table dict (first column) 30 | for attr in ['OS-EXT-SRV-ATTR:reservation_id', 31 | 'OS-EXT-SRV-ATTR:launch_index', 32 | 'OS-EXT-SRV-ATTR:ramdisk_id', 33 | 'OS-EXT-SRV-ATTR:kernel_id', 34 | 'OS-EXT-SRV-ATTR:hostname', 35 | 'OS-EXT-SRV-ATTR:root_device_name']: 36 | self._get_value_from_the_table(table, attr) 37 | # Check that attribute given below also exists in 'nova show' table 38 | # as a key (first column) of table dict 39 | volume_attr = self._get_value_from_the_table( 40 | table, 'os-extended-volumes:volumes_attached') 41 | # Check that 'delete_on_termination' exists as a key 42 | # of volume_attr dict 43 | self.assertIn('delete_on_termination', jsonutils.loads(volume_attr)[0]) 44 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/test_flavor.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from novaclient.tests.functional import base 14 | 15 | 16 | class TestFlavorNovaClientV274(base.ClientTestBase): 17 | """Functional tests for flavors""" 18 | 19 | COMPUTE_API_VERSION = "2.74" 20 | # NOTE(gmann): Before microversion 2.75, default value of 'swap' field is 21 | # returned as empty string. 22 | SWAP_DEFAULT = "" 23 | 24 | def _create_flavor(self, swap=None): 25 | flv_name = self.name_generate() 26 | cmd = 'flavor-create %s auto 512 1 1' 27 | if swap: 28 | cmd = cmd + (' --swap %s' % swap) 29 | out = self.nova(cmd % flv_name) 30 | self.addCleanup(self.nova, 'flavor-delete %s' % flv_name) 31 | return out, flv_name 32 | 33 | def test_create_flavor_with_no_swap(self): 34 | out, _ = self._create_flavor() 35 | self.assertEqual( 36 | self.SWAP_DEFAULT, 37 | self._get_column_value_from_single_row_table(out, "Swap")) 38 | 39 | def test_update_flavor_with_no_swap(self): 40 | _, flv_name = self._create_flavor() 41 | out = self.nova('flavor-update %s new-description' % flv_name) 42 | self.assertEqual( 43 | self.SWAP_DEFAULT, 44 | self._get_column_value_from_single_row_table(out, "Swap")) 45 | 46 | def test_show_flavor_with_no_swap(self): 47 | _, flv_name = self._create_flavor() 48 | out = self.nova('flavor-show %s' % flv_name) 49 | self.assertEqual(self.SWAP_DEFAULT, 50 | self._get_value_from_the_table(out, "swap")) 51 | 52 | def test_list_flavor_with_no_swap(self): 53 | self._create_flavor() 54 | out = self.nova('flavor-list') 55 | self.assertEqual( 56 | self.SWAP_DEFAULT, 57 | self._get_column_value_from_single_row_table(out, "Swap")) 58 | 59 | def test_create_flavor_with_swap(self): 60 | out, _ = self._create_flavor(swap=10) 61 | self.assertEqual( 62 | '10', 63 | self._get_column_value_from_single_row_table(out, "Swap")) 64 | 65 | 66 | class TestFlavorNovaClientV275(TestFlavorNovaClientV274): 67 | """Functional tests for flavors""" 68 | 69 | COMPUTE_API_VERSION = "2.75" 70 | # NOTE(gmann): Since microversion 2.75, default value of 'swap' field is 71 | # returned as 0. 72 | SWAP_DEFAULT = '0' 73 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/test_flavor_access.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from novaclient.tests.functional.v2.legacy import test_flavor_access 14 | 15 | 16 | class TestFlvAccessNovaClientV27(test_flavor_access.TestFlvAccessNovaClient): 17 | """Check that an attempt to grant an access to a public flavor 18 | for the given tenant fails with Conflict error in accordance with 19 | 2.7 microversion REST API History 20 | """ 21 | 22 | COMPUTE_API_VERSION = "2.7" 23 | 24 | def test_add_access_public_flavor(self): 25 | flv_name = self.name_generate() 26 | self.nova('flavor-create %s auto 512 1 1' % flv_name) 27 | self.addCleanup(self.nova, 'flavor-delete %s' % flv_name) 28 | output = self.nova('flavor-access-add %s %s' % 29 | (flv_name, self.project_id), 30 | fail_ok=True, merge_stderr=True) 31 | self.assertIn("ERROR (Conflict): " 32 | "Can not add access to a public flavor. (HTTP 409) ", 33 | output) 34 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/test_hypervisors.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from novaclient.tests.functional.v2.legacy import test_hypervisors 14 | 15 | 16 | class TestHypervisorsV28(test_hypervisors.TestHypervisors): 17 | 18 | COMPUTE_API_VERSION = "2.28" 19 | 20 | def test_list(self): 21 | self._test_list(dict) 22 | 23 | 24 | class TestHypervisorsV2_53(TestHypervisorsV28): 25 | COMPUTE_API_VERSION = "2.53" 26 | 27 | def test_list(self): 28 | self._test_list(cpu_info_type=dict, uuid_as_id=True) 29 | 30 | def test_search_with_details(self): 31 | # First find a hypervisor from the list to search on. 32 | hypervisors = self.client.hypervisors.list() 33 | # Now search for that hypervisor with details. 34 | hypervisor = hypervisors[0] 35 | hypervisors = self.client.hypervisors.search( 36 | hypervisor.hypervisor_hostname, detailed=True) 37 | self.assertEqual(1, len(hypervisors)) 38 | hypervisor = hypervisors[0] 39 | # We know we got details if service is in the response. 40 | self.assertIsNotNone(hypervisor.service, 41 | 'Expected service in hypervisor: %s' % hypervisor) 42 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/test_image_meta.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016 Mirantis, Inc. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | from novaclient.tests.functional import base 15 | 16 | 17 | class TestImageMetaV239(base.ClientTestBase): 18 | """Functional tests for image-meta proxy API.""" 19 | 20 | # 'image-metadata' proxy API was deprecated in 2.39 but the CLI should 21 | # fallback to 2.35 and emit a warning. 22 | COMPUTE_API_VERSION = "2.39" 23 | 24 | def test_limits(self): 25 | """Tests that 2.39 won't return 'maxImageMeta' resource limit and 26 | the CLI output won't show it. 27 | """ 28 | output = self.nova('limits') 29 | # assert that MaxImageMeta isn't in the table output 30 | self.assertRaises(ValueError, self._get_value_from_the_table, 31 | output, 'maxImageMeta') 32 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/test_instances.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from novaclient.tests.functional.v2.legacy import test_instances 14 | 15 | 16 | class TestInstanceCLI(test_instances.TestInstanceCLI): 17 | 18 | COMPUTE_API_VERSION = "2.latest" 19 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/test_networks.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016 Red Hat, Inc. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | from novaclient.tests.functional import base 15 | 16 | 17 | class TestNetworkCommandsV2_36(base.ClientTestBase): 18 | """Deprecated network command functional tests.""" 19 | 20 | # Proxy APIs were deprecated in 2.36 but the CLI should fallback to 2.35 21 | # and emit a warning. 22 | COMPUTE_API_VERSION = "2.36" 23 | 24 | def test_limits(self): 25 | """Tests that 2.36 won't return network-related resource limits and 26 | the CLI output won't show them. 27 | """ 28 | output = self.nova('limits') 29 | # assert that SecurityGroups isn't in the table output 30 | self.assertRaises(ValueError, self._get_value_from_the_table, 31 | output, 'SecurityGroups') 32 | 33 | def test_quota_show(self): 34 | """Tests that 2.36 won't return network-related resource quotas and 35 | the CLI output won't show them. 36 | """ 37 | output = self.nova('quota-show') 38 | # assert that security_groups isn't in the table output 39 | self.assertRaises(ValueError, self._get_value_from_the_table, 40 | output, 'security_groups') 41 | -------------------------------------------------------------------------------- /novaclient/tests/functional/v2/test_usage.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from novaclient.tests.functional.v2.legacy import test_usage 14 | 15 | 16 | class TestUsageCLI_V240(test_usage.TestUsageCLI): 17 | 18 | COMPUTE_API_VERSION = '2.40' 19 | 20 | 21 | class TestUsageClient_V240(test_usage.TestUsageClient): 22 | 23 | COMPUTE_API_VERSION = '2.40' 24 | 25 | def test_get(self): 26 | start, end = self._create_servers_in_time_window() 27 | tenant_id = self._get_project_id(self.cli_clients.tenant_name) 28 | usage = self.client.usage.get( 29 | tenant_id, start=start, end=end, limit=1) 30 | self.assertEqual(tenant_id, usage.tenant_id) 31 | self.assertEqual(1, len(usage.server_usages)) 32 | 33 | def test_list(self): 34 | start, end = self._create_servers_in_time_window() 35 | usages = self.client.usage.list( 36 | start=start, end=end, detailed=True, limit=1) 37 | self.assertEqual(1, len(usages)) 38 | self.assertEqual(1, len(usages[0].server_usages)) 39 | -------------------------------------------------------------------------------- /novaclient/tests/unit/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/python-novaclient/b2481a6f9739afe0e68327fc58c5bc208f69c052/novaclient/tests/unit/__init__.py -------------------------------------------------------------------------------- /novaclient/tests/unit/fake_actions_module.py: -------------------------------------------------------------------------------- 1 | # Copyright 2011 OpenStack Foundation 2 | # All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | # not use this file except in compliance with the License. You may obtain 6 | # a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations 14 | # under the License. 15 | 16 | from novaclient import api_versions 17 | from novaclient import utils 18 | 19 | 20 | @api_versions.wraps("2.10", "2.20") 21 | def do_fake_action(): 22 | return 1 23 | 24 | 25 | @api_versions.wraps("2.21", "2.30") 26 | def do_fake_action(): 27 | return 2 28 | 29 | 30 | @api_versions.wraps("2.0") 31 | def do_another_fake_action(): 32 | return 0 33 | 34 | 35 | @utils.arg( 36 | '--foo', 37 | start_version='2.1', 38 | end_version='2.2') 39 | @utils.arg( 40 | '--bar', 41 | start_version='2.3', 42 | end_version='2.4') 43 | def do_fake_action2(): 44 | return 3 45 | 46 | 47 | @utils.arg( 48 | '--foo', 49 | help='first foo', 50 | start_version='2.10', 51 | end_version='2.20') 52 | @utils.arg( 53 | '--foo', 54 | help='second foo', 55 | start_version='2.21') 56 | def do_fake_action3(): 57 | return 3 58 | -------------------------------------------------------------------------------- /novaclient/tests/unit/fixture_data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/python-novaclient/b2481a6f9739afe0e68327fc58c5bc208f69c052/novaclient/tests/unit/fixture_data/__init__.py -------------------------------------------------------------------------------- /novaclient/tests/unit/fixture_data/agents.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from novaclient.tests.unit.fixture_data import base 14 | 15 | 16 | class Fixture(base.Fixture): 17 | 18 | base_url = 'os-agents' 19 | 20 | def setUp(self): 21 | super(Fixture, self).setUp() 22 | 23 | post_os_agents = { 24 | 'agent': { 25 | 'url': '/xxx/xxx/xxx', 26 | 'hypervisor': 'kvm', 27 | 'md5hash': 'add6bb58e139be103324d04d82d8f546', 28 | 'version': '7.0', 29 | 'architecture': 'x86', 30 | 'os': 'win', 31 | 'id': 1 32 | } 33 | } 34 | 35 | self.requests_mock.post(self.url(), 36 | json=post_os_agents, 37 | headers=self.json_headers) 38 | 39 | put_os_agents_1 = { 40 | "agent": { 41 | "url": "/yyy/yyyy/yyyy", 42 | "version": "8.0", 43 | "md5hash": "add6bb58e139be103324d04d82d8f546", 44 | 'id': 1 45 | } 46 | } 47 | 48 | self.requests_mock.put(self.url(1), 49 | json=put_os_agents_1, 50 | headers=self.json_headers) 51 | 52 | self.requests_mock.delete(self.url(1), 53 | headers=self.json_headers, 54 | status_code=202) 55 | -------------------------------------------------------------------------------- /novaclient/tests/unit/fixture_data/aggregates.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from novaclient.tests.unit.fixture_data import base 14 | 15 | 16 | class Fixture(base.Fixture): 17 | 18 | base_url = 'os-aggregates' 19 | 20 | def setUp(self): 21 | super(Fixture, self).setUp() 22 | 23 | get_os_aggregates = {"aggregates": [ 24 | {'id': '1', 25 | 'name': 'test', 26 | 'availability_zone': 'nova1'}, 27 | {'id': '2', 28 | 'name': 'test2', 29 | 'availability_zone': 'nova1'}, 30 | ]} 31 | 32 | self.requests_mock.get(self.url(), 33 | json=get_os_aggregates, 34 | headers=self.json_headers) 35 | 36 | get_aggregates_1 = {'aggregate': get_os_aggregates['aggregates'][0]} 37 | 38 | self.requests_mock.post(self.url(), 39 | json=get_aggregates_1, 40 | headers=self.json_headers) 41 | 42 | for agg_id in (1, 2): 43 | for method in ('GET', 'PUT'): 44 | self.requests_mock.register_uri(method, self.url(agg_id), 45 | json=get_aggregates_1, 46 | headers=self.json_headers) 47 | 48 | self.requests_mock.post(self.url(agg_id, 'action'), 49 | json=get_aggregates_1, 50 | headers=self.json_headers) 51 | 52 | self.requests_mock.delete(self.url(1), status_code=202, 53 | headers=self.json_headers) 54 | 55 | self.requests_mock.register_uri('POST', self.url(1), 56 | json={}, 57 | headers=self.json_headers) 58 | self.requests_mock.post(self.url(1, 'images'), 59 | json={}, 60 | headers=self.json_headers) 61 | -------------------------------------------------------------------------------- /novaclient/tests/unit/fixture_data/base.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from urllib import parse 14 | 15 | import fixtures 16 | 17 | from novaclient.tests.unit.v2 import fakes 18 | 19 | COMPUTE_URL = 'http://compute.host' 20 | 21 | 22 | class Fixture(fixtures.Fixture): 23 | 24 | base_url = None 25 | json_headers = {'Content-Type': 'application/json', 26 | 'x-openstack-request-id': fakes.FAKE_REQUEST_ID} 27 | 28 | def __init__(self, requests_mock, compute_url=COMPUTE_URL): 29 | super(Fixture, self).__init__() 30 | self.requests_mock = requests_mock 31 | self.compute_url = compute_url 32 | 33 | def url(self, *args, **kwargs): 34 | url_args = [self.compute_url] 35 | 36 | if self.base_url: 37 | url_args.append(self.base_url) 38 | 39 | url = '/'.join(str(a).strip('/') for a in tuple(url_args) + args) 40 | 41 | if kwargs: 42 | url += '?%s' % parse.urlencode(kwargs, doseq=True) 43 | 44 | return url 45 | -------------------------------------------------------------------------------- /novaclient/tests/unit/fixture_data/client.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | import fixtures 14 | from keystoneauth1 import fixture 15 | from keystoneauth1 import loading 16 | from keystoneauth1 import session 17 | 18 | from novaclient import client 19 | 20 | IDENTITY_URL = 'http://identityserver:5000/v2.0' 21 | COMPUTE_URL = 'http://compute.host' 22 | 23 | 24 | class V1(fixtures.Fixture): 25 | 26 | def __init__(self, requests_mock, 27 | compute_url=COMPUTE_URL, identity_url=IDENTITY_URL, 28 | **client_kwargs): 29 | super(V1, self).__init__() 30 | self.identity_url = identity_url 31 | self.compute_url = compute_url 32 | self.client = None 33 | self.requests_mock = requests_mock 34 | 35 | self.token = fixture.V2Token() 36 | self.token.set_scope() 37 | self.discovery = fixture.V2Discovery(href=self.identity_url) 38 | 39 | s = self.token.add_service('compute') 40 | s.add_endpoint(self.compute_url) 41 | 42 | s = self.token.add_service('computev3') 43 | s.add_endpoint(self.compute_url) 44 | 45 | self._client_kwargs = client_kwargs 46 | 47 | def setUp(self): 48 | super(V1, self).setUp() 49 | 50 | auth_url = '%s/tokens' % self.identity_url 51 | headers = {'X-Content-Type': 'application/json'} 52 | self.requests_mock.post(auth_url, 53 | json=self.token, 54 | headers=headers) 55 | self.requests_mock.get(self.identity_url, 56 | json=self.discovery, 57 | headers=headers) 58 | self.client = self.new_client(**self._client_kwargs) 59 | 60 | def new_client(self, **client_kwargs): 61 | return client.Client("2", username='xx', 62 | password='xx', 63 | project_id='xx', 64 | auth_url=self.identity_url, 65 | **client_kwargs) 66 | 67 | 68 | class SessionV1(V1): 69 | 70 | def new_client(self): 71 | self.session = session.Session() 72 | loader = loading.get_plugin_loader('password') 73 | self.session.auth = loader.load_from_options( 74 | auth_url=self.identity_url, username='xx', password='xx') 75 | return client.Client("2", session=self.session) 76 | -------------------------------------------------------------------------------- /novaclient/tests/unit/fixture_data/floatingips.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from novaclient.tests.unit.fixture_data import base 14 | 15 | 16 | class FloatingFixture(base.Fixture): 17 | 18 | base_url = 'os-floating-ips' 19 | 20 | def setUp(self): 21 | super(FloatingFixture, self).setUp() 22 | 23 | floating_ips = [{'id': 1, 'fixed_ip': '10.0.0.1', 'ip': '11.0.0.1'}, 24 | {'id': 2, 'fixed_ip': '10.0.0.2', 'ip': '11.0.0.2'}] 25 | 26 | get_os_floating_ips = {'floating_ips': floating_ips} 27 | self.requests_mock.get(self.url(), 28 | json=get_os_floating_ips, 29 | headers=self.json_headers) 30 | 31 | for ip in floating_ips: 32 | get_os_floating_ip = {'floating_ip': ip} 33 | self.requests_mock.get(self.url(ip['id']), 34 | json=get_os_floating_ip, 35 | headers=self.json_headers) 36 | 37 | self.requests_mock.delete(self.url(ip['id']), 38 | headers=self.json_headers, 39 | status_code=204) 40 | 41 | def post_os_floating_ips(request, context): 42 | ip = floating_ips[0].copy() 43 | ip['pool'] = request.json().get('pool') 44 | return {'floating_ip': ip} 45 | self.requests_mock.post(self.url(), 46 | json=post_os_floating_ips, 47 | headers=self.json_headers) 48 | -------------------------------------------------------------------------------- /novaclient/tests/unit/fixture_data/images.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from novaclient.tests.unit import fakes 14 | from novaclient.tests.unit.fixture_data import base 15 | 16 | 17 | class V1(base.Fixture): 18 | 19 | base_url = 'v2/images' 20 | 21 | def setUp(self): 22 | super(V1, self).setUp() 23 | 24 | get_images = { 25 | 'images': [ 26 | {'id': 1, 'name': 'CentOS 5.2'}, 27 | {'id': 2, 'name': 'My Server Backup'} 28 | ] 29 | } 30 | 31 | headers = self.json_headers 32 | 33 | self.requests_mock.get(self.url(), 34 | json=get_images, 35 | headers=headers) 36 | 37 | image_1 = { 38 | 'id': 1, 39 | 'name': 'CentOS 5.2', 40 | "updated": "2010-10-10T12:00:00Z", 41 | "created": "2010-08-10T12:00:00Z", 42 | "status": "ACTIVE", 43 | "metadata": { 44 | "test_key": "test_value", 45 | }, 46 | "links": {}, 47 | } 48 | 49 | image_2 = { 50 | "id": 2, 51 | "name": "My Server Backup", 52 | "serverId": 1234, 53 | "updated": "2010-10-10T12:00:00Z", 54 | "created": "2010-08-10T12:00:00Z", 55 | "status": "SAVING", 56 | "progress": 80, 57 | "links": {}, 58 | } 59 | 60 | self.requests_mock.get(self.url('detail'), 61 | json={'images': [image_1, image_2]}, 62 | headers=headers) 63 | 64 | self.requests_mock.get(self.url(1), 65 | json={'image': image_1}, 66 | headers=headers) 67 | 68 | def post_images_1_metadata(request, context): 69 | body = request.json() 70 | assert list(body) == ['metadata'] 71 | fakes.assert_has_keys(body['metadata'], required=['test_key']) 72 | return {'metadata': image_1['metadata']} 73 | 74 | self.requests_mock.post(self.url(1, 'metadata'), 75 | json=post_images_1_metadata, 76 | headers=headers) 77 | 78 | for u in (1, '1/metadata/test_key'): 79 | self.requests_mock.delete(self.url(u), status_code=204, 80 | headers=headers) 81 | -------------------------------------------------------------------------------- /novaclient/tests/unit/fixture_data/keypairs.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from novaclient import api_versions 14 | from novaclient.tests.unit import fakes 15 | from novaclient.tests.unit.fixture_data import base 16 | 17 | 18 | class V1(base.Fixture): 19 | 20 | api_version = '2.1' 21 | base_url = 'os-keypairs' 22 | 23 | def setUp(self): 24 | super(V1, self).setUp() 25 | api_version = api_versions.APIVersion(self.api_version) 26 | 27 | keypair = {'fingerprint': 'FAKE_KEYPAIR', 'name': 'test'} 28 | 29 | headers = self.json_headers 30 | 31 | self.requests_mock.get(self.url(), 32 | json={'keypairs': [keypair]}, 33 | headers=headers) 34 | 35 | self.requests_mock.get(self.url('test'), 36 | json={'keypair': keypair}, 37 | headers=headers) 38 | 39 | self.requests_mock.delete(self.url('test'), 40 | status_code=202, 41 | headers=headers) 42 | 43 | def post_os_keypairs(request, context): 44 | body = request.json() 45 | assert list(body) == ['keypair'] 46 | if api_version >= api_versions.APIVersion("2.92"): 47 | # In 2.92, public_key becomes mandatory 48 | required = ['name', 'public_key'] 49 | else: 50 | required = ['name'] 51 | fakes.assert_has_keys(body['keypair'], 52 | required=required) 53 | return {'keypair': keypair} 54 | 55 | self.requests_mock.post(self.url(), 56 | json=post_os_keypairs, 57 | headers=headers) 58 | -------------------------------------------------------------------------------- /novaclient/tests/unit/idfake.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEA9QstF/7prDY7a9La7GS9TpMX+MWWXQgK6pHRLakDFp1WX1Q3 3 | Vly7rWitaZUGirUPMm181oJXBwkKlAxFD7hKjyHYaSswNszPYIAsVkc1+AO5epXz 4 | g9kUBNtfg44Pg72UecwLrZ8JpmNZpJlKQOx6vF+yi7JmHrrIf6il/grIGUPzoT2L 5 | yReimpyPoBrGtXhJYaCJ/XbKg1idRZiQdmwh1F/OmZWn9p0wunnsv08a0+qIywuw 6 | WhG9/Zy9fjnEByfusS6gI0GIxDRL4RWzOqphd3PZzunwIBgEKFhgiki9+2DgcRVO 7 | 9I5wnDvfwQREJRZWh1uJa5ZTcfPa1EzZryVeOQIDAQABAoIBABxO3Te/cBk/7p9n 8 | LXlPrfrszUEk+ljm+/PbQpIGy1+Kb5b1sKrebaP7ysS+vZG6lvXZZimVxx398mXm 9 | APhu7tYYL9r+bUR3ZqGcTQLumRJ8w6mgtxANPN3Oxfr5p1stxIBJjTPSgpfhNFLq 10 | joRvjUJDv+mZg2ibZVwyDHMLpdAdKp+3XMdyTLZcH9esqwii+natix7rHd1RuF85 11 | L1dfpxjkItwhgHsfdYS++5X3fRByFOhQ+Nhabh/kPQbQMcteRn1bN6zeCWBSglNb 12 | Ka/ZrXb6ApRUc22Ji62mNO2ZPPekLJeCHk2h2E7ezYX+sGDNvvd/jHVDJJ20FjD1 13 | Z9KXuK0CgYEA/2vniy9yWd925QQtWbmrxgy6yj89feMH/LTv4qP298rGZ2nqxsyd 14 | 9pdBdb4NMsi4HmV5PG1hp3VRNBHl53DNh5eqzT8WEXnIF+sbrIU3KzrCVAx1kZTl 15 | +OWKA6aVUsvvO3y85SOvInnsV+IsOGmU4/WBSjYoe39Bo7mq/YuZB9MCgYEA9ZlB 16 | KBm6PjFdHQGNgedXahWzRcwC+ALCYqequPYqJolNzhrK4Uc2sWPSGdnldcHZ4XCQ 17 | wbfCxUSwrMpA1oyuIQ0U4aowmOw5DjIueBWI8XBYEVRBlwvJwbXpBZ/DspGzTUDx 18 | MBrrEwEaMadQvxhRnAzhp0rQAepatcz6Fgb1JkMCgYBMwDLiew5kfSav6JJsDMPW 19 | DksurNQgeNEUmZYfx19V1EPMHWKj/CZXS9oqtEIpCXFyCNHmW4PlmvYcrGgmJJpN 20 | 7UAwzo0mES8UKNy2+Yy7W7u7H8dQSKrWILtZH3xtVcR8Xp4wSIm+1V40hkz9YpSP 21 | 71y7XQzLF1E1DnyYFZOVawKBgAFrmHfd5jjT2kD/sEzPBK9lXrsJmf7LLUqaw578 22 | NXQxmRSXDRNOcR+Hf0CNBQmwTE1EdGHaaTLw2cC2Drfu6lbgl31SmaNYwl+1pJUn 23 | MrqKtseq4BI6jDkljypsKRqQQyQwOvTXQwLCH9+nowzn3Bj17hwkj51jOJESlWOp 24 | OKO3AoGBALm+jjqyqX7gSnqK3FAumB8mlhv3yI1Wr1ctwe18mKfKbz17HxXRu9pF 25 | K/6e7WMCA1p+jhoE8gj1h2WBcH0nV2qt8Ye8gJBbCi4dhI08o4AfrIV47oZx1RlO 26 | qYcA1U9lyaODY5SL8+6PHOy5J/aYtuA+wvfEnWiCIdKQrhWetcn3 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /novaclient/tests/unit/test_exceptions.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016 IBM Corp. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | from novaclient import exceptions 16 | from novaclient.tests.unit import utils as test_utils 17 | 18 | 19 | class ExceptionsTestCase(test_utils.TestCase): 20 | 21 | def _test_from_response(self, body, expected_message): 22 | data = { 23 | 'status_code': 404, 24 | 'headers': { 25 | 'content-type': 'application/json', 26 | 'x-openstack-request-id': ( 27 | 'req-d9df03b0-4150-4b53-8157-7560ccf39f75'), 28 | } 29 | } 30 | response = test_utils.TestResponse(data) 31 | fake_url = 'http://localhost:8774/v2.1/fake/flavors/test' 32 | error = exceptions.from_response(response, body, fake_url, 'GET') 33 | self.assertIsInstance(error, exceptions.NotFound) 34 | self.assertEqual(expected_message, error.message) 35 | 36 | def test_from_response_webob_pre_1_6_0(self): 37 | # Tests error responses before webob 1.6.0 where the error details 38 | # are nested in the response body. 39 | message = "Flavor test could not be found." 40 | self._test_from_response( 41 | {"itemNotFound": {"message": message, "code": 404}}, 42 | message) 43 | 44 | def test_from_response_webob_post_1_6_0(self): 45 | # Tests error responses from webob 1.6.0 where the error details 46 | # are in the response body. 47 | message = "Flavor test could not be found." 48 | self._test_from_response({"message": message, "code": 404}, message) 49 | -------------------------------------------------------------------------------- /novaclient/tests/unit/v2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/python-novaclient/b2481a6f9739afe0e68327fc58c5bc208f69c052/novaclient/tests/unit/v2/__init__.py -------------------------------------------------------------------------------- /novaclient/tests/unit/v2/test_assisted_volume_snapshots.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013, Red Hat, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | """ 16 | Assisted volume snapshots - to be used by Cinder and not end users. 17 | """ 18 | 19 | from novaclient import api_versions 20 | from novaclient.tests.unit import utils 21 | from novaclient.tests.unit.v2 import fakes 22 | 23 | 24 | class AssistedVolumeSnapshotsTestCase(utils.TestCase): 25 | def setUp(self): 26 | super(AssistedVolumeSnapshotsTestCase, self).setUp() 27 | self.cs = fakes.FakeClient(api_versions.APIVersion("2.1")) 28 | 29 | def test_create_snap(self): 30 | vs = self.cs.assisted_volume_snapshots.create('1', {}) 31 | self.assert_request_id(vs, fakes.FAKE_REQUEST_ID_LIST) 32 | self.cs.assert_called('POST', '/os-assisted-volume-snapshots') 33 | 34 | def test_delete_snap(self): 35 | vs = self.cs.assisted_volume_snapshots.delete('x', {}) 36 | self.assert_request_id(vs, fakes.FAKE_REQUEST_ID_LIST) 37 | self.cs.assert_called( 38 | 'DELETE', 39 | '/os-assisted-volume-snapshots/x?delete_info={}') 40 | -------------------------------------------------------------------------------- /novaclient/tests/unit/v2/test_client.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from keystoneauth1 import session 14 | from oslo_utils import uuidutils 15 | 16 | from novaclient import api_versions 17 | from novaclient.tests.unit import utils 18 | from novaclient.v2 import client 19 | 20 | 21 | class ClientTest(utils.TestCase): 22 | 23 | def test_adapter_properties(self): 24 | # sample of properties, there are many more 25 | user_agent = uuidutils.generate_uuid(dashed=False) 26 | endpoint_override = uuidutils.generate_uuid(dashed=False) 27 | 28 | s = session.Session() 29 | c = client.Client(session=s, 30 | api_version=api_versions.APIVersion("2.0"), 31 | user_agent=user_agent, 32 | endpoint_override=endpoint_override, 33 | direct_use=False) 34 | 35 | self.assertEqual(user_agent, c.client.user_agent) 36 | self.assertEqual(endpoint_override, c.client.endpoint_override) 37 | 38 | def test_passing_endpoint_type(self): 39 | endpoint_type = uuidutils.generate_uuid(dashed=False) 40 | 41 | s = session.Session() 42 | c = client.Client(session=s, 43 | endpoint_type=endpoint_type, 44 | direct_use=False) 45 | 46 | self.assertEqual(endpoint_type, c.client.interface) 47 | -------------------------------------------------------------------------------- /novaclient/tests/unit/v2/test_images.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | from unittest import mock 15 | 16 | from novaclient.tests.unit.fixture_data import client 17 | from novaclient.tests.unit.fixture_data import images as data 18 | from novaclient.tests.unit import utils 19 | from novaclient.tests.unit.v2 import fakes 20 | from novaclient.v2 import images 21 | 22 | 23 | class ImagesTest(utils.FixturedTestCase): 24 | 25 | client_fixture_class = client.V1 26 | data_fixture_class = data.V1 27 | 28 | @mock.patch('novaclient.base.Manager.alternate_service_type') 29 | def test_list_images(self, mock_alternate_service_type): 30 | il = self.cs.glance.list() 31 | self.assert_request_id(il, fakes.FAKE_REQUEST_ID_LIST) 32 | self.assert_called('GET', '/v2/images') 33 | for i in il: 34 | self.assertIsInstance(i, images.Image) 35 | self.assertEqual(2, len(il)) 36 | mock_alternate_service_type.assert_called_once_with( 37 | 'image', allowed_types=('image',)) 38 | -------------------------------------------------------------------------------- /novaclient/tests/unit/v2/test_instance_usage_audit_log.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013 Rackspace Hosting 2 | # All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | # not use this file except in compliance with the License. You may obtain 6 | # a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations 14 | # under the License. 15 | 16 | from novaclient import api_versions 17 | from novaclient import exceptions 18 | from novaclient.tests.unit import utils 19 | from novaclient.tests.unit.v2 import fakes 20 | 21 | 22 | class InstanceUsageAuditLogTests(utils.TestCase): 23 | def setUp(self): 24 | super(InstanceUsageAuditLogTests, self).setUp() 25 | self.cs = fakes.FakeClient(api_versions.APIVersion("2.1")) 26 | 27 | def test_instance_usage_audit_log(self): 28 | audit_log = self.cs.instance_usage_audit_log.get() 29 | self.assert_request_id(audit_log, fakes.FAKE_REQUEST_ID_LIST) 30 | self.cs.assert_called('GET', '/os-instance_usage_audit_log') 31 | 32 | def test_instance_usage_audit_log_with_before(self): 33 | audit_log = self.cs.instance_usage_audit_log.get( 34 | before='2016-12-10 13:59:59.999999') 35 | self.assert_request_id(audit_log, fakes.FAKE_REQUEST_ID_LIST) 36 | self.cs.assert_called( 37 | 'GET', 38 | '/os-instance_usage_audit_log/2016-12-10%2013%3A59%3A59.999999') 39 | 40 | def test_instance_usage_audit_log_with_before_unicode(self): 41 | before = '\\u5de5\\u4f5c' 42 | self.assertRaises(exceptions.BadRequest, 43 | self.cs.instance_usage_audit_log.get, before) 44 | -------------------------------------------------------------------------------- /novaclient/tests/unit/v2/test_server_external_events.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2014, Red Hat, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | """ 16 | External event triggering for servers, not to be used by users. 17 | """ 18 | 19 | from novaclient import api_versions 20 | from novaclient.tests.unit import utils 21 | from novaclient.tests.unit.v2 import fakes 22 | 23 | 24 | class ServerExternalEventsTestCase(utils.TestCase): 25 | def setUp(self): 26 | super(ServerExternalEventsTestCase, self).setUp() 27 | self.cs = fakes.FakeClient(api_versions.APIVersion("2.1")) 28 | 29 | def test_external_event(self): 30 | events = [{'server_uuid': 'fake-uuid1', 31 | 'name': 'test-event', 32 | 'status': 'completed', 33 | 'tag': 'tag'}, 34 | {'server_uuid': 'fake-uuid2', 35 | 'name': 'test-event', 36 | 'status': 'completed', 37 | 'tag': 'tag'}] 38 | result = self.cs.server_external_events.create(events) 39 | self.assert_request_id(result, fakes.FAKE_REQUEST_ID_LIST) 40 | self.assertEqual(events, result) 41 | self.cs.assert_called('POST', '/os-server-external-events') 42 | -------------------------------------------------------------------------------- /novaclient/tests/unit/v2/testfile.txt: -------------------------------------------------------------------------------- 1 | BLAH 2 | -------------------------------------------------------------------------------- /novaclient/v2/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | # not use this file except in compliance with the License. You may obtain 6 | # a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations 14 | # under the License. 15 | 16 | from novaclient.v2.client import Client # noqa 17 | -------------------------------------------------------------------------------- /novaclient/v2/agents.py: -------------------------------------------------------------------------------- 1 | # Copyright 2012 IBM Corp. 2 | # All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | # not use this file except in compliance with the License. You may obtain 6 | # a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations 14 | # under the License. 15 | 16 | """ 17 | agent interface 18 | """ 19 | 20 | from novaclient import base 21 | 22 | # NOTE(takashin): The os-agents APIs have been removed 23 | # in https://review.opendev.org/c/openstack/nova/+/749309 . 24 | # But the following API bindings remains as there are 25 | # because the python-openstackclient depends on them. 26 | 27 | 28 | class Agent(base.Resource): 29 | def __repr__(self): 30 | return "" % self.agent 31 | 32 | def _add_details(self, info): 33 | dico = 'resource' in info and info['resource'] or info 34 | for (k, v) in dico.items(): 35 | setattr(self, k, v) 36 | 37 | 38 | class AgentsManager(base.ManagerWithFind): 39 | resource_class = Agent 40 | 41 | def list(self, hypervisor=None): 42 | """List all agent builds.""" 43 | url = "/os-agents" 44 | if hypervisor: 45 | url = "/os-agents?hypervisor=%s" % hypervisor 46 | return self._list(url, "agents") 47 | 48 | def _build_update_body(self, version, url, md5hash): 49 | return {'para': {'version': version, 50 | 'url': url, 51 | 'md5hash': md5hash}} 52 | 53 | def update(self, id, version, 54 | url, md5hash): 55 | """Update an existing agent build.""" 56 | body = self._build_update_body(version, url, md5hash) 57 | return self._update('/os-agents/%s' % id, body, 'agent') 58 | 59 | def create(self, os, architecture, version, 60 | url, md5hash, hypervisor): 61 | """Create a new agent build.""" 62 | body = {'agent': {'hypervisor': hypervisor, 63 | 'os': os, 64 | 'architecture': architecture, 65 | 'version': version, 66 | 'url': url, 67 | 'md5hash': md5hash}} 68 | return self._create('/os-agents', body, 'agent') 69 | 70 | def delete(self, id): 71 | """ 72 | Deletes an existing agent build. 73 | 74 | :param id: The agent's id to delete 75 | :returns: An instance of novaclient.base.TupleWithMeta 76 | """ 77 | return self._delete('/os-agents/%s' % id) 78 | -------------------------------------------------------------------------------- /novaclient/v2/assisted_volume_snapshots.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013, Red Hat, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | """ 16 | Assisted volume snapshots - to be used by Cinder and not end users. 17 | """ 18 | 19 | from oslo_serialization import jsonutils 20 | 21 | from novaclient import base 22 | 23 | 24 | class Snapshot(base.Resource): 25 | def __repr__(self): 26 | return "" % self.id 27 | 28 | def delete(self): 29 | """ 30 | Delete this snapshot. 31 | 32 | :returns: An instance of novaclient.base.TupleWithMeta 33 | """ 34 | return self.manager.delete(self) 35 | 36 | 37 | class AssistedSnapshotManager(base.Manager): 38 | resource_class = Snapshot 39 | 40 | def create(self, volume_id, create_info): 41 | body = {'snapshot': {'volume_id': volume_id, 42 | 'create_info': create_info}} 43 | return self._create('/os-assisted-volume-snapshots', body, 'snapshot') 44 | 45 | def delete(self, snapshot, delete_info): 46 | """ 47 | Delete a specified assisted volume snapshot. 48 | 49 | :param snapshot: an assisted volume snapshot to delete 50 | :param delete_info: Information for snapshot deletion 51 | :returns: An instance of novaclient.base.TupleWithMeta 52 | """ 53 | return self._delete("/os-assisted-volume-snapshots/%s?delete_info=%s" % 54 | (base.getid(snapshot), 55 | jsonutils.dumps(delete_info))) 56 | -------------------------------------------------------------------------------- /novaclient/v2/availability_zones.py: -------------------------------------------------------------------------------- 1 | # Copyright 2011 OpenStack Foundation 2 | # Copyright 2013 IBM Corp. 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | """ 18 | Availability Zone interface 19 | """ 20 | 21 | from novaclient import base 22 | 23 | 24 | class AvailabilityZone(base.Resource): 25 | """An availability zone object.""" 26 | NAME_ATTR = 'display_name' 27 | 28 | def __repr__(self): 29 | return "" % self.zoneName 30 | 31 | 32 | class AvailabilityZoneManager(base.ManagerWithFind): 33 | """Manage :class:`AvailabilityZone` resources.""" 34 | resource_class = AvailabilityZone 35 | return_parameter_name = "availabilityZoneInfo" 36 | 37 | def list(self, detailed=True): 38 | """Get a list of all availability zones. 39 | 40 | :param detailed: If True, list availability zones with details. 41 | :returns: list of :class:`AvailabilityZone` 42 | """ 43 | if detailed is True: 44 | return self._list("/os-availability-zone/detail", 45 | self.return_parameter_name) 46 | else: 47 | return self._list("/os-availability-zone", 48 | self.return_parameter_name) 49 | -------------------------------------------------------------------------------- /novaclient/v2/flavor_access.py: -------------------------------------------------------------------------------- 1 | # Copyright 2012 OpenStack Foundation 2 | # All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | # not use this file except in compliance with the License. You may obtain 6 | # a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations 14 | # under the License. 15 | 16 | """Flavor access interface.""" 17 | 18 | from novaclient import base 19 | from novaclient.i18n import _ 20 | 21 | 22 | class FlavorAccess(base.Resource): 23 | def __repr__(self): 24 | return ("" % 25 | (self.flavor_id, self.tenant_id)) 26 | 27 | 28 | class FlavorAccessManager(base.ManagerWithFind): 29 | """Manage :class:`FlavorAccess` resources.""" 30 | resource_class = FlavorAccess 31 | 32 | def list(self, **kwargs): 33 | # NOTE(mriedem): This looks a bit weird, you would normally expect this 34 | # method to just take a flavor arg, but it used to erroneously accept 35 | # flavor or tenant, but never actually implemented support for listing 36 | # flavor access by tenant. We leave the interface unchanged though for 37 | # backward compatibility. 38 | if kwargs.get('flavor'): 39 | return self._list('/flavors/%s/os-flavor-access' % 40 | base.getid(kwargs['flavor']), 'flavor_access') 41 | raise NotImplementedError(_('Unknown list options.')) 42 | 43 | def add_tenant_access(self, flavor, tenant): 44 | """Add a tenant to the given flavor access list.""" 45 | info = {'tenant': tenant} 46 | return self._action('addTenantAccess', flavor, info) 47 | 48 | def remove_tenant_access(self, flavor, tenant): 49 | """Remove a tenant from the given flavor access list.""" 50 | info = {'tenant': tenant} 51 | return self._action('removeTenantAccess', flavor, info) 52 | 53 | def _action(self, action, flavor, info, **kwargs): 54 | """Perform a flavor action.""" 55 | body = {action: info} 56 | self.run_hooks('modify_body_for_action', body, **kwargs) 57 | url = '/flavors/%s/action' % base.getid(flavor) 58 | resp, body = self.api.client.post(url, body=body) 59 | 60 | items = [self.resource_class(self, res) 61 | for res in body['flavor_access']] 62 | 63 | return base.ListWithMeta(items, resp) 64 | -------------------------------------------------------------------------------- /novaclient/v2/instance_usage_audit_log.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013 Rackspace Hosting 2 | # All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | # not use this file except in compliance with the License. You may obtain 6 | # a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations 14 | # under the License. 15 | 16 | from urllib import parse 17 | 18 | from novaclient import base 19 | 20 | 21 | class InstanceUsageAuditLog(base.Resource): 22 | pass 23 | 24 | 25 | class InstanceUsageAuditLogManager(base.Manager): 26 | resource_class = InstanceUsageAuditLog 27 | 28 | def get(self, before=None): 29 | """Get server usage audits. 30 | 31 | :param before: Filters the response by the date and time 32 | before which to list usage audits. 33 | """ 34 | if before: 35 | return self._get('/os-instance_usage_audit_log/%s' % 36 | parse.quote(before, safe=''), 37 | 'instance_usage_audit_log') 38 | else: 39 | return self._get('/os-instance_usage_audit_log', 40 | 'instance_usage_audit_logs') 41 | -------------------------------------------------------------------------------- /novaclient/v2/networks.py: -------------------------------------------------------------------------------- 1 | # Copyright 2012 OpenStack Foundation 2 | # All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | # not use this file except in compliance with the License. You may obtain 6 | # a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations 14 | # under the License. 15 | 16 | """ 17 | Network interface. 18 | """ 19 | from novaclient import base 20 | from novaclient import exceptions 21 | from novaclient.i18n import _ 22 | 23 | 24 | class Network(base.Resource): 25 | """ 26 | A network as defined in the Networking (Neutron) API. 27 | """ 28 | HUMAN_ID = True 29 | NAME_ATTR = "name" 30 | 31 | def __repr__(self): 32 | return "" % self.name 33 | 34 | 35 | class NeutronManager(base.Manager): 36 | """A manager for name -> id lookups for neutron networks. 37 | 38 | This uses neutron directly from service catalog. Do not use it 39 | for anything else besides that. You have been warned. 40 | """ 41 | 42 | resource_class = Network 43 | 44 | def find_network(self, name): 45 | """Find a network by name (user provided input).""" 46 | 47 | with self.alternate_service_type( 48 | 'network', allowed_types=('network',)): 49 | 50 | matches = self._list('/v2.0/networks?name=%s' % name, 'networks') 51 | 52 | num_matches = len(matches) 53 | if num_matches == 0: 54 | msg = "No %s matching %s." % ( 55 | self.resource_class.__name__, name) 56 | raise exceptions.NotFound(404, msg) 57 | elif num_matches > 1: 58 | msg = (_("Multiple %(class)s matches found for " 59 | "'%(name)s', use an ID to be more specific.") % 60 | {'class': self.resource_class.__name__.lower(), 61 | 'name': name}) 62 | raise exceptions.NoUniqueMatch(msg) 63 | else: 64 | matches[0].append_request_ids(matches.request_ids) 65 | return matches[0] 66 | -------------------------------------------------------------------------------- /novaclient/v2/server_external_events.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2014, Red Hat, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | """ 16 | External event triggering for servers, not to be used by users. 17 | """ 18 | 19 | from novaclient import base 20 | 21 | 22 | class Event(base.Resource): 23 | def __repr__(self): 24 | return "" % self.name 25 | 26 | 27 | class ServerExternalEventManager(base.Manager): 28 | resource_class = Event 29 | 30 | def create(self, events): 31 | """Create one or more server events. 32 | 33 | :param:events: A list of dictionaries containing 'server_uuid', 'name', 34 | 'status', and 'tag' (which may be absent) 35 | """ 36 | 37 | body = {'events': events} 38 | return self._create('/os-server-external-events', body, 'events', 39 | return_raw=True) 40 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["pbr>=5.7.0", "setuptools>=64.0.0", "wheel"] 3 | build-backend = "pbr.build" 4 | -------------------------------------------------------------------------------- /releasenotes/notes/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/python-novaclient/b2481a6f9739afe0e68327fc58c5bc208f69c052/releasenotes/notes/.placeholder -------------------------------------------------------------------------------- /releasenotes/notes/add-filter-to-nova-list-831dcbb34420fb29.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added the following filters support for the ``nova list`` command, 5 | these filters are admin-only restricted until microversion 2.82: 6 | 7 | * --availability-zone 8 | * --config-drive 9 | * --no-config-drive 10 | * --key-name 11 | * --power-state 12 | * --task-state 13 | * --vm-state 14 | * --progress 15 | 16 | Existing user filter will be available to non admin since 17 | `microversion 2.83`_. 18 | 19 | .. _microversion 2.83: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id76 20 | -------------------------------------------------------------------------------- /releasenotes/notes/add-osprofiler-support-cc9dd228242e9919.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | OSprofiler support was added to the client. That makes 4 | possible to trigger Nova operation trace generation from 5 | the CLI. 6 | features: 7 | - A new ``--profile`` option was added to allow Nova 8 | profiling from the CLI. If the user wishes to trace a 9 | nova boot request he or she needs to type the following 10 | command -- ``nova --profile boot --image 11 | --flavor ``, where ``secret_key`` should match one 12 | of the keys defined in nova.conf. As a result of this operation 13 | additional information regarding ``trace_id`` will be 14 | printed, that can be used to generate human-friendly 15 | html report -- ``osprofiler trace show --html --out 16 | trace.html``. 17 | To enable profiling, user needs to have osprofiler 18 | installed in the local environment via ``pip install osprofiler``. 19 | security: 20 | - OSprofiler support, that was added during the Ocata release cycle, 21 | requires passing of trace information between various 22 | OpenStack services. This information is signed by one of 23 | the HMAC keys defined in nova.conf file. That means that 24 | only someone who knows this key is able to send the proper 25 | header to trigger profiling. 26 | -------------------------------------------------------------------------------- /releasenotes/notes/add-support-for-volume-backed-rebuild-6a32d9d88fed6b4a.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.93`_. 5 | This microversion provides the ability to rebuild a volume 6 | backed instance. 7 | 8 | .. _microversion 2.93: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#microversion-2-93 9 | -------------------------------------------------------------------------------- /releasenotes/notes/add-user-agent-string-db77210dfd3ec671.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - novaclient now adds information about itself to the keystoneauth 4 | user-agent. Adding information about wrapping libraries or consuming 5 | applications can be found at 6 | https://docs.openstack.org/developer/python-novaclient/api.html 7 | -------------------------------------------------------------------------------- /releasenotes/notes/bp-add-locked-reason-3f136db97b820c73.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Added a ``--reason`` option to ``nova lock`` command that enables users 4 | to specify a reason when locking a server and a ``locked`` 5 | filtering/sorting option to ``nova list`` command which enables users to 6 | filter/sort servers based on their ``locked`` value in microversion 2.73. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/bp-cold-migration-with-target-queens-e361d4ae977aa396.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Added a new ``--host`` option to ``nova migrate`` command 4 | in microversion 2.56. It enables administrators to specify 5 | a target host when cold migating a server. The target host will be 6 | validated by the scheduler. The target host cannot be the same as 7 | the current host on which the server is running and must be in the 8 | same cell that the server is currently in. 9 | -------------------------------------------------------------------------------- /releasenotes/notes/bp-deprecate-image-meta-proxy-api-1483b75cf73b021e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - Starting from microversion 2.39 'image-metadata' proxy API in Nova is 4 | deprecated and python API bindings will not work, although 'image-meta' 5 | CLI commands will still work, because of the fallback on the CLI to 6 | version 2.35. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/bp-handling-down-cell-728cdb1efd1ea75b.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | From microversion 2.69 the results of ``nova list``, ``nova show`` and 5 | ``nova service-list`` may contain missing information in their outputs 6 | when there are partial infrastructure failure periods in the deployment. 7 | See `Handling Down Cells`_ for more information on the missing keys/info. 8 | 9 | .. _Handling Down Cells: https://developer.openstack.org/api-guide/compute/down_cells.html 10 | -------------------------------------------------------------------------------- /releasenotes/notes/bp-keypair-generation-removal-1b5d84a8906d3918.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Support has been added for `microversion 2.92`_. This microversion only 5 | accepts to import a public key and no longer to generate one, hence now the 6 | public_key parameter be mandatory. 7 | 8 | .. _microversion 2.92: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#microversion-2-92 9 | -------------------------------------------------------------------------------- /releasenotes/notes/bp-more-migration-list-filters-6c801896c7ee5cdc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The ``--migration-type`` and ``--source-compute`` options are added to the 5 | ``nova migration-list`` CLI and related kwargs are added to the 6 | ``novaclient.v2.migrations.MigrationManager.list`` method. These can be 7 | used to filter the list of migrations by type (evacuation, live-migration, 8 | migration, resize) and the name of the source compute service host involved 9 | in the migration. 10 | -------------------------------------------------------------------------------- /releasenotes/notes/bp-unshelve-to-host-b220131a00dff8a2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Support has been added for `microversion 2.91`_. This microversion 5 | allows specifying a destination host to unshelve a shelve 6 | offloaded server. And availability zone can be set to None to unpin 7 | the availability zone of a server. 8 | 9 | .. _microversion 2.91: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#microversion-2-91 10 | -------------------------------------------------------------------------------- /releasenotes/notes/bug-1669140-c21d045491201352.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | issues: 3 | - | 4 | The ``nova show`` command will no longer output the ``user_data`` column. 5 | This is traditionally binary data of limited value from a CLI perspective. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/bug-1744118-0b064d7062117317.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - | 4 | A fix is made for `bug 1744118`_ which adds the below missing CLI 5 | arguments. 6 | 7 | * OS_PROJECT_DOMAIN_ID 8 | 9 | * OS_PROJECT_DOMAIN_NAME 10 | 11 | * OS_USER_DOMAIN_ID 12 | 13 | * OS_USER_DOMAIN_NAME 14 | 15 | .. _bug 1744118: https://bugs.launchpad.net/python-novaclient/+bug/1744118 -------------------------------------------------------------------------------- /releasenotes/notes/bug-1764420-flavor-delete-output-7b80f73deee5a869.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The ``flavor-delete`` command no longer prints out the details of the 5 | deleted flavor. On successful deletion, there is no output. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/bug-1767287-cc28d60d9e59f9bd.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The ``nova server-group-create`` command now only supports specifying 5 | a single policy name when creating the server group. This is to match 6 | the server-side API validation. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/bug-1778536-a1b5d65a0d4ad622.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - The deprecated ``--bypass-url`` command line argument has been removed. 4 | deprecations: 5 | - | 6 | The ``--endpoint-override`` command line argument has been deprecated. 7 | It is renamed to ``--os-endpoint-override`` to avoid misinterpreting 8 | command line arguments. 9 | It defaults to the ``OS_ENDPOINT_OVERRIDE`` environment variable. 10 | See `bug 1778536`_ for more details. 11 | 12 | .. _bug 1778536: https://bugs.launchpad.net/python-novaclient/+bug/1778536 13 | -------------------------------------------------------------------------------- /releasenotes/notes/bug-1825061-2beb95db4d6df0cb.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - | 4 | A check for a value of the '--config-drive' option has been added on the 5 | ``nova boot`` command. A boolean value is only allowed in the option now. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/bug-1845322-463ee407b60131c9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The ``--hint`` option for the ``boot`` command expects a key-value 5 | argument. Previously, if this was not the case, the argument would be 6 | silently ignored. It will now raise an error. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/clarify-project-id-variable-5832698315000438.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - Keyword argument **tenant_id** of novaclient.client.Client entry-point was 4 | deprecated in favor of **project_id**. 5 | - Keyword argument **tenant_name** of novaclient.client.Client entry-point 6 | was deprecated in favor of **project_name**. 7 | other: 8 | - The meaning of 'project_id' variable of novaclient.client.Client 9 | entry-point was not clear. In different cases it was used as ID or Name of 10 | project (in terms of Keystone). The time to identify meaning is come, so 11 | now project_id/tenant_id variables specifically mean Project ID (in terms 12 | of Keystone) and project_name/tenant_name variables mean Project Name (in 13 | terms of Keystone). 14 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-agent-d0f58718ad1782f6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The following CLIs are deprecated. 5 | 6 | - ``nova agent-create`` 7 | - ``nova agent-delete`` 8 | - ``nova agent-list`` 9 | - ``nova agent-modify`` 10 | 11 | The CLIs will be removed in the first major release after Nova 24.0.0 X 12 | is released. 13 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-baremetal-d67f58a2986b3565.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The following CLIs and python API bindings are now deprecated for removal: 5 | 6 | * nova baremetal-node-list 7 | * nova baremetal-node-show 8 | * nova baremetal-interface-list 9 | 10 | These will be removed in the first major python-novaclient release after 11 | the Nova 15.0.0 Ocata release. Use python-ironicclient or 12 | python-openstackclient for CLI and python-ironicclient or openstacksdk 13 | for python API bindings. 14 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-cellsv1-extension-16482759993d112f.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The following CLIs and their backing API bindings are deprecated. 5 | 6 | - ``nova list-extensions`` 7 | - ``nova cell-capacities`` 8 | - ``nova cell-show`` 9 | 10 | The CLIs and API bindings will be removed in the first major release after 11 | Nova 20.0.0 Train is released. 12 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-certs-1558d8e3b7888938.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``nova x509-create-cert`` and ``nova x509-get-root-cert`` commands 5 | and ``novaclient.v2.certs`` API binding are now deprecated and will be 6 | removed in the first major release after the Nova server 16.0.0 Pike 7 | release. 8 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-cli-75074850847a8452.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``nova`` CLI is now deprecated. This is the signal that it is 5 | time to start using the openstack CLI. No new features will be 6 | added to the ``nova`` CLI, though fixes to the CLI will be assessed 7 | on a case by case basis. Fixes to the API bindings, development of 8 | new API bindings, and changes to the compute commands in the openstack 9 | CLI are exempt from this deprecation. 10 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-cloudpipe-670202797fdf97b6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The os-cloudpipe API has been removed from Nova. As a result, the 5 | ``nova cloudpipe-list``, ``nova cloudpipe-create``, and ``nova 6 | cloudpipe-configure`` commands and the ``novaclient.v2.cloudpipe`` 7 | API bindings are now deprecated, and will be removed in the first 8 | major release after the Nova server 16.0.0 Pike release. 9 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-connection-pool-arg-cef35346d5ebf40c.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - The **connection_pool** variable is deprecated now and will be ignored. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-force-option-7116d792bba17f09.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | Added support for `microversion 2.68`_, which removes the ``--force`` option 5 | from the ``nova evacuate``, ``nova live-migration``, ``nova host-evacuate`` 6 | and ``nova host-evacuate-live`` commands. 7 | 8 | .. _microversion 2.68: https://docs.openstack.org/nova/latest/api_microversion_history.html#id61 9 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-instance-name-option-bc76629d28f1d456.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``--instance-name`` option has been deprecated from the ``nova list`` 5 | command because the instance name query parameter is ignored by the 6 | compute REST API. 7 | 8 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-network-cli-f0a539528be594d3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The ability to update the following network-related resources via the 5 | ``nova quota-update`` and ``nova quota-class-update`` commands is now 6 | deprecated: 7 | 8 | * Fixed IPs 9 | * Floating IPs 10 | * Security Groups 11 | * Security Group Rules 12 | 13 | By default the quota and limits CLIs will not update or show those 14 | resources using microversion >= 2.36. You can still use them, however, by 15 | specifying ``--os-compute-api-version 2.35``. Quota information for network 16 | resources should be retrieved from python-neutronclient or 17 | python-openstackclient. 18 | deprecations: 19 | - | 20 | The following commands are now deprecated: 21 | 22 | * dns-create 23 | * dns-create-private-domain 24 | * dns-create-public-domain 25 | * dns-delete 26 | * dns-delete-domain 27 | * dns-domains 28 | * dns-list 29 | * fixed-ip-get 30 | * fixed-ip-reserve 31 | * fixed-ip-unreserve 32 | * floating-ip-create 33 | * floating-ip-delete 34 | * floating-ip-list 35 | * floating-ip-pool-list 36 | * floating-ip-bulk-create 37 | * floating-ip-bulk-delete 38 | * floating-ip-bulk-list 39 | * network-create 40 | * network-delete 41 | * network-disassociate 42 | * network-associate-host 43 | * network-associate-project 44 | * network-list 45 | * network-show 46 | * scrub 47 | * secgroup-create 48 | * secgroup-delete 49 | * secgroup-list 50 | * secgroup-update 51 | * secgroup-add-group-rule 52 | * secgroup-delete-group-rule 53 | * secgroup-add-rule 54 | * secgroup-delete-rule 55 | * secgroup-list-rules 56 | * secgroup-list-default-rules 57 | * secgroup-add-default-rule 58 | * secgroup-delete-default-rule 59 | * tenant-network-create 60 | * tenant-network-delete 61 | * tenant-network-list 62 | * tenant-network-show 63 | 64 | With the 2.36 microversion these will fail in the API. The CLI will 65 | fallback to passing the 2.35 microversion to ease the transition. Network 66 | resource information should be retrieved from python-neutronclient or 67 | python-openstackclient. 68 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-no-cache-arg-7814806b4f79c1b9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - novaclient.client.Client entry-point accepted two arguments with same 4 | meaning (**no_cache** and **os_cache**). Since **os_cache** is more widely 5 | used in our code, **no_cache** was deprecated. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-proxy-args-a3f4e224f7664ff8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - The **proxy_tenant_id** and **proxy_token** arguments to the 4 | novaclient.client.Client entry-point were never documented nor tested and 5 | are now deprecated for removal in a future release. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-service-binary-arg-2d5c446f5a2409a7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``binary`` argument to the ``nova service-enable``, 5 | ``nova service-disable``, and ``nova service-force-down`` commands has been 6 | deprecated. The only binary that it makes sense to use is ``nova-compute`` 7 | since disabling a service like ``nova-scheduler`` or ``nova-conductor`` 8 | does not actually do anything, and starting in the 16.0.0 Pike release the 9 | compute API will not be able to look up services other than 10 | ``nova-compute`` for these operations. 11 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-volume-service-name-arg-4c65e8866f9624dd.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - CLI argument for volume_service_name was deprecated long time ago. All 4 | novaclient's methods for communication with Volume API were deprecated and 5 | removed. There is no need to leave **volume_service_name** argument of 6 | novaclient.client.Client entry-point since it is not used anywhere, 7 | so it is removed now. 8 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_cell_name_arg-eb34cb7c43cfcb89.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - CLI argument ``--cell_name`` for ``nova migration-list`` command is 4 | deprecated. Nova API does not have logic for handling cell_name 5 | parameter in **os-migrations**, and while the parameter is passed to Nova 6 | it has never been used. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_contrib_extensions-0ec70c070b09eedb.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | All extensions of API V2.0 were merged to 2.1, but NovaClient continued 4 | to store them as a separate entities. 5 | upgrade: 6 | - All managers and resources from novaclient.v2.contrib submodules are moved 7 | to appropriate submodules of novaclient.v2 (except barametal and 8 | tenant_networks, which were deprecated previously) 9 | - All shell commands from novaclient.v2.contrib submodules are moved to 10 | novaclient.v2.shell module. 11 | - novaclient.v2.client.Client imports all modules (which were located in 12 | submodules of novaclient.v2.contrib) by-default for api version v2 13 | - Method novaclient.client.discover_extensions returns only barametal and 14 | tenant_networks extensions, since they are not included by default. 15 | - There are no modules and extensions for "deferred_delete", "host_evacuate", 16 | "host_evacuate_live" and "metadata_extensions" anymore. Previously, they 17 | contained only shell commands and shell module auto loads them (there is 18 | no ability to not do it). 19 | deprecations: 20 | - All modules of novaclient.v2.contrib are deprecated now and will be 21 | removed after OpenStack Pike. 22 | -------------------------------------------------------------------------------- /releasenotes/notes/drop-deprecated-aggregate-update-args-17bd019f4be34b18.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The deprecated `name` and `availability_zone` positional arguments in 5 | the ``nova aggregate-update`` command have been removed. Use the 6 | ``--name`` and ``--availability-zone`` options instead. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/drop-python2-support-d3a1bedc75445edc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | Python 2 is no longer supported. Python 3 is required. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/fix-booting-with-multiple-nics-c6e5885b948d35ba.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - Fix an ability to boot server with multiple nics which was broken with 4 | microversion 2.42 (fix tag attribute disappearing). 5 | -------------------------------------------------------------------------------- /releasenotes/notes/fix-raw-python-error-debd3edb17c2f675.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - | 4 | `Bug #1903727 `_: 5 | Fixed raw Python error message when using ``nova`` without 6 | a subcommand while passing an optional argument, such as 7 | ``--os-compute-api-version 2.87``. 8 | -------------------------------------------------------------------------------- /releasenotes/notes/fix-rebuild-userdata-9315e5784feb8ba9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - | 4 | The user data argument in the ``nova rebuild`` command was passing 5 | the filename as userdata. Now this passes the contents of the file 6 | as intended. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/fix-tag-attribute-disappearing-25483a80f548ef35.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - | 4 | Microversion 2.42 is related to the following bug. 5 | 6 | * https://bugs.launchpad.net/nova/+bug/1658571 7 | 8 | The following options have been changed as of Microversion 2.42. 9 | 10 | * Remove ``tag`` attribute in ``--block-device`` option 11 | on the server boot (nova boot) between microversion 2.33 and 2.41. 12 | * Remove ``tag`` attribute in ``--nic`` option 13 | on the server boot (nova boot) between microversion 2.37 and 2.41. 14 | -------------------------------------------------------------------------------- /releasenotes/notes/fix-token-auth-6c48c63a759f51d5.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - Fix an ability to authenticate using Keystone Token which was broken with 4 | novaclient 7.0.0 release. 5 | 6 | -------------------------------------------------------------------------------- /releasenotes/notes/fixed-ListExtResource-given-in-place-of-ListExtManager-a759a27079d16a44.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - | 4 | The contents of the list_extensions.py file was moved from contrib to v2 5 | directory in release 7.0.0, and a stub importing the objects from the new 6 | location was left in its place for backward compatibility, together with 7 | a warning informing about the new location. However, the stub incorrectly 8 | assigned the ListExtResource class to the ListExtManager name. This has 9 | now been fixed, and ListExtManager is used instead. 10 | -------------------------------------------------------------------------------- /releasenotes/notes/get-list-metadata-8afcc8f32ad82dda.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Adds supports for Nova Server get and list metadata API. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/get-rid-off-redundant-methods-47e679c13e88f28a.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | ``novaclient.utils.add_resource_manager_extra_kwargs_hook`` and 5 | ``novaclient.utils.get_resource_manager_extra_kwargs`` were designed for 6 | supporting extensions in nova/novaclient. Nowadays, this "extensions" 7 | feature is abandoned and both ``add_resource_manager_extra_kwargs_hook``, 8 | ``add_resource_manager_extra_kwargs_hook`` are not used in novaclient's 9 | code. These methods are not documented, so we are removing them without 10 | standard deprecation cycle. 11 | -------------------------------------------------------------------------------- /releasenotes/notes/global_request_id-26f4e4301f84d403.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | A new ``global_request_id`` parameter is accepted on the client 5 | constructor, which will then pass ``X-OpenStack-Request-ID`` on 6 | all requests made. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/image-api-deprecation-41944dc6fc024918.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The following CLIs and python API bindings are now deprecated for removal: 5 | 6 | * nova image-delete 7 | * nova image-list 8 | * nova image-meta 9 | * nova image-show 10 | 11 | These will be removed in the first major python-novaclient release after 12 | the Nova 15.0.0 Ocata release. Use python-glanceclient or 13 | python-openstackclient for CLI and python-glanceclient or openstacksdk 14 | for python API bindings. 15 | -------------------------------------------------------------------------------- /releasenotes/notes/instance-uuid-flag-in-migration-list-5d2fed7657d3def5.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | A new ``--instance-uuid`` option is added to ``nova migration-list`` 5 | command. This is used to query the migration history of a specific server 6 | by the migration-list command. Please use ``nova server-migration-list`` 7 | command for querying in-progress migrations of a specific server. 8 | -------------------------------------------------------------------------------- /releasenotes/notes/interface-attach-output-02d633d9b2a60da1.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - The ``nova interface-attach`` command shows output of its result 4 | when it is successful. 5 | - | 6 | The following methods return a ``NetworkInterface`` object 7 | instead of a ``Server`` object. 8 | 9 | * The ``interface_attach`` method in the ``novaclient.v2.Server`` class 10 | * The ``interface_attach`` method in the ``novaclient.v2.ServerManager`` 11 | class 12 | -------------------------------------------------------------------------------- /releasenotes/notes/keystoneauth-8ec1e6be14cdbae3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - keystoneauth plugins are now supported. 4 | upgrade: 5 | - novaclient now requires the keystoneauth library. 6 | deprecations: 7 | - novaclient auth strategy plugins are deprecated. Please use 8 | keystoneauth auth plugins instead. 9 | - nova credentials is deprecated. Please use openstack token issue 10 | - nova endpoints is deprecated. Please use openstack catalog list 11 | instead. 12 | -------------------------------------------------------------------------------- /releasenotes/notes/log-request-id-ce106497e0520fad.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | - Log 'x-openstack-request-id' or 'x-compute-request-id' 4 | in each API call. If the caller (e.g. heat) uses oslo.log, 5 | the caller's request id in oslo.context and the callee's 6 | request id can be output in the same log message (same line). 7 | features: 8 | - Log 'x-openstack-request-id' or 'x-compute-request-id' 9 | in each API call. If the caller (e.g. heat) uses oslo.log, 10 | the caller's request id in oslo.context and the callee's 11 | request id can be output in the same log message (same line). 12 | -------------------------------------------------------------------------------- /releasenotes/notes/make-console-public-0c776bfda240cd9d.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Provides a public unified interface 'get_console_url' for classes 4 | 'novaclient.v2.servers.Server' and 'novaclient.v2.servers.ServerManager'. 5 | Users (Heat, OpenStack-client and etc.) can call this public interface 6 | instead of calling the individual methods to retrieve a console url 7 | of a particular protocol. 8 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-2.37-d03da96406a45e67.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The 2.37 microversion is now supported. This introduces the following 5 | changes: 6 | 7 | * CLI: The **--nic** value for the **nova boot** command now takes two 8 | special values, 'auto' and 'none'. If --nic is not specified, the 9 | CLI defaults to 'auto'. 10 | * Python API: The **nics** kwarg is required when creating a server using 11 | the *novaclient.v2.servers.ServerManager.create* API. The **nics** 12 | value can be a list of dicts or a string with value 'auto' or 13 | 'none'. 14 | 15 | upgrade: 16 | - | 17 | With the 2.37 microversion, the **nics** kwarg is required when creating 18 | a server using the *novaclient.v2.servers.ServerManager.create* API. The 19 | **nics** value can be a list of dicts or an enum string with one of the 20 | following values: 21 | 22 | * **auto**: This tells the Compute service to automatically allocate a 23 | network for the project if one is not available and then associate 24 | an IP from that network with the server. This is the same behavior as 25 | passing nics=None before the 2.37 microversion. 26 | * **none**: This tells the Compute service to not allocate any networking 27 | for the server. 28 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_28-abf653ae5cf5c4a9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - Support v2.28 microversion 4 | - cpu_info property of hypervisor resource is a json now (previously it was 5 | text). 6 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_31-3e1a16eb5eb53f59.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - Support for microversion 2.31 which fixes a bug in the 4 | os-console-auth-tokens API 5 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_33-10d12ea3b25839e8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Added microversion v2.33 that adds pagination support for hypervisors with 4 | the help of new optional parameters 'limit' and 'marker' which were added 5 | to hypervisor-list command. -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_34-a9c5601811152964.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - Support for microversion 2.34 added. -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_35-537619a43278fbb5.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Added microversion v2.35 that adds pagination support for keypairs with 4 | the help of new optional parameters 'limit' and 'marker' which were added 5 | to keypair-list command. -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_38-0618fe2b3c7f96f9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - Support for microversion 2.38 added. As of microversion 2.38, invalid 4 | statuses passed to ``nova list --status invalid_status`` will result in a 5 | HTTP 400 Bad Request error response. -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_40-484adba0806b08bf.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Added microversion v2.40 which introduces pagination support for usage 4 | with the help of new optional parameters 'limit' and 'marker'. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_41-6df7a5a66a9ded35.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for microversion 2.41 which shows the aggregate UUID in CLI 5 | output when listing, creating, showing, updating, setting metadata, and 6 | adding or removing hosts from an aggregate. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_43-76db2ac463b431e4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The following CLIs and their backing API bindings are deprecated and capped 5 | at microversion 2.43: 6 | 7 | * ``nova host-describe`` - superseded by ``nova hypervisor-show`` 8 | * ``nova host-list`` - superseded by ``nova hypervisor-list`` 9 | * ``nova host-update`` - superseded by ``nova service-enable`` and 10 | ``nova service-disable`` 11 | * ``nova host-action`` - no alternative by design 12 | 13 | The CLIs and API bindings will be removed in the first major release after 14 | Nova 16.0.0 Pike is released. 15 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_44-d60c8834e436ad3d.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The following CLIs and their backing API bindings are deprecated and capped 5 | at microversion 2.44: 6 | 7 | * ``nova add-fixed-ip``: use python-neutronclient or openstacksdk 8 | * ``nova remove-fixed-ip``: use python-neutronclient or openstacksdk 9 | * ``nova floating-ip-associate``: use python-neutronclient or openstacksdk 10 | * ``nova floating-ip-disassociate``: use python-neutronclient or 11 | openstacksdk 12 | * ``nova virtual-interface-list``: there is no replacement as this is 13 | only implemented for nova-network which is deprecated 14 | 15 | The CLIs and API bindings will be removed in the first major release after 16 | Nova 16.0.0 Pike is released. 17 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_45-1bfcae3914280534.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Support was added for microversion 2.45. This changes how the 5 | ``createImage`` and ``createBackup`` server action APIs return 6 | the created snapshot image ID in the response. With microversion 7 | 2.45 and later, the image ID is return in a json dict response body 8 | with an ``image_id`` key and uuid value. The old ``Location`` response 9 | header is no longer returned in microversion 2.45 or later. 10 | 11 | There are no changes to the ``nova image-create`` CLI. However, the 12 | ``nova backup`` CLI will print out the backup snapshot image information 13 | with microversion 2.45 or greater now. 14 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_47-4aa54fbbd519e421.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for microversion 2.47 which returns the flavor details 5 | directly embedded in the server details when listing or showing servers. 6 | With this change, CLI requests with microversion >= 2.47 will no longer 7 | need to do additional queries to get the flavor and flavor extra_specs 8 | information. Instead, the flavor information will be output as 9 | separate key/value pairs with the keys namespaced with the 10 | "flavor:" prefix. As one would expect, these keys can also be 11 | specified as output fields when listing servers, like this: 12 | 13 | ``nova list --fields name,flavor:original_name`` 14 | 15 | When displaying details of a single server, the ``--minimal`` option will 16 | display a ``flavor`` field with a value of the ``original_name`` of the 17 | flavor. Prior to this microversion the value was the ``id`` of the flavor. 18 | 19 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_49-56bde596ee13366d.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for microversion 2.49 that enables users to 5 | attach tagged interfaces and volumes. 6 | A new ``--tag`` option is added to ``nova volume-attach`` and 7 | ``nova interface-attach`` commands. 8 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_50-4f484658d66d01aa.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - | 4 | Adds support for the ``2.50`` microversion which fixes the 5 | ``nova quota-class-show`` and ``nova quota-class-update`` commands in the 6 | following ways: 7 | 8 | * The ``server_groups`` and ``server_group_members`` quota resources will 9 | now be shown in the output table for ``nova quota-class-show``. 10 | * The ``floating_ips``, ``fixed_ips``, ``security_groups`` and 11 | ``security_group_rules`` quota resources will no longer be able to 12 | be updated using ``nova quota-class-update`` nor will they be shown in 13 | the output of ``nova quota-class-show``. Use python-openstackclient or 14 | python-neutronclient to work with quotas for network resources. 15 | 16 | In addition, the ``nova quota-class-update`` CLI was previously incorrectly 17 | limiting the ability to update quota class values for ``floating_ips``, 18 | ``fixed_ips``, ``security_groups`` and ``security_group_rules`` based on 19 | the 2.36 microversion. That has been changed to limit based on the ``2.50`` 20 | microversion. 21 | upgrade: 22 | - | 23 | The ``novaclient.v2.quota_classes.QuotaClassSetManager.update`` method 24 | now defines specific kwargs starting with microversion ``2.50`` since 25 | updating network-related resource quota class values is not supported on 26 | the server with microversion ``2.50``. The list of excluded resources is: 27 | 28 | - ``fixed_ips`` 29 | - ``floating_ips`` 30 | - ``networks`` 31 | - ``security_groups`` 32 | - ``security_group_rules`` 33 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_52-2fe81b3bf2e4b4ea.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | `Microversion 2.52`_ is now supported which adds the ``--tags`` option to 5 | the ``nova boot`` command and a ``tags`` kwarg to the 6 | ``novaclient.v2.servers.ServerManager.create()`` python API binding method. 7 | 8 | .. _Microversion 2.52: https://docs.openstack.org/nova/latest/api_microversion_history.html#id47 9 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_53-3463b546a38c5f84.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.53`_. The following changes were made 5 | for the ``services`` commands and python API bindings: 6 | 7 | - The ``nova service-list`` command and API will have a UUID value for the 8 | ``id`` field in the output and response, respectively. 9 | - The ``nova service-enable`` command and API will require a UUID service 10 | id value to uniquely identify the service rather than a ``host`` and 11 | ``binary`` value. The UUID ``id`` field will also be in the command 12 | output. 13 | - The ``nova service-disable`` command and API will require a UUID service 14 | id value to uniquely identify the service rather than a ``host`` and 15 | ``binary`` value. The UUID ``id`` field will also be in the command 16 | output. 17 | - The ``nova service-force-down`` command and API will require a UUID 18 | service id value to uniquely identify the service rather than a ``host`` 19 | and ``binary`` value. The UUID ``id`` field will also be in the command 20 | output. 21 | - The ``nova service-delete`` command and API will require a UUID 22 | service id value to uniquely identify the service rather than an integer 23 | service id value. 24 | 25 | The following changes were made for the ``hypervisors`` commands and python 26 | API bindings: 27 | 28 | - The ID field in the various ``nova hypervisor-*`` commands and 29 | ``Hypervisor.id`` attribute in the API binding will now be a UUID value. 30 | - If paging over hypervisors using ``nova hypervisor-list``, the 31 | ``--marker`` must be a UUID value. 32 | - The ``nova hypervisor-show`` and ``nova hypervisor-uptime`` commands and 33 | APIs now take a UUID value for the hypervisor ID. 34 | 35 | .. _microversion 2.53: https://docs.openstack.org/nova/latest/api_microversion_history.html#id48 36 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_54-6c7ccb61eff6cb6d.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Adds support for microversion 2.54 which adds resetting keypair and 5 | unsetting keypair in rebuild operation. 6 | Adds optional ``--key-name`` and ``--key-unset`` options 7 | in the ``nova rebuild`` command. 8 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_55-flavor-description-a93718b31f1f0f39.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Support is added for compute API version 2.55. This adds the ability 5 | to create a flavor with a description, show the description of a flavor, 6 | and update the description on an existing flavor. 7 | 8 | A new ``nova flavor-update `` command is added. 9 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_57-acae2ee11ddae4fb.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Support is added for the 2.57 microversion: 5 | 6 | * A ``userdata`` keyword argument can be passed to the ``Server.rebuild`` 7 | python API binding. If set to None, it will unset any existing userdata 8 | on the server. 9 | * The ``--user-data`` and ``--user-data-unset`` options are added to the 10 | ``nova rebuild`` CLI. The options are mutually exclusive. Specifying 11 | ``--user-data`` will overwrite the existing userdata in the server, and 12 | ``--user-data-unset`` will unset any existing userdata on the server. 13 | upgrade: 14 | - | 15 | Support is added for the 2.57 microversion: 16 | 17 | * The ``--file`` option for the ``nova boot`` and ``nova rebuild`` CLIs is 18 | capped at the 2.56 microversion. Similarly, the ``file`` parameter to 19 | the ``Server.create`` and ``Server.rebuild`` python API binding methods 20 | is capped at 2.56. Users are recommended to use the ``--user-data`` 21 | option instead. 22 | * The ``--injected-files``, ``--injected-file-content-bytes`` and 23 | ``--injected-file-path-bytes`` options are capped at the 2.56 24 | microversion in the ``nova quota-update`` and ``nova quota-class-update`` 25 | commands. 26 | * The ``maxPersonality`` and ``maxPersonalitySize`` fields are capped at 27 | the 2.56 microversion in the ``nova limits`` command and API binding. 28 | * The ``injected_files``, ``injected_file_content_bytes`` and 29 | ``injected_file_path_bytes`` entries are capped at version 2.56 from 30 | the output of the ``nova quota-show`` and ``nova quota-class-show`` 31 | commands and related python API bindings. 32 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_58-327c1031ebfe4a3a.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for microversion v2.58 which introduces pagination support 5 | for instance actions with the help of new optional parameters ``limit``, 6 | ``marker``, and also adds the new filter ``changes-since``. Users can use 7 | ``changes-since`` filter to filter the results based on the last time the 8 | instance action was updated. 9 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_59-4160c852d7d8812d.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for microversion v2.59 which introduces pagination support 5 | for migrations with the help of new optional parameters ``limit``, 6 | ``marker``, and also adds the new filter ``changes-since``. Users can use 7 | ``changes-since`` filter to filter the results based on the last time the 8 | migration was updated. 9 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_61-9a8faa02fddf9ed6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | other: 3 | - | 4 | Starting from microversion 2.61, the responses of the 'Flavor' APIs 5 | include the 'extra_specs' parameter. Therefore 'Flavors extra-specs' 6 | (os-extra_specs) API calls have been removed in the following commands 7 | since microversion 2.61. 8 | 9 | * ``nova flavor-list`` 10 | * ``nova flavor-show`` 11 | 12 | There are no behavior changes in the CLI. This is just a performance 13 | optimization. 14 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_62-479a23f0d4307500.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Adds support for microversion 2.62 which adds ``host`` (hostname) 5 | and ``hostId`` (an obfuscated hashed host id string) fields to the 6 | instance action ``GET /servers/{server_id}/os-instance-actions/{req_id}`` 7 | API. 8 | 9 | The event columns are already included in the result of 10 | "nova instance-action " command, therefore does not 11 | have any CLI or python API binding impacts in the client. 12 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_63-cd058a9145550cae.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.63`_, which includes the following 5 | changes: 6 | 7 | - New environment variable called ``OS_TRUSTED_IMAGE_CERTIFICATE_IDS`` 8 | - New ``nova boot`` option called ``--trusted-image-certificate-id`` 9 | - New ``nova rebuild`` options called ``--trusted-image-certificate-id`` 10 | and ``--trusted-image-certificates-unset`` 11 | - New kwarg called ``trusted_image_certificates`` added to python API 12 | bindings: 13 | 14 | - ``novaclient.v2.servers.ServerManager.create()`` 15 | - ``novaclient.v2.servers.ServerManager.rebuild()`` 16 | 17 | .. _microversion 2.63: https://docs.openstack.org/nova/latest/api_microversion_history.html#id57 18 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_64-66366829ec65bea4.yaml.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.64`_, which includes the following 5 | changes: 6 | 7 | * The ``--rule`` options is added to the ``nova server-group-create`` 8 | CLI that enables user to create server group with specific policy rules. 9 | * Remove ``metadata`` column in the output of ``nova server-group-create``, 10 | ``nova server-group-get``, ``nova server-group-list``. 11 | * Remove ``policies`` column, add ``policy`` and ``rules`` columns in 12 | the output of ``nova server-group-create``, ``nova server-group-get``, 13 | ``nova server-group-list``. 14 | 15 | .. _microversion 2.64: https://docs.openstack.org/nova/latest/api_microversion_history.html#id58 16 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_65-3c89c5932f4391cb.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Support has been added for the compute API `2.65`_ microversion. This 5 | allows calling ``nova live-migration-abort`` on live migrations that are 6 | in ``queued`` or ``preparing`` status in addition to the already accepted 7 | ``running`` status. 8 | 9 | .. _2.65: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id59 10 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_66-cda5d6dc31b56b46.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.66`_ which adds ``changes-before`` 5 | parameter to the servers, os-instance-actions or os-migrations APIs. 6 | 7 | * This parameter (``changes-before``) does not change any read-deleted 8 | behavior in the os-instance-actions or os-migrations APIs. 9 | * Like the ``changes-since`` filter, the ``changes-before`` filter will 10 | also return deleted servers. 11 | * The ``--changes-before`` options is added to the ``nova list``, 12 | ``nova instance-action-list`` and ``nova migration-list`` CLIs. 13 | 14 | .. _microversion 2.66: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id59 15 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_67-da6d9b12730b8562.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Support is added for the `2.67 microversion`_ which allows specifying 5 | a ``volume_type`` with the ``--block-device`` option on the ``nova boot`` 6 | command. The ``novaclient.v2.servers.ServerManager.create()`` method now 7 | also supports a ``volume_type`` entry in the ``block_device_mapping_v2`` 8 | parameter. 9 | 10 | .. _2.67 microversion: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id60 11 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_71-a87b4bb4205c46e2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.71`_ which outputs the `server_groups` 5 | field in the following commands: 6 | 7 | * ``nova show`` 8 | * ``nova rebuild`` 9 | 10 | .. _microversion 2.71: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id64 11 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_72-d910ce07ec3948d6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Support has been added for `microversion 2.72`_. This microversion 5 | allows creating a server using the ``nova boot`` command with 6 | pre-existing ports having a ``resource_request`` value to enable 7 | features such as guaranteed minimum bandwidth for `quality of service`_. 8 | 9 | .. _microversion 2.72: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id65 10 | .. _quality of service: https://docs.openstack.org/neutron/latest/admin/config-qos.html 11 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_74-43b128fe6b84b630.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Support is added for the `2.74 microversion`_ which allows specifying the 5 | ``--host`` and ``--hypervisor-hostname`` options on the ``nova boot`` 6 | command. The ``novaclient.v2.servers.ServerManager.create()`` method now 7 | also supports ``host`` and ``hypervisor_hostname`` parameters. 8 | 9 | .. _2.74 microversion: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id66 10 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_75-ea7fa3ba1396edea.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.75`_. The following changes were made: 5 | 6 | - Return all fields of ``server`` in ``nova rebuild`` command which are 7 | returned in ``nova show``. Both command will return the same set of 8 | fields of ``server`` representation. 9 | 10 | - Default return value of ``swap`` field will be 0 (integer) in below 11 | commands: 12 | 13 | - ``nova flavor-list`` 14 | - ``nova flavor-show`` 15 | - ``nova flavor-create`` 16 | - ``nova flavor-update`` 17 | 18 | .. _microversion 2.75: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id67 19 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_77-ffee30c180aa4dbe.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Support has been added for `microversion 2.77`_. This microversion 5 | allows specifying an availability zone to unshelve a shelve 6 | offloaded server. 7 | 8 | .. _microversion 2.77: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id69 9 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_78-77a12630e668c2ae.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.78`_ which outputs the server NUMA 5 | topology information in the following command: 6 | 7 | * ``nova server-topology`` 8 | 9 | And associated python API bindings: 10 | 11 | * ``novaclient.v2.servers.Server.topology`` 12 | * ``novaclient.v2.servers.ServerManager.topology`` 13 | 14 | .. _microversion 2.78: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id70 15 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_79-f13bc0414743dc16.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.79`_ which includes the following 5 | changes: 6 | 7 | - The ``--delete-on-termination`` option is added to the 8 | ``nova volume-attach`` CLI. 9 | - A ``DELETE ON TERMINATION`` column is added to the 10 | ``nova volume-attachments`` table. 11 | - New kwarg called ``delete_on_termination`` added to the python API 12 | binding: 13 | 14 | - ``novaclient.v2.volumes.VolumeManager.create_server_volume()`` 15 | 16 | .. _microversion 2.79: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id71 17 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_80-c2394316f9212865.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.80`_ which adds ``user_id`` 5 | and ``project_id`` filter parameters to the ``GET /os-migrations`` API. 6 | 7 | New kwargs ``project_id`` and ``user_id`` have been added to 8 | the following python API binding: 9 | 10 | - novaclient.v2.migrations.MigrationManager.list 11 | 12 | The following CLI changes have been made: 13 | 14 | - The ``--project-id`` and ``--user-id`` options are added to the 15 | ``nova migration-list`` CLI. 16 | - The ``nova server-migration-list`` and ``nova server-migration-show`` 17 | commands will show the ``Project ID`` and ``User ID`` values when 18 | using microversion 2.80 or greater. 19 | 20 | .. _microversion 2.80: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id72 21 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_81-3ddd8e2fc7e45030.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.81`_ which adds image pre-caching support by 5 | aggregate. 6 | 7 | - The ``aggregate-cache-images`` command is added to the CLI 8 | - The ``cache_images()`` method is added to the python API binding 9 | 10 | .. _microversion 2.81: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id73 11 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_85-230931f88c4f1d52.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Support is added for compute API `microversion 2.85`_. This adds the 5 | ability to update an attached volume with a ``delete_on_termination``, 6 | which specify if the attached volume should be deleted when the server 7 | is destroyed. 8 | 9 | - The ``--delete-on-termination`` and ``--no-delete-on-termination`` 10 | options are added to the ``nova volume-update`` CLI. 11 | - New kwarg called ``delete_on_termination`` added to the python API 12 | binding: 13 | 14 | - ``novaclient.v2.volumes.VolumeManager.update_server_volume()`` 15 | 16 | .. _microversion 2.85: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id78 17 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_88-d91136020e3a3621.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.88`_. The 5 | ``novaclient.v2.hypervisors.HypervisorManager.uptime`` method will now 6 | transparently switch between the ``/os-hypervisors/{id}/uptime`` API, 7 | which is deprecated in 2.88, and the ``/os-hypervisors/{id}`` API, which 8 | now includes uptime information, based on the microversion. 9 | 10 | .. _microversion 2.88: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#microversion-2-88 11 | deprecations: 12 | - | 13 | The ``nova hypervisor-stats`` command and underlying 14 | ``novaclient.v2.hypervisors.HypervisorStatsManager.statistics`` API are 15 | deprecated starting in microversion 2.88 and will return an error starting 16 | on this version. 17 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_90-259779668e67dfb5.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.90`_. This microversion provides the 5 | ability to manually configure the instance ``hostname`` attribute when 6 | creating a new instance (``nova boot --hostname HOSTNAME ...``), updating 7 | an existing instance (``nova update --hostname HOSTNAME ...``), or 8 | rebuilding an existing instance (``nova rebuild --hostname HOSTNAME``). 9 | This attribute is published via the metadata service and config drive and 10 | can be used by init scripts such as ``cloud-init`` to configure the guest's 11 | hostname. 12 | 13 | .. _microversion 2.90: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#microversion-2-90 14 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_94-5368d5dd7c5f6484.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.94`_. There are no client-side changes 5 | for this microversion, but sending this microversion allows the 6 | ``hostname`` parameter in the server create, server update, and server 7 | rebuild APIs to be a fully qualified domain name (FQDN). Prior to this 8 | microversion, server-side validation only allows short names as the 9 | ``hostname``. 10 | 11 | .. _microversion 2.94: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id83 12 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_95-3c6ad46be2656684.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.95`_. There are no client-side changes 5 | for this microversion, but sending this microversion triggers evacuated 6 | instances to be stopped on the destination host. Prior to this 7 | microversion, instances were keeping their state from source to 8 | destination host. 9 | 10 | .. _microversion 2.95: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id84 11 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion-v2_96-a50af976133de0ab.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The `microversion 2.96`_ has been added. This microversion adds 5 | pinned_availability_zone in ``server show`` and 6 | ``server list --long`` responses. 7 | 8 | .. _microversion 2.96: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#microversion-2-96 9 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion_v2_70-09cbe0933b3a9335.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.70`_ which outputs the `Tag` field in 5 | the following commands: 6 | 7 | * ``nova interface-list`` 8 | * ``nova interface-attach`` 9 | * ``nova volume-attachments`` 10 | * ``nova volume-attach`` 11 | 12 | .. _microversion 2.70: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id63 13 | -------------------------------------------------------------------------------- /releasenotes/notes/microversion_v2_89-af6223273b2bdfb0.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added support for `microversion 2.89`_. This microversion removes the 5 | ``id`` field while adding the ``attachment_id`` and ``bdm_uuid`` fields to 6 | the responses of ``GET /servers/{server_id}/os-volume_attachments`` and 7 | ``GET /servers/{server_id}/os-volume_attachments/{volume_id}`` with these 8 | changes reflected in novaclient under the ``nova volume-attachments`` 9 | command. 10 | 11 | .. _microversion 2.89: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#microversion-2-89 12 | -------------------------------------------------------------------------------- /releasenotes/notes/no-glance-proxy-5c13001a4b13e8ce.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The 2.36 microversion deprecated the image proxy API. As such, CLI calls 5 | now directly call the image service to get image details, for example, 6 | as a convenience to boot a server with an image name rather than the image 7 | id. To do this the following is assumed: 8 | 9 | #. There is an **image** entry in the service catalog. 10 | #. The image v2 API is available. 11 | -------------------------------------------------------------------------------- /releasenotes/notes/no-neutron-proxy-18fd54febe939a6b.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The 2.36 microversion deprecated the network proxy APIs in 5 | Nova. Because of this we now go directly to neutron for name to 6 | net-id lookups. For nova-net deployements the old proxies will 7 | continue to be used. 8 | 9 | To do this the following is assumed: 10 | 11 | #. There is a **network** entry in the service catalog. 12 | #. The network v2 API is available. 13 | -------------------------------------------------------------------------------- /releasenotes/notes/pike-rm-deprecated-img-d58e9ae2d774cbfc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | Deprecated image commands and python API bindings have been removed. 4 | upgrade: 5 | - | 6 | The following deprecated image commands have been removed:: 7 | 8 | * nova image-list 9 | * nova image-show 10 | * nova image-meta 11 | * nova image-delete 12 | 13 | Along with the related python API bindings in ``novaclient.v2.images``. 14 | -------------------------------------------------------------------------------- /releasenotes/notes/pike-rm-deprecated-net-272aeb62b329a5bc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | Deprecated network-related resource commands and python API bindings 4 | have been removed. From this point on, python-novaclient will no longer 5 | work with nova-network *except* for the ``nova virtual-interface-list``, 6 | ``nova add-fixed-ip`` and ``nova remove-fixed-ip`` commands. 7 | upgrade: 8 | - | 9 | The following deprecated network-related resource commands have been 10 | removed:: 11 | 12 | * nova dns-create 13 | * nova dns-create-private-domain 14 | * nova dns-create-public-domain 15 | * nova dns-delete 16 | * nova dns-delete-domain 17 | * nova dns-domains 18 | * nova dns-list 19 | * nova fixed-ip-get 20 | * nova fixed-ip-reserve 21 | * nova fixed-ip-unreserve 22 | * nova floating-ip-create 23 | * nova floating-ip-delete 24 | * nova floating-ip-list 25 | * nova floating-ip-bulk-create 26 | * nova floating-ip-bulk-delete 27 | * nova floating-ip-bulk-list 28 | * nova floating-ip-pool-list 29 | * nova net 30 | * nova net-create 31 | * nova net-delete 32 | * nova net-list 33 | * nova network-create 34 | * nova network-delete 35 | * nova network-list 36 | * nova network-show 37 | * nova network-associate-host 38 | * nova-network-associate-project 39 | * nova network-disassociate 40 | * nova scrub 41 | * nova secgroup-create 42 | * nova secgroup-delete 43 | * nova secgroup-list 44 | * nova secgroup-update 45 | * nova secgroup-add-rule 46 | * nova secgroup-delete-rule 47 | * nova secgroup-list-rules 48 | * nova secgroup-add-default-rule 49 | * nova secgroup-delete-default-rule 50 | * nova secgroup-list-default-rules 51 | * nova secgroup-add-group-rule 52 | * nova secgroup-delete-group-rule 53 | * nova tenant-network-create 54 | * nova tenant-network-delete 55 | * nova tenant-network-list 56 | * nova tenant-network-show 57 | 58 | Along with the following python API bindings:: 59 | 60 | * novaclient.v2.contrib.tenant_networks 61 | * novaclient.v2.fixed_ips 62 | * novaclient.v2.floating_ip_dns 63 | * novaclient.v2.floating_ip_pools 64 | * novaclient.v2.floating_ips 65 | * novaclient.v2.floating_ips_bulk 66 | * novaclient.v2.fping 67 | * novaclient.v2.networks 68 | * novaclient.v2.security_group_default_rules 69 | * novaclient.v2.security_group_rules 70 | * novaclient.v2.security_groups 71 | 72 | deprecations: 73 | - | 74 | The ``only_contrib`` parameter for the 75 | ``novaclient.client.discover_extensions`` method is deprecated and now 76 | results in an empty list returned since all contrib extensions are either 77 | required or have been removed. -------------------------------------------------------------------------------- /releasenotes/notes/remove-auth-system-b2cd247b8a312b72.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | The ability to use non-Keystone authentication systems has been removed. 4 | upgrade: 5 | - The ``--os-auth-system`` CLI option and ``OS_AUTH_SYSTEM`` environment 6 | variable usage was deprecated in the 3.1.0 release during the Mitaka 7 | development series. This release drops the support for using those options 8 | to load non-Keystone authentication systems via the 9 | ``openstack.client.auth_plugin`` extension point. 10 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-certs-4333342189200d91.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The ``nova x509-create-cert`` and ``nova x509-get-root-cert`` commands 5 | and ``novaclient.v2.certs`` API binding were deprecated in the 9.0.0 6 | release and have now been removed. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-cloudpipe-6c790c57dc3796eb.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The deprecated ``nova cloudpipe-list``, ``nova cloudpipe-create``, and 5 | ``nova cloudpipe-configure`` commands and the ``novaclient.v2.cloudpipe`` 6 | API bindings have been removed. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-contrib-8b5e35ac8dddbab3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - All modules of ``novaclient.v2.contrib`` have been removed. 4 | - The ``only_contrib`` parameter for the 5 | ``novaclient.client.discover_extensions`` method is no longer valid. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-deprecated-cellsv1-extentions-commands-4b26c826ad5194ca.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The following CLIs and their backing API bindings have been removed. 5 | 6 | - ``nova list-extensions`` 7 | - ``nova cell-capacities`` 8 | - ``nova cell-show`` 9 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-deprecated-methods-train-c450fe317c90d7f0.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The following properties have been removed. 5 | 6 | - ``novaclient.client.SessionClient`` 7 | 8 | - ``management_url`` 9 | 10 | - ``novaclient.v2.client.Client`` 11 | 12 | - ``projectid`` 13 | - ``tenant_id`` 14 | 15 | The following methods have been removed. 16 | 17 | - ``novaclient.client.get_client_class`` 18 | - ``novaclient.v2.client.Client`` 19 | 20 | - ``set_management_url`` 21 | - ``authenticate`` 22 | 23 | The ``novaclient.v2.client.Client.__enter__`` method now raises 24 | the ``InvalidUsage`` runtime error. 25 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-deprecated-option-14.0.0-c6d7189938f5f063.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The following deprecated options have been removed. 5 | 6 | * ``--endpoint-override`` (Authentication option) 7 | * ``--instance-name`` (``nova list`` command) 8 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-deprecated-option-in-3.3.0-82a413157838570d.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | update: 3 | - The following deprecated options have been removed: 4 | - create instances: 5 | - --num-instance replaced by --min-count and --max-count 6 | - --key_name replaced by --key-name 7 | - --user_data replaced by --user-data 8 | - --availability_zone replaced by -- availability-zone 9 | - --security_groups replaced by --sercurity-groups 10 | - --block_device_mapping replaced by --block-device-mapping 11 | - list servers: 12 | - --reservation_id replaced by --reservation-id 13 | - --instance_name replaced by --instance-name 14 | - --all_tenants replaced by --all-tenants 15 | - rebuild instance: 16 | - --rebuild_password replaced by --rebuild-password 17 | - get serial console: 18 | - --console_type replaced by --console-type 19 | - create dns private domain: 20 | - --availability_zone replaced by --availability-zone 21 | - list security groups: 22 | - --all_tenants replaced by --all-tenants 23 | - add key pairs: 24 | - --pub_key replaced by --pub-key 25 | - live-migrate servers: 26 | - --block_migrate replaced by --block-migrate 27 | - --disk_over_commit replaced by --disk-over-commit 28 | - update quotas: 29 | - --floating_ips replaced by --floating-ips 30 | - --metadata_items replaced by --metadata-items 31 | - --injected_files replaced by --injected-files 32 | - --injected_file_content_bytes replaced by --injected-file-content-bytes 33 | - update quota classes: 34 | - --floating_ips replaced by --floating-ips 35 | - --metadata_items replaced by --metadata-items 36 | - --injected_files replaced by --injected-files 37 | - --injected_file_content_bytes replaced by --injected-file-content-bytes 38 | - create server groups: 39 | - --policy 40 | - Authentication Options: 41 | - --os_username replaced by --os-username 42 | - --os_password replaced by --os-password 43 | - --os_tenant_name replaced by --os-tenant-name 44 | - --os_auth_url replaced by --os-auth-url 45 | - --os_region_name replaced by --os-region-name 46 | - --os_auth_system replaced by --os-auth-system 47 | - --endpoint-type replaced by --os-endpoint-type 48 | - Optional arguments: 49 | - --service_type replaced by --service-type 50 | - --service_name replaced by --service-name 51 | - --volume_service_name replaced by --volume-service-name 52 | - --os_compute_api_version replaced by --os-compute-api-version 53 | - --bypass_url replaced by --bypass-url 54 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-deprecated-option-in-9.0.0-bc76629d28f1d4c4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The following deprecated options have been removed: 5 | 6 | - ``--tenant`` (from ``flavor access list``) 7 | - ``--cell_name`` (from ``migration list``) 8 | - ``--volume-service-name`` (global option) 9 | 10 | As a result, the ``novaclient.v2.migrations.MigrationManager.list`` 11 | python API binding method no longer takes a ``cell_name`` kwarg. 12 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-hosts-d08855550c40b9c6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The following CLIs and their backing API bindings were deprecated and 5 | capped at microversion 2.43: 6 | 7 | * ``nova host-describe`` - superseded by ``nova hypervisor-show`` 8 | * ``nova host-list`` - superseded by ``nova hypervisor-list`` 9 | * ``nova host-update`` - superseded by ``nova service-enable`` and 10 | ``nova service-disable`` 11 | * ``nova host-action`` - no alternative by design 12 | 13 | The CLIs and API bindings have now been removed. 14 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-py26-support-f31379e86f40d975.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - Python 2.6 support has been removed from python-novaclient. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-py38-ae196c568a1577db.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | Support for Python 3.8 has been removed. Now the minimum python version 5 | supported is 3.9 . 6 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-run_tests.sh-3bdcaee4d388177a.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - The ``run_tests.sh`` shell script that was deprecated in Newton has 4 | been removed. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-service-binary-arg-ec2838214c8c7abc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The deprecated ``binary`` argument to the ``nova service-enable``, 5 | ``nova service-disable``, and ``nova service-force-down`` commands has been 6 | removed. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-virt-interfaces-add-rm-fixed-floating-398c905d9c91cca8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The following CLIs and their backing API bindings were deprecated and 5 | capped at microversion 2.44: 6 | 7 | * ``nova add-fixed-ip``: use python-neutronclient or openstacksdk 8 | * ``nova remove-fixed-ip``: use python-neutronclient or openstacksdk 9 | * ``nova floating-ip-associate``: use python-neutronclient or openstacksdk 10 | * ``nova floating-ip-disassociate``: use python-neutronclient or 11 | openstacksdk 12 | * ``nova virtual-interface-list``: there is no replacement as this is 13 | only implemented for nova-network which is deprecated 14 | 15 | The CLIs and API bindings have now been removed. 16 | -------------------------------------------------------------------------------- /releasenotes/notes/remove_api_v_1_1-88b3f18ce1423b46.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - remove version 1.1 API support as we only support v2 and v2.1 4 | API in nova side now. 5 | 6 | -------------------------------------------------------------------------------- /releasenotes/notes/rename-apikey-to-password-735588d841efa49e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - The **api_key** variable of novaclient.client.Client entry-point was 4 | deprecated in favor of **password**. Nothing has changed in the case 5 | of positional argument usage. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/rename-bypass-url-42cd96956a6bc6dc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - The **--bypass-url** CLI argument was deprecated in favor of 4 | **--endpoint-override** 5 | - The **bypass_url** argument of novaclient.client.Client entry-point was 6 | deprecated in favor of **endpoint_override**. 7 | fixes: 8 | - Inability to use bypass-url with keystone session is fixed. 9 | features: 10 | - You can use **bypass-url** / **endpoint-override** with Keystone V3. 11 | -------------------------------------------------------------------------------- /releasenotes/notes/restrict-args-for-novaclient-ep-491098c3634365be.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | novaclient.client.Client entry-point accepts only 5 positional arguments:: 5 | 6 | version, username, api_key, project_id, auth_url 7 | 8 | Using positional arguments for all other options is now an error. 9 | -------------------------------------------------------------------------------- /releasenotes/notes/restrict-direct-use-of-v2client-c8e1ee2afefec5a1.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - novaclient.v2.client.Client raises an exception in case of direct usage 4 | instead of warning message. novaclient.client.Client is a primary 5 | interface to initialize the python client for Nova. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/restrict-interface-parameter-e5fe166f39ba0935.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - keyword argument **interface** of novaclient.client.Client entry-point was 4 | deprecated in favor of **endpoint_type**; 5 | -------------------------------------------------------------------------------- /releasenotes/notes/return-request-id-to-caller-52c5423794b33f8b.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | Methods in manager classes and resource classes return wrapper classes 4 | that wrap values returned originally. 5 | For example, a wrapper class for list, a wrapper class for dict, 6 | a wrapper class for str and so on. 7 | The wrapper classes have a 'request_ids' property for request IDs 8 | returned from Nova (nova-api). So the caller can get the 9 | Nova's request IDs, then output them to logs with its own request ID. 10 | The function to output them to the logs will be implemented 11 | in other projects (cinder, heat, etc.). 12 | features: 13 | - Methods in manager classes and resource classes return wrapper classes 14 | that wrap values returned originally. 15 | For example, a wrapper class for list, a wrapper class for dict, 16 | a wrapper class for str and so on. 17 | The wrapper classes have a 'request_ids' property for request IDs 18 | returned from Nova (nova-api). So the caller can get the 19 | Nova's request IDs, then output them to logs with its own request ID. 20 | The function to output them to the logs will be implemented 21 | in other projects (cinder, heat, etc.). 22 | upgrade: 23 | - In case that methods return a response object and body originally and 24 | body is None, the methods return the wrapper class for tuple as 'body' 25 | instead of the wrapper class for None. 26 | The wrapper class for None has not been added. 27 | -------------------------------------------------------------------------------- /releasenotes/notes/rm-baremetal-cli-api-fbc8c242d48cd2fb.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The baremetal CLIs and python API bindings were deprecated in the Newton 5 | release and have been removed. Use python-openstackclient or 6 | python-ironicclient for CLIs. Use python-ironicclient or openstacksdk for 7 | python API bindings -------------------------------------------------------------------------------- /releasenotes/notes/rm-deprecated-commands-options-ocata-00f249810e5bdf97.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | Several deprecated commands have been removed. See the upgrade section for 4 | details. 5 | upgrade: 6 | - | 7 | The following deprecated commands have been removed: 8 | 9 | * absolute-limits 10 | * add-floating-ip 11 | * aggregate-details 12 | * credentials 13 | * endpoints 14 | * rate-limits 15 | * remove-floating-ip 16 | * rename 17 | * root-password 18 | -------------------------------------------------------------------------------- /releasenotes/notes/search-hypervisor-detailed-352f3ac70d42fe6e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The ``novaclient.v2.hypervisors.HypervisorManager.search`` method now 5 | accepts a ``detailed`` boolean kwarg which defaults to False but when 6 | True will search for the given hypervisor hostname match and return 7 | details about any matching hypervisors. Specifying ``detailed=True`` 8 | requires compute API version 2.53 or greater. 9 | -------------------------------------------------------------------------------- /releasenotes/notes/server-networks-sorted-1d3a7f1c1f88e846.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | other: 3 | - | 4 | The ``novaclient.v2.servers.Server.networks`` property method now returns 5 | an OrderedDict where the keys are sorted in natural (ascending) order. 6 | This means the ``nova show`` and ``nova list`` output will have predictable 7 | sort order on the networks attached to a server. 8 | -------------------------------------------------------------------------------- /releasenotes/notes/show-instance-usage-audit-logs-7826b411fac1283b.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Added new client API and CLI (``nova instance-usage-audit-log``) 4 | to get server usage audit logs. 5 | By default, it lists usage audits for all servers on all 6 | compute hosts where usage auditing is configured. 7 | If you specify the ``--before`` option, the result is filtered 8 | by the date and time before which to list server usage audits. 9 | -------------------------------------------------------------------------------- /releasenotes/notes/strict_hostname_match-f37243f0520a09a2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Provides "--strict" option for "nova host-servers-migrate", "nova host-evacuate", 5 | "nova host-evacuate-live" and "nova host-meta" commands. When "--strict" option is 6 | used, the action will be applied to a single compute with the exact hypervisor 7 | hostname string match rather than to the computes with hostname substring match. 8 | When the specified hostname does not exist in the system, "NotFound" error code 9 | will be returned. 10 | -------------------------------------------------------------------------------- /releasenotes/notes/switch-to-sessionclient-aa49d16599fea570.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | When using novaclient as a library (via novaclient.client.Client 5 | entry-point), an internal implementation of HTTPClient was used if a 6 | session object is not specified. For better user experience we switched 7 | to using SessionClient which uses keystoneauth (Keystone folks maintain 8 | this library) for all auth stuff. 9 | The SessionClient interface is similar to HTTPClient, but there is a 10 | small possibility that you will notice a difference. 11 | -------------------------------------------------------------------------------- /releasenotes/notes/volume-cli-removal-ffcb94421a356042.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - Volume, volume-type and volume-snapshot create/update/delete/list CLIs 4 | and python API bindings are removed. Use python-cinderclient or 5 | python-openstackclient for CLIs instead. Use python-cinderclient or 6 | python-openstacksdk for python API bindings instead. 7 | -------------------------------------------------------------------------------- /releasenotes/source/2023.1.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2023.1 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/2023.1 7 | -------------------------------------------------------------------------------- /releasenotes/source/2023.2.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2023.2 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2023.2 7 | -------------------------------------------------------------------------------- /releasenotes/source/2024.1.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2024.1 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2024.1 7 | -------------------------------------------------------------------------------- /releasenotes/source/2024.2.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2024.2 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2024.2 7 | -------------------------------------------------------------------------------- /releasenotes/source/2025.1.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2025.1 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2025.1 7 | -------------------------------------------------------------------------------- /releasenotes/source/_static/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/python-novaclient/b2481a6f9739afe0e68327fc58c5bc208f69c052/releasenotes/source/_static/.placeholder -------------------------------------------------------------------------------- /releasenotes/source/_templates/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/python-novaclient/b2481a6f9739afe0e68327fc58c5bc208f69c052/releasenotes/source/_templates/.placeholder -------------------------------------------------------------------------------- /releasenotes/source/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # python-novaclient Release Notes documentation build configuration file 4 | 5 | # -- General configuration ------------------------------------------------ 6 | 7 | # Add any Sphinx extension module names here, as strings. They can be 8 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 9 | # ones. 10 | extensions = [ 11 | 'reno.sphinxext', 12 | 'openstackdocstheme', 13 | ] 14 | 15 | # The master toctree document. 16 | master_doc = 'index' 17 | 18 | 19 | # -- Options for HTML output ---------------------------------------------- 20 | 21 | # The theme to use for HTML and HTML Help pages. See the documentation for 22 | # a list of builtin themes. 23 | html_theme = 'openstackdocs' 24 | 25 | 26 | # -- Options for Internationalization output ------------------------------ 27 | 28 | locale_dirs = ['locale/'] 29 | -------------------------------------------------------------------------------- /releasenotes/source/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to Nova Client Release Notes documentation! 2 | =================================================== 3 | 4 | Contents 5 | ======== 6 | 7 | .. toctree:: 8 | :maxdepth: 2 9 | 10 | unreleased 11 | 2025.1 12 | 2024.2 13 | 2024.1 14 | 2023.2 15 | 2023.1 16 | zed 17 | yoga 18 | xena 19 | wallaby 20 | victoria 21 | ussuri 22 | train 23 | stein 24 | rocky 25 | queens 26 | pike 27 | ocata 28 | newton 29 | mitaka 30 | liberty 31 | 32 | Indices and tables 33 | ================== 34 | 35 | * :ref:`genindex` 36 | * :ref:`search` 37 | -------------------------------------------------------------------------------- /releasenotes/source/liberty.rst: -------------------------------------------------------------------------------- 1 | ============================== 2 | Liberty Series Release Notes 3 | ============================== 4 | 5 | .. release-notes:: 6 | :branch: stable/liberty 7 | -------------------------------------------------------------------------------- /releasenotes/source/mitaka.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Mitaka Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/mitaka 7 | -------------------------------------------------------------------------------- /releasenotes/source/newton.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Newton Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/newton 7 | -------------------------------------------------------------------------------- /releasenotes/source/ocata.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Ocata Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/ocata 7 | -------------------------------------------------------------------------------- /releasenotes/source/pike.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Pike Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/pike 7 | -------------------------------------------------------------------------------- /releasenotes/source/queens.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Queens Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/queens 7 | -------------------------------------------------------------------------------- /releasenotes/source/rocky.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Rocky Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/rocky 7 | -------------------------------------------------------------------------------- /releasenotes/source/stein.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Stein Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/stein 7 | -------------------------------------------------------------------------------- /releasenotes/source/train.rst: -------------------------------------------------------------------------------- 1 | ========================== 2 | Train Series Release Notes 3 | ========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/train 7 | -------------------------------------------------------------------------------- /releasenotes/source/unreleased.rst: -------------------------------------------------------------------------------- 1 | ============================ 2 | Current Series Release Notes 3 | ============================ 4 | 5 | .. release-notes:: 6 | -------------------------------------------------------------------------------- /releasenotes/source/ussuri.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | Ussuri Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/ussuri 7 | -------------------------------------------------------------------------------- /releasenotes/source/victoria.rst: -------------------------------------------------------------------------------- 1 | ============================= 2 | Victoria Series Release Notes 3 | ============================= 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/victoria 7 | -------------------------------------------------------------------------------- /releasenotes/source/wallaby.rst: -------------------------------------------------------------------------------- 1 | ============================ 2 | Wallaby Series Release Notes 3 | ============================ 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/wallaby 7 | -------------------------------------------------------------------------------- /releasenotes/source/xena.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | Xena Series Release Notes 3 | ========================= 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/xena 7 | -------------------------------------------------------------------------------- /releasenotes/source/yoga.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | Yoga Series Release Notes 3 | ========================= 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/yoga 7 | -------------------------------------------------------------------------------- /releasenotes/source/zed.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | Zed Series Release Notes 3 | ======================== 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/zed 7 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # Requirements lower bounds listed here are our best effort to keep them up to 2 | # date but we do not test them so no guarantee of having them all correct. If 3 | # you find any incorrect lower bounds, let us know or propose a fix. 4 | 5 | pbr>=3.0.0 # Apache-2.0 6 | keystoneauth1>=3.5.0 # Apache-2.0 7 | iso8601>=0.1.11 # MIT 8 | oslo.i18n>=3.15.3 # Apache-2.0 9 | oslo.serialization>=2.20.0 # Apache-2.0 10 | oslo.utils>=3.33.0 # Apache-2.0 11 | PrettyTable>=0.7.2 # BSD 12 | stevedore>=2.0.1 # Apache-2.0 13 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = python-novaclient 3 | summary = Client library for OpenStack Compute API 4 | description_file = 5 | README.rst 6 | license = Apache License, Version 2.0 7 | author = OpenStack 8 | author_email = openstack-discuss@lists.openstack.org 9 | home_page = https://docs.openstack.org/python-novaclient/latest 10 | python_requires = >=3.9 11 | classifier = 12 | Development Status :: 5 - Production/Stable 13 | Environment :: Console 14 | Environment :: OpenStack 15 | Intended Audience :: Developers 16 | Intended Audience :: Information Technology 17 | License :: OSI Approved :: Apache Software License 18 | Operating System :: OS Independent 19 | Programming Language :: Python 20 | Programming Language :: Python :: 3 21 | Programming Language :: Python :: 3.9 22 | Programming Language :: Python :: 3.10 23 | Programming Language :: Python :: 3.11 24 | Programming Language :: Python :: 3.12 25 | Programming Language :: Python :: 3 :: Only 26 | Programming Language :: Python :: Implementation :: CPython 27 | 28 | [files] 29 | packages = 30 | novaclient 31 | 32 | [entry_points] 33 | console_scripts = 34 | nova = novaclient.shell:main 35 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 | # implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | import setuptools 17 | 18 | setuptools.setup( 19 | setup_requires=['pbr>=2.0.0'], 20 | pbr=True) 21 | -------------------------------------------------------------------------------- /test-requirements.txt: -------------------------------------------------------------------------------- 1 | hacking>=6.1.0,<6.2.0 # Apache-2.0 2 | bandit>=1.1.0 # Apache-2.0 3 | coverage>=4.4.1 # Apache-2.0 4 | ddt>=1.0.1 # MIT 5 | fixtures>=3.0.0 # Apache-2.0/BSD 6 | python-keystoneclient>=3.8.0 # Apache-2.0 7 | python-cinderclient>=4.0.1 # Apache-2.0 8 | python-neutronclient>=6.7.0 # Apache-2.0 9 | requests-mock>=1.2.0 # Apache-2.0 10 | openstacksdk>=0.11.2 # Apache-2.0 11 | osprofiler>=1.4.0 # Apache-2.0 12 | stestr>=2.0.0 # Apache-2.0 13 | testscenarios>=0.4 # Apache-2.0/BSD 14 | testtools>=2.2.0 # MIT 15 | tempest>=17.1.0 # Apache-2.0 16 | -------------------------------------------------------------------------------- /tools/nova.bash_completion: -------------------------------------------------------------------------------- 1 | _nova_opts="" # lazy init 2 | _nova_flags="" # lazy init 3 | _nova_opts_exp="" # lazy init 4 | _nova() 5 | { 6 | local cur prev nbc cflags 7 | COMPREPLY=() 8 | cur="${COMP_WORDS[COMP_CWORD]}" 9 | prev="${COMP_WORDS[COMP_CWORD-1]}" 10 | 11 | if [ "x$_nova_opts" == "x" ] ; then 12 | nbc="`nova bash-completion | sed -e "s/ *-h */ /" -e "s/ *-i */ /"`" 13 | _nova_opts="`echo "$nbc" | sed -e "s/--[a-z0-9_-]*//g" -e "s/ */ /g"`" 14 | _nova_flags="`echo " $nbc" | sed -e "s/ [^-][^-][a-z0-9_-]*//g" -e "s/ */ /g"`" 15 | _nova_opts_exp="`echo "$_nova_opts" | tr ' ' '|'`" 16 | fi 17 | 18 | if [[ " ${COMP_WORDS[@]} " =~ " "($_nova_opts_exp)" " && "$prev" != "help" ]] ; then 19 | COMPLETION_CACHE=~/.novaclient/*/*-cache 20 | cflags="$_nova_flags "$(cat $COMPLETION_CACHE 2> /dev/null | tr '\n' ' ') 21 | COMPREPLY=($(compgen -W "${cflags}" -- ${cur})) 22 | else 23 | COMPREPLY=($(compgen -W "${_nova_opts}" -- ${cur})) 24 | fi 25 | return 0 26 | } 27 | complete -F _nova nova 28 | -------------------------------------------------------------------------------- /tools/nova.zsh_completion: -------------------------------------------------------------------------------- 1 | #compdef nova 2 | 3 | local -a nbc _nova_opts _nova_flags _nova_opts_exp cur prev 4 | 5 | nbc=(${(ps: :)$(_call_program options "$service bash-completion" 2>/dev/null)}) 6 | _nova_opts=(${nbc:#-*}) 7 | _nova_flags=(${(M)nbc:#-*}) 8 | _nova_opt_exp=${${nbc:#-*}// /|} 9 | cur=$words[CURRENT] 10 | prev=$words[(( CURRENT - 1 ))] 11 | 12 | _checkcomp(){ 13 | for word in $words[@]; do 14 | if [[ -n ${_nova_opts[(r)$word]} ]]; then 15 | return 0 16 | fi 17 | done 18 | return 1 19 | } 20 | 21 | echo $_nova_opts[@] |grep --color nova 22 | if [[ "$prev" != "help" ]] && _checkcomp; then 23 | COMPLETION_CACHE=(~/.novaclient/*/*-cache) 24 | cflags=($_nova_flags[@] ${(ps: :)$(cat $COMPLETION_CACHE 2>/dev/null)}) 25 | compadd "$@" -d $cflags[@] 26 | else 27 | compadd "$@" -d $_nova_opts[@] 28 | fi 29 | 30 | --------------------------------------------------------------------------------