forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 14992 in Azure/azure-rest-api-specs
Merge 45201a5f0ff71666b476c1b3224ac8e9c3c4178f into a68e908
- Loading branch information
SDKAuto
committed
Jun 29, 2021
1 parent
a009929
commit 3643063
Showing
53 changed files
with
7,689 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 | ||
=============== | ||
|
||
0.1.0 | ||
++++++ | ||
* Initial release. |
This file contains 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,82 @@ | ||
# Azure CLI elastic Extension # | ||
This is the extension for elastic | ||
|
||
### How to use ### | ||
Install this extension using the below CLI command | ||
``` | ||
az extension add --name elastic | ||
``` | ||
|
||
### Included Features ### | ||
#### elastic monitor #### | ||
##### Create ##### | ||
``` | ||
az elastic monitor create --monitor-name "myMonitor" --name "myMonitor" --location "West US 2" \ | ||
--user-info "{\\"companyInfo\\":{\\"business\\":\\"Technology\\",\\"country\\":\\"US\\",\\"domain\\":\\"microsoft.com\\",\\"employeeNumber\\":\\"10000\\",\\"state\\":\\"WA\\"},\\"companyName\\":\\"Microsoft\\",\\"emailAddress\\":\\"alice@microsoft.com\\",\\"firstName\\":\\"Alice\\",\\"lastName\\":\\"Bob\\"}" \ | ||
--name "free_Monthly" --tags Environment="Dev" --resource-group "myResourceGroup" | ||
az elastic monitor wait --created --monitor-name "{myMonitor}" --resource-group "{rg}" | ||
``` | ||
##### Show ##### | ||
``` | ||
az elastic monitor show --name "myMonitor" --resource-group "myResourceGroup" | ||
``` | ||
##### List ##### | ||
``` | ||
az elastic monitor list --resource-group "myResourceGroup" | ||
``` | ||
##### Update ##### | ||
``` | ||
az elastic monitor update --name "myMonitor" --tags Environment="Dev" --resource-group "myResourceGroup" | ||
``` | ||
##### Delete ##### | ||
``` | ||
az elastic monitor delete --name "myMonitor" --resource-group "myResourceGroup" | ||
``` | ||
#### elastic monitored-resource #### | ||
##### List ##### | ||
``` | ||
az elastic monitored-resource list --monitor-name "myMonitor" --resource-group "myResourceGroup" | ||
``` | ||
#### elastic deployment-info #### | ||
##### List ##### | ||
``` | ||
az elastic deployment-info list --monitor-name "myMonitor" --resource-group "myResourceGroup" | ||
``` | ||
#### elastic tag-rule #### | ||
##### Create ##### | ||
``` | ||
az elastic tag-rule create --monitor-name "myMonitor" \ | ||
--filtering-tags name="Environment" action="Include" value="Prod" \ | ||
--filtering-tags name="Environment" action="Exclude" value="Dev" --send-aad-logs false --send-activity-logs true \ | ||
--send-subscription-logs true --resource-group "myResourceGroup" --rule-set-name "default" | ||
``` | ||
##### Show ##### | ||
``` | ||
az elastic tag-rule show --monitor-name "myMonitor" --resource-group "myResourceGroup" --rule-set-name "default" | ||
``` | ||
##### List ##### | ||
``` | ||
az elastic tag-rule list --monitor-name "myMonitor" --resource-group "myResourceGroup" | ||
``` | ||
##### Delete ##### | ||
``` | ||
az elastic tag-rule delete --monitor-name "myMonitor" --resource-group "myResourceGroup" --rule-set-name "default" | ||
``` | ||
#### elastic vm-host #### | ||
##### List ##### | ||
``` | ||
az elastic vm-host list --monitor-name "myMonitor" --resource-group "myResourceGroup" | ||
``` | ||
#### elastic vm-ingestion #### | ||
##### Detail ##### | ||
``` | ||
az elastic vm-ingestion detail --monitor-name "myMonitor" --resource-group "myResourceGroup" | ||
``` | ||
#### elastic vm-collection #### | ||
##### Update ##### | ||
``` | ||
az elastic vm-collection update --monitor-name "myMonitor" --operation-name "Add" \ | ||
--vm-resource-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualmachines/myVM" \ | ||
--resource-group "myResourceGroup" | ||
``` |
This file contains 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,50 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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 Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from azure.cli.core import AzCommandsLoader | ||
from azext_elastic.generated._help import helps # pylint: disable=unused-import | ||
try: | ||
from azext_elastic.manual._help import helps # pylint: disable=reimported | ||
except ImportError: | ||
pass | ||
|
||
|
||
class MicrosoftElasticCommandsLoader(AzCommandsLoader): | ||
|
||
def __init__(self, cli_ctx=None): | ||
from azure.cli.core.commands import CliCommandType | ||
from azext_elastic.generated._client_factory import cf_elastic_cl | ||
elastic_custom = CliCommandType( | ||
operations_tmpl='azext_elastic.custom#{}', | ||
client_factory=cf_elastic_cl) | ||
parent = super(MicrosoftElasticCommandsLoader, self) | ||
parent.__init__(cli_ctx=cli_ctx, custom_command_type=elastic_custom) | ||
|
||
def load_command_table(self, args): | ||
from azext_elastic.generated.commands import load_command_table | ||
load_command_table(self, args) | ||
try: | ||
from azext_elastic.manual.commands import load_command_table as load_command_table_manual | ||
load_command_table_manual(self, args) | ||
except ImportError: | ||
pass | ||
return self.command_table | ||
|
||
def load_arguments(self, command): | ||
from azext_elastic.generated._params import load_arguments | ||
load_arguments(self, command) | ||
try: | ||
from azext_elastic.manual._params import load_arguments as load_arguments_manual | ||
load_arguments_manual(self, command) | ||
except ImportError: | ||
pass | ||
|
||
|
||
COMMAND_LOADER_CLS = MicrosoftElasticCommandsLoader |
This file contains 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,17 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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 Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
# pylint: disable=wildcard-import | ||
# pylint: disable=unused-wildcard-import | ||
|
||
from .generated.action import * # noqa: F403 | ||
try: | ||
from .manual.action import * # noqa: F403 | ||
except ImportError: | ||
pass |
This file contains 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,4 @@ | ||
{ | ||
"azext.isExperimental": true, | ||
"azext.minCliCoreVersion": "2.15.0" | ||
} |
This file contains 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,17 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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 Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
# pylint: disable=wildcard-import | ||
# pylint: disable=unused-wildcard-import | ||
|
||
from .generated.custom import * # noqa: F403 | ||
try: | ||
from .manual.custom import * # noqa: F403 | ||
except ImportError: | ||
pass |
This file contains 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,12 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# 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 Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
This file contains 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,44 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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 Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
|
||
def cf_elastic_cl(cli_ctx, *_): | ||
from azure.cli.core.commands.client_factory import get_mgmt_service_client | ||
from azext_elastic.vendored_sdks.elastic import MicrosoftElastic | ||
return get_mgmt_service_client(cli_ctx, | ||
MicrosoftElastic) | ||
|
||
|
||
def cf_monitor(cli_ctx, *_): | ||
return cf_elastic_cl(cli_ctx).monitors | ||
|
||
|
||
def cf_monitored_resource(cli_ctx, *_): | ||
return cf_elastic_cl(cli_ctx).monitored_resources | ||
|
||
|
||
def cf_deployment_info(cli_ctx, *_): | ||
return cf_elastic_cl(cli_ctx).deployment_info | ||
|
||
|
||
def cf_tag_rule(cli_ctx, *_): | ||
return cf_elastic_cl(cli_ctx).tag_rules | ||
|
||
|
||
def cf_vm_host(cli_ctx, *_): | ||
return cf_elastic_cl(cli_ctx).vm_host | ||
|
||
|
||
def cf_vm_ingestion(cli_ctx, *_): | ||
return cf_elastic_cl(cli_ctx).vm_ingestion | ||
|
||
|
||
def cf_vm_collection(cli_ctx, *_): | ||
return cf_elastic_cl(cli_ctx).vm_collection |
Oops, something went wrong.