Skip to content
Merged
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
17 changes: 17 additions & 0 deletions src/apr/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Python
__pycache__/
*.py[cod]
*.egg-info/
*.egg
build/
dist/
.pytest_cache/
.mypy_cache/
.ruff_cache/

# Virtualenv
.venv/
venv/

# Packaging
MANIFEST
15 changes: 15 additions & 0 deletions src/apr/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.. :changelog:

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

1.0.0b1
++++++++

* Add the initial preview command surface for registries, repositories,
releases, packages, distributions, remotes, publications, and tasks.
* Use the final ``apr`` extension and command identity for Azure Package
Registry.
* Generate registry management commands with AAZ.
* Reject invalid data-plane endpoints and paths, disable redirects, and retry
only GET requests.
21 changes: 21 additions & 0 deletions src/apr/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Microsoft Corporation.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
28 changes: 28 additions & 0 deletions src/apr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Azure Package Registry CLI extension

This preview extension manages Azure Package Registry resources and their
repository content.

## Command groups

- `az apr registry`
- `az apr repository`
- `az apr repository release`
- `az apr repository package`
- `az apr package`
- `az apr distro`
- `az apr remote`
- `az apr publication`
- `az apr task`

Registry commands use the ARM control plane. Repository and package commands
use the registry data-plane endpoint returned by ARM.

## Installation

After publication:

```bash
az extension add --name apr
az apr --help
```
36 changes: 36 additions & 0 deletions src/apr/azext_apr/__init__.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.
# --------------------------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader


class AprCommandsLoader(AzCommandsLoader):
def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType

from azext_apr._client_factory import cf_apr

apr_custom = CliCommandType(
operations_tmpl="azext_apr.commands.registry#{}",
client_factory=cf_apr,
)
super().__init__(cli_ctx=cli_ctx, custom_command_type=apr_custom)

def load_command_table(self, args):
from azure.cli.core.aaz import load_aaz_command_table

from azext_apr.commands import load_command_table

load_aaz_command_table(self, "azext_apr.aaz", args)
load_command_table(self, args)
return self.command_table

def load_arguments(self, command):
from azext_apr.commands import load_arguments

load_arguments(self, command)


COMMAND_LOADER_CLS = AprCommandsLoader
17 changes: 17 additions & 0 deletions src/apr/azext_apr/_client_factory.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.
# --------------------------------------------------------------------------------------------


def cf_apr(cli_ctx, *_):
del cli_ctx
# Control-plane (ARM) client factory. The az command pipeline calls this
# BEFORE the handler runs, so it's the right place to refuse control-plane
# commands while running as a local dev build — otherwise the same gate in the
# handlers would be shadowed by the error below. Keep this check first when the
# real management-plane SDK client is wired up.
from azext_apr.server import raise_if_dev_extension

raise_if_dev_extension()
raise NotImplementedError("management-plane SDK client not yet available")
6 changes: 6 additions & 0 deletions src/apr/azext_apr/aaz/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions src/apr/azext_apr/aaz/latest/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa
24 changes: 24 additions & 0 deletions src/apr/azext_apr/aaz/latest/apr/__cmd_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------------------------------------------------------------------
# mypy: ignore-errors

# pylint: skip-file
# flake8: noqa

from azure.cli.core.aaz import *


@register_command_group(
"apr",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Azure Package Registry."""

pass


__all__ = ["__CMDGroup"]
11 changes: 11 additions & 0 deletions src/apr/azext_apr/aaz/latest/apr/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from .__cmd_group import *
24 changes: 24 additions & 0 deletions src/apr/azext_apr/aaz/latest/apr/registry/__cmd_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------------------------------------------------------------------
# mypy: ignore-errors

# pylint: skip-file
# flake8: noqa

from azure.cli.core.aaz import *


@register_command_group(
"apr registry",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Azure Package Registry (APR) registries."""

pass


__all__ = ["__CMDGroup"]
17 changes: 17 additions & 0 deletions src/apr/azext_apr/aaz/latest/apr/registry/__init__.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 aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from .__cmd_group import *
from ._create import *
from ._delete import *
from ._list import *
from ._show import *
from ._update import *
from ._wait import *
Loading
Loading