-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Elastic] Initial GA Elastic #3921
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 all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4eaf6ed
first generation
00Kai0 aba41ea
regen the elastic extension
00Kai0 267acc1
fix sytle
00Kai0 c6f7e48
fix recording
00Kai0 c313e96
add codeowners
00Kai0 69f1926
rename commands
00Kai0 39544df
Merge remote-tracking branch 'origin/main' into kaihui-elastic-first-gen
00Kai0 b3ee85f
update readme
00Kai0 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 |
|---|---|---|
|
|
@@ -207,3 +207,5 @@ | |
| /src/authV2/ @mkarmark | ||
|
|
||
| /src/purview/ @kairu-ms @jsntcy | ||
|
|
||
| /src/elastic/ @kairu-ms @jsntcy | ||
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 | ||
| =============== | ||
|
|
||
| 0.1.0 | ||
| ++++++ | ||
| * 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,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\\":\\"[email protected]\\",\\"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 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,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 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,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 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,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 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,4 @@ | ||
| { | ||
| "azext.isExperimental": true, | ||
| "azext.minCliCoreVersion": "2.15.0" | ||
| } |
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,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 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,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 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,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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please correct the content in this file.