Skip to content
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

[AutoPR storagecache] [Hub Generated] Review request for Microsoft.StorageCache to add version stable/2020-10-01 #406

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/storagecache/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:
Release History
===============

0.1.0
++++++
* Initial release.
107 changes: 107 additions & 0 deletions src/storagecache/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# 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 cache ####
##### Create #####
```
az storagecache cache create --location "westus" --cache-size-gb 3072 \
--subnet "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1" \
--sku-name "Standard_2G" --tags "{\\"Dept\\":\\"ContosoAds\\"}" --cache-name "sc1" --resource-group "scgroup"
```
##### Create #####
```
az storagecache cache create --location "westus" --cache-size-gb 3072 \
--subnet "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1" \
--sku-name "Standard_2G" --tags "{\\"Dept\\":\\"ContosoAds\\"}" --cache-name "sc1" --resource-group "scgroup"
```
##### List #####
```
az storagecache cache list --resource-group "scgroup"
```
##### Show #####
```
az storagecache cache show --cache-name "sc1" --resource-group "scgroup"
```
##### Update #####
```
az storagecache cache update --location "westus" --cache-size-gb 3072 \
--subnet "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1" \
--sku-name "Standard_2G" --tags "{\\"Dept\\":\\"ContosoAds\\"}" --cache-name "sc1" --resource-group "scgroup"
```
##### Update #####
```
az storagecache cache update --location "westus" --cache-size-gb 3072 \
--subnet "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1" \
--sku-name "Standard_2G" --tags "{\\"Dept\\":\\"ContosoAds\\"}" --cache-name "sc1" --resource-group "scgroup"
```
##### Flush #####
```
az storagecache cache flush --cache-name "sc" --resource-group "scgroup"
```
##### Start #####
```
az storagecache cache start --cache-name "sc" --resource-group "scgroup"
```
##### Stop #####
```
az storagecache cache stop --cache-name "sc" --resource-group "scgroup"
```
##### Upgrade-firmware #####
```
az storagecache cache upgrade-firmware --cache-name "sc1" --resource-group "scgroup"
```
##### Delete #####
```
az storagecache cache 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" --target-type "nfs3"

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" --target-type "nfs3"

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"
```
50 changes: 50 additions & 0 deletions src/storagecache/azext_storagecache/__init__.py
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
17 changes: 17 additions & 0 deletions src/storagecache/azext_storagecache/action.py
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
4 changes: 4 additions & 0 deletions src/storagecache/azext_storagecache/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.11.0"
}
17 changes: 17 additions & 0 deletions src/storagecache/azext_storagecache/custom.py
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
12 changes: 12 additions & 0 deletions src/storagecache/azext_storagecache/generated/__init__.py
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 src/storagecache/azext_storagecache/generated/_client_factory.py
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 ..vendored_sdks.storagecache import StorageCacheManagementClient
return get_mgmt_service_client(cli_ctx,
StorageCacheManagementClient)


def cf_sku(cli_ctx, *_):
return cf_storagecache_cl(cli_ctx).sku


def cf_usage_model(cli_ctx, *_):
return cf_storagecache_cl(cli_ctx).usage_model


def cf_ascoperation(cli_ctx, *_):
return cf_storagecache_cl(cli_ctx).asc_operation


def cf_cache(cli_ctx, *_):
return cf_storagecache_cl(cli_ctx).cache


def cf_storage_target(cli_ctx, *_):
return cf_storagecache_cl(cli_ctx).storage_target
Loading