about summary refs log tree commit diff
path: root/.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/registry/registry.py
diff options
context:
space:
mode:
authorS. Solomon Darnell2025-03-28 21:52:21 -0500
committerS. Solomon Darnell2025-03-28 21:52:21 -0500
commit4a52a71956a8d46fcb7294ac71734504bb09bcc2 (patch)
treeee3dc5af3b6313e921cd920906356f5d4febc4ed /.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/registry/registry.py
parentcc961e04ba734dd72309fb548a2f97d67d578813 (diff)
downloadgn-ai-master.tar.gz
two version of R2R are here HEAD master
Diffstat (limited to '.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/registry/registry.py')
-rw-r--r--.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/registry/registry.py53
1 files changed, 53 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/registry/registry.py b/.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/registry/registry.py
new file mode 100644
index 00000000..17233195
--- /dev/null
+++ b/.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/registry/registry.py
@@ -0,0 +1,53 @@
+# ---------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# ---------------------------------------------------------
+
+from marshmallow import fields
+
+from azure.ai.ml._schema.core.fields import DumpableStringField, NestedField, StringTransformedEnum, UnionField
+from azure.ai.ml._schema.core.intellectual_property import PublisherSchema
+from azure.ai.ml._schema.core.resource import ResourceSchema
+from azure.ai.ml._schema.workspace.identity import IdentitySchema
+from azure.ai.ml._utils.utils import snake_to_pascal
+from azure.ai.ml.constants._common import PublicNetworkAccess
+from azure.ai.ml.constants._registry import AcrAccountSku
+from azure.ai.ml.entities._registry.registry_support_classes import SystemCreatedAcrAccount
+
+from .registry_region_arm_details import RegistryRegionDetailsSchema
+from .system_created_acr_account import SystemCreatedAcrAccountSchema
+from .util import acr_format_validator
+
+
+# Based on 10-01-preview api
+class RegistrySchema(ResourceSchema):
+    # Inherits name, id, tags, and description fields from ResourceSchema
+
+    # Values from RegistryTrackedResource (Client name: Registry)
+    location = fields.Str(required=True)
+
+    # Values from Registry (Client name: RegistryProperties)
+    public_network_access = StringTransformedEnum(
+        allowed_values=[PublicNetworkAccess.DISABLED, PublicNetworkAccess.ENABLED],
+        casing_transform=snake_to_pascal,
+    )
+    replication_locations = fields.List(NestedField(RegistryRegionDetailsSchema))
+    intellectual_property = NestedField(PublisherSchema)
+    # This is an acr account which will be applied to every registryRegionArmDetail defined
+    # in replication_locations. This is different from the internal swagger
+    # definition, which has a per-region list of acr accounts.
+    # Per-region acr account configuration is NOT possible through yaml configs for now.
+    container_registry = UnionField(
+        [DumpableStringField(validate=acr_format_validator), NestedField(SystemCreatedAcrAccountSchema)],
+        required=False,
+        is_strict=True,
+        load_default=SystemCreatedAcrAccount(acr_account_sku=AcrAccountSku.PREMIUM),
+    )
+
+    # Values that can only be set by return values from the system, never
+    # set by the user.
+    identity = NestedField(IdentitySchema, dump_only=True)
+    kind = fields.Str(dump_only=True)
+    sku = fields.Str(dump_only=True)
+    managed_resource_group = fields.Str(dump_only=True)
+    mlflow_registry_uri = fields.Str(dump_only=True)
+    discovery_url = fields.Str(dump_only=True)