diff --git a/src/service_name.json b/src/service_name.json index c27f62afdff..414aae014d4 100644 --- a/src/service_name.json +++ b/src/service_name.json @@ -968,5 +968,10 @@ "Command": "az networkfabric", "AzureServiceName": "Nexus Network Fabric", "URL": "https://learn.microsoft.com/en-us/azure/operator-nexus/concepts-network-fabric" + }, + { + "Command": "az site", + "AzureServiceName": "Azure Arc site manager", + "URL": "https://learn.microsoft.com/en-us/azure/azure-arc/site-manager/" } ] diff --git a/src/site/HISTORY.rst b/src/site/HISTORY.rst new file mode 100644 index 00000000000..abbff5a61a7 --- /dev/null +++ b/src/site/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +1.0.0b1 +++++++ +* Initial release. \ No newline at end of file diff --git a/src/site/README.md b/src/site/README.md new file mode 100644 index 00000000000..0a687d88817 --- /dev/null +++ b/src/site/README.md @@ -0,0 +1,86 @@ +# Azure CLI Site Extension # +This is an extension to Azure CLI to manage Site resources. + +## How to use ## +Install this extension using the below CLI command +``` +az extension add --name site +``` +## What is Azure Arc site manager? +Azure Arc site manager allows you to manage and monitor your on-premises environments as Azure Arc sites. Arc sites are scoped to an Azure resource group, subscription or service group and enable you to track connectivity, alerts, and updates across your environment. The experience is tailored for on-premises scenarios where infrastructure is often managed within a common physical boundary, such as a store, restaurant, or factory. + +### Included Features ### +##### Create a Site at service group scope ##### + ``` + az site create --site-name TestSiteName --service-group TestSGName --display-name 'Test Site Display' --description "Test Site" --labels key1="value1" key2="value2" --street-address1="16 TOWNSEND ST" --street-address2="UNIT 1" --city="newyork" --state-or-province="CA" --country="US" --postal-code="94107" + ``` + +##### Create a Site at resource group scope ##### + ``` + az site create --site-name TestSiteName --resource-group TestRGName --subscription 000000000-0000-0000-0000-000000000000 --display-name 'Test Site Display' --description "Test Site" --street-address1="16 TOWNSEND ST" --street-address2="UNIT 1" --city="newyork" --state-or-province="CA" --country="US" --postal-code="94107" + ``` + +##### Create a Site at subscription scope ##### + ``` + az site create --site-name TestSiteName --subscription 000000000-0000-0000-0000-000000000000 --display-name 'Test Site Display' --description "Test Site" --labels key1="value1" --street-address1="16 TOWNSEND ST" --street-address2="UNIT 1" --city="newyork" --state-or-province="CA" --country="US" --postal-code="94107" + ``` + +##### Delete a Site at service group scope ##### + ``` + az site delete --site-name TestSiteName --service-group TestSGName + ``` + +##### Delete a Site at resource group scope ##### + ``` + az site delete --site-name TestSiteName --resource-group TestRGName --subscription 00000000-0000-0000-0000-000000000000 + ``` + +##### Delete a Site at subscription scope ##### + ``` + az site delete --site-name TestSiteName --subscription 00000000-0000-0000-0000-000000000000 + ``` + +##### List Sites at service group scope ##### + ``` + az site list --service-group TestSGName + ``` + +##### List Sites at resource group scope ##### + ``` + az site list --resource-group TestRGName --subscription 00000000000-0000-0000-0000-000000000000 + ``` + +##### List Sites at subscription scope ##### + ``` + az site list --subscription 00000000000-0000-0000-0000-000000000000 + ``` + +##### Show a Site at service group scope ##### + ``` + az site show --site-name TestSiteName --service-group TestSGName + ``` + +##### Show a Site at resource group scope ##### + ``` + az site show --site-name TestSiteName --resource-group TestRGName --subscription 00000000-0000-0000-0000-000000000000 + ``` + +##### Show a Site at subscription scope ##### + ``` + az site show --site-name TestSiteName --subscription 00000000-0000-0000-0000-000000000000 + ``` + +##### Update a Site at service group scope ##### + ``` + az site update --site-name TestSiteName --service-group TestSGName --description "Test Site" --labels key1="value1" key2="value2" --street-address1="17 TOWNSEND ST" --street-address2="UNIT 2" --city="newyork" --state-or-province="CA" --country="US" --postal-code="94107" + ``` + +##### Update a Site at resource group scope ##### + ``` + az site update --site-name TestSiteName --resource-group TestMSRG --subscription 00000000-0000-0000-0000-000000000000 --description "Test Site" --labels key1="value1" key2="value2" --street-address1="17 TOWNSEND ST" --street-address2="UNIT 2" --city="newyork" --state-or-province="CA" --country="US" --postal-code="94107" + ``` + +##### Update a Site at subscription scope ##### + ``` + az site update --site-name TestSiteName --subscription 00000000-0000-0000-0000-000000000000 --description "Test Site" --labels key1="value1" key2="value2" --street-address1="17 TOWNSEND ST" --street-address2="UNIT 2" --city="newyork" --state-or-province="CA" --country="US" --postal-code="94107" + ``` \ No newline at end of file diff --git a/src/site/azext_site/__init__.py b/src/site/azext_site/__init__.py new file mode 100644 index 00000000000..658c41b5857 --- /dev/null +++ b/src/site/azext_site/__init__.py @@ -0,0 +1,42 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader +from azext_site._help import helps # pylint: disable=unused-import + + +class SiteCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + custom_command_type = CliCommandType( + operations_tmpl='azext_site.custom#{}') + super().__init__(cli_ctx=cli_ctx, + custom_command_type=custom_command_type) + + def load_command_table(self, args): + from azext_site.commands import load_command_table + from azure.cli.core.aaz import load_aaz_command_table + try: + from . import aaz + except ImportError: + aaz = None + if aaz: + load_aaz_command_table( + loader=self, + aaz_pkg_name=aaz.__name__, + args=args + ) + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_site._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = SiteCommandsLoader diff --git a/src/site/azext_site/_help.py b/src/site/azext_site/_help.py new file mode 100644 index 00000000000..126d5d00714 --- /dev/null +++ b/src/site/azext_site/_help.py @@ -0,0 +1,11 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines + +from knack.help_files import helps # pylint: disable=unused-import diff --git a/src/site/azext_site/_params.py b/src/site/azext_site/_params.py new file mode 100644 index 00000000000..cfcec717c9c --- /dev/null +++ b/src/site/azext_site/_params.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + + +def load_arguments(self, _): # pylint: disable=unused-argument + pass diff --git a/src/site/azext_site/aaz/__init__.py b/src/site/azext_site/aaz/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/site/azext_site/aaz/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/site/azext_site/aaz/latest/__init__.py b/src/site/azext_site/aaz/latest/__init__.py new file mode 100644 index 00000000000..f6acc11aa4e --- /dev/null +++ b/src/site/azext_site/aaz/latest/__init__.py @@ -0,0 +1,10 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + diff --git a/src/site/azext_site/aaz/latest/site/__cmd_group.py b/src/site/azext_site/aaz/latest/site/__cmd_group.py new file mode 100644 index 00000000000..61c0dd9ad83 --- /dev/null +++ b/src/site/azext_site/aaz/latest/site/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "site", +) +class __CMDGroup(AAZCommandGroup): + """Manage Site + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/site/azext_site/aaz/latest/site/__init__.py b/src/site/azext_site/aaz/latest/site/__init__.py new file mode 100644 index 00000000000..c401f439385 --- /dev/null +++ b/src/site/azext_site/aaz/latest/site/__init__.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * diff --git a/src/site/azext_site/aaz/latest/site/_create.py b/src/site/azext_site/aaz/latest/site/_create.py new file mode 100644 index 00000000000..ea763a47e86 --- /dev/null +++ b/src/site/azext_site/aaz/latest/site/_create.py @@ -0,0 +1,760 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "site create", +) +class Create(AAZCommand): + """Create a site resource scoped to a resource group, subscription, or service group. + + Scope Options: + --resource-group: Scope the site to a specific resource group. Note: When using this option, you must also provide --subscription. + --subscription: Scope the site to a subscription. + --service-group: Scope the site to a service group. + + :example: Create a Site at service group scope + az site create --site-name TestSiteName --service-group TestSGName --display-name 'Test Site Display' --description "Test Site" --labels key1="value1" key2="value2" --street-address1="16 TOWNSEND ST" --street-address2="UNIT 1" --city="newyork" --state-or-province="CA" --country="US" --postal-code="94107" + + :example: Create a Site at resource group scope + az site create --site-name TestSiteName --resource-group TestRGName --subscription 000000000-0000-0000-0000-000000000000 --display-name 'Test Site Display' --description "Test Site" --street-address1="16 TOWNSEND ST" --street-address2="UNIT 1" --city="newyork" --state-or-province="CA" --country="US" --postal-code="94107" + + :example: Create a Site at subscription scope + az site create --site-name TestSiteName --subscription 000000000-0000-0000-0000-000000000000 --display-name 'Test Site Display' --description "Test Site" --labels key1="value1" --street-address1="16 TOWNSEND ST" --street-address2="UNIT 1" --city="newyork" --state-or-province="CA" --country="US" --postal-code="94107" + """ + + _aaz_info = { + "version": "2025-06-01", + "resources": [ + ["mgmt-plane", "/providers/microsoft.management/servicegroups/{}/providers/microsoft.edge/sites/{}", "2025-06-01"], + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.edge/sites/{}", "2025-06-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.edge/sites/{}", "2025-06-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + help="Name of the resource group", + ) + _args_schema.service_group = AAZStrArg( + options=["--sg", "--service-group"], + help="Name of the service group", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9\\-_().]{1,90}$", + ), + ) + _args_schema.site_name = AAZStrArg( + options=["-n", "--name", "--site-name"], + help="Name of the site resource", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$", + ), + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.description = AAZStrArg( + options=["--description"], + arg_group="Properties", + help="Description of site resource", + ) + _args_schema.display_name = AAZStrArg( + options=["--display-name"], + arg_group="Properties", + help="Display name of site resource", + ) + _args_schema.labels = AAZDictArg( + options=["--labels"], + arg_group="Properties", + help="Key-value pairs for labeling the site resource.", + ) + + labels = cls._args_schema.labels + labels.Element = AAZStrArg() + + # define Arg Group "SiteAddress" + + _args_schema = cls._args_schema + _args_schema.city = AAZStrArg( + options=["--city"], + arg_group="SiteAddress", + help="City of the address", + ) + _args_schema.country = AAZStrArg( + options=["--country"], + arg_group="SiteAddress", + help="Country of the address", + ) + _args_schema.postal_code = AAZStrArg( + options=["--postal-code"], + arg_group="SiteAddress", + help="Postal or ZIP code of the address", + ) + _args_schema.state_or_province = AAZStrArg( + options=["--state-or-province"], + arg_group="SiteAddress", + help="State or province of the address", + ) + _args_schema.street_address1 = AAZStrArg( + options=["--street-address1"], + arg_group="SiteAddress", + help="First line of the street address", + ) + _args_schema.street_address2 = AAZStrArg( + options=["--street-address2"], + arg_group="SiteAddress", + help="Second line of the street address", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + condition_0 = has_value(self.ctx.args.service_group) and has_value(self.ctx.args.site_name) + condition_1 = has_value(self.ctx.args.site_name) and has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + condition_2 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.args.site_name) and has_value(self.ctx.subscription_id) + if condition_0: + yield self.SitesByServiceGroupCreateOrUpdate(ctx=self.ctx)() + elif condition_1: + yield self.SitesBySubscriptionCreateOrUpdate(ctx=self.ctx)() + elif condition_2: + yield self.SitesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class SitesByServiceGroupCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + False, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + False, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "servicegroupName", self.ctx.args.service_group, + required=True, + ), + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("displayName", AAZStrType, ".display_name") + properties.set_prop("labels", AAZDictType, ".labels") + properties.set_prop("siteAddress", AAZObjectType) + + labels = _builder.get(".properties.labels") + if labels is not None: + labels.set_elements(AAZStrType, ".") + + site_address = _builder.get(".properties.siteAddress") + if site_address is not None: + site_address.set_prop("city", AAZStrType, ".city") + site_address.set_prop("country", AAZStrType, ".country") + site_address.set_prop("postalCode", AAZStrType, ".postal_code") + site_address.set_prop("stateOrProvince", AAZStrType, ".state_or_province") + site_address.set_prop("streetAddress1", AAZStrType, ".street_address1") + site_address.set_prop("streetAddress2", AAZStrType, ".street_address2") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.description = AAZStrType() + properties.display_name = AAZStrType( + serialized_name="displayName", + ) + properties.labels = AAZDictType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.site_address = AAZObjectType( + serialized_name="siteAddress", + ) + + labels = cls._schema_on_200_201.properties.labels + labels.Element = AAZStrType() + + site_address = cls._schema_on_200_201.properties.site_address + site_address.city = AAZStrType() + site_address.country = AAZStrType() + site_address.postal_code = AAZStrType( + serialized_name="postalCode", + ) + site_address.state_or_province = AAZStrType( + serialized_name="stateOrProvince", + ) + site_address.street_address1 = AAZStrType( + serialized_name="streetAddress1", + ) + site_address.street_address2 = AAZStrType( + serialized_name="streetAddress2", + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200_201 + + class SitesBySubscriptionCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + False, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + False, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("displayName", AAZStrType, ".display_name") + properties.set_prop("labels", AAZDictType, ".labels") + properties.set_prop("siteAddress", AAZObjectType) + + labels = _builder.get(".properties.labels") + if labels is not None: + labels.set_elements(AAZStrType, ".") + + site_address = _builder.get(".properties.siteAddress") + if site_address is not None: + site_address.set_prop("city", AAZStrType, ".city") + site_address.set_prop("country", AAZStrType, ".country") + site_address.set_prop("postalCode", AAZStrType, ".postal_code") + site_address.set_prop("stateOrProvince", AAZStrType, ".state_or_province") + site_address.set_prop("streetAddress1", AAZStrType, ".street_address1") + site_address.set_prop("streetAddress2", AAZStrType, ".street_address2") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.description = AAZStrType() + properties.display_name = AAZStrType( + serialized_name="displayName", + ) + properties.labels = AAZDictType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.site_address = AAZObjectType( + serialized_name="siteAddress", + ) + + labels = cls._schema_on_200_201.properties.labels + labels.Element = AAZStrType() + + site_address = cls._schema_on_200_201.properties.site_address + site_address.city = AAZStrType() + site_address.country = AAZStrType() + site_address.postal_code = AAZStrType( + serialized_name="postalCode", + ) + site_address.state_or_province = AAZStrType( + serialized_name="stateOrProvince", + ) + site_address.street_address1 = AAZStrType( + serialized_name="streetAddress1", + ) + site_address.street_address2 = AAZStrType( + serialized_name="streetAddress2", + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200_201 + + class SitesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + False, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + False, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("displayName", AAZStrType, ".display_name") + properties.set_prop("labels", AAZDictType, ".labels") + properties.set_prop("siteAddress", AAZObjectType) + + labels = _builder.get(".properties.labels") + if labels is not None: + labels.set_elements(AAZStrType, ".") + + site_address = _builder.get(".properties.siteAddress") + if site_address is not None: + site_address.set_prop("city", AAZStrType, ".city") + site_address.set_prop("country", AAZStrType, ".country") + site_address.set_prop("postalCode", AAZStrType, ".postal_code") + site_address.set_prop("stateOrProvince", AAZStrType, ".state_or_province") + site_address.set_prop("streetAddress1", AAZStrType, ".street_address1") + site_address.set_prop("streetAddress2", AAZStrType, ".street_address2") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.description = AAZStrType() + properties.display_name = AAZStrType( + serialized_name="displayName", + ) + properties.labels = AAZDictType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.site_address = AAZObjectType( + serialized_name="siteAddress", + ) + + labels = cls._schema_on_200_201.properties.labels + labels.Element = AAZStrType() + + site_address = cls._schema_on_200_201.properties.site_address + site_address.city = AAZStrType() + site_address.country = AAZStrType() + site_address.postal_code = AAZStrType( + serialized_name="postalCode", + ) + site_address.state_or_province = AAZStrType( + serialized_name="stateOrProvince", + ) + site_address.street_address1 = AAZStrType( + serialized_name="streetAddress1", + ) + site_address.street_address2 = AAZStrType( + serialized_name="streetAddress2", + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/site/azext_site/aaz/latest/site/_delete.py b/src/site/azext_site/aaz/latest/site/_delete.py new file mode 100644 index 00000000000..d2eeffe8db8 --- /dev/null +++ b/src/site/azext_site/aaz/latest/site/_delete.py @@ -0,0 +1,285 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "site delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Deletes an existing site resource scoped to a resource group, subscription, or service group. + + Scope Options: + --resource-group: Target a site within a specific resource group. Note: Requires --subscription. + --subscription: Target a site scoped to a subscription. + --service-group: Target a site scoped to a service group. + + :example: Delete a Site at service group scope + az site delete --site-name TestSiteName --service-group TestSGName + + :example: Delete a Site at resource group scope + az site delete --site-name TestSiteName --resource-group TestRGName --subscription 00000000-0000-0000-0000-000000000000 + + :example: Delete a Site at subscription scope + az site delete --site-name TestSiteName --subscription 00000000-0000-0000-0000-000000000000 + """ + + _aaz_info = { + "version": "2025-06-01", + "resources": [ + ["mgmt-plane", "/providers/microsoft.management/servicegroups/{}/providers/microsoft.edge/sites/{}", "2025-06-01"], + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.edge/sites/{}", "2025-06-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.edge/sites/{}", "2025-06-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return None + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + help="Name of the resource group", + ) + _args_schema.service_group = AAZStrArg( + options=["--sg", "--service-group"], + help="Name of the service group", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9\\-_().]{1,90}$", + ), + ) + _args_schema.site_name = AAZStrArg( + options=["-n", "--name", "--site-name"], + help="Name of the site resource", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + condition_0 = has_value(self.ctx.args.service_group) and has_value(self.ctx.args.site_name) + condition_1 = has_value(self.ctx.args.site_name) and has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + condition_2 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.args.site_name) and has_value(self.ctx.subscription_id) + if condition_0: + self.SitesByServiceGroupDelete(ctx=self.ctx)() + elif condition_1: + self.SitesBySubscriptionDelete(ctx=self.ctx)() + elif condition_2: + self.SitesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class SitesByServiceGroupDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "servicegroupName", self.ctx.args.service_group, + required=True, + ), + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + class SitesBySubscriptionDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + class SitesDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/site/azext_site/aaz/latest/site/_list.py b/src/site/azext_site/aaz/latest/site/_list.py new file mode 100644 index 00000000000..a110ef88dd5 --- /dev/null +++ b/src/site/azext_site/aaz/latest/site/_list.py @@ -0,0 +1,570 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "site list", +) +class List(AAZCommand): + """Lists all site resources scoped to a resource group, subscription, or service group. + + Scope Options: + --resource-group: List sites within a specific resource group. Note: Requires --subscription. + --subscription: List sites scoped to a subscription. + --service-group: List sites scoped to a service group. + + :example: List Sites at service group scope + az site list --service-group TestSGName + + :example: List Sites at resource group scope + az site list --resource-group TestRGName --subscription 00000000000-0000-0000-0000-000000000000 + + :example: List Sites at subscription scope + az site list --subscription 00000000000-0000-0000-0000-000000000000 + """ + + _aaz_info = { + "version": "2025-06-01", + "resources": [ + ["mgmt-plane", "/providers/microsoft.management/servicegroups/{}/providers/microsoft.edge/sites", "2025-06-01"], + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.edge/sites", "2025-06-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.edge/sites", "2025-06-01"], + ] + } + + AZ_SUPPORT_PAGINATION = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + help="Name of the resource group", + ) + _args_schema.service_group = AAZStrArg( + options=["--sg", "--service-group"], + help="Name of the service group", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9\\-_().]{1,90}$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + condition_0 = has_value(self.ctx.args.service_group) + condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + condition_2 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) + if condition_0: + self.SitesByServiceGroupListByServiceGroup(ctx=self.ctx)() + elif condition_1: + self.SitesBySubscriptionList(ctx=self.ctx)() + elif condition_2: + self.SitesListByResourceGroup(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class SitesByServiceGroupListByServiceGroup(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "servicegroupName", self.ctx.args.service_group, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.description = AAZStrType() + properties.display_name = AAZStrType( + serialized_name="displayName", + ) + properties.labels = AAZDictType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.site_address = AAZObjectType( + serialized_name="siteAddress", + ) + + labels = cls._schema_on_200.value.Element.properties.labels + labels.Element = AAZStrType() + + site_address = cls._schema_on_200.value.Element.properties.site_address + site_address.city = AAZStrType() + site_address.country = AAZStrType() + site_address.postal_code = AAZStrType( + serialized_name="postalCode", + ) + site_address.state_or_province = AAZStrType( + serialized_name="stateOrProvince", + ) + site_address.street_address1 = AAZStrType( + serialized_name="streetAddress1", + ) + site_address.street_address2 = AAZStrType( + serialized_name="streetAddress2", + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + class SitesBySubscriptionList(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.description = AAZStrType() + properties.display_name = AAZStrType( + serialized_name="displayName", + ) + properties.labels = AAZDictType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.site_address = AAZObjectType( + serialized_name="siteAddress", + ) + + labels = cls._schema_on_200.value.Element.properties.labels + labels.Element = AAZStrType() + + site_address = cls._schema_on_200.value.Element.properties.site_address + site_address.city = AAZStrType() + site_address.country = AAZStrType() + site_address.postal_code = AAZStrType( + serialized_name="postalCode", + ) + site_address.state_or_province = AAZStrType( + serialized_name="stateOrProvince", + ) + site_address.street_address1 = AAZStrType( + serialized_name="streetAddress1", + ) + site_address.street_address2 = AAZStrType( + serialized_name="streetAddress2", + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + class SitesListByResourceGroup(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.description = AAZStrType() + properties.display_name = AAZStrType( + serialized_name="displayName", + ) + properties.labels = AAZDictType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.site_address = AAZObjectType( + serialized_name="siteAddress", + ) + + labels = cls._schema_on_200.value.Element.properties.labels + labels.Element = AAZStrType() + + site_address = cls._schema_on_200.value.Element.properties.site_address + site_address.city = AAZStrType() + site_address.country = AAZStrType() + site_address.postal_code = AAZStrType( + serialized_name="postalCode", + ) + site_address.state_or_province = AAZStrType( + serialized_name="stateOrProvince", + ) + site_address.street_address1 = AAZStrType( + serialized_name="streetAddress1", + ) + site_address.street_address2 = AAZStrType( + serialized_name="streetAddress2", + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/site/azext_site/aaz/latest/site/_show.py b/src/site/azext_site/aaz/latest/site/_show.py new file mode 100644 index 00000000000..f5bc9fa5391 --- /dev/null +++ b/src/site/azext_site/aaz/latest/site/_show.py @@ -0,0 +1,555 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "site show", +) +class Show(AAZCommand): + """Displays details of a specific site resource scoped to a resource group, subscription, or service group. + + Scope Options: + --resource-group: Show site details within a specific resource group. Note: Requires --subscription. + --subscription: Show site details scoped to a subscription. + --service-group: Show site details scoped to a service group. + + :example: Show a Site at service group scope + az site show --site-name TestSiteName --service-group TestSGName + + :example: Show a Site at resource group scope + az site show --site-name TestSiteName --resource-group TestRGName --subscription 00000000-0000-0000-0000-000000000000 + + :example: Show a Site at subscription scope + az site show --site-name TestSiteName --subscription 00000000-0000-0000-0000-000000000000 + """ + + _aaz_info = { + "version": "2025-06-01", + "resources": [ + ["mgmt-plane", "/providers/microsoft.management/servicegroups/{}/providers/microsoft.edge/sites/{}", "2025-06-01"], + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.edge/sites/{}", "2025-06-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.edge/sites/{}", "2025-06-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + help="Name of the resource group", + ) + _args_schema.service_group = AAZStrArg( + options=["--sg", "--service-group"], + help="Name of the service group", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9\\-_().]{1,90}$", + ), + ) + _args_schema.site_name = AAZStrArg( + options=["-n", "--name", "--site-name"], + help="Name of the site resource", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + condition_0 = has_value(self.ctx.args.service_group) and has_value(self.ctx.args.site_name) + condition_1 = has_value(self.ctx.args.site_name) and has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + condition_2 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.args.site_name) and has_value(self.ctx.subscription_id) + if condition_0: + self.SitesByServiceGroupGet(ctx=self.ctx)() + elif condition_1: + self.SitesBySubscriptionGet(ctx=self.ctx)() + elif condition_2: + self.SitesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SitesByServiceGroupGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "servicegroupName", self.ctx.args.service_group, + required=True, + ), + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.description = AAZStrType() + properties.display_name = AAZStrType( + serialized_name="displayName", + ) + properties.labels = AAZDictType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.site_address = AAZObjectType( + serialized_name="siteAddress", + ) + + labels = cls._schema_on_200.properties.labels + labels.Element = AAZStrType() + + site_address = cls._schema_on_200.properties.site_address + site_address.city = AAZStrType() + site_address.country = AAZStrType() + site_address.postal_code = AAZStrType( + serialized_name="postalCode", + ) + site_address.state_or_province = AAZStrType( + serialized_name="stateOrProvince", + ) + site_address.street_address1 = AAZStrType( + serialized_name="streetAddress1", + ) + site_address.street_address2 = AAZStrType( + serialized_name="streetAddress2", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + class SitesBySubscriptionGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.description = AAZStrType() + properties.display_name = AAZStrType( + serialized_name="displayName", + ) + properties.labels = AAZDictType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.site_address = AAZObjectType( + serialized_name="siteAddress", + ) + + labels = cls._schema_on_200.properties.labels + labels.Element = AAZStrType() + + site_address = cls._schema_on_200.properties.site_address + site_address.city = AAZStrType() + site_address.country = AAZStrType() + site_address.postal_code = AAZStrType( + serialized_name="postalCode", + ) + site_address.state_or_province = AAZStrType( + serialized_name="stateOrProvince", + ) + site_address.street_address1 = AAZStrType( + serialized_name="streetAddress1", + ) + site_address.street_address2 = AAZStrType( + serialized_name="streetAddress2", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + class SitesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.description = AAZStrType() + properties.display_name = AAZStrType( + serialized_name="displayName", + ) + properties.labels = AAZDictType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.site_address = AAZObjectType( + serialized_name="siteAddress", + ) + + labels = cls._schema_on_200.properties.labels + labels.Element = AAZStrType() + + site_address = cls._schema_on_200.properties.site_address + site_address.city = AAZStrType() + site_address.country = AAZStrType() + site_address.postal_code = AAZStrType( + serialized_name="postalCode", + ) + site_address.state_or_province = AAZStrType( + serialized_name="stateOrProvince", + ) + site_address.street_address1 = AAZStrType( + serialized_name="streetAddress1", + ) + site_address.street_address2 = AAZStrType( + serialized_name="streetAddress2", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/site/azext_site/aaz/latest/site/_update.py b/src/site/azext_site/aaz/latest/site/_update.py new file mode 100644 index 00000000000..7cffd34d16d --- /dev/null +++ b/src/site/azext_site/aaz/latest/site/_update.py @@ -0,0 +1,715 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "site update", +) +class Update(AAZCommand): + """Updates an existing site resource scoped to a resource group, subscription, or service group. + + Scope Options: + --resource-group: Update a site within a specific resource group. + Note: Requires --subscription. + --subscription: Update a site scoped to a subscription. + --service-group: Update a site scoped to a service group. + + :example: Update a Site at service group scope + az site update --site-name TestSiteName --service-group TestSGName --description "Test Site" --labels key1="value1" key2="value2" --street-address1="17 TOWNSEND ST" --street-address2="UNIT 2" --city="newyork" --state-or-province="CA" --country="US" --postal-code="94107" + + :example: Update a Site at resource group scope + az site update --site-name TestSiteName --resource-group TestMSRG --subscription 00000000-0000-0000-0000-000000000000 --description "Test Site" --labels key1="value1" key2="value2" --street-address1="17 TOWNSEND ST" --street-address2="UNIT 2" --city="newyork" --state-or-province="CA" --country="US" --postal-code="94107" + + :example: Update a Site at subscription scope + az site update --site-name TestSiteName --subscription 00000000-0000-0000-0000-000000000000 --description "Test Site" --labels key1="value1" key2="value2" --street-address1="17 TOWNSEND ST" --street-address2="UNIT 2" --city="newyork" --state-or-province="CA" --country="US" --postal-code="94107" + """ + + _aaz_info = { + "version": "2025-06-01", + "resources": [ + ["mgmt-plane", "/providers/microsoft.management/servicegroups/{}/providers/microsoft.edge/sites/{}", "2025-06-01"], + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.edge/sites/{}", "2025-06-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.edge/sites/{}", "2025-06-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + help="Name of the resource group", + ) + _args_schema.service_group = AAZStrArg( + options=["--sg", "--service-group"], + help="Name of the service group", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9\\-_().]{1,90}$", + ), + ) + _args_schema.site_name = AAZStrArg( + options=["-n", "--name", "--site-name"], + help="Name of the site resource", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$", + ), + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.description = AAZStrArg( + options=["--description"], + arg_group="Properties", + help="Description of Site resource", + ) + _args_schema.display_name = AAZStrArg( + options=["--display-name"], + arg_group="Properties", + help="displayName of Site resource", + ) + _args_schema.labels = AAZDictArg( + options=["--labels"], + arg_group="Properties", + help="Key-value pairs for labeling the site resource; to delete a label, set its value to null, or to delete all labels, set --labels to null.", + nullable=True, + ) + + labels = cls._args_schema.labels + labels.Element = AAZStrArg(nullable=True) + + # define Arg Group "SiteAddress" + + _args_schema = cls._args_schema + _args_schema.city = AAZStrArg( + options=["--city"], + arg_group="SiteAddress", + help="City of the address", + ) + _args_schema.country = AAZStrArg( + options=["--country"], + arg_group="SiteAddress", + help="Country of the address", + ) + _args_schema.postal_code = AAZStrArg( + options=["--postal-code"], + arg_group="SiteAddress", + help="Postal or ZIP code of the address", + ) + _args_schema.state_or_province = AAZStrArg( + options=["--state-or-province"], + arg_group="SiteAddress", + help="State or province of the address", + ) + _args_schema.street_address1 = AAZStrArg( + options=["--street-address1"], + arg_group="SiteAddress", + help="First line of the street address", + ) + _args_schema.street_address2 = AAZStrArg( + options=["--street-address2"], + arg_group="SiteAddress", + help="Second line of the street address", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + condition_0 = has_value(self.ctx.args.service_group) and has_value(self.ctx.args.site_name) + condition_1 = has_value(self.ctx.args.site_name) and has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + condition_2 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.args.site_name) and has_value(self.ctx.subscription_id) + if condition_0: + self.SitesByServiceGroupUpdate(ctx=self.ctx)() + elif condition_1: + self.SitesBySubscriptionUpdate(ctx=self.ctx)() + elif condition_2: + self.SitesUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SitesByServiceGroupUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "PATCH" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "servicegroupName", self.ctx.args.service_group, + required=True, + ), + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("displayName", AAZStrType, ".display_name") + properties.set_prop("labels", AAZDictType, ".labels", typ_kwargs={"nullable": True}) + properties.set_prop("siteAddress", AAZObjectType) + + labels = _builder.get(".properties.labels") + if labels is not None: + labels.set_elements(AAZStrType, ".", typ_kwargs={"nullable": True}) + + site_address = _builder.get(".properties.siteAddress") + if site_address is not None: + site_address.set_prop("city", AAZStrType, ".city") + site_address.set_prop("country", AAZStrType, ".country") + site_address.set_prop("postalCode", AAZStrType, ".postal_code") + site_address.set_prop("stateOrProvince", AAZStrType, ".state_or_province") + site_address.set_prop("streetAddress1", AAZStrType, ".street_address1") + site_address.set_prop("streetAddress2", AAZStrType, ".street_address2") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.description = AAZStrType() + properties.display_name = AAZStrType( + serialized_name="displayName", + ) + properties.labels = AAZDictType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.site_address = AAZObjectType( + serialized_name="siteAddress", + ) + + labels = cls._schema_on_200.properties.labels + labels.Element = AAZStrType() + + site_address = cls._schema_on_200.properties.site_address + site_address.city = AAZStrType() + site_address.country = AAZStrType() + site_address.postal_code = AAZStrType( + serialized_name="postalCode", + ) + site_address.state_or_province = AAZStrType( + serialized_name="stateOrProvince", + ) + site_address.street_address1 = AAZStrType( + serialized_name="streetAddress1", + ) + site_address.street_address2 = AAZStrType( + serialized_name="streetAddress2", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + class SitesBySubscriptionUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "PATCH" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("displayName", AAZStrType, ".display_name") + properties.set_prop("labels", AAZDictType, ".labels", typ_kwargs={"nullable": True}) + properties.set_prop("siteAddress", AAZObjectType) + + labels = _builder.get(".properties.labels") + if labels is not None: + labels.set_elements(AAZStrType, ".", typ_kwargs={"nullable": True}) + + site_address = _builder.get(".properties.siteAddress") + if site_address is not None: + site_address.set_prop("city", AAZStrType, ".city") + site_address.set_prop("country", AAZStrType, ".country") + site_address.set_prop("postalCode", AAZStrType, ".postal_code") + site_address.set_prop("stateOrProvince", AAZStrType, ".state_or_province") + site_address.set_prop("streetAddress1", AAZStrType, ".street_address1") + site_address.set_prop("streetAddress2", AAZStrType, ".street_address2") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.description = AAZStrType() + properties.display_name = AAZStrType( + serialized_name="displayName", + ) + properties.labels = AAZDictType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.site_address = AAZObjectType( + serialized_name="siteAddress", + ) + + labels = cls._schema_on_200.properties.labels + labels.Element = AAZStrType() + + site_address = cls._schema_on_200.properties.site_address + site_address.city = AAZStrType() + site_address.country = AAZStrType() + site_address.postal_code = AAZStrType( + serialized_name="postalCode", + ) + site_address.state_or_province = AAZStrType( + serialized_name="stateOrProvince", + ) + site_address.street_address1 = AAZStrType( + serialized_name="streetAddress1", + ) + site_address.street_address2 = AAZStrType( + serialized_name="streetAddress2", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + class SitesUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "PATCH" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("displayName", AAZStrType, ".display_name") + properties.set_prop("labels", AAZDictType, ".labels", typ_kwargs={"nullable": True}) + properties.set_prop("siteAddress", AAZObjectType) + + labels = _builder.get(".properties.labels") + if labels is not None: + labels.set_elements(AAZStrType, ".", typ_kwargs={"nullable": True}) + + site_address = _builder.get(".properties.siteAddress") + if site_address is not None: + site_address.set_prop("city", AAZStrType, ".city") + site_address.set_prop("country", AAZStrType, ".country") + site_address.set_prop("postalCode", AAZStrType, ".postal_code") + site_address.set_prop("stateOrProvince", AAZStrType, ".state_or_province") + site_address.set_prop("streetAddress1", AAZStrType, ".street_address1") + site_address.set_prop("streetAddress2", AAZStrType, ".street_address2") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.description = AAZStrType() + properties.display_name = AAZStrType( + serialized_name="displayName", + ) + properties.labels = AAZDictType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.site_address = AAZObjectType( + serialized_name="siteAddress", + ) + + labels = cls._schema_on_200.properties.labels + labels.Element = AAZStrType() + + site_address = cls._schema_on_200.properties.site_address + site_address.city = AAZStrType() + site_address.country = AAZStrType() + site_address.postal_code = AAZStrType( + serialized_name="postalCode", + ) + site_address.state_or_province = AAZStrType( + serialized_name="stateOrProvince", + ) + site_address.street_address1 = AAZStrType( + serialized_name="streetAddress1", + ) + site_address.street_address2 = AAZStrType( + serialized_name="streetAddress2", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _UpdateHelper: + """Helper class for Update""" + + +__all__ = ["Update"] diff --git a/src/site/azext_site/azext_metadata.json b/src/site/azext_site/azext_metadata.json new file mode 100644 index 00000000000..71889bb136b --- /dev/null +++ b/src/site/azext_site/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.75.0" +} \ No newline at end of file diff --git a/src/site/azext_site/commands.py b/src/site/azext_site/commands.py new file mode 100644 index 00000000000..b0d842e4993 --- /dev/null +++ b/src/site/azext_site/commands.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +# from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): # pylint: disable=unused-argument + pass diff --git a/src/site/azext_site/custom.py b/src/site/azext_site/custom.py new file mode 100644 index 00000000000..86df1e48ef5 --- /dev/null +++ b/src/site/azext_site/custom.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from knack.log import get_logger + + +logger = get_logger(__name__) diff --git a/src/site/azext_site/tests/__init__.py b/src/site/azext_site/tests/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/site/azext_site/tests/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/site/azext_site/tests/latest/__init__.py b/src/site/azext_site/tests/latest/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/site/azext_site/tests/latest/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/site/azext_site/tests/latest/recordings/test_edge_site_crud.yaml b/src/site/azext_site/tests/latest/recordings/test_edge_site_crud.yaml new file mode 100644 index 00000000000..184740af00e --- /dev/null +++ b/src/site/azext_site/tests/latest/recordings/test_edge_site_crud.yaml @@ -0,0 +1,632 @@ +interactions: +- request: + body: '{"properties": {"description": "Test Site", "displayName": "Test Site Display", + "labels": {"key1": "value1", "key2": "value2"}, "siteAddress": {"city": "San + Francisco", "country": "US", "postalCode": "94107", "stateOrProvince": "CA", + "streetAddress1": "16 TOWNSEND ST", "streetAddress2": "UNIT 1"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - site create + Connection: + - keep-alive + Content-Length: + - '299' + Content-Type: + - application/json + ParameterSetName: + - --site-name --resource-group --display-name --description --labels --street-address1 + --street-address2 --city --state-or-province --country --postal-code + User-Agent: + - AZURECLI/2.77.0 azsdk-python-core/1.35.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_site_000001/providers/Microsoft.Edge/sites/TestSiteName?api-version=2025-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_site_000001/providers/Microsoft.Edge/sites/TestSiteName","name":"TestSiteName","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-09-18T12:16:02.9227483Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-09-18T12:16:02.9227483Z"},"properties":{"description":"Test + Site","displayName":"Test Site Display","labels":{"key1":"value1","key2":"value2"},"siteAddress":{"city":"San + Francisco","country":"US","postalCode":"94107","stateOrProvince":"CA","streetAddress1":"16 + TOWNSEND ST","streetAddress2":"UNIT 1"},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '724' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 18 Sep 2025 12:16:03 GMT + etag: + - '"7c009fa5-0000-0500-0000-68cbf8030000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=45f75482-df7a-47c1-9ff8-61b072ef97cb/eastus/98743580-06db-4a6f-8442-30eedef7f805 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-writes: + - '11999' + x-ms-ratelimit-remaining-subscription-writes: + - '799' + x-msedge-ref: + - 'Ref A: AAD3EEB7AE174E11B805FB7343949EC5 Ref B: PNQ231110906062 Ref C: 2025-09-18T12:16:02Z' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"description": "Test Subs Site", "displayName": "Test Subs + Site Display", "labels": {"key1": "value1", "key2": "value2"}, "siteAddress": + {"city": "San Francisco", "country": "US", "postalCode": "94107", "stateOrProvince": + "CA", "streetAddress1": "16 TOWNSEND ST", "streetAddress2": "UNIT 1"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - site create + Connection: + - keep-alive + Content-Length: + - '309' + Content-Type: + - application/json + ParameterSetName: + - --site-name --display-name --description --labels --street-address1 --street-address2 + --city --state-or-province --country --postal-code + User-Agent: + - AZURECLI/2.77.0 azsdk-python-core/1.35.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/TestSubsSiteName?api-version=2025-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/TestSubsSiteName","name":"TestSubsSiteName","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-09-18T12:16:04.6436888Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-09-18T12:16:04.6436888Z"},"properties":{"description":"Test + Subs Site","displayName":"Test Subs Site Display","labels":{"key1":"value1","key2":"value2"},"siteAddress":{"city":"San + Francisco","country":"US","postalCode":"94107","stateOrProvince":"CA","streetAddress1":"16 + TOWNSEND ST","streetAddress2":"UNIT 1"},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '706' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 18 Sep 2025 12:16:04 GMT + etag: + - '"7c00cfa5-0000-0500-0000-68cbf8040000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=45f75482-df7a-47c1-9ff8-61b072ef97cb/eastus/d4212c4a-5870-4d67-b00c-ebf68d54f0df + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-writes: + - '11999' + x-ms-ratelimit-remaining-subscription-writes: + - '799' + x-msedge-ref: + - 'Ref A: 29BE45F1605D4CD7AC0D145C9811DB97 Ref B: PNQ231110907023 Ref C: 2025-09-18T12:16:04Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - site show + Connection: + - keep-alive + ParameterSetName: + - --site-name --resource-group + User-Agent: + - AZURECLI/2.77.0 azsdk-python-core/1.35.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_site_000001/providers/Microsoft.Edge/sites/TestSiteName?api-version=2025-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_site_000001/providers/Microsoft.Edge/sites/TestSiteName","name":"TestSiteName","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-09-18T12:16:02.9227483Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-09-18T12:16:02.9227483Z"},"properties":{"description":"Test + Site","displayName":"Test Site Display","labels":{"key1":"value1","key2":"value2"},"siteAddress":{"city":"San + Francisco","country":"US","postalCode":"94107","stateOrProvince":"CA","streetAddress1":"16 + TOWNSEND ST","streetAddress2":"UNIT 1"},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '724' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 18 Sep 2025 12:16:05 GMT + etag: + - '"7c009fa5-0000-0500-0000-68cbf8030000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=45f75482-df7a-47c1-9ff8-61b072ef97cb/eastus/48971acd-8ebb-45dd-8d14-1760191fd4ae + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 3FE7A88F59F644D7BCD88CB2025D3E6C Ref B: PNQ231110909029 Ref C: 2025-09-18T12:16:05Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - site show + Connection: + - keep-alive + ParameterSetName: + - --site-name + User-Agent: + - AZURECLI/2.77.0 azsdk-python-core/1.35.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/TestSubsSiteName?api-version=2025-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/TestSubsSiteName","name":"TestSubsSiteName","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-09-18T12:16:04.6436888Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-09-18T12:16:04.6436888Z"},"properties":{"description":"Test + Subs Site","displayName":"Test Subs Site Display","labels":{"key1":"value1","key2":"value2"},"siteAddress":{"city":"San + Francisco","country":"US","postalCode":"94107","stateOrProvince":"CA","streetAddress1":"16 + TOWNSEND ST","streetAddress2":"UNIT 1"},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '706' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 18 Sep 2025 12:16:05 GMT + etag: + - '"7c00cfa5-0000-0500-0000-68cbf8040000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=45f75482-df7a-47c1-9ff8-61b072ef97cb/eastus/9a61614d-5314-4755-9963-e92dd97a4fbb + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 5EE021000AA54FEE9BC6CD9DF78819D8 Ref B: PNQ231110909040 Ref C: 2025-09-18T12:16:06Z' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"description": "Test Site", "labels": {"key1": "value1", + "key2": "value2"}, "siteAddress": {"city": "San Francisco", "country": "US", + "postalCode": "94108", "stateOrProvince": "CA", "streetAddress1": "18 TOWNSEND + ST", "streetAddress2": "UNIT 1"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - site update + Connection: + - keep-alive + Content-Length: + - '263' + Content-Type: + - application/json + ParameterSetName: + - --site-name --resource-group --description --labels --street-address1 --street-address2 + --city --state-or-province --country --postal-code + User-Agent: + - AZURECLI/2.77.0 azsdk-python-core/1.35.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_site_000001/providers/Microsoft.Edge/sites/TestSiteName?api-version=2025-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_site_000001/providers/Microsoft.Edge/sites/TestSiteName","name":"TestSiteName","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-09-18T12:16:02.9227483Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-09-18T12:16:07.4469719Z"},"properties":{"description":"Test + Site","displayName":"Test Site Display","labels":{"key1":"value1","key2":"value2"},"siteAddress":{"city":"San + Francisco","country":"US","postalCode":"94108","stateOrProvince":"CA","streetAddress1":"18 + TOWNSEND ST","streetAddress2":"UNIT 1"},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '724' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 18 Sep 2025 12:16:13 GMT + etag: + - '"7c002ba7-0000-0500-0000-68cbf80d0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=45f75482-df7a-47c1-9ff8-61b072ef97cb/centralindia/6f6a8972-0ddc-401e-b15f-94b0d7d6b4de + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-writes: + - '12000' + x-ms-ratelimit-remaining-subscription-writes: + - '800' + x-msedge-ref: + - 'Ref A: D8243E93A6064445BC697EAD49B516DA Ref B: PNQ231110909054 Ref C: 2025-09-18T12:16:06Z' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"description": "Test Subs Site", "labels": {"key1": "value1", + "key2": "value2"}, "siteAddress": {"city": "San Francisco", "country": "US", + "postalCode": "94108", "stateOrProvince": "CA", "streetAddress1": "18 TOWNSEND + ST", "streetAddress2": "UNIT 1"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - site update + Connection: + - keep-alive + Content-Length: + - '268' + Content-Type: + - application/json + ParameterSetName: + - --site-name --description --labels --street-address1 --street-address2 --city + --state-or-province --country --postal-code + User-Agent: + - AZURECLI/2.77.0 azsdk-python-core/1.35.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/TestSubsSiteName?api-version=2025-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/TestSubsSiteName","name":"TestSubsSiteName","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-09-18T12:16:04.6436888Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-09-18T12:16:14.5112965Z"},"properties":{"description":"Test + Subs Site","displayName":"Test Subs Site Display","labels":{"key1":"value1","key2":"value2"},"siteAddress":{"city":"San + Francisco","country":"US","postalCode":"94108","stateOrProvince":"CA","streetAddress1":"18 + TOWNSEND ST","streetAddress2":"UNIT 1"},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '706' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 18 Sep 2025 12:16:19 GMT + etag: + - '"7c001da8-0000-0500-0000-68cbf8130000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=45f75482-df7a-47c1-9ff8-61b072ef97cb/centralindia/ad47fecf-946a-4464-99e8-5d44dddb09d5 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-writes: + - '12000' + x-ms-ratelimit-remaining-subscription-writes: + - '800' + x-msedge-ref: + - 'Ref A: C22CE52DFAC34769A0462B212E7D4A5B Ref B: PNQ231110907062 Ref C: 2025-09-18T12:16:14Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - site list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.77.0 azsdk-python-core/1.35.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_site_000001/providers/Microsoft.Edge/sites?api-version=2025-06-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_site_000001/providers/Microsoft.Edge/sites/TestSiteName","name":"TestSiteName","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-09-18T12:16:02.9227483Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-09-18T12:16:07.4469719Z"},"properties":{"description":"Test + Site","displayName":"Test Site Display","labels":{"key1":"value1","key2":"value2"},"siteAddress":{"city":"San + Francisco","country":"US","postalCode":"94108","stateOrProvince":"CA","streetAddress1":"18 + TOWNSEND ST","streetAddress2":"UNIT 1"},"provisioningState":"Succeeded"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '736' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 18 Sep 2025 12:16:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=45f75482-df7a-47c1-9ff8-61b072ef97cb/eastus/523ca097-f0a5-4abe-a503-0c52a723f2f1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: A74C1EFCA479412BBCA703969702FDD9 Ref B: PNQ231110909036 Ref C: 2025-09-18T12:16:20Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - site list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.77.0 azsdk-python-core/1.35.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites?api-version=2025-06-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/abhimishra-site-test/providers/microsoft.edge/sites/AbhishekSite","name":"AbhishekSite","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-04-23T10:41:25.5885796Z","lastModifiedBy":"17962ed5-6318-422b-b607-83385030b63d","lastModifiedByType":"Application","lastModifiedAt":"2025-05-13T00:25:36.5258485Z"},"properties":{"displayName":"Abhishek''s + Site","provisioningState":"Succeeded","siteAddress":{"streetAddress1":"221B + Baker Street","streetAddress2":"","city":"London","stateOrProvince":"","country":"GB","postalCode":""}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/edge-sites-common/providers/microsoft.edge/sites/AbhishekSite","name":"AbhishekSite","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-06-05T07:01:20.1611866Z","lastModifiedBy":"17962ed5-6318-422b-b607-83385030b63d","lastModifiedByType":"Application","lastModifiedAt":"2025-05-13T01:15:49.8128999Z"},"properties":{"displayName":"Abhishek + Site","provisioningState":"Succeeded","siteAddress":{"streetAddress1":"221B + Baker Street","streetAddress2":"","city":"London","stateOrProvince":"","country":"GB","postalCode":""}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/BasavarajSitesRG/providers/microsoft.edge/sites/BasavarajSite","name":"BasavarajSite","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-06-14T05:16:45.7330072Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-08-26T06:24:34.3482253Z"},"properties":{"displayName":"BasavarajSite","provisioningState":"Succeeded","labels":{"key1":"Value1"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datalabs-test-rg/providers/microsoft.edge/sites/Testcmadala","name":"Testcmadala","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-06-25T05:56:02.6706749Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-06-25T05:56:02.6706749Z"},"properties":{"displayName":"TestCmadala","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nbtoclean/providers/Microsoft.Edge/sites/Rome","name":"Rome","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-07-01T05:39:19.9933702Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-07-01T05:39:19.9933702Z"},"properties":{"displayName":"Rome","description":"Demo + site, not any description.","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nbtoclean/providers/Microsoft.Edge/sites/Rome1","name":"Rome1","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-07-01T05:40:05.4076927Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-07-01T05:40:05.4076927Z"},"properties":{"displayName":"Rome","description":"Demo + site, not any description.","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amrawat-test/providers/microsoft.edge/sites/TestSite","name":"TestSite","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-09-03T09:24:19.8939686Z","lastModifiedBy":"17962ed5-6318-422b-b607-83385030b63d","lastModifiedByType":"Application","lastModifiedAt":"2025-05-13T02:41:17.0805884Z"},"properties":{"displayName":"TestSite","provisioningState":"Succeeded","siteAddress":{"streetAddress1":"AL1","streetAddress2":"","city":"","stateOrProvince":"","country":"AU","postalCode":""}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/akanksha-test/providers/Microsoft.Edge/Sites/akanksha-test2","name":"akanksha-test2","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-09-11T08:03:55.5654761Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-09-11T08:03:55.5654761Z"},"properties":{"displayName":"akanksha-test2","description":"Demo + site, not any description.","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/akanksha-test/providers/Microsoft.Edge/Sites/akanksha-test3","name":"akanksha-test3","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-09-11T08:07:38.3710599Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-09-11T08:07:38.3710599Z"},"properties":{"displayName":"akanksha-test3","description":"Demo + site, not any description.","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/aupmanyu-test-rg/providers/microsoft.edge/sites/ayushi-test-site","name":"ayushi-test-site","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-09-12T09:13:23.4154951Z","lastModifiedBy":"17962ed5-6318-422b-b607-83385030b63d","lastModifiedByType":"Application","lastModifiedAt":"2025-05-13T02:48:20.0133766Z"},"properties":{"displayName":"ayushi-test-site","provisioningState":"Succeeded","siteAddress":{"streetAddress1":"AL1","streetAddress2":"","city":"","stateOrProvince":"","country":"AU","postalCode":""}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/EdgeSites_geneva_auto_create_rg/providers/microsoft.edge/sites/testrg1site","name":"testrg1site","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-09-13T09:24:28.1617093Z","lastModifiedBy":"17962ed5-6318-422b-b607-83385030b63d","lastModifiedByType":"Application","lastModifiedAt":"2025-05-13T02:50:33.8597178Z"},"properties":{"displayName":"testrg1site","provisioningState":"Succeeded","siteAddress":{"streetAddress1":"testrg1site","streetAddress2":"","city":"","stateOrProvince":"","country":"AR","postalCode":""}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.edge/sites/testsubs1site","name":"testsubs1site","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-09-13T09:26:44.2418479Z","lastModifiedBy":"17962ed5-6318-422b-b607-83385030b63d","lastModifiedByType":"Application","lastModifiedAt":"2025-05-13T02:50:34.4672403Z"},"properties":{"displayName":"testsubs1site","provisioningState":"Succeeded","siteAddress":{"streetAddress1":"testsubs1site","streetAddress2":"","city":"","stateOrProvince":"","country":"AR","postalCode":""}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/aupmanyu-test-rg2/providers/microsoft.edge/sites/ayushi-test-site","name":"ayushi-test-site","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-09-17T06:48:30.371194Z","lastModifiedBy":"17962ed5-6318-422b-b607-83385030b63d","lastModifiedByType":"Application","lastModifiedAt":"2025-05-13T02:52:44.6786823Z"},"properties":{"displayName":"ayushi-test-site","provisioningState":"Succeeded","siteAddress":{"streetAddress1":"AL1","streetAddress2":"","city":"","stateOrProvince":"","country":"AU","postalCode":""}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/site717","name":"site717","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-11-05T08:54:15.7942514Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-11-05T08:54:15.7942514Z"},"properties":{"displayName":"site717","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/site8765","name":"site8765","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-11-05T08:54:53.7578068Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-11-05T08:54:53.7578068Z"},"properties":{"displayName":"site8765","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/site3792","name":"site3792","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-11-05T09:30:22.8801694Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-11-05T09:30:28.0391794Z"},"properties":{"displayName":"updatedSite5777","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/site6658","name":"site6658","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-11-05T09:31:11.4165114Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-11-05T09:31:17.9496874Z"},"properties":{"displayName":"updatedSite8680","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/site5039","name":"site5039","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-11-05T09:49:59.8090298Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-11-05T09:50:03.7664602Z"},"properties":{"displayName":"updatedSite4592","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/site6436","name":"site6436","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-11-05T09:50:53.4345941Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-11-05T09:50:56.7949842Z"},"properties":{"displayName":"updatedSite6267","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/site5554","name":"site5554","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-11-05T09:58:09.1575817Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-11-05T09:58:14.7659557Z"},"properties":{"displayName":"updatedSite487","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/site4743","name":"site4743","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-11-05T09:58:59.9630708Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-11-05T09:59:09.9734395Z"},"properties":{"displayName":"updatedSite715","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/site4400","name":"site4400","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-11-05T10:05:26.0761734Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-11-05T10:05:33.6596605Z"},"properties":{"displayName":"updatedSite6930","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/site1073","name":"site1073","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-11-05T10:13:37.1870224Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-11-05T10:13:39.5217895Z"},"properties":{"displayName":"updatedSite7280","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3861/providers/Microsoft.Edge/sites/site3904","name":"site3904","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-11-06T09:14:55.4444145Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-11-06T09:14:59.632989Z"},"properties":{"displayName":"updatedSite1777","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4978/providers/Microsoft.Edge/sites/site5244","name":"site5244","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-11-06T09:15:15.169431Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-11-06T09:15:17.8144135Z"},"properties":{"displayName":"updatedSite785","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3917/providers/Microsoft.Edge/sites/site4261","name":"site4261","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-11-06T09:16:16.2357795Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-11-06T09:16:20.0178777Z"},"properties":{"displayName":"updatedSite8734","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg6198/providers/Microsoft.Edge/sites/site8484","name":"site8484","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-11-06T09:16:32.9316134Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-11-06T09:16:34.5913736Z"},"properties":{"displayName":"updatedSite6901","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg7271/providers/Microsoft.Edge/sites/site4937","name":"site4937","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2024-11-06T13:03:00.2136568Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2024-11-06T13:03:00.2136568Z"},"properties":{"displayName":"site4937","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/BasavarajRGTest/providers/microsoft.edge/sites/BasavarajSite","name":"BasavarajSite","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-02-24T07:40:27.8886096Z","lastModifiedBy":"17962ed5-6318-422b-b607-83385030b63d","lastModifiedByType":"Application","lastModifiedAt":"2025-05-13T05:25:14.5782642Z"},"properties":{"displayName":"Basavaraj''s + Site","labels":{"as":"asdad1"},"provisioningState":"Succeeded","siteAddress":{"streetAddress1":"221B + Baker Street","streetAddress2":"","city":"London","stateOrProvince":"","country":"GB","postalCode":""}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/basavarajNoAddressId","name":"basavarajNoAddressId","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-03-04T06:03:54.137328Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-09-01T12:41:32.4213114Z"},"properties":{"displayName":"Basavaraj''s + latest Site resource","provisioningState":"Succeeded","siteAddress":{"city":"","country":"au","postalCode":"","stateOrProvince":"","streetAddress1":"","streetAddress2":""},"labels":{"UpdatedBy":"darshana","type":"line"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/basavarajnewaddrprop","name":"basavarajnewaddrprop","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-03-07T05:25:10.8812825Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-07T05:30:05.1665133Z"},"properties":{"displayName":"SiteWithAddrProps","siteAddress":{"streetAddress1":"15 + TOWNSEND ST","streetAddress2":"UNIT 1","city":"San Francisco","stateOrProvince":"CA","country":"US","postalCode":"94107"},"labels":{},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/sitecreatedwithv1","name":"sitecreatedwithv1","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-03-17T09:18:29.2551643Z","lastModifiedBy":"17962ed5-6318-422b-b607-83385030b63d","lastModifiedByType":"Application","lastModifiedAt":"2025-05-13T05:45:31.7828752Z"},"properties":{"displayName":"SiteWithAddrProps","provisioningState":"Succeeded","siteAddress":{"streetAddress1":"221B + Baker Street","streetAddress2":"","city":"London","country":"GB","postalCode":"","stateOrProvince":""},"labels":{"NewAPI":"2025-03-01-preview"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/site1004","name":"site1004","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-04-10T08:01:00.867816Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-08-26T03:56:09.3311563Z"},"properties":{"displayName":"Basavaraj''s + Site resource","labels":{"type":"line","name":"Basavaraj S","UpdatedBy":"Kartik"},"provisioningState":"Succeeded","siteAddress":{"streetAddress1":"AL1","streetAddress2":"","city":"","stateOrProvince":"","country":"AU","postalCode":""}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/site1404","name":"site1404","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-04-14T03:34:30.5274919Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-08-26T03:56:09.4059973Z"},"properties":{"displayName":"Basavaraj''s + Site resource","labels":{"type":"line","name":"Basavaraj S","UpdatedBy":"Kartik"},"provisioningState":"Succeeded","siteAddress":{"streetAddress1":"AL1","streetAddress2":"","city":"","stateOrProvince":"","country":"AU","postalCode":""}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Darshita-resource/providers/microsoft.edge/sites/new-site","name":"new-site","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-04-15T08:54:06.1146298Z","lastModifiedBy":"17962ed5-6318-422b-b607-83385030b63d","lastModifiedByType":"Application","lastModifiedAt":"2025-05-13T06:21:53.20199Z"},"properties":{"displayName":"new-site","provisioningState":"Succeeded","siteAddress":{"streetAddress1":"edjfn","streetAddress2":"fefjn","city":"jaipur","stateOrProvince":"","country":"IN","postalCode":""}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/abc-resource/providers/microsoft.edge/sites/test","name":"test","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-04-22T03:32:27.9523017Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-04-22T03:36:03.1189508Z"},"properties":{"displayName":"testsite","description":"","siteAddress":{"streetAddress1":"","country":"dz"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzSecPackAutoConfigRG/providers/microsoft.edge/sites/test2","name":"test2","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-04-22T03:37:46.7523779Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-04-22T03:37:46.7523779Z"},"properties":{"displayName":"testsite2","description":"","siteAddress":{"streetAddress1":"abc","city":"983","stateOrProvince":"2309","country":"AT","postalCode":"133"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/BvtCloudTestAccounts/providers/microsoft.edge/sites/test3","name":"test3","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-04-22T03:39:33.4816786Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-04-22T03:39:33.4816786Z"},"properties":{"displayName":"testsite3","description":"","siteAddress":{"country":"AR"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/abc-resource/providers/microsoft.edge/sites/Test_123","name":"Test_123","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-04-22T10:43:54.8417661Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-04-22T10:43:54.8417661Z"},"properties":{"displayName":"Test_123","description":"","siteAddress":{"streetAddress1":"pune","city":"pune","stateOrProvince":"Maharashtra","country":"IN","postalCode":"411021"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sites-rg9287/providers/Microsoft.Edge/sites/SeattleSite7153","name":"SeattleSite7153","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-08T09:18:02.5360451Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-05-08T09:18:02.5360451Z"},"properties":{"displayName":"Seattle + Site","description":"Seattle Site Description","siteAddress":{"streetAddress1":" + Apt 4B","streetAddress2":"123 Main St","city":"Seattle","stateOrProvince":"WA","country":"USA","postalCode":"98101"},"labels":{"city":"Seattle","country":"USA"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sites-rg530/providers/Microsoft.Edge/sites/SeattleSite6303","name":"SeattleSite6303","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-08T09:21:31.8430327Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-05-08T09:21:31.8430327Z"},"properties":{"displayName":"Seattle + Site","description":"Seattle Site Description","siteAddress":{"streetAddress1":" + Apt 4B","streetAddress2":"123 Main St","city":"Seattle","stateOrProvince":"WA","country":"USA","postalCode":"98101"},"labels":{"city":"Seattle","country":"USA"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sites-rg6366/providers/Microsoft.Edge/sites/SeattleSite4276","name":"SeattleSite4276","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-08T09:44:46.738625Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-05-08T09:44:54.1548089Z"},"properties":{"provisioningState":"Succeeded","displayName":"Seattle + Site","description":"Seattle Site Description","siteAddress":{"streetAddress1":" + Apt 4B","streetAddress2":"123 Main St","city":"Seattle","stateOrProvince":"WA","country":"USA","postalCode":"98101"},"labels":{"city":"Seattle","country":"USA"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sites-rg2939/providers/Microsoft.Edge/sites/SeattleSite3523","name":"SeattleSite3523","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-08T09:46:09.9542318Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-05-08T09:46:12.0789199Z"},"properties":{"provisioningState":"Succeeded","displayName":"New + York Site","description":"New York Site Description","siteAddress":{"city":"New + York","country":"USA"},"labels":{"city":"New York"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/site1405","name":"site1405","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-14T04:04:45.5570928Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-08-26T03:56:09.3459485Z"},"properties":{"displayName":"Basavaraj''s + Site resource","labels":{"type":"line","name":"Basavaraj S","UpdatedBy":"Kartik"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/siteclirg/providers/Microsoft.Edge/sites/clirgsite","name":"clirgsite","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-28T13:24:35.9140956Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-05-28T13:24:35.9140956Z"},"properties":{"description":"cli + based sites creation","labels":{"key1":"value1","key2":"value2"},"siteAddress":{"city":"newyork","country":"usa","postalCode":"56797","streetAddress1":"15 + 2nd street"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/clisubssite","name":"clisubssite","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-28T13:25:31.5018995Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-09-01T12:42:12.2844728Z"},"properties":{"description":"cli + based sites creation","labels":{"key1":"value1","key2":"value2","UpdatedBy":"darshana"},"siteAddress":{"city":"newyork","country":"usa","postalCode":"56797","streetAddress1":"15 + 2nd street"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/clisgsite","name":"clisgsite","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-28T13:27:14.9086592Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-08-26T03:56:09.4309122Z"},"properties":{"provisioningState":"Succeeded","description":"cli + based sites creation","labels":{"key1":"value1","key2":"value2","UpdatedBy":"Kartik"},"siteAddress":{"city":"newyork","country":"usa","postalCode":"56797","streetAddress1":"15 + 2nd street"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/clisgsite2","name":"clisgsite2","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-28T13:30:45.082122Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-08-26T03:56:09.3769911Z"},"properties":{"provisioningState":"Succeeded","description":"cli + based sites creation","labels":{"key1":"value1","key2":"value2","UpdatedBy":"Kartik"},"siteAddress":{"city":"newyork","country":"usa","postalCode":"56797","streetAddress1":"15 + 2nd street"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/clisgsite3","name":"clisgsite3","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-29T03:42:33.8265987Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-09-03T12:54:13.59982Z"},"properties":{"description":"cli + based sites creation","labels":{"key1":"value1","key2":"value2","UpdatedBy":"darshana"},"siteAddress":{"city":"newyork","country":"usa","postalCode":"56797","streetAddress1":"15 + 2nd street"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/abc-resource/providers/Microsoft.Edge/sites/pythonsdktesting","name":"pythonsdktesting","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-29T10:19:48.5431938Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-05-29T10:20:44.5601223Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_edgesite_uyro7ozv235ouflh3jfxeksnaznzhjh6ss6edcojwpssp5kjnxprqbsr2/providers/Microsoft.Edge/sites/TestSiteName","name":"TestSiteName","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-30T08:21:04.0845954Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-05-30T08:21:04.0845954Z"},"properties":{"description":"Test + Site","labels":{"key1":"value1","key2":"value2"},"siteAddress":{"city":"San + Francisco","country":"US","postalCode":"94107","stateOrProvince":"CA","streetAddress1":"16 + TOWNSEND ST","streetAddress2":"UNIT 1"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_edgesite_za6ebtqlizxktj2g63tngf3qc745if7mxmrcyfsymcajwagvwe7ekgpan/providers/Microsoft.Edge/sites/TestSiteName","name":"TestSiteName","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-30T08:22:16.9670446Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-05-30T08:22:16.9670446Z"},"properties":{"description":"Test + Site","labels":{"key1":"value1","key2":"value2"},"siteAddress":{"city":"San + Francisco","country":"US","postalCode":"94107","stateOrProvince":"CA","streetAddress1":"16 + TOWNSEND ST","streetAddress2":"UNIT 1"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_edgesite_ge72pyhszjmi5qzivk5d5umt5rwqxxunhb47ek4gahagwflacnn5glsfn/providers/Microsoft.Edge/sites/TestSiteName","name":"TestSiteName","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-30T08:55:24.1131229Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-05-30T08:55:29.4691428Z"},"properties":{"description":"Test + Site","labels":{"key1":"value1","key2":"value2"},"siteAddress":{"city":"San + Francisco","country":"US","postalCode":"94108","stateOrProvince":"CA","streetAddress1":"18 + TOWNSEND ST","streetAddress2":"UNIT 1"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_edgesite_ltcjpfsvowok53hsw7aozvcxjxbbfgero5cefivdqipu4zosyj5ofntmi/providers/Microsoft.Edge/sites/TestSiteName","name":"TestSiteName","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-30T08:56:52.0192761Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-05-30T08:56:57.5687721Z"},"properties":{"description":"Test + Site","labels":{"key1":"value1","key2":"value2"},"siteAddress":{"city":"San + Francisco","country":"US","postalCode":"94108","stateOrProvince":"CA","streetAddress1":"18 + TOWNSEND ST","streetAddress2":"UNIT 1"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_edgesite_rh3b4xjz2lftzg2uhlea3ywg62uaggkhh734pwwaqu6t346gl75j73lv3/providers/Microsoft.Edge/sites/TestSiteName","name":"TestSiteName","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-05-30T09:03:06.9832201Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-05-30T09:03:13.4891315Z"},"properties":{"description":"Test + Site","labels":{"key1":"value1","key2":"value2"},"siteAddress":{"city":"San + Francisco","country":"US","postalCode":"94108","stateOrProvince":"CA","streetAddress1":"18 + TOWNSEND ST","streetAddress2":"UNIT 1"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloud-shell-storage-southeastasia/providers/microsoft.edge/sites/test1234","name":"test1234","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-06-19T14:32:15.8483267Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-06-19T14:32:15.8483267Z"},"properties":{"displayName":"test1234","description":"","siteAddress":{"country":"US"},"labels":{},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/NetworkWatcherRG/providers/microsoft.edge/sites/test12345","name":"test12345","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-06-20T14:15:06.6084492Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-06-20T14:15:06.6084492Z"},"properties":{"displayName":"test12345","description":"","siteAddress":{"country":"US"},"labels":{},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/EdgeSitesRG/providers/microsoft.edge/sites/test123456","name":"test123456","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-06-24T04:19:25.3365309Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-06-24T04:19:25.3365309Z"},"properties":{"displayName":"test123456","description":"","siteAddress":{"country":"US"},"labels":{},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SitesRGBased/providers/microsoft.edge/sites/labels_test","name":"labels_test","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-08-26T05:00:07.4052942Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-08-26T06:12:47.2384237Z"},"properties":{"displayName":"labels_test","description":"","siteAddress":{"streetAddress1":"Bellandur","city":"Bengaluru","stateOrProvince":"KA","country":"IN","postalCode":"560016"},"labels":{"Env":"ProjectCostAllocationTrackingForEnterpriseResourcePlanningAndFinancialForecastingAcrossMultipleDepartmentsIncludingMarketingSalesOperationsHumanResourcesLegalComplianceAndInformationTechnologyWithAdditionalConsiderationsForCloudMigrationSecurityProtocolsDataGovernanceAndSustainabilityInitiativesInAlignmentWithGlobalExpansionStrategiesAndQuarterlyPerformanceMetricsReviewCycleIncludingStakeholderEngagementAndRegulatoryReportingRequirementsVersion2025Q3AlphaReleaseCandidateExtendedSupportPhaseOne","ProjectCostAllocationTrackingForEnterpriseResourcePlanningAndFinancialForecastingAcrossMultipleDepartmentsIncludingMarketingSalesOperationsHumanResourcesLegalComplianceAndInformationTechnologyWithAdditionalConsiderationsForCloudMigrationSecurityProtocolsDataGovernanceAndSustainabilityInitiativesInAlignmentWithGlobalExpansionStrategiesAndQuarterlyPerformanceMetricsReviewCycleIncludingStakeholderEngagementAndRegulatoryReportingRequirementsVersion2025Q3AlphaReleaseCandidateExtendedSupportPhaseOne":"Test"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_site_000001/providers/Microsoft.Edge/sites/TestSiteName","name":"TestSiteName","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-09-18T12:16:02.9227483Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-09-18T12:16:07.4469719Z"},"properties":{"description":"Test + Site","displayName":"Test Site Display","labels":{"key1":"value1","key2":"value2"},"siteAddress":{"city":"San + Francisco","country":"US","postalCode":"94108","stateOrProvince":"CA","streetAddress1":"18 + TOWNSEND ST","streetAddress2":"UNIT 1"},"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/TestSubsSiteName","name":"TestSubsSiteName","type":"microsoft.edge/sites","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-09-18T12:16:04.6436888Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-09-18T12:16:14.5112965Z"},"properties":{"description":"Test + Subs Site","displayName":"Test Subs Site Display","labels":{"key1":"value1","key2":"value2"},"siteAddress":{"city":"San + Francisco","country":"US","postalCode":"94108","stateOrProvince":"CA","streetAddress1":"18 + TOWNSEND ST","streetAddress2":"UNIT 1"},"provisioningState":"Succeeded"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '36764' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 18 Sep 2025 12:16:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=45f75482-df7a-47c1-9ff8-61b072ef97cb/eastus/8ed7498d-099a-41d5-a3d8-b523926d1830 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 6BC605A11239400491306E902B24850A Ref B: PNQ231110909052 Ref C: 2025-09-18T12:16:20Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - site delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --site-name -g --yes + User-Agent: + - AZURECLI/2.77.0 azsdk-python-core/1.35.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_site_000001/providers/Microsoft.Edge/sites/TestSiteName?api-version=2025-06-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 18 Sep 2025 12:16:23 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=45f75482-df7a-47c1-9ff8-61b072ef97cb/westindia/2e5489f3-e828-48d0-bde7-faa2664efa73 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '799' + x-ms-ratelimit-remaining-subscription-global-deletes: + - '11999' + x-msedge-ref: + - 'Ref A: 82D3CAA7E18240A3B27BCCCB1229D485 Ref B: PNQ231110907062 Ref C: 2025-09-18T12:16:21Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - site delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --site-name --yes + User-Agent: + - AZURECLI/2.77.0 azsdk-python-core/1.35.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Edge/sites/TestSubsSiteName?api-version=2025-06-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 18 Sep 2025 12:16:29 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=45f75482-df7a-47c1-9ff8-61b072ef97cb/southindia/a0a8d44c-baf9-4a5b-b7b2-fc412261ff03 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '799' + x-ms-ratelimit-remaining-subscription-global-deletes: + - '11999' + x-msedge-ref: + - 'Ref A: B200CC7F35374BE9BF3D611EAED77E7B Ref B: PNQ231110909025 Ref C: 2025-09-18T12:16:24Z' + status: + code: 200 + message: OK +version: 1 diff --git a/src/site/azext_site/tests/latest/test_site.py b/src/site/azext_site/tests/latest/test_site.py new file mode 100644 index 00000000000..9e791a28a41 --- /dev/null +++ b/src/site/azext_site/tests/latest/test_site.py @@ -0,0 +1,133 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from azure.cli.testsdk import * + + +class SiteScenario(ScenarioTest): + + @ResourceGroupPreparer(name_prefix="cli_test_site_", location="eastus") + def test_edge_site_crud(self): + self.kwargs.update({ + "city": "San Francisco", + "country": "US", + "code": "94107", + "state": "CA", + "address1": "16 TOWNSEND ST", + "address2": "UNIT 1" + }) + #Create Site at resource group scope + self.cmd( + "az site create --site-name TestSiteName --resource-group {rg} " + "--display-name 'Test Site Display' --description 'Test Site' --labels key1='value1' key2='value2' " + "--street-address1='{address1}' --street-address2='{address2}' " + "--city='{city}' --state-or-province={state} --country={country} --postal-code={code} ", + checks=[ + self.check("name", "TestSiteName"), + self.check("type", "microsoft.edge/sites"), + self.check("properties.displayName", "Test Site Display"), + self.check("properties.description", "Test Site"), + self.check("properties.labels.key1", "value1"), + self.check("properties.labels.key2", "value2"), + self.check("properties.siteAddress.city", "San Francisco"), + self.check("properties.siteAddress.postalCode", "94107"), + self.check("properties.siteAddress.streetAddress1", "{address1}"), + ] + ) + + #Create Site at subscription scope + self.cmd( + "az site create --site-name TestSubsSiteName " + "--display-name 'Test Subs Site Display' --description 'Test Subs Site' --labels key1='value1' key2='value2' " + "--street-address1='{address1}' --street-address2='{address2}' " + "--city='{city}' --state-or-province={state} --country={country} --postal-code={code} ", + checks=[ + self.check("name", "TestSubsSiteName"), + self.check("type", "microsoft.edge/sites"), + self.check("properties.displayName", "Test Subs Site Display"), + self.check("properties.description", "Test Subs Site"), + self.check("properties.labels.key1", "value1"), + self.check("properties.labels.key2", "value2"), + self.check("properties.siteAddress.city", "San Francisco"), + self.check("properties.siteAddress.postalCode", "94107"), + self.check("properties.siteAddress.streetAddress1", "{address1}"), + ] + ) + + #Show Site at resource group scope + self.cmd( + "az site show --site-name TestSiteName --resource-group {rg} ", + checks=[ + self.check("name", "TestSiteName"), + self.check("type", "microsoft.edge/sites"), + self.check("properties.displayName", "Test Site Display"), + self.check("properties.description", "Test Site"), + self.check("properties.labels.key1", "value1"), + self.check("properties.siteAddress.streetAddress1", "{address1}"), + self.check("properties.siteAddress.streetAddress2", "{address2}"), + ] + ) + + #Show Site at subscription scope + self.cmd( + "az site show --site-name TestSubsSiteName ", + checks=[ + self.check("name", "TestSubsSiteName"), + self.check("type", "microsoft.edge/sites"), + self.check("properties.displayName", "Test Subs Site Display"), + self.check("properties.description", "Test Subs Site"), + self.check("properties.labels.key1", "value1"), + self.check("properties.siteAddress.streetAddress1", "{address1}"), + self.check("properties.siteAddress.streetAddress2", "{address2}"), + ] + ) + + #Update Site at resource group scope + self.cmd( + "az site update --site-name TestSiteName --resource-group {rg} " + "--description 'Test Site' --labels key1='value1' key2='value2' " + "--street-address1='18 TOWNSEND ST' --street-address2='{address2}' " + "--city='{city}' --state-or-province={state} --country={country} --postal-code='94108' ", + checks=[ + self.check("name", "TestSiteName"), + self.check("properties.siteAddress.streetAddress1", "18 TOWNSEND ST"), + self.check("properties.siteAddress.postalCode", "94108"), + self.check("properties.provisioningState", "Succeeded"), + ], + ) + + #Update Site at subscription scope + self.cmd( + "az site update --site-name TestSubsSiteName " + "--description 'Test Subs Site' --labels key1='value1' key2='value2' " + "--street-address1='18 TOWNSEND ST' --street-address2='{address2}' " + "--city='{city}' --state-or-province={state} --country={country} --postal-code='94108' ", + checks=[ + self.check("name", "TestSubsSiteName"), + self.check("properties.siteAddress.streetAddress1", "18 TOWNSEND ST"), + self.check("properties.siteAddress.postalCode", "94108"), + self.check("properties.provisioningState", "Succeeded"), + ], + ) + + #List Sites at resource group scope + result = self.cmd( + "az site list -g {rg}" + ).get_output_in_json() + assert any(item.get("name") == "TestSiteName" for item in result), f"'TestSiteName' not found in schema list" + + #List Sites at subscription scope + result = self.cmd( + "az site list" + ).get_output_in_json() + assert any(item.get("name") == "TestSubsSiteName" for item in result), f"'TestSubsSiteName' not found in schema list" + + #Delete Site at resource group scope + self.cmd("az site delete --site-name TestSiteName -g {rg} --yes") + + #Delete Site at subscription scope + self.cmd("az site delete --site-name TestSubsSiteName --yes") diff --git a/src/site/setup.cfg b/src/site/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/site/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/site/setup.py b/src/site/setup.py new file mode 100644 index 00000000000..69a27be0491 --- /dev/null +++ b/src/site/setup.py @@ -0,0 +1,51 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from codecs import open +from setuptools import setup, find_packages + + +# HISTORY.rst entry. +VERSION = '1.0.0b1' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='site', + version=VERSION, + description='Microsoft Azure Command-Line Tools Site Extension.', + long_description=README + '\n\n' + HISTORY, + license='MIT', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/main/src/site', + classifiers=CLASSIFIERS, + packages=find_packages(exclude=["tests"]), + package_data={'azext_site': ['azext_metadata.json']}, + install_requires=DEPENDENCIES +)