Skip to content

Commit 3643063

Browse files
author
SDKAuto
committed
CodeGen from PR 14992 in Azure/azure-rest-api-specs
Merge 45201a5f0ff71666b476c1b3224ac8e9c3c4178f into a68e908
1 parent a009929 commit 3643063

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+7689
-0
lines changed

src/elastic/HISTORY.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.. :changelog:
2+
3+
Release History
4+
===============
5+
6+
0.1.0
7+
++++++
8+
* Initial release.

src/elastic/README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Azure CLI elastic Extension #
2+
This is the extension for elastic
3+
4+
### How to use ###
5+
Install this extension using the below CLI command
6+
```
7+
az extension add --name elastic
8+
```
9+
10+
### Included Features ###
11+
#### elastic monitor ####
12+
##### Create #####
13+
```
14+
az elastic monitor create --monitor-name "myMonitor" --name "myMonitor" --location "West US 2" \
15+
--user-info "{\\"companyInfo\\":{\\"business\\":\\"Technology\\",\\"country\\":\\"US\\",\\"domain\\":\\"microsoft.com\\",\\"employeeNumber\\":\\"10000\\",\\"state\\":\\"WA\\"},\\"companyName\\":\\"Microsoft\\",\\"emailAddress\\":\\"alice@microsoft.com\\",\\"firstName\\":\\"Alice\\",\\"lastName\\":\\"Bob\\"}" \
16+
--name "free_Monthly" --tags Environment="Dev" --resource-group "myResourceGroup"
17+
18+
az elastic monitor wait --created --monitor-name "{myMonitor}" --resource-group "{rg}"
19+
```
20+
##### Show #####
21+
```
22+
az elastic monitor show --name "myMonitor" --resource-group "myResourceGroup"
23+
```
24+
##### List #####
25+
```
26+
az elastic monitor list --resource-group "myResourceGroup"
27+
```
28+
##### Update #####
29+
```
30+
az elastic monitor update --name "myMonitor" --tags Environment="Dev" --resource-group "myResourceGroup"
31+
```
32+
##### Delete #####
33+
```
34+
az elastic monitor delete --name "myMonitor" --resource-group "myResourceGroup"
35+
```
36+
#### elastic monitored-resource ####
37+
##### List #####
38+
```
39+
az elastic monitored-resource list --monitor-name "myMonitor" --resource-group "myResourceGroup"
40+
```
41+
#### elastic deployment-info ####
42+
##### List #####
43+
```
44+
az elastic deployment-info list --monitor-name "myMonitor" --resource-group "myResourceGroup"
45+
```
46+
#### elastic tag-rule ####
47+
##### Create #####
48+
```
49+
az elastic tag-rule create --monitor-name "myMonitor" \
50+
--filtering-tags name="Environment" action="Include" value="Prod" \
51+
--filtering-tags name="Environment" action="Exclude" value="Dev" --send-aad-logs false --send-activity-logs true \
52+
--send-subscription-logs true --resource-group "myResourceGroup" --rule-set-name "default"
53+
```
54+
##### Show #####
55+
```
56+
az elastic tag-rule show --monitor-name "myMonitor" --resource-group "myResourceGroup" --rule-set-name "default"
57+
```
58+
##### List #####
59+
```
60+
az elastic tag-rule list --monitor-name "myMonitor" --resource-group "myResourceGroup"
61+
```
62+
##### Delete #####
63+
```
64+
az elastic tag-rule delete --monitor-name "myMonitor" --resource-group "myResourceGroup" --rule-set-name "default"
65+
```
66+
#### elastic vm-host ####
67+
##### List #####
68+
```
69+
az elastic vm-host list --monitor-name "myMonitor" --resource-group "myResourceGroup"
70+
```
71+
#### elastic vm-ingestion ####
72+
##### Detail #####
73+
```
74+
az elastic vm-ingestion detail --monitor-name "myMonitor" --resource-group "myResourceGroup"
75+
```
76+
#### elastic vm-collection ####
77+
##### Update #####
78+
```
79+
az elastic vm-collection update --monitor-name "myMonitor" --operation-name "Add" \
80+
--vm-resource-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualmachines/myVM" \
81+
--resource-group "myResourceGroup"
82+
```
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
11+
from azure.cli.core import AzCommandsLoader
12+
from azext_elastic.generated._help import helps # pylint: disable=unused-import
13+
try:
14+
from azext_elastic.manual._help import helps # pylint: disable=reimported
15+
except ImportError:
16+
pass
17+
18+
19+
class MicrosoftElasticCommandsLoader(AzCommandsLoader):
20+
21+
def __init__(self, cli_ctx=None):
22+
from azure.cli.core.commands import CliCommandType
23+
from azext_elastic.generated._client_factory import cf_elastic_cl
24+
elastic_custom = CliCommandType(
25+
operations_tmpl='azext_elastic.custom#{}',
26+
client_factory=cf_elastic_cl)
27+
parent = super(MicrosoftElasticCommandsLoader, self)
28+
parent.__init__(cli_ctx=cli_ctx, custom_command_type=elastic_custom)
29+
30+
def load_command_table(self, args):
31+
from azext_elastic.generated.commands import load_command_table
32+
load_command_table(self, args)
33+
try:
34+
from azext_elastic.manual.commands import load_command_table as load_command_table_manual
35+
load_command_table_manual(self, args)
36+
except ImportError:
37+
pass
38+
return self.command_table
39+
40+
def load_arguments(self, command):
41+
from azext_elastic.generated._params import load_arguments
42+
load_arguments(self, command)
43+
try:
44+
from azext_elastic.manual._params import load_arguments as load_arguments_manual
45+
load_arguments_manual(self, command)
46+
except ImportError:
47+
pass
48+
49+
50+
COMMAND_LOADER_CLS = MicrosoftElasticCommandsLoader
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
# pylint: disable=wildcard-import
11+
# pylint: disable=unused-wildcard-import
12+
13+
from .generated.action import * # noqa: F403
14+
try:
15+
from .manual.action import * # noqa: F403
16+
except ImportError:
17+
pass
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"azext.isExperimental": true,
3+
"azext.minCliCoreVersion": "2.15.0"
4+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
# pylint: disable=wildcard-import
11+
# pylint: disable=unused-wildcard-import
12+
13+
from .generated.custom import * # noqa: F403
14+
try:
15+
from .manual.custom import * # noqa: F403
16+
except ImportError:
17+
pass
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
11+
12+
def cf_elastic_cl(cli_ctx, *_):
13+
from azure.cli.core.commands.client_factory import get_mgmt_service_client
14+
from azext_elastic.vendored_sdks.elastic import MicrosoftElastic
15+
return get_mgmt_service_client(cli_ctx,
16+
MicrosoftElastic)
17+
18+
19+
def cf_monitor(cli_ctx, *_):
20+
return cf_elastic_cl(cli_ctx).monitors
21+
22+
23+
def cf_monitored_resource(cli_ctx, *_):
24+
return cf_elastic_cl(cli_ctx).monitored_resources
25+
26+
27+
def cf_deployment_info(cli_ctx, *_):
28+
return cf_elastic_cl(cli_ctx).deployment_info
29+
30+
31+
def cf_tag_rule(cli_ctx, *_):
32+
return cf_elastic_cl(cli_ctx).tag_rules
33+
34+
35+
def cf_vm_host(cli_ctx, *_):
36+
return cf_elastic_cl(cli_ctx).vm_host
37+
38+
39+
def cf_vm_ingestion(cli_ctx, *_):
40+
return cf_elastic_cl(cli_ctx).vm_ingestion
41+
42+
43+
def cf_vm_collection(cli_ctx, *_):
44+
return cf_elastic_cl(cli_ctx).vm_collection

0 commit comments

Comments
 (0)