# Usage

The most basic use of os-service-types in a project:

    import os_service_types

    service_types = os_service_types.ServiceTypes()

However, os-service-types expects to be able to fetch remote data, so it’s better to pass in a `Session` object. Both `requests.sessions.Session` and `keystoneauth1.session.Session` objects are supported. A `keystoneauth1.session.Session` object does not need auth information attached, although it will not break anything if it does.

    import keystoneauth1.session
    import os_service_types

    session = keystoneauth1.session.Session()
    service_types = os_service_types.ServiceTypes(session=session)

this page last updated: 2026-03-26 16:38:04

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug