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

fix: some parameters should be required in import-specification and deployment command #53

Merged
merged 3 commits into from
Jun 3, 2024
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
16 changes: 9 additions & 7 deletions src/apic-extension/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ Release History
===============

1.0.0
++++++
++++++++++++++++++
* Update: Redesigned `az apic service import-from-apim` command to provide easier way to specify APIM instance
* Fix: API title created by register command is not same with provided spec
* Fix: Error not thrown when import spec with >3MB file
* Fix: Error when register API with long description in spec
* Fix: `--definition-id`, `--environment-id`, `--server`, `--title` parameters should be required in `az apic api deployment create` command
* Fix: `--format`, `--specification`, `--value` parameters should be required in `az apic api definition import-specification` command
* Remove: `--state`` parameter for `az apic api deployment` commands.
* Remove: `--file-name`` parameter for `az apic api definition import-specification`, `az apic metadata create` and `az apic metadata update` command. Use the `@filename` syntax provided by Azure CLI to read parameter value from a file directly.

1.0.0b5
+++++
++++++++++++++++++
* Add: Support yaml file for `az apic api register` command.
* Update: Command names, parameter names, and command descriptions for better understanding. Please leverage `-h` option or refer Azure CLI reference doc to see full list of commands and parameters.
* Update: Introduction to parameter constraints to ensure that valid values are provided.
Expand All @@ -24,17 +26,17 @@ Release History
* Remove: `head` commands in each command group are removed.

1.0.0b4
+++++
++++++++++++++++++
* Add: Support for Default Portal configuration and default hostname provisoning deprovisioning commands

1.0.0b3
+++++
++++++++++++++++++
* Add: Support for Import from apim command along with add examples for create service

1.0.0b2
++++++
++++++++++++++++++
* Remove: All workspace cli commands as it should not be exposed to customers just yet.

1.0.0b1
++++++
* Initial release.
++++++++++++++++++
* Initial release.
21 changes: 19 additions & 2 deletions src/apic-extension/azext_apic_extension/command_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,15 @@ class ExportAPIDefinitionExtension(DefaultWorkspaceParameter, ExportAPIDefinitio


class ImportAPIDefinitionExtension(DefaultWorkspaceParameter, ImportAPIDefinition):
pass
# pylint: disable=too-few-public-methods
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
# pylint: disable=protected-access
args_schema = super()._build_arguments_schema(*args, **kwargs)
args_schema.format._required = True
args_schema.specification._required = True
args_schema.value._required = True
return args_schema


class ListAPIDefinitionExtension(DefaultWorkspaceParameter, ListAPIDefinition):
Expand Down Expand Up @@ -139,7 +147,16 @@ class UpdateAPIVersionExtension(DefaultWorkspaceParameter, UpdateAPIVersion):

# `az apic api deployment` commands
class CreateAPIDeploymentExtension(DefaultWorkspaceParameter, CreateAPIDeployment):
pass
# pylint: disable=too-few-public-methods
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
# pylint: disable=protected-access
args_schema = super()._build_arguments_schema(*args, **kwargs)
args_schema.definition_id._required = True
args_schema.environment_id._required = True
args_schema.server._required = True
args_schema.title._required = True
return args_schema


class DeleteAPIDeploymentExtension(DefaultWorkspaceParameter, DeleteAPIDeployment):
Expand Down
Loading