Skip to content

Commit 4ce8c40

Browse files
author
SDKAuto
committed
CodeGen from PR 15540 in Azure/azure-rest-api-specs
Merge 3c943fe10854a1fe6f67a91b7f51913274b05893 into 57e30b5
1 parent 927c622 commit 4ce8c40

Some content is hidden

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

51 files changed

+12380
-0
lines changed

src/storagecache/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/storagecache/README.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# Azure CLI storagecache Extension #
2+
This is the extension for storagecache
3+
4+
### How to use ###
5+
Install this extension using the below CLI command
6+
```
7+
az extension add --name storagecache
8+
```
9+
10+
### Included Features ###
11+
#### storagecache sku ####
12+
##### List #####
13+
```
14+
az storagecache sku list
15+
```
16+
#### storagecache usage-model ####
17+
##### List #####
18+
```
19+
az storagecache usage-model list
20+
```
21+
#### storagecache asc-operation ####
22+
##### Show #####
23+
```
24+
az storagecache asc-operation show --operation-id "testoperationid" --location "westus"
25+
```
26+
#### storagecache ####
27+
##### Create #####
28+
```
29+
az storagecache create --type "UserAssigned" \
30+
--user-assigned-identities "{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1\\":{}}" \
31+
--location "westus" --cache-size-gb 3072 --cache-net-bios-name "contosoSmb" \
32+
--cache-active-directory-settings-credentials password="<password>" username="consotoAdmin" \
33+
--domain-name "contosoAd.contoso.local" --domain-net-bios-name "contosoAd" --primary-dns-ip-address "192.0.2.10" \
34+
--secondary-dns-ip-address "192.0.2.11" \
35+
--credentials bind-dn="cn=ldapadmin,dc=contosoad,dc=contoso,dc=local" bind-password="<bindPassword>" \
36+
--extended-groups true --ldap-base-dn "dc=contosoad,dc=contoso,dc=local" --ldap-server "192.0.2.12" \
37+
--username-source "LDAP" --key-url "https://keyvault-cmk.vault.azure.net/keys/key2047/test" \
38+
--id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk" \
39+
--access-policies name="default" access-rules={"access":"rw","rootSquash":false,"scope":"default","submountAccess":true,"suid":false} \
40+
--subnet "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1" \
41+
--name "Standard_2G" --tags Dept="Contoso" --cache-name "sc1" --resource-group "scgroup"
42+
```
43+
##### Create #####
44+
```
45+
az storagecache create --location "westus" --cache-size-gb 3072 \
46+
--credentials bind-dn="cn=ldapadmin,dc=contosoad,dc=contoso,dc=local" bind-password="<bindPassword>" \
47+
--extended-groups true --ldap-base-dn "dc=contosoad,dc=contoso,dc=local" --ldap-server "192.0.2.12" \
48+
--username-source "LDAP" --key-url "https://keyvault-cmk.vault.azure.net/keys/key2048/test" \
49+
--id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk" \
50+
--access-policies name="default" access-rules={"access":"rw","rootSquash":false,"scope":"default","submountAccess":true,"suid":false} \
51+
--subnet "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1" \
52+
--name "Standard_2G" --tags Dept="Contoso" --cache-name "sc1" --resource-group "scgroup"
53+
```
54+
##### List #####
55+
```
56+
az storagecache list --resource-group "scgroup"
57+
```
58+
##### Show #####
59+
```
60+
az storagecache show --cache-name "sc1" --resource-group "scgroup"
61+
```
62+
##### Update #####
63+
```
64+
az storagecache update --location "westus" --cache-size-gb 3072 --cache-net-bios-name "contosoSmb" \
65+
--domain-name "contosoAd.contoso.local" --domain-net-bios-name "contosoAd" --primary-dns-ip-address "192.0.2.10" \
66+
--secondary-dns-ip-address "192.0.2.11" --extended-groups true --username-source "AD" \
67+
--network-settings dns-search-domain="contoso.com" dns-servers="10.1.22.33" dns-servers="10.1.12.33" mtu=1500 ntp-server="time.contoso.com" \
68+
--access-policies name="default" access-rules={"access":"rw","rootSquash":false,"scope":"default","submountAccess":true,"suid":false} \
69+
--access-policies name="restrictive" access-rules={"access":"rw","filter":"10.99.3.145","rootSquash":false,"scope":"host","submountAccess":true,"suid":true} access-rules={"access":"rw","filter":"10.99.1.0/24","rootSquash":false,"scope":"network","submountAccess":true,"suid":true} access-rules={"access":"no","anonymousGID":"65534","anonymousUID":"65534","rootSquash":true,"scope":"default","submountAccess":true,"suid":false} \
70+
--subnet "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1" \
71+
--name "Standard_2G" --tags Dept="Contoso" --cache-name "sc1" --resource-group "scgroup"
72+
```
73+
##### Update #####
74+
```
75+
az storagecache update --location "westus" --cache-size-gb 3072 \
76+
--credentials bind-dn="cn=ldapadmin,dc=contosoad,dc=contoso,dc=local" bind-password="<bindPassword>" \
77+
--extended-groups true --ldap-base-dn "dc=contosoad,dc=contoso,dc=local" --ldap-server "192.0.2.12" \
78+
--username-source "LDAP" \
79+
--network-settings dns-search-domain="contoso.com" dns-servers="10.1.22.33" dns-servers="10.1.12.33" mtu=1500 ntp-server="time.contoso.com" \
80+
--access-policies name="default" access-rules={"access":"rw","rootSquash":false,"scope":"default","submountAccess":true,"suid":false} \
81+
--access-policies name="restrictive" access-rules={"access":"rw","filter":"10.99.3.145","rootSquash":false,"scope":"host","submountAccess":true,"suid":true} access-rules={"access":"rw","filter":"10.99.1.0/24","rootSquash":false,"scope":"network","submountAccess":true,"suid":true} access-rules={"access":"no","anonymousGID":"65534","anonymousUID":"65534","rootSquash":true,"scope":"default","submountAccess":true,"suid":false} \
82+
--subnet "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1" \
83+
--name "Standard_2G" --tags Dept="Contoso" --cache-name "sc1" --resource-group "scgroup"
84+
```
85+
##### Debug-info #####
86+
```
87+
az storagecache debug-info --cache-name "sc" --resource-group "scgroup"
88+
```
89+
##### Flush #####
90+
```
91+
az storagecache flush --cache-name "sc" --resource-group "scgroup"
92+
```
93+
##### Start #####
94+
```
95+
az storagecache start --cache-name "sc" --resource-group "scgroup"
96+
```
97+
##### Stop #####
98+
```
99+
az storagecache stop --cache-name "sc" --resource-group "scgroup"
100+
```
101+
##### Upgrade-firmware #####
102+
```
103+
az storagecache upgrade-firmware --cache-name "sc1" --resource-group "scgroup"
104+
```
105+
##### Delete #####
106+
```
107+
az storagecache delete --cache-name "sc" --resource-group "scgroup"
108+
```
109+
#### storagecache storage-target ####
110+
##### Create #####
111+
```
112+
az storagecache storage-target create --cache-name "sc1" --resource-group "scgroup" --name "st1" \
113+
--junctions namespace-path="/path/on/cache" nfs-access-policy="default" nfs-export="exp1" target-path="/path/on/exp1" \
114+
--junctions namespace-path="/path2/on/cache" nfs-access-policy="rootSquash" nfs-export="exp2" target-path="/path2/on/exp2" \
115+
--nfs3 target="10.0.44.44" usage-model="READ_HEAVY_INFREQ" --target-type "nfs3"
116+
117+
az storagecache storage-target wait --created --resource-group "{rg}" --name "{myStorageTarget}"
118+
```
119+
##### Create #####
120+
```
121+
az storagecache storage-target create --cache-name "sc1" --resource-group "scgroup" --name "st1" \
122+
--blob-nfs target="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/blofnfs/blobServices/default/containers/blobnfs" usage-model="WRITE_WORKLOAD_15" \
123+
--junctions namespace-path="/blobnfs" --target-type "blobNfs"
124+
125+
az storagecache storage-target wait --created --resource-group "{rg}" --name "{myStorageTarget}"
126+
```
127+
##### Create #####
128+
```
129+
az storagecache storage-target create --cache-name "sc1" --resource-group "scgroup" --name "st1" \
130+
--nfs3 target="10.0.44.44" usage-model="READ_HEAVY_INFREQ" --target-type "nfs3"
131+
132+
az storagecache storage-target wait --created --resource-group "{rg}" --name "{myStorageTarget}"
133+
```
134+
##### Show #####
135+
```
136+
az storagecache storage-target show --cache-name "sc1" --resource-group "scgroup" --name "st1"
137+
```
138+
##### List #####
139+
```
140+
az storagecache storage-target list --cache-name "sc1" --resource-group "scgroup"
141+
```
142+
##### Dns-refresh #####
143+
```
144+
az storagecache storage-target dns-refresh --cache-name "sc" --resource-group "scgroup" --name "st1"
145+
```
146+
##### Delete #####
147+
```
148+
az storagecache storage-target delete --cache-name "sc1" --resource-group "scgroup" --name "st1"
149+
```
150+
#### storagecache storage-target ####
151+
##### Flush #####
152+
```
153+
az storagecache storage-target flush --cache-name "sc" --resource-group "scgroup" --name "st1"
154+
```
155+
##### Resume #####
156+
```
157+
az storagecache storage-target resume --cache-name "sc" --resource-group "scgroup" --name "st1"
158+
```
159+
##### Suspend #####
160+
```
161+
az storagecache storage-target suspend --cache-name "sc" --resource-group "scgroup" --name "st1"
162+
```
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_storagecache.generated._help import helps # pylint: disable=unused-import
13+
try:
14+
from azext_storagecache.manual._help import helps # pylint: disable=reimported
15+
except ImportError:
16+
pass
17+
18+
19+
class StorageCacheManagementClientCommandsLoader(AzCommandsLoader):
20+
21+
def __init__(self, cli_ctx=None):
22+
from azure.cli.core.commands import CliCommandType
23+
from azext_storagecache.generated._client_factory import cf_storagecache_cl
24+
storagecache_custom = CliCommandType(
25+
operations_tmpl='azext_storagecache.custom#{}',
26+
client_factory=cf_storagecache_cl)
27+
parent = super(StorageCacheManagementClientCommandsLoader, self)
28+
parent.__init__(cli_ctx=cli_ctx, custom_command_type=storagecache_custom)
29+
30+
def load_command_table(self, args):
31+
from azext_storagecache.generated.commands import load_command_table
32+
load_command_table(self, args)
33+
try:
34+
from azext_storagecache.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_storagecache.generated._params import load_arguments
42+
load_arguments(self, command)
43+
try:
44+
from azext_storagecache.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 = StorageCacheManagementClientCommandsLoader
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: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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_storagecache_cl(cli_ctx, *_):
13+
from azure.cli.core.commands.client_factory import get_mgmt_service_client
14+
from azext_storagecache.vendored_sdks.storagecache import StorageCacheManagementClient
15+
return get_mgmt_service_client(cli_ctx,
16+
StorageCacheManagementClient)
17+
18+
19+
def cf_sku(cli_ctx, *_):
20+
return cf_storagecache_cl(cli_ctx).skus
21+
22+
23+
def cf_usage_model(cli_ctx, *_):
24+
return cf_storagecache_cl(cli_ctx).usage_models
25+
26+
27+
def cf_ascoperation(cli_ctx, *_):
28+
return cf_storagecache_cl(cli_ctx).asc_operations
29+
30+
31+
def cf_cache(cli_ctx, *_):
32+
return cf_storagecache_cl(cli_ctx).caches
33+
34+
35+
def cf_storage_target(cli_ctx, *_):
36+
return cf_storagecache_cl(cli_ctx).storage_targets
37+
38+
39+
def cf_storage_target(cli_ctx, *_):
40+
return cf_storagecache_cl(cli_ctx).storage_target

0 commit comments

Comments
 (0)