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

Sync #18

Merged
merged 80 commits into from
Dec 16, 2021
Merged

Sync #18

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
50a3e25
[SSH] Clean up credentials and support local user login (#4065)
vthiebaut10 Nov 17, 2021
b05b991
[Release] Update index.json for extension [ ssh ] (#4118)
Nov 17, 2021
7112613
[Release] Update index.json for extension [ k8s-configuration ] (#4112)
Nov 17, 2021
63e144c
fix getter for workspace id (#4115)
FumingZhang Nov 17, 2021
e98e624
[Quantum] Do not display update message if version numbers are not av…
Nov 18, 2021
4e935b9
[Network] Virtual-wan support multi link (#4111)
00Kai0 Nov 18, 2021
a144bde
Add warning prompt to private cloud rotate password commands and dele…
jonathanhe-msft Nov 18, 2021
a3302b0
[Release] Update index.json for extension [ virtual-wan ] (#4122)
Nov 18, 2021
c03f7d9
[vm-repair] Bug fix for disk copy V2 to V1 and Adding preview paramet…
haagha Nov 18, 2021
0bff552
fix list by subscription (#4132)
qingc Nov 20, 2021
e203fc9
Vmware 4.0.0 publish (#4127)
jonathanhe-msft Nov 21, 2021
77d700b
[acrtransfer] acrtransfer extension v1.1 release (#4121)
mabenedi Nov 21, 2021
506144a
change dcr resource naming convention used in aks monitoring addon (#…
ganga1980 Nov 21, 2021
b77fbe6
{AKS} Update the implementation of `aks create` to adopt the decorato…
FumingZhang Nov 22, 2021
2780304
chore(arcdata): version bump v1.1.2 (#4133)
swells Nov 22, 2021
ff3ad3c
refine app start, stop and restart logic (#4139)
ShichaoQiu Nov 23, 2021
51175d7
[Release] ml 2.0.3 public preview release (#4134)
nthandeMS Nov 23, 2021
7a0f8b1
Dev/sanmishra/added vm extension support to connectedvmware az cli ex…
Nov 23, 2021
3c901fd
Checksum Hotfix for Azure ML CLI 2.0.3 (#4155)
nthandeMS Nov 24, 2021
b7e3f4f
[Azure Firewall] Fix a bug that will raise an error due to updating p…
00Kai0 Nov 24, 2021
311e5fc
Pin max CLI version for `azure-cli-ml` version `1.5.0` (#4117)
Mossaka Nov 24, 2021
3bef337
[Release] Update index.json for extension [ azure-firewall ] (#4156)
Nov 24, 2021
2665398
remove GA test cases (#4141)
FumingZhang Nov 24, 2021
182cbb3
[Network Manager] Fix multi issues on network-manager (#4147)
00Kai0 Nov 25, 2021
1bb1a9f
Update version and history info for 'az quantum' extension 0.10.0 (#4…
Nov 25, 2021
4e9a124
[Release] Update index.json for extension [ quantum ] (#4159)
Nov 25, 2021
07f131a
Fixed inventory item issue in connectedvmware az cli extension. (#4162)
Nov 26, 2021
5f77367
[Release] Update index.json for extension [ network-manager ] (#4158)
Nov 28, 2021
321deaf
{AKS} Update default test matrix (#4161)
FumingZhang Nov 29, 2021
9ab9156
publish vmware 4.0.1 (#4167)
cataggar Nov 30, 2021
d66c84c
[Release] Update index.json for extension [ vmware ] (#4168)
Nov 30, 2021
dcc6da0
[Stream Analytics] Update Stream Analytics CLI (#4098)
necusjz Nov 30, 2021
ec097c2
[Release] Update index.json for extension [ aks-preview ] (#4138)
Nov 30, 2021
215adf7
[Release] Update index.json for extension [ acrtransfer ] (#4137)
Nov 30, 2021
cf29c26
[Release] Update index.json for extension [ spring-cloud ] (#4135)
Nov 30, 2021
411e3cc
[Release] Update index.json for extension [ connectedvmware ] (#4146)
Nov 30, 2021
97af224
[Release] Update index.json for extension [ vm-repair ] (#4123)
Nov 30, 2021
fcb3c9b
Remove the snapshot name trimming in az aks snapshot create command (…
chengliangli0918 Nov 30, 2021
33b1d6b
[Quantum] Left align histogram (#4153)
Nov 30, 2021
cfc8476
[Release] Update index.json for extension [ aks-preview ] (#4170)
Nov 30, 2021
0c092fe
remove preview tag for postgres (#4173)
DaeunYim Dec 1, 2021
fa998ce
{AKS} Update live test pipeline (#4171)
FumingZhang Dec 1, 2021
e95a41f
[k8s-extension] Release v1.0.1 with fix for AzureML (#4177)
jonathan-innis Dec 2, 2021
9f53e32
{AKS} vendor 2021-10-01 API (#4165)
tyler-lloyd Dec 2, 2021
192c045
Fix 'az webapp config ssl bind' for web apps in kubernetes environmen…
StrawnSC Dec 2, 2021
fb13b28
[Release] Update index.json for extension [ stream-analytics ] (#4169)
Dec 2, 2021
b7275e4
Add fix for PP2 and Public Preview extension version (#4187)
pkoushik Dec 3, 2021
9f6a1b8
[Release] Update index.json for extension [ k8s-extension ] (#4182)
Dec 3, 2021
956b71f
[Release] Update index.json for extension [ aks-preview ] (#4183)
Dec 3, 2021
a5bd1c5
refactor: 💡 Use validator to validate or default deployment (#4188)
yuwzho Dec 3, 2021
b45ca40
[Release] Update index.json for extension [ connectedvmware ] (#4190)
zhoxing-ms Dec 3, 2021
2435c8f
[k8s-configuration] Release v1.3.0 with deployed-object support (#4163)
jonathan-innis Dec 5, 2021
a677d9f
[AKS] enable `aks create` dual-stack clusters (#4174)
tyler-lloyd Dec 7, 2021
7ca79ef
[Release] Update index.json for extension [ k8s-configuration ] (#4191)
Dec 8, 2021
7629dc0
Add azurestackhci v0.2.2 (#4197)
Arkanayan Dec 8, 2021
203ef00
[Release] Update index.json for extension [ aks-preview ] (#4196)
Dec 8, 2021
281a70a
[Release] Update index.json for extension [ appservice-kube ] (#4186)
Dec 8, 2021
8f9d065
refactor: 💡 Move ensure_active_deployment_exist to validator (#4192)
yuwzho Dec 8, 2021
eba5a33
{AKS} Refactor 1st part of the update sub-command in aks-preview modu…
FumingZhang Dec 9, 2021
7cc72df
[rdbms-connect] Updated version for commands GA (#4178)
DaeunYim Dec 10, 2021
5e714bb
[Release] Update index.json for extension [ rdbms-connect ] (#4208)
Dec 10, 2021
b648b31
{testsdk} Migrate `azure-devtools` to `azure-cli-testsdk` (#4211)
zhoxing-ms Dec 10, 2021
f525c43
Set maxCliCoreVersion as 2.29.0 for connectedk8s ext (#4212)
sirireddy12 Dec 13, 2021
495d429
[Release] Update index.json for extension [ connectedk8s ] (#4214)
Dec 13, 2021
466a441
[k8s-extension] Release v1.0.2 with Update Api-Version Support for Ge…
jonathan-innis Dec 13, 2021
234a10f
`az appservice kube` : allow passing custom location by name, add ASE…
StrawnSC Dec 13, 2021
36bd25e
ML v1 extension support for MSAL (#4220)
singankit Dec 14, 2021
1f9412a
[Release] Update index.json for extension [ appservice-kube ] (#4217)
Dec 14, 2021
6dc3d0d
[Release] Update index.json for extension [ k8s-extension ] (#4216)
Dec 14, 2021
635828b
remove is_Preview from --enable-fips-image argument (#4223)
chengliangli0918 Dec 14, 2021
51c43b9
add clean up pipeline (#4224)
FumingZhang Dec 15, 2021
4857749
{AKS} Update default pool for check-in pipelines (#4222)
FumingZhang Dec 15, 2021
fc287ef
{AKS} Update unit test check-in pipeline (#4210)
FumingZhang Dec 15, 2021
f21c2cf
Quantum CLI extension 0.11.0 (#4201)
vxfield Dec 15, 2021
b4b130a
[Release] Update index.json for extension [ quantum ] (#4226)
azclibot Dec 15, 2021
1b81e53
{AKS} Refactor 2nd part of the update sub-command in aks-preview modu…
FumingZhang Dec 15, 2021
6f71dee
Managed cassandra preview commands for cli extension (#3948)
vivek-microsoft Dec 15, 2021
5f48738
[Release] Update index.json for extension [ cosmosdb-preview ] (#4229)
azclibot Dec 15, 2021
7867fd8
[AKS] managed outbound ips should be None if specifying other lb prop…
tyler-lloyd Dec 16, 2021
5d3c6bf
[Release] Update index.json for extension [ aks-preview ] (#4232)
azclibot Dec 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ignore =
F401, # imported but unused, too many violations, to be removed in the future
F811, # redefinition of unused, to be removed in the future
C901 # code flow is too complex, too many violations, to be removed in the future
W503 # line break before binary operator effect on readability is subjective
W504 # line break after binary operator effect on readability is subjective
exclude =
*/vendored_sdks
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

/src/alertsmanagement/ @qwordy

/src/stream-analytics/ @houk-ms
/src/stream-analytics/ @houk-ms @necusjz

/src/databricks/ @fengzhou-msft @xfz11

Expand Down
35 changes: 35 additions & 0 deletions linter_exclusions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ aks create:
load_balancer_managed_outbound_ip_count:
rule_exclusions:
- option_length_too_long
load_balancer_managed_outbound_ipv6_count:
rule_exclusions:
- option_length_too_long
load_balancer_outbound_ip_prefixes:
rule_exclusions:
- option_length_too_long
Expand Down Expand Up @@ -161,6 +164,9 @@ aks update:
load_balancer_managed_outbound_ip_count:
rule_exclusions:
- option_length_too_long
load_balancer_managed_outbound_ipv6_count:
rule_exclusions:
- option_length_too_long
load_balancer_outbound_ip_prefixes:
rule_exclusions:
- option_length_too_long
Expand Down Expand Up @@ -1627,6 +1633,35 @@ network vhub connection create:
allow_remote_vnet_to_use_hub_vnet_gateways:
rule_exclusions:
- option_length_too_long
network vpn-gateway connection vpn-site-link-conn add:
parameters:
use_local_azure_ip_address:
rule_exclusions:
- option_length_too_long
use_policy_based_traffic_selectors:
rule_exclusions:
- option_length_too_long
vpn_connection_protocol_type:
rule_exclusions:
- option_length_too_long
vpn_link_connection_mode:
rule_exclusions:
- option_length_too_long
network vpn-gateway connection vpn-site-link-conn ipsec-policy add:
parameters:
vpn_site_link_conn_name:
rule_exclusions:
- option_length_too_long
network vpn-gateway connection vpn-site-link-conn ipsec-policy list:
parameters:
vpn_site_link_conn_name:
rule_exclusions:
- option_length_too_long
network vpn-gateway connection vpn-site-link-conn ipsec-policy remove:
parameters:
vpn_site_link_conn_name:
rule_exclusions:
- option_length_too_long
network vpn-server-config create:
parameters:
radius_client_root_certs:
Expand Down
2 changes: 1 addition & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ disable=

[TYPECHECK]
# For Azure CLI extensions, we ignore some import errors as they'll be available in the environment of the CLI
ignored-modules=azure,azure.cli,azure.cli.core,azure.cli.core.commands,knack,msrestazure,argcomplete,azure_devtools,isodate,OpenSSL
ignored-modules=azure,azure.cli,azure.cli.core,azure.cli.core.commands,knack,msrestazure,argcomplete,azure.cli.testsdk,isodate,OpenSSL

[FORMAT]
max-line-length=120
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import unittest
import time

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer)


Expand Down
8 changes: 7 additions & 1 deletion src/acrtransfer/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

Release History
===============
1.1.0
++++++
* Add: New command acr pipeline-run clean - Bulk deletes failed pipeline-runs.
* Add: New parameter to acr pipeline-run list --top - Displays only the n most recent pipeline-runs.
* Bug fix: ResourceNotFoundError will now be thrown if the resource does not exist when calling import-pipeline delete and export-pipeline delete.
* Bug fix: Help text typos fixed.

0.1.0
1.0.0
++++++
* Initial release.
3 changes: 1 addition & 2 deletions src/acrtransfer/azext_acrtransfer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ def __init__(self, cli_ctx=None):
acrtransfer_custom = CliCommandType(
operations_tmpl='azext_acrtransfer.custom#{}',
client_factory=cf_acrtransfer)
super(AcrtransferCommandsLoader, self).__init__(cli_ctx=cli_ctx,
custom_command_type=acrtransfer_custom)
super().__init__(cli_ctx=cli_ctx, custom_command_type=acrtransfer_custom)

def load_command_table(self, args):
from azext_acrtransfer.commands import load_command_table
Expand Down
27 changes: 15 additions & 12 deletions src/acrtransfer/azext_acrtransfer/_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
# pylint: disable=line-too-long

from collections import OrderedDict
from distutils import log as logger
from knack.log import get_logger

logger = get_logger(__name__)


def import_pipeline_output_format(result):
Expand Down Expand Up @@ -40,25 +42,26 @@ def _export_pipeline_format_group(item):

def _pipeline_run_format_group(item):
if "importPipelines" in _get_value(item, 'request', 'pipelineResourceId'):
return OrderedDict([
d = OrderedDict([
('NAME', _get_value(item, 'name')),
('PIPELINE', _get_value(item, 'request', 'pipelineResourceId').split('/')[-1]),
('START_TIME', _get_value(item, 'response', 'startTime').split('.')[0]),
('PIPELINE', _get_value(item, 'request', 'pipelineResourceId').split('/', maxsplit=-1)[-1]),
('START_TIME', _get_value(item, 'response', 'startTime').split('.', maxsplit=1)[0]),
('DURATION', _get_duration(_get_value(item, 'response', 'startTime'), _get_value(item, 'response', 'finishTime'))),
('SOURCE_TRIGGER', str('_' in _get_value(item, 'name'))),
('STATUS', _get_value(item, 'response', 'status')),
('ERROR_MESSAGE', _get_value(item, 'response', 'pipelineRunErrorMessage'))
])

else:
return OrderedDict([
d = OrderedDict([
('NAME', _get_value(item, 'name')),
('PIPELINE', _get_value(item, 'request', 'pipelineResourceId').split('/')[-1]),
('START_TIME', _get_value(item, 'response', 'startTime').split('.')[0]),
('PIPELINE', _get_value(item, 'request', 'pipelineResourceId').split('/', maxsplit=-1)[-1]),
('START_TIME', _get_value(item, 'response', 'startTime').split('.', maxsplit=1)[0]),
('DURATION', _get_duration(_get_value(item, 'response', 'startTime'), _get_value(item, 'response', 'finishTime'))),
('STATUS', _get_value(item, 'response', 'status')),
('ERROR_MESSAGE', _get_value(item, 'response', 'pipelineRunErrorMessage'))
])
return d


def _output_format(result, format_group):
Expand Down Expand Up @@ -86,10 +89,10 @@ def _get_duration(start_time, finish_time):
from dateutil.parser import parse
try:
duration = parse(finish_time) - parse(start_time)
hours = "{0:02d}".format((24 * duration.days) + (duration.seconds // 3600))
minutes = "{0:02d}".format((duration.seconds % 3600) // 60)
seconds = "{0:02d}".format(duration.seconds % 60)
return "{0}:{1}:{2}".format(hours, minutes, seconds)
hours = f'{((24 * duration.days) + (duration.seconds // 3600)):02d}'
minutes = f'{((duration.seconds % 3600) // 60):02d}'
seconds = f'{(duration.seconds % 60):02d}'
return f'{hours}:{minutes}:{seconds}'
except (ValueError, TypeError):
logger.debug("Unable to get duration with start_time '%s' and finish_time '%s'", start_time, finish_time)
logger.debug('Unable to get duration with start_time %s and finish_time %s', start_time, finish_time)
return ' '
34 changes: 22 additions & 12 deletions src/acrtransfer/azext_acrtransfer/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

helps['acr pipeline-run'] = """
type: group
short-summary: Manage ACR import and export pipeline runs.
short-summary: Manage ACR import and export pipeline-runs.
"""

helps['acr import-pipeline create'] = """
Expand All @@ -28,7 +28,7 @@
examples:
- name: Create an import pipeline.
text: az acr import-pipeline create --resource-group $MyRG --registry $MyReg --name $MyPipeline --secret-uri https://$MyKV.vault.azure.net/secrets/$MySecret --storage-container-uri https://$MyStorage.blob.core.windows.net/$MyContainer
- name: Create an import pipeline with a user assigned identity, all available options, and source trigger disabled.
- name: Create an import pipeline with a user-assigned identity, all available options, and source trigger disabled.
text: az acr import-pipeline create --resource-group $MyRG --registry $MyReg --name $MyPipeline --secret-uri https://$MyKV.vault.azure.net/secrets/$MySecret --storage-container-uri https://$MyStorage.blob.core.windows.net/$MyContainer --options DeleteSourceBlobOnSuccess OverwriteTags ContinueOnErrors --assign-identity /subscriptions/$MySubID/resourceGroups/$MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/$MyIdentity --source-trigger-enabled False
"""

Expand Down Expand Up @@ -62,7 +62,7 @@
examples:
- name: Create an export pipeline.
text: az acr export-pipeline create --resource-group $MyRG --registry $MyReg --name $MyPipeline --secret-uri https://$MyKV.vault.azure.net/secrets/$MySecret --storage-container-uri https://$MyStorage.blob.core.windows.net/$MyContainer
- name: Create an export pipeline with a user assigned identity and all available options.
- name: Create an export pipeline with a user-assigned identity and all available options.
text: az acr export-pipeline create --resource-group $MyRG --registry $MyReg --name $MyPipeline --secret-uri https://$MyKV.vault.azure.net/secrets/$MySecret --storage-container-uri https://$MyStorage.blob.core.windows.net/$MyContainer --options OverwriteBlobs ContinueOnErrors --assign-identity /subscriptions/$MySubID/resourceGroups/$MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/$MyIdentity
"""

Expand Down Expand Up @@ -92,34 +92,44 @@

helps['acr pipeline-run create'] = """
type: command
short-summary: Create a pipeline run.
short-summary: Create a pipeline-run.
examples:
- name: Create an import pipeline run.
- name: Create an import pipeline-run.
text: az acr pipeline-run create --resource-group $MyRG --registry $MyReg --pipeline $MyPipeline --name $MyPipelineRunName --pipeline-type import --storage-blob $MyBlob
- name: Create an export pipeline run and force redeploy.
- name: Create an export pipeline-run and force redeploy.
text: az acr pipeline-run create --resource-group $MyRG --registry $MyReg --pipeline $MyPipeline --name $MyPipelineRunName --pipeline-type export --storage-blob $MyBlob --artifacts hello-world:latest hello-world@sha256:90659bf80b44ce6be8234e6ff90a1ac34acbeb826903b02cfa0da11c82cbc042 --force-redeploy
"""

helps['acr pipeline-run list'] = """
type: command
short-summary: List pipelineruns of all pipelines on a container registry.
short-summary: List pipeline-runs of all pipelines on a container registry.
examples:
- name: List all export pipelines on a container registry
- name: List all pipeline-runs on a container registry
text: az acr pipeline-run list --resource-group $MyRG --registry $MyReg
"""

helps['acr pipeline-run show'] = """
type: command
short-summary: Show an export pipeline in detail.
short-summary: Show a pipeline-run in detail.
examples:
- name: Show a specific export pipeline in detail.
- name: Show a specific pipeline-run in detail.
text: az acr pipeline-run show --resource-group $MyRG --registry $MyReg --name $MyPipelineRun
"""

helps['acr pipeline-run delete'] = """
type: command
short-summary: Delete an export pipeline.
short-summary: Delete a pipeline-run.
examples:
- name: Delete an export pipeline.
- name: Delete a pipeline-run.
text: az acr pipeline-run delete --resource-group $MyRG --registry $MyReg --name $MyPipelineRun
"""

helps['acr pipeline-run clean'] = """
type: command
short-summary: Delete all failed pipeline-runs on the registry.
examples:
- name: Delete all failed pipeline-runs on the registry.
text: az acr pipeline-run clean --resource-group $MyRG --registry $MyReg
- name: List the failed pipeline-runs that would have been deleted, but do not delete any.
text: az acr pipeline-run clean --resource-group $MyRG --registry $MyReg --dry-run -o table
"""
6 changes: 5 additions & 1 deletion src/acrtransfer/azext_acrtransfer/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# --------------------------------------------------------------------------------------------
# pylint: disable=line-too-long

from ._validators import validate_export_options, validate_import_options, validate_keyvault_secret_uri, validate_pipeline_type, validate_storage_account_container_uri, validate_user_assigned_identity_resource_id
from ._validators import validate_export_options, validate_import_options, validate_keyvault_secret_uri, validate_pipeline_type, validate_storage_account_container_uri, validate_user_assigned_identity_resource_id, validate_top


def load_arguments(self, _):
Expand Down Expand Up @@ -35,3 +35,7 @@ def load_arguments(self, _):
c.argument('force_update_tag', options_list=['--force-redeploy', '-f'], action='store_true', help='Flag that forces ARM to redeploy resource even if no parameters have changed.')
c.argument('storage_blob_name', options_list=['--storage-blob', '-b'], help='Name of the storage blob to be imported or exported.')
c.argument('artifacts', options_list=['--artifacts', '-a'], nargs='+', help='Space-separated list of container artifacts. Artifacts must be either of the form `repository:tag` or `repository@digest` such as hello-world:latest or hello-world@sha256:90659bf80b44ce6be8234e6ff90a1ac34acbeb826903b02cfa0da11c82cbc042.')
c.argument('top', validator=validate_top, help='List only the last n pipeline-runs. Must be an integer.')

with self.argument_context('acr pipeline-run clean') as c:
c.argument('dry_run', action='store_true', help='List the failed pipeline-runs that would have been deleted, but do not delete any.')
35 changes: 25 additions & 10 deletions src/acrtransfer/azext_acrtransfer/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
# --------------------------------------------------------------------------------------------
# pylint: disable=line-too-long

from distutils import log as logger
from knack.util import CLIError
from knack.log import get_logger
from azure.cli.core.azclierror import InvalidArgumentValueError

logger = get_logger(__name__)


def validate_storage_account_container_uri(namespace):
Expand All @@ -16,7 +18,7 @@ def validate_storage_account_container_uri(namespace):
valid = False

if not valid:
logger.warn("Invalid storage account container URI. Please provide a storage account container URI of the form https://$MyStorageAccount.blob.core.windows.net/$MyContainer. Note - The exact URI form may be different outside of AzureCloud.")
logger.warning("Invalid storage account container URI. Please provide a storage account container URI of the form https://$MyStorageAccount.blob.core.windows.net/$MyContainer. Note - The exact URI form may be different outside of AzureCloud.")


def validate_keyvault_secret_uri(namespace):
Expand All @@ -27,7 +29,7 @@ def validate_keyvault_secret_uri(namespace):
valid = False

if not valid:
logger.warn("Invalid keyvault secret URI. Please provide a keyvault secret URI of the form https://$MyKeyvault.vault.azure.net/secrets/$MySecret. Note - The exact URI form may be different outside of AzureCloud.")
logger.warning("Invalid keyvault secret URI. Please provide a keyvault secret URI of the form https://$MyKeyvault.vault.azure.net/secrets/$MySecret. Note - The exact URI form may be different outside of AzureCloud.")


def validate_user_assigned_identity_resource_id(namespace):
Expand All @@ -41,7 +43,7 @@ def validate_user_assigned_identity_resource_id(namespace):
valid = False

if not valid:
logger.warn("Invalid user assigned identity resource ID. Please provide a user assigned identity resource ID of the form /subscriptions/$MySubID/resourceGroups/$MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/$MyIdentity.")
logger.warning("Invalid user assigned identity resource ID. Please provide a user assigned identity resource ID of the form /subscriptions/$MySubID/resourceGroups/$MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/$MyIdentity.")


def validate_import_options(namespace):
Expand All @@ -57,8 +59,8 @@ def validate_import_options(namespace):
valid = False

if not valid:
logger.warn("Allowed options are: " + str(allowed_options_list))
logger.warn("Invalid option found in options parameter. Please provide a space-separated list of allowed options.")
logger.warning("Allowed options are: %s", str(allowed_options_list))
logger.warning("Invalid option found in options parameter. Please provide a space-separated list of allowed options.")


def validate_export_options(namespace):
Expand All @@ -74,8 +76,8 @@ def validate_export_options(namespace):
valid = False

if not valid:
logger.warn("Allowed options are: " + str(allowed_options_list))
logger.warn("Invalid option found in options parameter. Please provide a space-separated list of allowed options.")
logger.warning('Allowed options are: %s', str(allowed_options_list))
logger.warning("Invalid option found in options parameter. Please provide a space-separated list of allowed options.")


def validate_pipeline_type(namespace):
Expand All @@ -86,4 +88,17 @@ def validate_pipeline_type(namespace):
valid = False

if not valid:
logger.warn("Invalid pipeline type. Pipeline type must be import or export.")
logger.warning("Invalid pipeline type. Pipeline type must be import or export.")


def validate_top(namespace):
n = namespace.top

if n is None:
return

try:
int(n)

except ValueError as e:
raise InvalidArgumentValueError(f'Argument provided for parameter top \'{n}\' is not an integer. Please provide an integer for the top parameter.') from e
1 change: 1 addition & 0 deletions src/acrtransfer/azext_acrtransfer/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ def load_command_table(self, _):
g.custom_command('delete', 'delete_pipelinerun')
g.custom_command('list', 'list_pipelinerun')
g.custom_show_command('show', 'get_pipelinerun')
g.custom_command('clean', 'clean_pipelinerun')
2 changes: 1 addition & 1 deletion src/acrtransfer/azext_acrtransfer/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# --------------------------------------------------------------------------------------------
# pylint: disable=unused-import

from .pipelinerun import create_pipelinerun, get_pipelinerun, delete_pipelinerun, list_pipelinerun
from .pipelinerun import create_pipelinerun, get_pipelinerun, delete_pipelinerun, list_pipelinerun, clean_pipelinerun
from .exportpipeline import create_exportpipeline, get_exportpipeline, delete_exportpipeline, list_exportpipeline
from .importpipeline import create_importpipeline, get_importpipeline, delete_importpipeline, list_importpipeline
9 changes: 9 additions & 0 deletions src/acrtransfer/azext_acrtransfer/exportpipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# --------------------------------------------------------------------------------------------
# pylint: disable=line-too-long

from azure.cli.core.azclierror import ResourceNotFoundError
from .vendored_sdks.containerregistry.v2019_12_01_preview.models._models_py3 import ExportPipeline, ExportPipelineTargetProperties
from .vendored_sdks.containerregistry.v2019_12_01_preview.models._container_registry_management_client_enums import PipelineSourceType
from .utility_functions import create_identity_properties
Expand Down Expand Up @@ -46,6 +47,14 @@ def get_exportpipeline(client, resource_group_name, registry_name, export_pipeli
def delete_exportpipeline(client, resource_group_name, registry_name, export_pipeline_name):
'''Delete an export pipeline.'''

try:
client.export_pipelines.get(resource_group_name=resource_group_name,
registry_name=registry_name,
export_pipeline_name=export_pipeline_name)

except Exception as e:
raise ResourceNotFoundError(f'Export pipeline {export_pipeline_name} not found on registry {registry_name} in the {resource_group_name} resource group.') from e

return client.export_pipelines.begin_delete(resource_group_name=resource_group_name,
registry_name=registry_name,
export_pipeline_name=export_pipeline_name)
Expand Down
Loading