-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Elastic] Initial GA Elastic (#3921)
* first generation * regen the elastic extension * fix sytle * fix recording * add codeowners * rename commands * update readme
- Loading branch information
Showing
60 changed files
with
9,127 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 |
---|---|---|
|
@@ -207,3 +207,5 @@ | |
/src/authV2/ @mkarmark | ||
|
||
/src/purview/ @kairu-ms @jsntcy | ||
|
||
/src/elastic/ @kairu-ms @jsntcy |
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,77 @@ | ||
# 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\\"}" \ | ||
--sku "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" | ||
``` | ||
##### List Resource ##### | ||
``` | ||
az elastic monitor list-resource --name "myMonitor" --resource-group "myResourceGroup" | ||
``` | ||
##### List Deployment Info ##### | ||
``` | ||
az elastic monitor list-deployment-info --name "myMonitor" --resource-group "myResourceGroup" | ||
``` | ||
##### List VM Host ##### | ||
``` | ||
az elastic monitor list-vm-host --name "myMonitor" --resource-group "myResourceGroup" | ||
``` | ||
##### List VM Ingestion Detail ##### | ||
``` | ||
az elastic monitor list-vm-ingestion-detail --name "myMonitor" --resource-group "myResourceGroup" | ||
``` | ||
##### Update VM Collection ##### | ||
``` | ||
az elastic monitor update-vm-collection --name "myMonitor" --operation-name "Add" --vm-resource-id \ | ||
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtual\ | ||
machines/myVM" --resource-group "myResourceGroup" | ||
``` | ||
#### elastic monitor tag-rule #### | ||
##### Create ##### | ||
``` | ||
az elastic monitor 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 monitor elastic tag-rule show --monitor-name "myMonitor" --resource-group "myResourceGroup" --rule-set-name "default" | ||
``` | ||
##### List ##### | ||
``` | ||
az monitor elastic tag-rule list --monitor-name "myMonitor" --resource-group "myResourceGroup" | ||
``` | ||
##### Delete ##### | ||
``` | ||
az monitor elastic tag-rule delete --monitor-name "myMonitor" --resource-group "myResourceGroup" --rule-set-name "default" | ||
``` |
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,53 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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=unused-import | ||
|
||
import azext_elastic._help | ||
from azure.cli.core import AzCommandsLoader | ||
|
||
|
||
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 as e: | ||
if e.name.endswith('manual.commands'): | ||
pass | ||
else: | ||
raise e | ||
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 as e: | ||
if e.name.endswith('manual._params'): | ||
pass | ||
else: | ||
raise e | ||
|
||
|
||
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,20 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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 | ||
# pylint: disable=unused-import | ||
from .generated._help import helps # pylint: disable=reimported | ||
try: | ||
from .manual._help import helps # pylint: disable=reimported | ||
except ImportError as e: | ||
if e.name.endswith('manual._help'): | ||
pass | ||
else: | ||
raise e |
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,20 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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 as e: | ||
if e.name.endswith('manual.action'): | ||
pass | ||
else: | ||
raise e |
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,20 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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 as e: | ||
if e.name.endswith('manual.custom'): | ||
pass | ||
else: | ||
raise e |
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.