-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Azure CLI to manage Site resources #9181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
92ed107
Site cli extension changes
bsomeshekar 5fe4ced
removing beta
bsomeshekar 1da9f90
Allowing labels deletion
bsomeshekar a8609f3
removing beta from version history
bsomeshekar 2d0dae9
Correcting argument
bsomeshekar b9650fa
Correcting format
bsomeshekar f7d2985
Updated readme
bsomeshekar 276e6e3
Adding beta to version
bsomeshekar fb08a5a
Updating service_name file with site entry
bsomeshekar 7699d8b
Merge branch 'Azure:main' into Basavaraj_site_cliextension
bsomeshekar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| .. :changelog: | ||
| Release History | ||
| =============== | ||
|
|
||
| 1.0.0b1 | ||
| ++++++ | ||
| * Initial release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| # 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 | ||
| ``` | ||
|
|
||
| ### Included Features ### | ||
| ##### Create a Site at service group scope ##### | ||
| ``` | ||
| az site create --site-name TestSiteName --servicegroup-name 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" | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| # -------------------------------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 * |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.