
    Vh                     R    d Z dZdZddlmZ  G d de      Zd Zedk(  r e        y	y	)
a  
---
module: project_info
short_description: Retrieve information about one or more OpenStack projects
author: OpenStack Ansible SIG
description:
  - Retrieve information about a one or more OpenStack projects
options:
  name:
    description:
      - Name or ID of the project.
    type: str
  domain:
    description:
      - Name or ID of the domain containing the project.
    type: str
  filters:
    description:
      - A dictionary of meta data to use for filtering projects.
      - Elements of I(filters) are passed as query parameters to
        OpenStack Identity API.
    type: dict
extends_documentation_fragment:
  - openstack.cloud.openstack
a  
- name: Fetch all Identity (Keystone) projects
  openstack.cloud.project_info:
    cloud: awesomecloud

- name: Fetch all projects with a name
  openstack.cloud.project_info:
    cloud: awesomecloud
    name: demoproject

- name: Fetch all projects with a name in a domain
  openstack.cloud.project_info:
    cloud: awesomecloud
    name: demoproject
    domain: admindomain

- name: Fetch all disabled projects
  openstack.cloud.project_info:
    cloud: awesomecloud
    filters:
      is_enabled: false
a
  
projects:
  description: List of dictionaries describing Identity (Keystone) projects.
  elements: dict
  returned: always, but can be empty
  type: list
  contains:
    description:
      description: Project description
      type: str
      sample: "demodescription"
    domain_id:
      description: Domain ID to which the project belongs
      type: str
      sample: "default"
    id:
      description: Project ID
      type: str
      sample: "f59382db809c43139982ca4189404650"
    is_domain:
      description: Indicates whether the project also acts as a domain.
      type: bool
    is_enabled:
      description: Indicates whether the project is enabled
      type: bool
    name:
      description: Project name
      type: str
      sample: "demoproject"
    options:
      description: The resource options for the project
      type: dict
    parent_id:
      description: The ID of the parent of the project
      type: str
    tags:
      description: A list of associated tags
      type: list
      elements: str
    )OpenStackModulec                   \    e Zd Z e e        e        ed            Z ed      Zd Zy)IdentityProjectInfoModuledict)type)domainnamefiltersT)supports_check_modec           	         | j                   d   xs i }| j                   d   }|I| j                  j                  j                  |      }|s| j	                  dg        |j
                  |d<   | j                  j                  | j                   d   |      }| j	                  d|D cg c]  }|j                  d       c}       y c c}w )	Nr
   r   F)changedprojects	domain_idr	   )
name_or_idr
   )computed)paramsconnidentityfind_domain	exit_jsonidsearch_projectsto_dict)selfr
   domain_name_or_idr   r   ps         p/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/openstack/cloud/plugins/modules/project_info.pyrunzIdentityProjectInfoModule.runn   s    ++i(.B KK1(YY''334EFFur:#)99GK 99,,F8K5< - > 	uDL MqE!: M 	 	O Ms   (C

N)__name__
__module____qualname__r   argument_specmodule_kwargsr        r   r   r   d   s3    vV&!M
  MOr%   r   c                  &    t               }  |         y )N)r   )modules    r   mainr(      s    &(F
Hr%   __main__N)DOCUMENTATIONEXAMPLESRETURNBansible_collections.openstack.cloud.plugins.module_utils.openstackr   r   r(   r   r$   r%   r   <module>r.      sH   4.'
R _O O:
 zF r%   