# Storage

## Storage Base

class designate.storage.sqlalchemy.SQLAlchemyStorage

  Bases: `SQLAlchemy`

  SQLAlchemy connection

  count_records(context, criterion=None)

    Count records

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

  count_recordsets(context, criterion=None)

    Count recordsets

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

  count_tenants(context)

    Count tenants

    Parameters:

      context – RPC Context.

  count_zone_tasks(context, criterion=None)
  count_zone_transfer_accept(context, criterion=None)
  count_zones(context, criterion=None)

    Count zones

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

  create_blacklist(context, blacklist)

    Create a Blacklist.

    Parameters:

      - context – RPC Context.

      - blacklist – Blacklist object with the values to be created.

  create_pool(context, pool)

    Create a Pool.

    Parameters:

      - context – RPC Context.

      - pool – Pool object with the values to be created.

  create_pool_also_notify(context, pool_id, pool_also_notify)
  create_pool_attribute(context, pool_id, pool_attribute)

    Create a PoolAttribute.

    Parameters:

      - context – RPC Context.

      - pool_id – The ID of the pool to which the attribute belongs.

      - pool_attribute – PoolAttribute object with the values created.

  create_pool_nameserver(context, pool_id, pool_nameserver)
  create_pool_ns_record(context, pool_id, pool_ns_record)
  create_pool_target(context, pool_id, pool_target)
  create_pool_target_master(context, pool_target_id, pool_target_master)
  create_pool_target_option(context, pool_target_id, pool_target_option)
  create_quota(context, quota)

    Create a Quota.

    Parameters:

      - context – RPC Context.

      - quota – Quota object with the values to be created.

  create_record(context, zone_id, recordset_id, record)

    Create a record on a given Zone ID

    Parameters:

      - context – RPC Context.

      - zone_id – Zone ID to create the record in.

      - recordset_id – RecordSet ID to create the record in.

      - record – Record object with the values to be created.

  create_recordset(context, zone_id, recordset)

    Create a recordset on a given Zone ID

    Parameters:

      - context – RPC Context.

      - zone_id – Zone ID to create the recordset in.

      - recordset – RecordSet object with the values to be created.

  create_service_status(context, service_status)

    Create a Service status for a service.

    Parameters:

      - context – RPC Context.

      - service_status – The status of a service.

  create_tld(context, tld)

    Create a TLD.

    Parameters:

      - context – RPC Context.

      - tld – Tld object with the values to be created.

  create_tsigkey(context, tsigkey)

    Create a TSIG Key.

    Parameters:

      - context – RPC Context.

      - tsigkey – TsigKey object with the values to be created.

  create_zone(context, zone)

    Create a new Zone.

    Parameters:

      - context – RPC Context.

      - zone – Zone object with the values to be created.

  create_zone_attribute(context, zone_id, zone_attribute)
  create_zone_export(context, zone_export)

    Create a Zone Export.

    Parameters:

      - context – RPC Context.

      - zone_export – Zone Export object with the values to be created.

  create_zone_import(context, zone_import)

    Create a Zone Import.

    Parameters:

      - context – RPC Context.

      - zone_import – Zone Import object with the values to be created.

  create_zone_master(context, zone_id, zone_master)
  create_zone_transfer_accept(context, zone_transfer_accept)
  create_zone_transfer_request(context, zone_transfer_request)
  delete_blacklist(context, blacklist_id)

    Delete a Blacklist via ID.

    Parameters:

      - context – RPC Context.

      - blacklist_id – Delete a Blacklist via ID

  delete_pool(context, pool_id)

    Delete the pool with the matching id

    Parameters:

      - context – RPC Context.

      - pool_id – The ID of the pool to be deleted

  delete_pool_also_notify(context, pool_also_notify_id)
  delete_pool_attribute(context, pool_attribute_id)

    Delete the pool with the matching id

    Parameters:

      - context – RPC Context.

      - pool_attribute_id – The ID of the PoolAttribute to be deleted

  delete_pool_nameserver(context, pool_nameserver_id)
  delete_pool_ns_record(context, pool_ns_record_id)
  delete_pool_target(context, pool_target_id)
  delete_pool_target_master(context, pool_target_master_id)
  delete_pool_target_option(context, pool_target_option_id)
  delete_quota(context, quota_id)

    Delete a Quota via ID.

    Parameters:

      - context – RPC Context.

      - quota_id – Delete a Quota via ID

  delete_record(context, record_id)

    Delete a record

    Parameters:

      - context – RPC Context.

      - record_id – Record ID to delete

  delete_recordset(context, recordset_id)

    Delete a recordset

    Parameters:

      - context – RPC Context.

      - recordset_id – RecordSet ID to delete

  delete_service_status(context, service_status)

    Delete the Service status.

    Parameters:

      - context – RPC Context.

      - service_status – Status for a service.

  delete_tld(context, tld_id)

    Delete a TLD via ID.

    Parameters:

      - context – RPC Context.

      - tld_id – Delete a TLD via ID

  delete_tsigkey(context, tsigkey_id)

    Delete a TSIG Key via ID.

    Parameters:

      - context – RPC Context.

      - tsigkey_id – Delete a TSIG Key via ID

  delete_zone(context, zone_id)

    Delete a Zone

    Parameters:

      - context – RPC Context.

      - zone_id – Zone ID to delete.

  delete_zone_attribute(context, zone_attribute_id)
  delete_zone_export(context, zone_export_id)

    Delete a Zone Export via ID.

    Parameters:

      - context – RPC Context.

      - zone_export_id – Delete a Zone Export via ID

  delete_zone_import(context, zone_import_id)

    Delete a Zone Import via ID.

    Parameters:

      - context – RPC Context.

      - zone_import_id – Delete a Zone Import via ID

  delete_zone_master(context, zone_master_id)
  delete_zone_shares(zone_id)

    Delete all of the zone shares for a specific zone.

    Parameters:

      zone_id – The zone ID to check.

  delete_zone_transfer_accept(context, zone_transfer_accept_id)
  delete_zone_transfer_request(context, zone_transfer_request_id)
  find_blacklist(context, criterion)

    Find a single Blacklist.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

  find_blacklists(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)

    Find Blacklists

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

      - marker – Resource ID from which after the requested page will start after

      - limit – Integer limit of objects of the page size after the marker

      - sort_key – Key from which to sort after.

      - sort_dir – Direction to sort after using sort_key.

  find_pool(context, criterion)

    Find a single Pool.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

  find_pool_also_notifies(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)
  find_pool_also_notify(context, criterion)
  find_pool_attribute(context, criterion)

    Find a single PoolAttribute

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

  find_pool_attributes(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)

    Find all PoolAttributes

    Parameters:

      - context – RPC Context

      - criterion – Criteria by which to filer

      - marker – Resource ID used by paging. The next page will start at the next resource after the marker

      - limit – Integer limit of objects on the page

      - sort_key – Key used to sort the returned list

      - sort_dir – Directions to sort after using sort_key

  find_pool_nameserver(context, criterion)
  find_pool_nameservers(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)
  find_pool_target(context, criterion)
  find_pool_targets(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)
  find_pools(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)

    Find all Pools

    Parameters:

      - context – RPC Context.

      - criterion – Criteria by which to filter

      - marker – Resource ID used by paging. The next page will start at the next resource after the marker

      - limit – Integer limit of objects on the page

      - sort_key – Key used to sort the returned list

      - sort_dir – Directions to sort after using sort_key

  find_quota(context, criterion)

    Find a single Quota.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

  find_quotas(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)

    Find Quotas

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

      - marker – Resource ID from which after the requested page will start after

      - limit – Integer limit of objects of the page size after the marker

      - sort_key – Key from which to sort after.

      - sort_dir – Direction to sort after using sort_key.

  find_record(context, criterion)

    Find a single Record.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

  find_records(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)

    Find Records.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

      - marker – Resource ID from which after the requested page will start after

      - limit – Integer limit of objects of the page size after the marker

      - sort_key – Key from which to sort after.

      - sort_dir – Direction to sort after using sort_key.

  find_recordset(context, criterion, apply_tenant_criteria=True)

    Find a single RecordSet.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

      - apply_tenant_criteria – Whether to filter results by project_id.

  find_recordsets(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None, force_index=False, apply_tenant_criteria=True)

    Find RecordSets.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

      - marker – Resource ID from which after the requested page will start after

      - limit – Integer limit of objects of the page size after the marker

      - sort_key – Key from which to sort after.

      - sort_dir – Direction to sort after using sort_key.

      - apply_tenant_criteria – Whether to filter results by project_id.

  find_recordsets_axfr(context, criterion=None)

    Find RecordSets.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

  find_recordsets_export(context, criterion=None)
  find_service_status(context, criterion)

    Find a single Service Status.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

  find_service_statuses(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)

    Retrieve status for services

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

      - marker – Resource ID from which after the requested page will start after

      - limit – Integer limit of objects of the page size after the marker

      - sort_key – Key from which to sort after.

      - sort_dir – Direction to sort after using sort_key.

  find_shared_zones(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)

    Find shared zones

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

      - marker – Resource ID from which after the requested page will start after

      - limit – Integer limit of objects of the page size after the marker

      - sort_key – Key from which to sort after.

      - sort_dir – Direction to sort after using sort_key.

  find_tenants(context)

    Find all Tenants.

    Parameters:

      context – RPC Context.

  find_tld(context, criterion)

    Find a single TLD.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

  find_tlds(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)

    Find TLDs

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

      - marker – Resource ID from which after the requested page will start after

      - limit – Integer limit of objects of the page size after the marker

      - sort_key – Key from which to sort after.

      - sort_dir – Direction to sort after using sort_key.

  find_tsigkey(context, criterion)

    Find TSIG Key.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

  find_tsigkeys(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)

    Find TSIG Keys.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

      - marker – Resource ID from which after the requested page will start after

      - limit – Integer limit of objects of the page size after the marker

      - sort_key – Key from which to sort after.

      - sort_dir – Direction to sort after using sort_key.

  find_zone(context, criterion)

    Find a single Zone.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

  find_zone_attributes(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)
  find_zone_export(context, criterion)

    Find a single Zone Export.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

  find_zone_exports(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)

    Find Zone Exports

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

      - marker – Resource ID from which after the requested page will start after

      - limit – Integer limit of objects of the page size after the marker

      - sort_key – Key from which to sort after.

      - sort_dir – Direction to sort after using sort_key.

  find_zone_import(context, criterion)

    Find a single Zone Import.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

  find_zone_imports(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)

    Find Zone Imports

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

      - marker – Resource ID from which after the requested page will start after

      - limit – Integer limit of objects of the page size after the marker

      - sort_key – Key from which to sort after.

      - sort_dir – Direction to sort after using sort_key.

  find_zone_transfer_accept(context, criterion)
  find_zone_transfer_accepts(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)
  find_zone_transfer_request(context, criterion)
  find_zone_transfer_requests(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)
  find_zones(context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None)

    Find zones

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

      - marker – Resource ID from which after the requested page will start after

      - limit – Integer limit of objects of the page size after the marker

      - sort_key – Key from which to sort after.

      - sort_dir – Direction to sort after using sort_key.

  get_blacklist(context, blacklist_id)

    Get a Blacklist via ID.

    Parameters:

      - context – RPC Context.

      - blacklist_id – Blacklist ID to get.

  get_catalog_zone(context, pool)
  get_catalog_zone_records(context, pool)
  get_inspector()
  get_pool(context, pool_id)

    Get a Pool via the id

    Parameters:

      - context – RPC Context.

      - pool_id – The ID of the pool to get

  get_pool_also_notify(context, pool_also_notify_id)
  get_pool_attribute(context, pool_attribute_id)

    Get a PoolAttribute via the ID

    Parameters:

      - context – RPC Context.

      - pool_attribute_id – The ID of the PoolAttribute to get

  get_pool_nameserver(context, pool_nameserver_id)
  get_pool_target(context, pool_target_id)
  get_quota(context, quota_id)

    Get a Quota via ID.

    Parameters:

      - context – RPC Context.

      - quota_id – Quota ID to get.

  get_record(context, record_id)

    Get a record via ID

    Parameters:

      - context – RPC Context.

      - record_id – Record ID to get

  get_shared_zone(context, zone_id, shared_zone_id)

    Get a shared zone via ID

    Parameters:

      - context – RPC Context.

      - shared_zone_id – Shared Zone Id

  get_tenant(context, tenant_id)

    Get Tenant.

    Parameters:

      - context – RPC Context.

      - tenant_id – ID of the Tenant.

  get_tld(context, tld_id)

    Get a TLD via ID.

    Parameters:

      - context – RPC Context.

      - tld_id – TLD ID to get.

  get_tsigkey(context, tsigkey_id)

    Get a TSIG Key via ID.

    Parameters:

      - context – RPC Context.

      - tsigkey_id – Server ID to get.

  get_zone(context, zone_id, apply_tenant_criteria=True)

    Get a Zone via its ID.

    Parameters:

      - context – RPC Context.

      - zone_id – ID of the Zone.

      - apply_tenant_criteria – Whether to filter results by project_id.

  get_zone_attributes(context, zone_attribute_id)
  get_zone_export(context, zone_export_id)

    Get a Zone Export via ID.

    Parameters:

      - context – RPC Context.

      - zone_export_id – Zone Export ID to get.

  get_zone_import(context, zone_import_id)

    Get a Zone Import via ID.

    Parameters:

      - context – RPC Context.

      - zone_import_id – Zone Import ID to get.

  get_zone_transfer_accept(context, zone_transfer_accept_id)
  get_zone_transfer_request(context, zone_transfer_request_id)
  increment_serial(context, zone_id)

    Increment the zone’s serial number.

  is_zone_shared_with_project(zone_id, project_id)

    Checks if a zone is shared with a project.

    Parameters:

      - zone_id – The zone ID to check.

      - project_id – The project ID to check.

    Returns:

      Boolean True/False if the zone is shared with the project.

  purge_zone(context, zone)

    Purge a Zone, effectively removing the zone database record.

    Parameters:

      - context – RPC Context.

      - zone – Zone to delete.

  purge_zones(context, criterion, limit)

    Purge Zones, effectively removing the zones database records.

    Reparent orphan childrens, if any. Transactions/locks are not needed.

    Parameters:

      - context – RPC Context.

      - criterion – Criteria to filter by.

      - limit – Integer limit of objects of the page size after the marker

  share_zone(context, shared_zone)

    Share zone

    Parameters:

      - context – RPC Context.

      - shared_zone – Shared Zone dict

  unshare_zone(context, zone_id, shared_zone_id)

    Unshare zone

    Parameters:

      - context – RPC Context.

      - shared_zone_id – Shared Zone Id

  update_blacklist(context, blacklist)

    Update a Blacklist

    Parameters:

      - context – RPC Context.

      - blacklist – Blacklist to update.

  update_pool(context, pool)

    Update the specified pool

    Parameters:

      - context – RPC Context.

      - pool – Pool to update.

  update_pool_also_notify(context, pool_also_notify)
  update_pool_attribute(context, pool_attribute)

    Update the specified pool

    Parameters:

      - context – RPC Context.

      - pool_attribute – PoolAttribute to update

  update_pool_nameserver(context, pool_nameserver)
  update_pool_ns_record(context, pool_ns_record)
  update_pool_target(context, pool_target)
  update_pool_target_master(context, pool_target_master)
  update_pool_target_option(context, pool_target_option)
  update_quota(context, quota)

    Update a Quota

    Parameters:

      - context – RPC Context.

      - quota – Quota to update.

  update_record(context, record)

    Update a record

    Parameters:

      - context – RPC Context.

      - record – Record to update

  update_recordset(context, recordset)

    Update a recordset

    Parameters:

      - context – RPC Context.

      - recordset – RecordSet to update

  update_service_status(context, service_status)

    Update the Service status for a service.

    Parameters:

      - context – RPC Context.

      - service_status – Set the status for a service.

  update_tld(context, tld)

    Update a TLD

    Parameters:

      - context – RPC Context.

      - tld – TLD to update.

  update_tsigkey(context, tsigkey)

    Update a TSIG Key

    Parameters:

      - context – RPC Context.

      - tsigkey – TSIG Keyto update.

  update_zone(context, zone)

    Update a Zone

    Parameters:

      - context – RPC Context.

      - zone – Zone object.

  update_zone_attribute(context, zone_attribute)
  update_zone_export(context, zone_export)

    Update a Zone Export

    Parameters:

      - context – RPC Context.

      - zone_export – Zone Export to update.

  update_zone_import(context, zone_import)

    Update a Zone Import

    Parameters:

      - context – RPC Context.

      - zone_import – Zone Import to update.

  update_zone_master(context, zone_master)
  update_zone_transfer_accept(context, zone_transfer_accept)
  update_zone_transfer_request(context, zone_transfer_request)

this page last updated: 2026-04-13 15:37:16

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