-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
{DisconnectedOperations} Added az edge disconnected-operation edge-marketplace offer
command
#30980
Open
kotewar
wants to merge
31
commits into
Azure:dev
Choose a base branch
from
kotewar:dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 27 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
fdb30b0
initial commit
20ccfa2
fixed linter issues
fb71536
Added enhanced list and download logic
bdd0065
fixed linter comments
073d0d3
added get-offer
ded8819
updated help file
f084e8c
Added image download logic
4e310f1
removing mgmt storage latest
f888c18
Added storage mgmt version back
3de81a9
Merge branch 'dev' of https://github.com/kotewar/azure-cli into dev
dd577af
Merge branch 'Azure:dev' into dev
kotewar abe306c
initial commit
b3a27b7
fixed linter issues
d2159a2
Added enhanced list and download logic
a6544bb
fixed linter comments
82077ab
added get-offer
3a6d509
updated help file
5f2053d
Added image download logic
c0b969d
removing mgmt storage latest
65dd221
Added storage mgmt version back
d67dab0
fixed styling issues
e4effe4
Merge branch 'dev' of https://github.com/kotewar/azure-cli into dev
5f9ceff
Added unit tests
977bb3f
added more tests and fixed linting issues
7e11fbc
Updated test case
e28abbf
Merge branch 'Azure:dev' into dev
kotewar ff73e46
Merge branch 'Azure:dev' into dev
kotewar caa8d91
Addressed review comments for command and help
ae32b4a
Merge branch 'Azure:dev' into dev
kotewar b73d852
Addressed review comments for edge
a372b18
Merge branch 'Azure:dev' into dev
kotewar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
43 changes: 43 additions & 0 deletions
43
src/azure-cli/azure/cli/command_modules/disconnectedoperations/__init__.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,43 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# 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 | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from azure.cli.command_modules.disconnectedoperations._client_factory import cf_image | ||
from azure.cli.core import AzCommandsLoader | ||
|
||
|
||
class DisconnectedoperationsCommandsLoader(AzCommandsLoader): | ||
def __init__(self, cli_ctx=None): | ||
from azure.cli.core.commands import CliCommandType | ||
from azure.cli.core.profiles import ResourceType | ||
|
||
disconnectedoperations_custom = CliCommandType( | ||
operations_tmpl="azure.cli.command_modules.disconnectedoperations.custom#{}", | ||
client_factory=cf_image, | ||
) | ||
super().__init__( | ||
cli_ctx=cli_ctx, | ||
resource_type=ResourceType.MGMT_DISCONNECTEDOPERATIONS, | ||
custom_command_type=disconnectedoperations_custom, | ||
) | ||
|
||
def load_command_table(self, args): | ||
from azure.cli.command_modules.disconnectedoperations.commands import ( | ||
load_command_table, | ||
) | ||
|
||
load_command_table(self, args) | ||
return self.command_table | ||
|
||
def load_arguments(self, command): | ||
from azure.cli.command_modules.disconnectedoperations._params import ( | ||
load_arguments, | ||
) | ||
|
||
load_arguments(self, command) | ||
|
||
|
||
COMMAND_LOADER_CLS = DisconnectedoperationsCommandsLoader |
15 changes: 15 additions & 0 deletions
15
src/azure-cli/azure/cli/command_modules/disconnectedoperations/_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,15 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
|
||
def get_disconnectedoperations_management_client(cli_ctx, *_): | ||
from azure.cli.core.commands.client_factory import get_mgmt_service_client | ||
from azure.mgmt.disconnectedoperations import DisconnectedOperationsClient | ||
|
||
return get_mgmt_service_client(cli_ctx, DisconnectedOperationsClient) | ||
|
||
|
||
def cf_image(cli_ctx, *_): | ||
return get_disconnectedoperations_management_client(cli_ctx).image |
98 changes: 98 additions & 0 deletions
98
src/azure-cli/azure/cli/command_modules/disconnectedoperations/_help.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,98 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from knack.help_files import helps | ||
|
||
helps['disconnectedoperations'] = """ | ||
type: group | ||
short-summary: Manage disconnected operations. | ||
""" | ||
|
||
helps['disconnectedoperations edgemarketplace'] = """ | ||
type: group | ||
short-summary: Manage Edge Marketplace offers for disconnected operations. | ||
""" | ||
|
||
helps['disconnectedoperations edgemarketplace listoffers'] = """ | ||
type: command | ||
short-summary: List all available marketplace offers. | ||
examples: | ||
- name: List all marketplace offers for a specific resource | ||
text: > | ||
az disconnectedoperations edgemarketplace listoffers --resource-group myResourceGroup --resource-name myResource | ||
- name: List offers and format output as table | ||
text: > | ||
az disconnectedoperations edgemarketplace listoffers -g myResourceGroup --resource-name myResource --output table | ||
- name: List offers and filter output using JMESPath query | ||
text: > | ||
az disconnectedoperations edgemarketplace listoffers -g myResourceGroup --resource-name myResource --query "[?OS_Type=='Linux']" | ||
parameters: | ||
- name: --resource-group -g | ||
type: string | ||
short-summary: Name of resource group | ||
- name: --resource-name | ||
type: string | ||
short-summary: The resource name | ||
""" | ||
|
||
helps['disconnectedoperations edgemarketplace getoffer'] = """ | ||
type: command | ||
short-summary: Get details of a specific marketplace offer. | ||
examples: | ||
- name: Get details of a specific marketplace offer | ||
text: > | ||
az disconnectedoperations edgemarketplace getoffer --resource-group myResourceGroup --resource-name myResource --publisher-name publisherName --offer-name offerName | ||
- name: Get offer details and output as JSON | ||
text: > | ||
az disconnectedoperations edgemarketplace getoffer -g myResourceGroup --resource-name myResource --publisher-name publisherName --offer-name offerName --output json | ||
- name: Get offer details with custom query | ||
text: > | ||
az disconnectedoperations edgemarketplace getoffer -g myResourceGroup --resource-name myResource --publisher-name publisherName --offer-name offerName --query "[].{SKU:SKU,Version:Versions}" | ||
parameters: | ||
- name: --resource-group -g | ||
type: string | ||
short-summary: Name of resource group | ||
- name: --resource-name | ||
type: string | ||
short-summary: The resource name | ||
- name: --publisher-name | ||
type: string | ||
short-summary: The publisher name of the offer | ||
- name: --offer-name | ||
type: string | ||
short-summary: The name of the offer | ||
""" | ||
|
||
helps['disconnectedoperations edgemarketplace packageoffer'] = """ | ||
type: command | ||
short-summary: Download and package a marketplace offer with its metadata and icons. | ||
long-summary: Downloads the marketplace offer metadata, icons, and creates a package in the specified output folder. | ||
examples: | ||
- name: Package a marketplace offer with specific version | ||
text: > | ||
az disconnectedoperations edgemarketplace packageoffer --resource-group myResourceGroup --resource-name myResource --publisher-name publisherName --offer-name offerName --sku skuName --version versionNumber --output-folder "D:\\MarketplacePackages" | ||
parameters: | ||
- name: --resource-group -g | ||
type: string | ||
short-summary: Name of resource group | ||
- name: --resource-name | ||
type: string | ||
short-summary: The resource name | ||
- name: --publisher-name | ||
type: string | ||
short-summary: The publisher name of the offer | ||
- name: --offer-name | ||
type: string | ||
short-summary: The name of the offer | ||
- name: --sku | ||
type: string | ||
short-summary: The SKU of the offer | ||
- name: --version | ||
type: string | ||
short-summary: The version of the offer (optional, latest version will be used if not specified) | ||
- name: --output-folder | ||
type: string | ||
short-summary: The folder path where the package will be downloaded | ||
""" |
43 changes: 43 additions & 0 deletions
43
src/azure-cli/azure/cli/command_modules/disconnectedoperations/_params.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,43 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# 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 | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from azure.cli.core.commands.parameters import resource_group_name_type | ||
|
||
|
||
def load_arguments(self, _): | ||
with self.argument_context( | ||
"disconnectedoperations edgemarketplace listoffers" | ||
) as c: | ||
c.argument("resource_group_name", arg_type=resource_group_name_type) | ||
c.argument( | ||
"resource_name", type=str, help="Name of the resource to list offers for" | ||
) | ||
|
||
with self.argument_context("disconnectedoperations edgemarketplace getoffer") as c: | ||
c.argument("resource_group_name", arg_type=resource_group_name_type) | ||
c.argument( | ||
"resource_name", type=str, help="Name of the resource to list offers for" | ||
) | ||
c.argument("offer_name", type=str, help="Name of the offer") | ||
c.argument("publisher_name", type=str, help="Name of the publisher") | ||
|
||
with self.argument_context( | ||
"disconnectedoperations edgemarketplace packageoffer" | ||
) as c: | ||
c.argument("resource_group_name", arg_type=resource_group_name_type) | ||
c.argument( | ||
"resource_name", type=str, help="Name of the resource to list offers for" | ||
) | ||
c.argument("publisher_name", type=str, help="Name of the publisher") | ||
c.argument("offer_name", type=str, help="Name of the offer to package") | ||
c.argument("sku", type=str, help="SKU of the product") | ||
c.argument("version", type=str, help="Version of the product") | ||
c.argument( | ||
"output_folder", | ||
type=str, | ||
help="Drive and directory to save the package to. Example: E:\\ or D:\\packages\\", | ||
) |
6 changes: 6 additions & 0 deletions
6
src/azure-cli/azure/cli/command_modules/disconnectedoperations/aaz/__init__.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,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 | ||
# -------------------------------------------------------------------------------------------- |
10 changes: 10 additions & 0 deletions
10
src/azure-cli/azure/cli/command_modules/disconnectedoperations/aaz/latest/__init__.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,10 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# 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
24
...azure-cli/azure/cli/command_modules/disconnectedoperations/aaz/latest/edge/__cmd_group.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,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 | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
# pylint: skip-file | ||
# flake8: noqa | ||
|
||
from azure.cli.core.aaz import * | ||
|
||
|
||
@register_command_group( | ||
"edge", | ||
is_preview=True, | ||
) | ||
class __CMDGroup(AAZCommandGroup): | ||
"""Edge disconnected operations CLI | ||
""" | ||
pass | ||
|
||
|
||
__all__ = ["__CMDGroup"] |
11 changes: 11 additions & 0 deletions
11
src/azure-cli/azure/cli/command_modules/disconnectedoperations/aaz/latest/edge/__init__.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,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
24
...mand_modules/disconnectedoperations/aaz/latest/edge/disconnected_operation/__cmd_group.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,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 | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
# pylint: skip-file | ||
# flake8: noqa | ||
|
||
from azure.cli.core.aaz import * | ||
|
||
|
||
@register_command_group( | ||
"edge disconnected-operation", | ||
is_preview=True, | ||
) | ||
class __CMDGroup(AAZCommandGroup): | ||
"""Disconnected operations cli | ||
""" | ||
pass | ||
|
||
|
||
__all__ = ["__CMDGroup"] |
12 changes: 12 additions & 0 deletions
12
...command_modules/disconnectedoperations/aaz/latest/edge/disconnected_operation/__init__.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,12 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# 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 ._list import * |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please input the _help.py here like this
azure-cli/src/azure-cli/azure/cli/command_modules/monitor/__init__.py
Line 9 in 3b70655
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added