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

[MarketplaceOrdering] New command group az term to accept/show terms #17686

Merged
merged 12 commits into from
Apr 28, 2021
3 changes: 2 additions & 1 deletion doc/sphinx/azhelpgen/doc_source_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@
"aro": "src/azure-cli/azure/cli/command_modules/aro/_help.py",
"util": "src/azure-cli/azure/cli/command_modules/util/_help.py",
"synapse": "src/azure-cli/azure/cli/command_modules/synapse/_help.py",
"databoxedge": "src/azure-cli/azure/cli/command_modules/databoxedge/_help.py"
"databoxedge": "src/azure-cli/azure/cli/command_modules/databoxedge/_help.py",
"term": "src/azure-cli/azure/cli/command_modules/marketplaceordering/_help.py"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# --------------------------------------------------------------------------
# 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

yungezz marked this conversation as resolved.
Show resolved Hide resolved

class MarketplaceOrderingAgreementsCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from .generated._client_factory import cf_marketplaceordering_cl
marketplaceordering_custom = CliCommandType(
operations_tmpl='azure.cli.command_modules.marketplaceordering.custom#{}',
client_factory=cf_marketplaceordering_cl)
parent = super(MarketplaceOrderingAgreementsCommandsLoader, self)
parent.__init__(cli_ctx=cli_ctx, custom_command_type=marketplaceordering_custom)

def load_command_table(self, args):
from .generated.commands import load_command_table
load_command_table(self, args)
try:
from .manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError as e:
if e.name.endswith('manual.commands'):
pass
else:
raise e
return self.command_table

def load_arguments(self, command):
from .generated._params import load_arguments
load_arguments(self, command)
try:
from .manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError as e:
if e.name.endswith('manual._params'):
pass
else:
raise e


COMMAND_LOADER_CLS = MarketplaceOrderingAgreementsCommandsLoader
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 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
yungezz marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# --------------------------------------------------------------------------
# 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 as e:
if e.name.endswith('manual.action'):
pass
else:
raise e
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# --------------------------------------------------------------------------
# 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 as e:
if e.name.endswith('manual.custom'):
pass
else:
raise e
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,20 @@
# --------------------------------------------------------------------------
# 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_marketplaceordering_cl(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.marketplaceordering import MarketplaceOrderingAgreements
return get_mgmt_service_client(cli_ctx,
MarketplaceOrderingAgreements)


def cf_marketplace_agreement(cli_ctx, *_):
return cf_marketplaceordering_cl(cli_ctx).marketplace_agreements
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# --------------------------------------------------------------------------
# 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=too-many-lines

from knack.help_files import helps


helps['marketplaceordering'] = '''
type: group
short-summary: Manage Marketplace Ordering Agreements
'''
yungezz marked this conversation as resolved.
Show resolved Hide resolved

helps['term'] = """
type: group
short-summary: Manage marketplace agreement with marketplaceordering
"""

helps['term show'] = """
type: command
short-summary: "Get marketplace terms."
examples:
- name: GetMarketplaceTerms
yungezz marked this conversation as resolved.
Show resolved Hide resolved
text: |-
az term show --offer "offid" --plan "planid" --publisher "pubid"
"""

helps['term accept'] = """
type: command
short-summary: "Accept marketplace terms."
examples:
- name: SetMarketplaceTerms
text: |-
az term accept --offer "offid" --plan "planid" --offer "offid" --publisher "pubid" --plan "planid" \
--publisher "pubid"
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# --------------------------------------------------------------------------
# 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=too-many-lines
# pylint: disable=too-many-statements


def load_arguments(self, _):

with self.argument_context('term show') as c:
c.argument('publisher', type=str, help='Publisher identifier string of image being deployed.',
id_part='child_name_1')
c.argument('offer', type=str, help='Offer identifier string of image being deployed.', id_part='child_name_2')
c.argument('plan', type=str, help='Plan identifier string of image being deployed.', id_part='child_name_3')
yungezz marked this conversation as resolved.
Show resolved Hide resolved

with self.argument_context('term accept') as c:
c.argument('publisher', type=str, help='Publisher identifier string of image being deployed.',
id_part='child_name_1')
c.argument('offer', type=str, help='Offer identifier string of image being deployed.', id_part='child_name_2')
c.argument('plan', type=str, help='Plan identifier string of image being deployed.', id_part='child_name_3')
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 Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
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 Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=protected-access
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# --------------------------------------------------------------------------
# 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=too-many-statements
# pylint: disable=too-many-locals
# pylint: disable=bad-continuation
# pylint: disable=line-too-long

from azure.cli.core.commands import CliCommandType
from ..generated._client_factory import cf_marketplace_agreement


marketplaceordering_marketplace_agreement = CliCommandType(
operations_tmpl='azure.mgmt.marketplaceordering.operations._marketplace_agreements_operations#MarketplaceAgreementsOperations.{}',
client_factory=cf_marketplace_agreement,
)


def load_command_table(self, _):

with self.command_group(
'term', marketplaceordering_marketplace_agreement, client_factory=cf_marketplace_agreement, is_experimental=True
) as g:
g.custom_show_command('show', 'term_show')
g.custom_command('accept', 'term_accept')
yungezz marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# --------------------------------------------------------------------------
# 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=too-many-lines


def term_show(client,
publisher,
offer,
plan):
return client.get(offer_type="virtualmachine",
publisher_id=publisher,
offer_id=offer,
plan_id=plan)


def term_accept(client,
publisher,
offer,
plan):
parameters = {}
parameters['publisher'] = publisher
parameters['product'] = offer
parameters['plan'] = plan
return client.create(offer_type="virtualmachine",
publisher_id=publisher,
offer_id=offer,
plan_id=plan,
parameters=parameters)
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,52 @@
# Azure CLI Module Creation Report

## EXTENSION
|CLI Extension|Command Groups|
|---------|------------|
|az marketplaceordering|[groups](#CommandGroups)

## GROUPS
### <a name="CommandGroups">Command groups in `az marketplaceordering` extension </a>
|CLI Command Group|Group Swagger name|Commands|
|---------|------------|--------|
|az term|MarketplaceAgreements|[commands](#CommandsInMarketplaceAgreements)|

## COMMANDS
### <a name="CommandsInMarketplaceAgreements">Commands in `az term` group</a>
|CLI Command|Operation Swagger name|Parameters|Examples|
|---------|------------|--------|-----------|
|[az term show](#MarketplaceAgreementsGet)|Get|[Parameters](#ParametersMarketplaceAgreementsGet)|[Example](#ExamplesMarketplaceAgreementsGet)|
|[az term accept](#MarketplaceAgreementsCreate)|Create|[Parameters](#ParametersMarketplaceAgreementsCreate)|[Example](#ExamplesMarketplaceAgreementsCreate)|


## COMMAND DETAILS

### group `az term`
#### <a name="MarketplaceAgreementsGet">Command `az term show`</a>

##### <a name="ExamplesMarketplaceAgreementsGet">Example</a>
```
az term show --offer "offid" --plan "planid" --publisher "pubid"
```
##### <a name="ParametersMarketplaceAgreementsGet">Parameters</a>
|Option|Type|Description|Path (SDK)|Swagger name|
|------|----|-----------|----------|------------|
|**--publisher**|string|Publisher identifier string of image being deployed.|publisher|publisherId|
|**--offer**|string|Offer identifier string of image being deployed.|offer|offerId|
|**--plan**|string|Plan identifier string of image being deployed.|plan|planId|

#### <a name="MarketplaceAgreementsCreate">Command `az term accept`</a>

##### <a name="ExamplesMarketplaceAgreementsCreate">Example</a>
```
az term accept --offer "offid" --plan "planid" --offer "offid" --publisher "pubid" --plan "planid" --publisher "pubid"
```
##### <a name="ParametersMarketplaceAgreementsCreate">Parameters</a>
|Option|Type|Description|Path (SDK)|Swagger name|
|------|----|-----------|----------|------------|
|**--publisher**|string|Publisher identifier string of image being deployed.|publisher|publisherId|
|**--offer**|string|Offer identifier string of image being deployed.|offer|offerId|
|**--plan**|string|Plan identifier string of image being deployed.|plan|planId|
|**--publisher**|string|Publisher identifier string of image being deployed.|publisher|publisher|
|**--offer**|string|Offer identifier string of image being deployed.|offer|product|
|**--plan**|string|Plan identifier string of image being deployed.|plan|plan|
Loading