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 12975 in Azure/azure-rest-api-specs
Merge 155a31387ace99d7fc51e5fdbf2e9521c6614fe1 into fdb32f2
- Loading branch information
SDKAuto
committed
Feb 18, 2021
1 parent
5d5ba39
commit 9bb0ba0
Showing
49 changed files
with
11,007 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,133 @@ | ||
# Azure CLI storagecache Extension # | ||
This is the extension for storagecache | ||
|
||
### How to use ### | ||
Install this extension using the below CLI command | ||
``` | ||
az extension add --name storagecache | ||
``` | ||
|
||
### Included Features ### | ||
#### storagecache sku #### | ||
##### List ##### | ||
``` | ||
az storagecache sku list | ||
``` | ||
#### storagecache usage-model #### | ||
##### List ##### | ||
``` | ||
az storagecache usage-model list | ||
``` | ||
#### storagecache asc-operation #### | ||
##### Show ##### | ||
``` | ||
az storagecache asc-operation show --operation-id "testoperationid" --location "westus" | ||
``` | ||
#### storagecache #### | ||
##### Create ##### | ||
``` | ||
az storagecache create --location "westus" --cache-size-gb 3072 --cache-net-bios-name "contosoSmb" \ | ||
--cache-active-directory-settings-credentials password="<password>" username="consotoAdmin" \ | ||
--domain-name "contosoAd.contoso.local" --domain-net-bios-name "contosoAd" --primary-dns-ip-address "192.0.2.10" \ | ||
--secondary-dns-ip-address "192.0.2.11" \ | ||
--credentials bind-dn="cn=ldapadmin,dc=contosoad,dc=contoso,dc=local" bind-password="<bindPassword>" \ | ||
--extended-groups true --ldap-base-dn "dc=contosoad,dc=contoso,dc=local" --ldap-server "192.0.2.12" \ | ||
--username-source "LDAP" --key-url "https://keyvault-cmk.vault.azure.net/keys/key2047/test" \ | ||
--id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk" \ | ||
--access-policies name="default" access-rules={"access":"rw","rootSquash":false,"scope":"default","submountAccess":true,"suid":false} \ | ||
--subnet "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1" \ | ||
--name "Standard_2G" --tags "{\\"Dept\\":\\"ContosoAds\\"}" --cache-name "sc1" --resource-group "scgroup" | ||
``` | ||
##### Create ##### | ||
``` | ||
az storagecache create --location "westus" --cache-size-gb 3072 \ | ||
--credentials bind-dn="cn=ldapadmin,dc=contosoad,dc=contoso,dc=local" bind-password="<bindPassword>" \ | ||
--extended-groups true --ldap-base-dn "dc=contosoad,dc=contoso,dc=local" --ldap-server "192.0.2.12" \ | ||
--username-source "LDAP" --key-url "https://keyvault-cmk.vault.azure.net/keys/key2048/test" \ | ||
--id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk" \ | ||
--access-policies name="default" access-rules={"access":"rw","rootSquash":false,"scope":"default","submountAccess":true,"suid":false} \ | ||
--subnet "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1" \ | ||
--name "Standard_2G" --tags "{\\"Dept\\":\\"ContosoAds\\"}" --cache-name "sc1" --resource-group "scgroup" | ||
``` | ||
##### List ##### | ||
``` | ||
az storagecache list --resource-group "scgroup" | ||
``` | ||
##### Show ##### | ||
``` | ||
az storagecache show --cache-name "sc1" --resource-group "scgroup" | ||
``` | ||
##### Update ##### | ||
``` | ||
az storagecache update --location "westus" --cache-size-gb 3072 --cache-net-bios-name "contosoSmb" \ | ||
--domain-name "contosoAd.contoso.local" --domain-net-bios-name "contosoAd" --primary-dns-ip-address "192.0.2.10" \ | ||
--secondary-dns-ip-address "192.0.2.11" --extended-groups true --username-source "AD" --mtu 1400 \ | ||
--access-policies name="default" access-rules={"access":"rw","rootSquash":false,"scope":"default","submountAccess":true,"suid":false} \ | ||
--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":"-2","anonymousUID":"-2","rootSquash":true,"scope":"default","submountAccess":true,"suid":false} \ | ||
--subnet "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1" \ | ||
--name "Standard_2G" --tags "{\\"Dept\\":\\"ContosoAds\\"}" --cache-name "sc1" --resource-group "scgroup" | ||
``` | ||
##### Update ##### | ||
``` | ||
az storagecache update --location "westus" --cache-size-gb 3072 \ | ||
--credentials bind-dn="cn=ldapadmin,dc=contosoad,dc=contoso,dc=local" bind-password="<bindPassword>" \ | ||
--extended-groups true --ldap-base-dn "dc=contosoad,dc=contoso,dc=local" --ldap-server "192.0.2.12" \ | ||
--username-source "LDAP" --mtu 1400 \ | ||
--access-policies name="default" access-rules={"access":"rw","rootSquash":false,"scope":"default","submountAccess":true,"suid":false} \ | ||
--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":"-2","anonymousUID":"-2","rootSquash":true,"scope":"default","submountAccess":true,"suid":false} \ | ||
--subnet "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1" \ | ||
--name "Standard_2G" --tags "{\\"Dept\\":\\"ContosoAds\\"}" --cache-name "sc1" --resource-group "scgroup" | ||
``` | ||
##### Debug-info ##### | ||
``` | ||
az storagecache debug-info --cache-name "sc" --resource-group "scgroup" | ||
``` | ||
##### Flush ##### | ||
``` | ||
az storagecache flush --cache-name "sc" --resource-group "scgroup" | ||
``` | ||
##### Start ##### | ||
``` | ||
az storagecache start --cache-name "sc" --resource-group "scgroup" | ||
``` | ||
##### Stop ##### | ||
``` | ||
az storagecache stop --cache-name "sc" --resource-group "scgroup" | ||
``` | ||
##### Upgrade-firmware ##### | ||
``` | ||
az storagecache upgrade-firmware --cache-name "sc1" --resource-group "scgroup" | ||
``` | ||
##### Delete ##### | ||
``` | ||
az storagecache delete --cache-name "sc" --resource-group "scgroup" | ||
``` | ||
#### storagecache storage-target #### | ||
##### Create ##### | ||
``` | ||
az storagecache storage-target create --cache-name "sc1" --resource-group "scgroup" --name "st1" \ | ||
--junctions namespace-path="/path/on/cache" nfs-access-policy="default" nfs-export="exp1" target-path="/path/on/exp1" \ | ||
--junctions namespace-path="/path2/on/cache" nfs-access-policy="rootSquash" nfs-export="exp2" target-path="/path2/on/exp2" \ | ||
--nfs3 target="10.0.44.44" usage-model="READ_HEAVY_INFREQ" | ||
az storagecache storage-target wait --created --resource-group "{rg}" --name "{myStorageTarget}" | ||
``` | ||
##### Create ##### | ||
``` | ||
az storagecache storage-target create --cache-name "sc1" --resource-group "scgroup" --name "st1" \ | ||
--nfs3 target="10.0.44.44" usage-model="READ_HEAVY_INFREQ" | ||
az storagecache storage-target wait --created --resource-group "{rg}" --name "{myStorageTarget}" | ||
``` | ||
##### List ##### | ||
``` | ||
az storagecache storage-target list --cache-name "sc1" --resource-group "scgroup" | ||
``` | ||
##### Show ##### | ||
``` | ||
az storagecache storage-target show --cache-name "sc1" --resource-group "scgroup" --name "st1" | ||
``` | ||
##### Delete ##### | ||
``` | ||
az storagecache storage-target delete --cache-name "sc1" --resource-group "scgroup" --name "st1" | ||
``` |
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_storagecache.generated._help import helps # pylint: disable=unused-import | ||
try: | ||
from azext_storagecache.manual._help import helps # pylint: disable=reimported | ||
except ImportError: | ||
pass | ||
|
||
|
||
class StorageCacheManagementClientCommandsLoader(AzCommandsLoader): | ||
|
||
def __init__(self, cli_ctx=None): | ||
from azure.cli.core.commands import CliCommandType | ||
from azext_storagecache.generated._client_factory import cf_storagecache_cl | ||
storagecache_custom = CliCommandType( | ||
operations_tmpl='azext_storagecache.custom#{}', | ||
client_factory=cf_storagecache_cl) | ||
parent = super(StorageCacheManagementClientCommandsLoader, self) | ||
parent.__init__(cli_ctx=cli_ctx, custom_command_type=storagecache_custom) | ||
|
||
def load_command_table(self, args): | ||
from azext_storagecache.generated.commands import load_command_table | ||
load_command_table(self, args) | ||
try: | ||
from azext_storagecache.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_storagecache.generated._params import load_arguments | ||
load_arguments(self, command) | ||
try: | ||
from azext_storagecache.manual._params import load_arguments as load_arguments_manual | ||
load_arguments_manual(self, command) | ||
except ImportError: | ||
pass | ||
|
||
|
||
COMMAND_LOADER_CLS = StorageCacheManagementClientCommandsLoader |
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__) |
36 changes: 36 additions & 0 deletions
36
src/storagecache/azext_storagecache/generated/_client_factory.py
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,36 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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_storagecache_cl(cli_ctx, *_): | ||
from azure.cli.core.commands.client_factory import get_mgmt_service_client | ||
from azext_storagecache.vendored_sdks.storagecache import StorageCacheManagementClient | ||
return get_mgmt_service_client(cli_ctx, | ||
StorageCacheManagementClient) | ||
|
||
|
||
def cf_sku(cli_ctx, *_): | ||
return cf_storagecache_cl(cli_ctx).skus | ||
|
||
|
||
def cf_usage_model(cli_ctx, *_): | ||
return cf_storagecache_cl(cli_ctx).usage_models | ||
|
||
|
||
def cf_ascoperation(cli_ctx, *_): | ||
return cf_storagecache_cl(cli_ctx).asc_operations | ||
|
||
|
||
def cf_cache(cli_ctx, *_): | ||
return cf_storagecache_cl(cli_ctx).caches | ||
|
||
|
||
def cf_storage_target(cli_ctx, *_): | ||
return cf_storagecache_cl(cli_ctx).storage_targets |
Oops, something went wrong.