<commit_before>Python Bindings for the OpenStack Images API
============================================

This is a client for the OpenStack Images API. There's :doc:`a Python API <ref/index>` (the :mod:`glanceclient` module) and a :doc:`command-line script<man/glance>` (installed as :program:`glance`).

Python API
----------
In order to use the python api directly, you must first obtain an auth token and identify which endpoint you wish to speak to. Once you have done so, you can use the API like so::

    >>> from glanceclient import Client
    >>> glance = Client('1', endpoint=OS_IMAGE_ENDPOINT, token=OS_AUTH_TOKEN)
    >>> image = glance.images.create(name="My Test Image")
    >>> print image.status
    'queued'
    >>> image.update(data=open('/tmp/myimage.iso', 'rb'))
    >>> print image.status
    'active'
    >>> image.update(properties=dict(my_custom_property='value'))
    >>> with open('/tmp/copyimage.iso', 'wb') as f:
            for chunk in image.data():
                f.write(chunk)
    >>> image.delete()

Python API Reference
~~~~~~~~~~~~~~~~~~~~

.. toctree::
   :maxdepth: 2

   ref/index
   ref/v1/index
   ref/v2/index


Command-line Tool
-----------------
In order to use the CLI, you must provide your OpenStack username, password, tenant, and auth endpoint. Use the corresponding configuration options (``--os-username``, ``--os-password``, ``--os-tenant-id``, and ``--os-auth-url``) or set them in environment variables::

    export OS_USERNAME=user
    export OS_PASSWORD=<PASSWORD>
    export OS_TENANT_ID=b363706f891f48019483f8bd6503c54b
    export OS_AUTH_URL=http://auth.example.com:5000/v2.0

The command line tool will attempt to reauthenticate using your provided credentials for every request. You can override this behavior by manually supplying an auth token using ``--os-image-url`` and ``--os-auth-token``. You can alternatively set these environment variables::

    export OS_IMAGE_URL=http://glance.example.org:9292/
    export OS_AUTH_TOKEN=<PASSWORD>

Once you've configured your authentication parameters, you can run ``glance help`` to see a complete listing of available commands.

See also :doc:`/man/glance`.

Release Notes
=============

1.1.0
-----

* This release provides mainly bugfixes for the bugs discovered after defaulting to v2 API on CLI. If you're using 1.0.0 client, it is highly recommended to upgrade.

* 1494259_: Fixes CLI client called without subcommands
* 1488914_: Print the reverting back to v1 to stderr
* 1487645_: Invalid output running the command 'glance image-show <image_id>'
* 1490457_: Don't make `help` require auth parameters
* 1491311_: check for None value in utils.safe_header
* f0b30f4 Updated from global requirements
* 1490462_: Consider `--os-token` when using v2
* 1489381_: Check if v2 is available and fallback
* 1491646_: Update path to subunit2html in post_test_hook
* 1488892_: Password should be prompted once

.. _1494259: https://bugs.launchpad.net/python-glanceclient/+bug/1494259
.. _1488914: https://bugs.launchpad.net/python-glanceclient/+bug/1488914
.. _1487645: https://bugs.launchpad.net/python-glanceclient/+bug/1487645
.. _1490457: https://bugs.launchpad.net/python-glanceclient/+bug/1490457
.. _1491311: https://bugs.launchpad.net/python-glanceclient/+bug/1491311
.. _1490462: https://bugs.launchpad.net/python-glanceclient/+bug/1490462
.. _1489381: https://bugs.launchpad.net/python-glanceclient/+bug/1489381
.. _1491646: https://bugs.launchpad.net/python-glanceclient/+bug/1491646
.. _1488892: https://bugs.launchpad.net/python-glanceclient/+bug/1488892

1.0.0
-----
<commit_msg>Release Notes for version 1.2.0<commit_after>Python Bindings for the OpenStack Images API
============================================

This is a client for the OpenStack Images API. There's :doc:`a Python API <ref/index>` (the :mod:`glanceclient` module) and a :doc:`command-line script<man/glance>` (installed as :program:`glance`).

Python API
----------
In order to use the python api directly, you must first obtain an auth token and identify which endpoint you wish to speak to. Once you have done so, you can use the API like so::

    >>> from glanceclient import Client
    >>> glance = Client('1', endpoint=OS_IMAGE_ENDPOINT, token=OS_AUTH_TOKEN)
    >>> image = glance.images.create(name="My Test Image")
    >>> print image.status
    'queued'
    >>> image.update(data=open('/tmp/myimage.iso', 'rb'))
    >>> print image.status
    'active'
    >>> image.update(properties=dict(my_custom_property='value'))
    >>> with open('/tmp/copyimage.iso', 'wb') as f:
            for chunk in image.data():
                f.write(chunk)
    >>> image.delete()

Python API Reference
~~~~~~~~~~~~~~~~~~~~

.. toctree::
   :maxdepth: 2

   ref/index
   ref/v1/index
   ref/v2/index


Command-line Tool
-----------------
In order to use the CLI, you must provide your OpenStack username, password, tenant, and auth endpoint. Use the corresponding configuration options (``--os-username``, ``--os-password``, ``--os-tenant-id``, and ``--os-auth-url``) or set them in environment variables::

    export OS_USERNAME=user
    export OS_PASSWORD=<PASSWORD>
    export OS_TENANT_ID=b363706f891f48019483f8bd6503c54b
    export OS_AUTH_URL=http://auth.example.com:5000/v2.0

The command line tool will attempt to reauthenticate using your provided credentials for every request. You can override this behavior by manually supplying an auth token using ``--os-image-url`` and ``--os-auth-token``. You can alternatively set these environment variables::

    export OS_IMAGE_URL=http://glance.example.org:9292/
    export OS_AUTH_TOKEN=<PASSWORD>

Once you've configured your authentication parameters, you can run ``glance help`` to see a complete listing of available commands.

See also :doc:`/man/glance`.

Release Notes
=============

1.2.0
-----

* This release consists mainly bugfixes since Liberty release.
* Some functionality has been added, documentation improved.
* Trivial & typo fixed and requirement changes not included below.

* 1511180_:  Add versions list function
* 1508356_: Added reactivate/deactivate image using CLI
* 1510340_: Fix the missing help descripiton of "image-create"
* 8a4cd79 Add documentation for running the functional tests
* 5a24705 Update docs to recommend KSA instead of KSC
* 1507386_: Use clouds.yaml from devstack for functional tests
* 4fb3092 Add translation to v2 shell
* b51634a improve readme contents
* 1480529_: Add support for setting Accept-Language header
* 1504058_: Use the subcomand parsed args instead of the base
* afd1810 Stop trying to send image_size to the server
* 1485407_: Support image deletion in batches in v2
* 1295356_: print usage when no argument is specified for python3
* df0f664 Do not use openstack.common.i18n in glance client
* 1f2fefb Use common identity parameters fro keystone client
* 1499540_: No auth when token and endpoint are passed
* 557acb1 Use dictionary literal for dictionary creation
* c6addc7 Replace exception_to_str with oslo.utils function
* 1496305_: Don't get the image before deleting it
* 1495632_: Fix human readable when size is None
* 1489727_: Add parsing the endpoint URL
* 1467719_: Add check Identity validate when get schemas

.. _1511180: https://bugs.launchpad.net/python-glanceclient/+bug/1511180
.. _1508356: https://bugs.launchpad.net/python-glanceclient/+bug/1508356
.. _1510340: https://bugs.launchpad.net/python-glanceclient/+bug/1510340
.. _1507386: https://bugs.launchpad.net/python-neutronclient/+bug/1507386
.. _1480529: https://bugs.launchpad.net/python-glanceclient/+bug/1480529
.. _1504058: https://bugs.launchpad.net/python-glanceclient/+bug/1504058
.. _1485407: https://bugs.launchpad.net/python-glanceclient/+bug/1485407
.. _1295356: https://bugs.launchpad.net/python-novaclient/+bug/1295356
.. _1499540: https://bugs.launchpad.net/python-glanceclient/+bug/1499540
.. _1496305: https://bugs.launchpad.net/python-glanceclient/+bug/1496305
.. _1495632: https://bugs.launchpad.net/python-glanceclient/+bug/1495632
.. _1489727: https://bugs.launchpad.net/python-glanceclient/+bug/1489727
.. _1467719: https://bugs.launchpad.net/glance/+bug/1467719

1.1.0
-----

* This release provides mainly bugfixes for the bugs discovered after defaulting to v2 API on CLI. If you're using 1.0.0 client, it is highly recommended to upgrade.

* 1494259_: Fixes CLI client called without subcommands
* 1488914_: Print the reverting back to v1 to stderr
* 1487645_: Invalid output running the command 'glance image-show <image_id>'
* 1490457_: Don't make `help` require auth parameters
* 1491311_: check for None value in utils.safe_header
* f0b30f4 Updated from global requirements
* 1490462_: Consider `--os-token` when using v2
* 1489381_: Check if v2 is available and fallback
* 1491646_: Update path to subunit2html in post_test_hook
* 1488892_: Password should be prompted once

.. _1494259: https://bugs.launchpad.net/python-glanceclient/+bug/1494259
.. _1488914: https://bugs.launchpad.net/python-glanceclient/+bug/1488914
.. _1487645: https://bugs.launchpad.net/python-glanceclient/+bug/1487645
.. _1490457: https://bugs.launchpad.net/python-glanceclient/+bug/1490457
.. _1491311: https://bugs.launchpad.net/python-glanceclient/+bug/1491311
.. _1490462: https://bugs.launchpad.net/python-glanceclient/+bug/1490462
.. _1489381: https://bugs.launchpad.net/python-glanceclient/+bug/1489381
.. _1491646: https://bugs.launchpad.net/python-glanceclient/+bug/1491646
.. _1488892: https://bugs.launchpad.net/python-glanceclient/+bug/1488892

1.0.0
-----

{'fraction_non_alphanumeric': 0.1328174022171094, 'fraction_numerical': 0.08471031165028237, 'mean_word_length': 4.205770277626565, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 67, 'https://': 31, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4470976', 'n_tokens_mistral': 3558, 'n_tokens_neox': 2876, 'n_words': 893}