Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/service_name.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
}
]
8 changes: 8 additions & 0 deletions src/site/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:

Release History
===============

1.0.0b1
++++++
* Initial release.
86 changes: 86 additions & 0 deletions src/site/README.md
Original file line number Diff line number Diff line change
@@ -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"
```
42 changes: 42 additions & 0 deletions src/site/azext_site/__init__.py
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions src/site/azext_site/_help.py
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions src/site/azext_site/_params.py
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions src/site/azext_site/aaz/__init__.py
Original file line number Diff line number Diff line change
@@ -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
# --------------------------------------------------------------------------------------------
10 changes: 10 additions & 0 deletions src/site/azext_site/aaz/latest/__init__.py
Original file line number Diff line number Diff line change
@@ -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

23 changes: 23 additions & 0 deletions src/site/azext_site/aaz/latest/site/__cmd_group.py
Original file line number Diff line number Diff line change
@@ -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"]
16 changes: 16 additions & 0 deletions src/site/azext_site/aaz/latest/site/__init__.py
Original file line number Diff line number Diff line change
@@ -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 *
Loading
Loading