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

[ReleasePR storageimportexport] Added default values for parameters for Import Export #3633

Closed
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/storageimportexport/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:

Release History
===============

0.1.0
++++++
* Initial release.
71 changes: 71 additions & 0 deletions src/storageimportexport/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Azure CLI storageimportexport Extension #
This is the extension for storageimportexport

### How to use ###
Install this extension using the below CLI command
```
az extension add --name storageimportexport
```

### Included Features ###
#### storageimportexport location ####
##### List #####
```
az storageimportexport location list
```
##### Show #####
```
az storageimportexport location show --name "West US"
```
#### storageimportexport job ####
##### Create #####
```
az storageimportexport job create --location "West US" --backup-drive-manifest true \
--diagnostics-path "waimportexport" --export blob-path-prefix="/" --job-type "Export" --log-level "Verbose" \
--return-address city="Redmond" country-or-region="USA" email="Test@contoso.com" phone="4250000000" postal-code="98007" recipient-name="Test" state-or-province="wa" street-address1="Street1" street-address2="street2" \
--return-shipping carrier-account-number="989ffff" carrier-name="FedEx" \
--storage-account-id "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ClassicStorage/storageAccounts/test" \
--name "myExportJob" --resource-group "myResourceGroup"
```
##### Create #####
```
az storageimportexport job create --location "West US" --backup-drive-manifest true \
--diagnostics-path "waimportexport" \
--drive-list bit-locker-key="238810-662376-448998-450120-652806-203390-606320-483076" drive-header-hash="0:1048576:FB6B6ED500D49DA6E0D723C98D42C657F2881CC13357C28DCECA6A524F1292501571A321238540E621AB5BD9C9A32637615919A75593E6CB5C1515DAE341CABF;135266304:143360:C957A189AFC38C4E80731252301EB91427CE55E61448FA3C73C6FDDE70ABBC197947EC8D0249A2C639BB10B95957D5820A4BE8DFBBF76FFFA688AE5CE0D42EC3" drive-id="9CA995BB" manifest-file="\\\\8a0c23f7-14b7-470a-9633-fcd46590a1bc.manifest" manifest-hash="4228EC5D8E048CB9B515338C789314BE8D0B2FDBC7C7A0308E1C826242CDE74E" \
--job-type "Import" --log-level "Verbose" \
--return-address city="Redmond" country-or-region="USA" email="Test@contoso.com" phone="4250000000" postal-code="98007" recipient-name="Test" state-or-province="wa" street-address1="Street1" street-address2="street2" \
--return-shipping carrier-account-number="989ffff" carrier-name="FedEx" \
--storage-account-id "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ClassicStorage/storageAccounts/test" \
--name "myJob" --resource-group "myResourceGroup"
```
##### Show #####
```
az storageimportexport job show --name "myJob" --resource-group "myResourceGroup"
```
##### List #####
```
az storageimportexport job list --resource-group "myResourceGroup"
```
##### Show #####
```
az storageimportexport job show --name "myJob" --resource-group "myResourceGroup"
```
##### Update #####
```
az storageimportexport job update --backup-drive-manifest true --log-level "Verbose" --state "" --name "myExportJob" \
--resource-group "myResourceGroup"
```
##### Update #####
```
az storageimportexport job update --backup-drive-manifest true --log-level "Verbose" --state "" --name "myJob" \
--resource-group "myResourceGroup"
```
##### Delete #####
```
az storageimportexport job delete --name "myJob" --resource-group "myResourceGroup"
```
#### storageimportexport bit-locker-key ####
##### List #####
```
az storageimportexport bit-locker-key list --job-name "myJob" --resource-group "myResourceGroup"
```
50 changes: 50 additions & 0 deletions src/storageimportexport/azext_storageimportexport/__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_storageimportexport.generated._help import helps # pylint: disable=unused-import
try:
from azext_storageimportexport.manual._help import helps # pylint: disable=reimported
except ImportError:
pass


class StorageImportExportCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_storageimportexport.generated._client_factory import cf_storageimportexport_cl
storageimportexport_custom = CliCommandType(
operations_tmpl='azext_storageimportexport.custom#{}',
client_factory=cf_storageimportexport_cl)
parent = super(StorageImportExportCommandsLoader, self)
parent.__init__(cli_ctx=cli_ctx, custom_command_type=storageimportexport_custom)

def load_command_table(self, args):
from azext_storageimportexport.generated.commands import load_command_table
load_command_table(self, args)
try:
from azext_storageimportexport.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_storageimportexport.generated._params import load_arguments
load_arguments(self, command)
try:
from azext_storageimportexport.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError:
pass


COMMAND_LOADER_CLS = StorageImportExportCommandsLoader
17 changes: 17 additions & 0 deletions src/storageimportexport/azext_storageimportexport/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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.15.0"
}
17 changes: 17 additions & 0 deletions src/storageimportexport/azext_storageimportexport/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
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__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# --------------------------------------------------------------------------
# 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_storageimportexport_cl(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azext_storageimportexport.vendored_sdks.storageimportexport import StorageImportExport
return get_mgmt_service_client(cli_ctx,
StorageImportExport)


def cf_location(cli_ctx, *_):
return cf_storageimportexport_cl(cli_ctx).locations


def cf_job(cli_ctx, *_):
return cf_storageimportexport_cl(cli_ctx).jobs


def cf_bit_locker_key(cli_ctx, *_):
return cf_storageimportexport_cl(cli_ctx).bit_locker_keys
Loading