{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-sql-database/json-schema/microsoft-azure-sql-database-distributed-availability-groups-list-result-schema.json",
  "title": "DistributedAvailabilityGroupsListResult",
  "description": "A list of distributed availability groups in instance.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-sql-database-distributedavailabilitygroups-api-openapi.yml#/components/schemas/DistributedAvailabilityGroupsListResult",
  "type": "object",
  "properties": {
    "value": {
      "type": "array",
      "description": "Array of results.",
      "items": {
        "$ref": "#/$defs/DistributedAvailabilityGroup"
      },
      "readOnly": true
    },
    "nextLink": {
      "type": "string",
      "description": "Link to retrieve next page of results.",
      "readOnly": true
    }
  },
  "$defs": {
    "Azure.Core.uuid": {
      "type": "string",
      "format": "uuid",
      "description": "Universally Unique Identifier"
    },
    "CertificateInfo": {
      "type": "object",
      "description": "Certificate information",
      "properties": {
        "certificateName": {
          "type": "string",
          "description": "The certificate name",
          "readOnly": true
        },
        "expiryDate": {
          "type": "string",
          "format": "date-time",
          "description": "The certificate expiry date",
          "readOnly": true
        }
      }
    },
    "DistributedAvailabilityGroup": {
      "type": "object",
      "description": "Distributed availability group between box and Sql Managed Instance.",
      "properties": {
        "properties": {
          "$ref": "#/$defs/DistributedAvailabilityGroupProperties",
          "description": "Resource properties.",
          "x-ms-client-flatten": true
        }
      },
      "allOf": [
        {
          "$ref": "#/$defs/ProxyResource"
        }
      ]
    },
    "DistributedAvailabilityGroupDatabase": {
      "type": "object",
      "description": "Database specific information",
      "properties": {
        "databaseName": {
          "type": "string",
          "description": "The name of the database in link"
        },
        "instanceReplicaId": {
          "$ref": "#/$defs/Azure.Core.uuid",
          "description": "Managed instance replica id",
          "readOnly": true
        },
        "partnerReplicaId": {
          "$ref": "#/$defs/Azure.Core.uuid",
          "description": "SQL server replica id",
          "readOnly": true
        },
        "replicaState": {
          "type": "string",
          "description": "Current link state",
          "readOnly": true
        },
        "seedingProgress": {
          "type": "string",
          "description": "Seeding progress",
          "readOnly": true
        },
        "synchronizationHealth": {
          "$ref": "#/$defs/ReplicaSynchronizationHealth",
          "description": "Link health state",
          "readOnly": true
        },
        "connectedState": {
          "$ref": "#/$defs/ReplicaConnectedState",
          "description": "Link connected state",
          "readOnly": true
        },
        "lastReceivedLsn": {
          "type": "string",
          "description": "Last received LSN",
          "readOnly": true
        },
        "lastReceivedTime": {
          "type": "string",
          "format": "date-time",
          "description": "Last received LSN time",
          "readOnly": true
        },
        "lastSentLsn": {
          "type": "string",
          "description": "Last sent LSN",
          "readOnly": true
        },
        "lastSentTime": {
          "type": "string",
          "format": "date-time",
          "description": "Last sent LSN time",
          "readOnly": true
        },
        "lastCommitLsn": {
          "type": "string",
          "description": "Last commit LSN",
          "readOnly": true
        },
        "lastCommitTime": {
          "type": "string",
          "format": "date-time",
          "description": "Last commit LSN time",
          "readOnly": true
        },
        "lastHardenedLsn": {
          "type": "string",
          "description": "Last hardened LSN",
          "readOnly": true
        },
        "lastHardenedTime": {
          "type": "string",
          "format": "date-time",
          "description": "Last hardened LSN time",
          "readOnly": true
        },
        "lastBackupLsn": {
          "type": "string",
          "description": "Last backup LSN",
          "readOnly": true
        },
        "lastBackupTime": {
          "type": "string",
          "format": "date-time",
          "description": "Last backup LSN time",
          "readOnly": true
        },
        "mostRecentLinkError": {
          "type": "string",
          "description": "The most recent link connection error description",
          "readOnly": true
        },
        "partnerAuthCertValidity": {
          "$ref": "#/$defs/CertificateInfo",
          "description": "SQL server certificate validity",
          "readOnly": true
        },
        "instanceSendReplicationLagSeconds": {
          "type": "integer",
          "format": "int32",
          "description": "Replication lag when Managed Instance link side is primary",
          "readOnly": true
        },
        "instanceRedoReplicationLagSeconds": {
          "type": "integer",
          "format": "int32",
          "description": "Redo lag when Managed Instance link side is primary",
          "readOnly": true
        }
      }
    },
    "DistributedAvailabilityGroupProperties": {
      "type": "object",
      "description": "The properties of a distributed availability group.",
      "properties": {
        "distributedAvailabilityGroupName": {
          "type": "string",
          "description": "Name of the distributed availability group",
          "readOnly": true
        },
        "distributedAvailabilityGroupId": {
          "$ref": "#/$defs/Azure.Core.uuid",
          "description": "ID of the distributed availability group",
          "readOnly": true
        },
        "replicationMode": {
          "$ref": "#/$defs/ReplicationModeType",
          "description": "Replication mode of the link"
        },
        "partnerLinkRole": {
          "$ref": "#/$defs/LinkRole",
          "description": "SQL server side link role",
          "readOnly": true
        },
        "partnerAvailabilityGroupName": {
          "type": "string",
          "description": "SQL server side availability group name"
        },
        "partnerEndpoint": {
          "type": "string",
          "description": "SQL server side endpoint - IP or DNS resolvable name"
        },
        "instanceLinkRole": {
          "$ref": "#/$defs/LinkRole",
          "description": "Managed instance side link role"
        },
        "instanceAvailabilityGroupName": {
          "type": "string",
          "description": "Managed instance side availability group name"
        },
        "failoverMode": {
          "$ref": "#/$defs/FailoverModeType",
          "description": "The link failover mode - can be Manual if intended to be used for two-way failover with a supported SQL Server, or None for one-way failover to Azure."
        },
        "seedingMode": {
          "$ref": "#/$defs/SeedingModeType",
          "description": "Database seeding mode – can be Automatic (default), or Manual for supported scenarios."
        },
        "databases": {
          "type": "array",
          "description": "Databases in the distributed availability group",
          "items": {
            "$ref": "#/$defs/DistributedAvailabilityGroupDatabase"
          }
        }
      }
    },
    "FailoverModeType": {
      "type": "string",
      "description": "The link failover mode - can be Manual if intended to be used for two-way failover with a supported SQL Server, or None for one-way failover to Azure.",
      "enum": [
        "None",
        "Manual"
      ],
      "x-ms-enum": {
        "name": "FailoverModeType",
        "modelAsString": true,
        "values": [
          {
            "name": "None",
            "value": "None",
            "description": "None"
          },
          {
            "name": "Manual",
            "value": "Manual",
            "description": "Manual"
          }
        ]
      }
    },
    "LinkRole": {
      "type": "string",
      "description": "SQL server side link role",
      "enum": [
        "Primary",
        "Secondary"
      ],
      "x-ms-enum": {
        "name": "LinkRole",
        "modelAsString": true,
        "values": [
          {
            "name": "Primary",
            "value": "Primary",
            "description": "Primary"
          },
          {
            "name": "Secondary",
            "value": "Secondary",
            "description": "Secondary"
          }
        ]
      }
    },
    "ProxyResource": {
      "type": "object",
      "title": "Proxy Resource",
      "description": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location",
      "allOf": [
        {
          "$ref": "#/$defs/Resource"
        }
      ]
    },
    "ReplicaConnectedState": {
      "type": "string",
      "description": "Link connected state",
      "enum": [
        "DISCONNECTED",
        "CONNECTED"
      ],
      "x-ms-enum": {
        "name": "ReplicaConnectedState",
        "modelAsString": true,
        "values": [
          {
            "name": "DISCONNECTED",
            "value": "DISCONNECTED",
            "description": "DISCONNECTED"
          },
          {
            "name": "CONNECTED",
            "value": "CONNECTED",
            "description": "CONNECTED"
          }
        ]
      }
    },
    "ReplicaSynchronizationHealth": {
      "type": "string",
      "description": "Link health state",
      "enum": [
        "NOT_HEALTHY",
        "PARTIALLY_HEALTHY",
        "HEALTHY"
      ],
      "x-ms-enum": {
        "name": "ReplicaSynchronizationHealth",
        "modelAsString": true,
        "values": [
          {
            "name": "NOT_HEALTHY",
            "value": "NOT_HEALTHY",
            "description": "NOT_HEALTHY"
          },
          {
            "name": "PARTIALLY_HEALTHY",
            "value": "PARTIALLY_HEALTHY",
            "description": "PARTIALLY_HEALTHY"
          },
          {
            "name": "HEALTHY",
            "value": "HEALTHY",
            "description": "HEALTHY"
          }
        ]
      }
    },
    "ReplicationModeType": {
      "type": "string",
      "description": "Replication mode of the link",
      "enum": [
        "Async",
        "Sync"
      ],
      "x-ms-enum": {
        "name": "ReplicationModeType",
        "modelAsString": true,
        "values": [
          {
            "name": "Async",
            "value": "Async",
            "description": "Async"
          },
          {
            "name": "Sync",
            "value": "Sync",
            "description": "Sync"
          }
        ]
      }
    },
    "SeedingModeType": {
      "type": "string",
      "description": "Database seeding mode – can be Automatic (default), or Manual for supported scenarios.",
      "enum": [
        "Automatic",
        "Manual"
      ],
      "x-ms-enum": {
        "name": "SeedingModeType",
        "modelAsString": true,
        "values": [
          {
            "name": "Automatic",
            "value": "Automatic",
            "description": "Automatic"
          },
          {
            "name": "Manual",
            "value": "Manual",
            "description": "Manual"
          }
        ]
      }
    }
  }
}