Skip to content

Commit

Permalink
Feature 2024 01 01 preview unhide package and protected files (#7569)
Browse files Browse the repository at this point in the history
* added stable into example

* version added

* unhide package and protected files

* added version

* version update

* new recording

* updated test

* add test

* recording

* latest recording

* new recording with updated azure-cli
  • Loading branch information
jamesfan1 authored May 10, 2024
1 parent 0df6540 commit 3bfa3d7
Show file tree
Hide file tree
Showing 6 changed files with 773 additions and 677 deletions.
4 changes: 4 additions & 0 deletions src/nginx/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

2.0.0b3
++++++
* unhide package and protected file

2.0.0b2
++++++
* use appropriate sku in the example command for deployment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ def _build_arguments_schema(cls, *args, **kwargs):
help={"short-summary": "This is an array of files required for the config set-up. Cannot be used with packages", "long-summary": "One of the files virtual-path should match the root file. For a multi-file config set-up, the root file needs to have references to the other file(s) in an include directive.\nUsage: --files [{\"content\":\"<Base64 content of config file>\",\"virtual-path\":\"<path>\"}]."},
nullable=True,
)
_args_schema.package = AAZObjectArg(
options=["--package"],
arg_group="Properties",
help="Compressed files",
nullable=True,
)
_args_schema.protected_files = AAZListArg(
options=["--protected-files"],
arg_group="Properties",
help="Protected files",
nullable=True,
)
_args_schema.root_file = AAZStrArg(
options=["--root-file"],
arg_group="Properties",
Expand All @@ -98,6 +110,27 @@ def _build_arguments_schema(cls, *args, **kwargs):
nullable=True,
)
cls._build_args_nginx_configuration_file_update(files.Element)

package = cls._args_schema.package
package.data = AAZStrArg(
options=["data"],
nullable=True,
)
package.protected_files = AAZListArg(
options=["protected-files"],
nullable=True,
)

protected_files = cls._args_schema.package.protected_files
protected_files.Element = AAZStrArg(
nullable=True,
)

protected_files = cls._args_schema.protected_files
protected_files.Element = AAZObjectArg(
nullable=True,
)
cls._build_args_nginx_configuration_file_update(protected_files.Element)
return cls._args_schema

_args_nginx_configuration_file_update = None
Expand Down Expand Up @@ -375,12 +408,27 @@ def _update_instance(self, instance):
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("files", AAZListType, ".files")
properties.set_prop("package", AAZObjectType, ".package")
properties.set_prop("protectedFiles", AAZListType, ".protected_files")
properties.set_prop("rootFile", AAZStrType, ".root_file")

files = _builder.get(".properties.files")
if files is not None:
_UpdateHelper._build_schema_nginx_configuration_file_update(files.set_elements(AAZObjectType, "."))

package = _builder.get(".properties.package")
if package is not None:
package.set_prop("data", AAZStrType, ".data")
package.set_prop("protectedFiles", AAZListType, ".protected_files")

protected_files = _builder.get(".properties.package.protectedFiles")
if protected_files is not None:
protected_files.set_elements(AAZStrType, ".")

protected_files = _builder.get(".properties.protectedFiles")
if protected_files is not None:
_UpdateHelper._build_schema_nginx_configuration_file_update(protected_files.set_elements(AAZObjectType, "."))

return _instance_value

class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation):
Expand Down
2 changes: 1 addition & 1 deletion src/nginx/azext_nginx/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.58.0"
"azext.minCliCoreVersion": "2.60.0"
}
Loading

0 comments on commit 3bfa3d7

Please sign in to comment.