---
title: Charmhub | Deploy MAAS Region Controller using Charmhub - The Open Operator
  Collection
description: Deploy the latest version of MAAS Region Controller on any cloud.
url: https://charmhub.io/maas-region/libraries/maas
---

# MAAS Region Controller

[MAAS Maintainers](https://charmhub.io/publisher/maas-maintainers "View all packages from MAAS Maintainers")

* [MAAS Maintainers](https://charmhub.io/publisher/maas-maintainers "View all packages from MAAS Maintainers")

Platform:

26.04

24.04

22.04

edge 0af4e194

```
juju deploy maas-region --channel edge
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

[Toggle side navigation](https://charmhub.io/maas-region/libraries/maas#drawer)

## charms.maas\_region.v0.maas

* [*Docstrings*Docstrings](https://charmhub.io/maas-region/libraries/maas)
  [*Code*Source code](https://charmhub.io/maas-region/libraries/maas/source-code)
* + Download

    Fetch library

    ```
    charmcraft fetch-lib charms.maas_region.v0.maas
    ```

    [Download maas.py](https://charmhub.io/maas-region/libraries/maas/download)
  + *Last updated* 04 Aug 2025
  + *Revision* Library version 0.4

MAAS operator library.

Allows MAAS Agents to enroll with Region controllers

---

Index

* [class MaasInterfaceError](https://charmhub.io/maas-region/libraries/maas#maasinterfaceerror)
* [class MaasDatabag](https://charmhub.io/maas-region/libraries/maas#maasdatabag)
* + [def load(
    cls,
    data)](https://charmhub.io/maas-region/libraries/maas#maasdatabag-load)
* + [def dump(
    self,
    databag)](https://charmhub.io/maas-region/libraries/maas#maasdatabag-dump)
* [class MaasRequirerUnitData](https://charmhub.io/maas-region/libraries/maas#maasrequirerunitdata)
* [class MaasProviderAppData](https://charmhub.io/maas-region/libraries/maas#maasproviderappdata)
* + [def get\_secret(
    self,
    model)](https://charmhub.io/maas-region/libraries/maas#maasproviderappdata-get_secret)
* [class MaasConfigReceivedEvent](https://charmhub.io/maas-region/libraries/maas#maasconfigreceivedevent)
* + [def \_\_init\_\_(
    self,
    handle,
    config)](https://charmhub.io/maas-region/libraries/maas#maasconfigreceivedevent-__init__)
* + [def snapshot(
    self)](https://charmhub.io/maas-region/libraries/maas#maasconfigreceivedevent-snapshot)
* + [def restore(
    self,
    snapshot)](https://charmhub.io/maas-region/libraries/maas#maasconfigreceivedevent-restore)
* [class MaasAgentRemovedEvent](https://charmhub.io/maas-region/libraries/maas#maasagentremovedevent)
* [class MaasRegionRequirerEvents](https://charmhub.io/maas-region/libraries/maas#maasregionrequirerevents)
* [class MaasRegionRequirer](https://charmhub.io/maas-region/libraries/maas#maasregionrequirer)
* + [def \_\_init\_\_(
    self,
    charm,
    key,
    endpoint)](https://charmhub.io/maas-region/libraries/maas#maasregionrequirer-__init__)
* + [def get\_enroll\_data(
    self)](https://charmhub.io/maas-region/libraries/maas#maasregionrequirer-get_enroll_data)
* + [def is\_published(
    self)](https://charmhub.io/maas-region/libraries/maas#maasregionrequirer-is_published)
* + [def publish\_unit\_hostname(
    self,
    hostname)](https://charmhub.io/maas-region/libraries/maas#maasregionrequirer-publish_unit_hostname)
* [class MaasRegionProvider](https://charmhub.io/maas-region/libraries/maas#maasregionprovider)
* + [def \_\_init\_\_(
    self,
    charm,
    key,
    endpoint)](https://charmhub.io/maas-region/libraries/maas#maasregionprovider-__init__)
* + [def publish\_enroll\_token(
    self,
    maas\_api,
    regions,
    maas\_secret)](https://charmhub.io/maas-region/libraries/maas#maasregionprovider-publish_enroll_token)
* + [def gather\_rack\_units(
    self)](https://charmhub.io/maas-region/libraries/maas#maasregionprovider-gather_rack_units)

#### class MaasInterfaceError

Description

Common ancestor for MAAS interface related exceptions. None

#### class MaasDatabag

Description

Base class from MAAS databags. None

Methods

MaasDatabag.
load(

cls

,
data
)

Description

Load from dictionary. None

MaasDatabag.
dump(

*self*

,
databag
)

Description

Write the contents of this model to Juju databag. None

#### class MaasRequirerUnitData

Description

The schema for the Requirer side of this relation. None

#### class MaasProviderAppData

Description

The schema for the Provider side of this relation. None

Methods

MaasProviderAppData.
get\_secret(

*self*

,
model
)

Retrieve MAAS secret.

Returns

str

the secret

#### class MaasConfigReceivedEvent

Description

Event emitted when the Region has shared the secret. None

Methods

MaasConfigReceivedEvent.
\_\_init\_\_(

*self*

,
handle: Handle

,
config
)

MaasConfigReceivedEvent.
snapshot(

*self*
)

Serialize the event to disk.

Description

Not meant to be called by charm code.

MaasConfigReceivedEvent.
restore(

*self*

,
snapshot
)

Deserialize the event from disk.

Description

Not meant to be called by charm code.

#### class MaasAgentRemovedEvent

Event emitted when the relation with the "maas-region" provider has been severed.

Description

Or when the relation data has been wiped.

#### class MaasRegionRequirerEvents

Description

MAAS events. None

#### class MaasRegionRequirer

Description

Requires-side of the MAAS relation. None

Methods

MaasRegionRequirer.
\_\_init\_\_(

*self*

,
charm

,
key

,
endpoint: str
)

MaasRegionRequirer.
get\_enroll\_data(

*self*
)

Description

Get enrollment data from databag. None

MaasRegionRequirer.
is\_published(

*self*
)

Description

Verify that the local side has done all they need to do. None

MaasRegionRequirer.
publish\_unit\_hostname(

*self*

,
hostname: str
)

Description

Publish unit hostname in the databag. None

#### class MaasRegionProvider

Description

Provides-side of the MAAS relation. None

Methods

MaasRegionProvider.
\_\_init\_\_(

*self*

,
charm

,
key

,
endpoint: str
)

MaasRegionProvider.
publish\_enroll\_token(

*self*

,
maas\_api: str

,
regions

,
maas\_secret: str
)

Publish enrollment data.

Arguments

maas\_api
(str)

MAAS API URL

regions
(list[str])

List of MAAS regions

maas\_secret
(str)

Enrollment token

MaasRegionProvider.
gather\_rack\_units(

*self*
)

Get a map of Rack units.

Returns

dict[str, ops.model.Unit]

map of units
