Skip to main content

Domain

The Domain class provides an interface to interact with OpenStack domains, allowing you to retrieve information about domains and their associated projects and users.

Constructor

Domain(domain_id=None, name=None, cloud=Cloud())
Initialize a Domain instance.
domain_id
str
The unique identifier of the domain. Either domain_id or name should be provided.
name
str
The name of the domain. Either domain_id or name should be provided.
cloud
Cloud
default:"Cloud()"
The Cloud instance to use for OpenStack operations. Defaults to a new Cloud instance.

Properties

name

@property
def name(self) -> str
name
str
Returns the name associated to this Domain.

id

@property
def id(self) -> str
id
str
Returns the domain_id associated to this Domain.

projects

@property
def projects(self) -> EntityList
projects
EntityList
Returns the list of Projects in this Domain.

users

@property
def users(self) -> EntityList
users
EntityList
Returns the list of Users in this Domain.

Usage Example

from myos.domain import Domain

# Initialize domain by name
domain = Domain(name='jasmin')

# Access domain properties
print(domain.name)  # Get domain name
print(domain.id)    # Get domain ID

# List projects in the domain
for project in domain.projects:
    print(project.id)

# List users in the domain
for user in domain.users:
    print(user.id)

Build docs developers (and LLMs) love