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
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.0b7
++++++
* Added support for API key and protected files. Remove location for configuration create and update.

2.0.0b6
++++++
* Added support for Web Application Firewall.
Expand Down
47 changes: 35 additions & 12 deletions src/nginx/azext_nginx/aaz/latest/nginx/deployment/_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,23 @@ class Create(AAZCommand):
"""Create an NGINX for Azure resource

:example: Deployment Create with PublicIP
az nginx deployment create --name myDeployment --resource-group myResourceGroup --location eastus2 --sku name="standardv2_Monthly_gmz7xq9ge3py" --network-profile front-end-ip-configuration="{public-ip-addresses:[{id:/subscriptions/mySubscription/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/myPublicIP}]}" network-interface-configuration="{subnet-id:/subscriptions/mySubscription/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet}"
az nginx deployment create --name myDeployment --resource-group myResourceGroup --location eastus2 --sku name="standard_Monthly_gmz7xq9ge3py" --network-profile front-end-ip-configuration="{public-ip-addresses:[{id:/subscriptions/mySubscription/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/myPublicIP}]}" network-interface-configuration="{subnet-id:/subscriptions/mySubscription/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet}"

:example: Deployment Create with PrivateIP
az nginx deployment create --name myDeployment --resource-group myResourceGroup --location eastus2 --sku name="standardv2_Monthly_gmz7xq9ge3py" --network-profile front-end-ip-configuration="{private-ip-addresses:[{private-ip-allocation-method:Static,subnet-id:/subscriptions/mySubscription/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet,private-ip-address:10.0.0.2}]}" network-interface-configuration="{subnet-id:/subscriptions/mySubscription/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet}"
az nginx deployment create --name myDeployment --resource-group myResourceGroup --location eastus2 --sku name="standardv2_Monthly_gmz7xq9ge3py" --network-profile front-end-ip-configuration="{private-ip-addresses:[{private-ip-allocation-method:Dynamic,subnet-id:/subscriptions/mySubscription/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet,private-ip-address:10.0.0.2}]}" network-interface-configuration="{subnet-id:/subscriptions/mySubscription/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet}"
az nginx deployment create --name myDeployment --resource-group myResourceGroup --location eastus2 --sku name="standard_Monthly_gmz7xq9ge3py" --network-profile front-end-ip-configuration="{private-ip-addresses:[{private-ip-allocation-method:Static,subnet-id:/subscriptions/mySubscription/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet,private-ip-address:10.0.0.2}]}" network-interface-configuration="{subnet-id:/subscriptions/mySubscription/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet}"
az nginx deployment create --name myDeployment --resource-group myResourceGroup --location eastus2 --sku name="standard_Monthly_gmz7xq9ge3py" --network-profile front-end-ip-configuration="{private-ip-addresses:[{private-ip-allocation-method:Dynamic,subnet-id:/subscriptions/mySubscription/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet,private-ip-address:10.0.0.2}]}" network-interface-configuration="{subnet-id:/subscriptions/mySubscription/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet}"

:example: Deployment with managed identity, storage account and scaling
az anginx deployment create --deployment-name myDeployment --myResourceGroup azclitest-geo --location eastus --sku name=standardv2_Monthly_gmz7xq9ge3py --network-profile network-interface-configuration='{subnet-id:/subscriptions/subscriptionId/resourcegroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet-azclitest/subnets/mySubnet}' front-end-ip-configuration='{public-ip-addresses:[{id:/subscriptions/subscriptionId/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/myPublicIP}]}' --identity '{"type":"UserAssigned","userAssignedIdentities":{"/subscriptions/subscriptionId/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myManagedIdentity":{}}}' --logging storage-account='{"account-name":"myStorageAccount","container-name":"myContainer"}' --scaling-properties capacity=10
az anginx deployment create --deployment-name myDeployment --myResourceGroup azclitest-geo --location eastus --sku name=standard_Monthly_gmz7xq9ge3py --network-profile network-interface-configuration='{subnet-id:/subscriptions/subscriptionId/resourcegroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet-azclitest/subnets/mySubnet}' front-end-ip-configuration='{public-ip-addresses:[{id:/subscriptions/subscriptionId/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/myPublicIP}]}' --identity '{"type":"UserAssigned","userAssignedIdentities":{"/subscriptions/subscriptionId/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myManagedIdentity":{}}}' --logging storage-account='{"account-name":"myStorageAccount","container-name":"myContainer"}' --scaling-properties capacity=10

:example: Deployment with managed identity, storage account, and system assigned managed identity
az az anginx deployment create --deployment-name myDeployment --myResourceGroup azclitest-geo --location eastus --sku name=standard_Monthly_gmz7xq9ge3py --network-profile network-interface-configuration='{subnet-id:/subscriptions/subscriptionId/resourcegroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet-azclitest/subnets/mySubnet}' front-end-ip-configuration='{public-ip-addresses:[{id:/subscriptions/subscriptionId/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/myPublicIP}]}' --identity '{"type":"SystemAssigned"}' --logging storage-account='{"account-name":"myStorageAccount","container-name":"myContainer"}' --scaling-properties capacity=10
"""

_aaz_info = {
"version": "2024-06-01-preview",
"version": "2024-09-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/nginx.nginxplus/nginxdeployments/{}", "2024-06-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/nginx.nginxplus/nginxdeployments/{}", "2024-09-01-preview"],
]
}

Expand Down Expand Up @@ -90,15 +93,28 @@ def _build_arguments_schema(cls, *args, **kwargs):
)

identity = cls._args_schema.identity
identity.mi_system_assigned = AAZStrArg(
options=["system-assigned", "mi-system-assigned"],
help="Set the system managed identity.",
blank="True",
)
identity.type = AAZStrArg(
options=["type"],
help="Type of managed identity to use",
enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned, UserAssigned": "SystemAssigned, UserAssigned", "UserAssigned": "UserAssigned"},
)
identity.mi_user_assigned = AAZListArg(
options=["user-assigned", "mi-user-assigned"],
help="Set the user managed identities.",
blank=[],
)
identity.user_assigned_identities = AAZDictArg(
options=["user-assigned-identities"],
)

mi_user_assigned = cls._args_schema.identity.mi_user_assigned
mi_user_assigned.Element = AAZStrArg()

user_assigned_identities = cls._args_schema.identity.user_assigned_identities
user_assigned_identities.Element = AAZObjectArg(
blank={},
Expand Down Expand Up @@ -362,7 +378,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"api-version", "2024-09-01-preview",
required=True,
),
}
Expand All @@ -387,7 +403,7 @@ def content(self):
typ=AAZObjectType,
typ_kwargs={"flags": {"client_flatten": True}}
)
_builder.set_prop("identity", AAZObjectType, ".identity")
_builder.set_prop("identity", AAZIdentityObjectType, ".identity")
_builder.set_prop("location", AAZStrType, ".location")
_builder.set_prop("properties", AAZObjectType)
_builder.set_prop("sku", AAZObjectType, ".sku")
Expand All @@ -397,11 +413,17 @@ def content(self):
if identity is not None:
identity.set_prop("type", AAZStrType, ".type")
identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities")
identity.set_prop("userAssigned", AAZListType, ".mi_user_assigned", typ_kwargs={"flags": {"action": "create"}})
identity.set_prop("systemAssigned", AAZStrType, ".mi_system_assigned", typ_kwargs={"flags": {"action": "create"}})

user_assigned_identities = _builder.get(".identity.userAssignedIdentities")
if user_assigned_identities is not None:
user_assigned_identities.set_elements(AAZObjectType, ".")

user_assigned = _builder.get(".identity.userAssigned")
if user_assigned is not None:
user_assigned.set_elements(AAZStrType, ".")

properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("autoUpgradeProfile", AAZObjectType, ".auto_upgrade_profile")
Expand Down Expand Up @@ -523,7 +545,7 @@ def _build_schema_on_200_201(cls):
_schema_on_200_201.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.identity = AAZObjectType()
_schema_on_200_201.identity = AAZIdentityObjectType()
_schema_on_200_201.location = AAZStrType()
_schema_on_200_201.name = AAZStrType(
flags={"read_only": True},
Expand Down Expand Up @@ -570,6 +592,10 @@ def _build_schema_on_200_201(cls):
properties.auto_upgrade_profile = AAZObjectType(
serialized_name="autoUpgradeProfile",
)
properties.dataplane_api_endpoint = AAZStrType(
serialized_name="dataplaneApiEndpoint",
flags={"read_only": True},
)
properties.enable_diagnostics_support = AAZBoolType(
serialized_name="enableDiagnosticsSupport",
)
Expand All @@ -578,9 +604,6 @@ def _build_schema_on_200_201(cls):
flags={"read_only": True},
)
properties.logging = AAZObjectType()
properties.managed_resource_group = AAZStrType(
serialized_name="managedResourceGroup",
)
properties.network_profile = AAZObjectType(
serialized_name="networkProfile",
)
Expand Down
6 changes: 3 additions & 3 deletions src/nginx/azext_nginx/aaz/latest/nginx/deployment/_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class Delete(AAZCommand):
"""

_aaz_info = {
"version": "2024-06-01-preview",
"version": "2024-09-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/nginx.nginxplus/nginxdeployments/{}", "2024-06-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/nginx.nginxplus/nginxdeployments/{}", "2024-09-01-preview"],
]
}

Expand Down Expand Up @@ -146,7 +146,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"api-version", "2024-09-01-preview",
required=True,
),
}
Expand Down
52 changes: 27 additions & 25 deletions src/nginx/azext_nginx/aaz/latest/nginx/deployment/_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class List(AAZCommand):
"""

_aaz_info = {
"version": "2024-06-01-preview",
"version": "2024-09-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/nginx.nginxplus/nginxdeployments", "2024-06-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/nginx.nginxplus/nginxdeployments", "2024-06-01-preview"],
["mgmt-plane", "/subscriptions/{}/providers/nginx.nginxplus/nginxdeployments", "2024-09-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/nginx.nginxplus/nginxdeployments", "2024-09-01-preview"],
]
}

Expand All @@ -55,12 +55,12 @@ def _build_arguments_schema(cls, *args, **kwargs):

def _execute_operations(self):
self.pre_operations()
condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
if condition_0:
self.DeploymentsListByResourceGroup(ctx=self.ctx)()
if condition_1:
self.DeploymentsList(ctx=self.ctx)()
if condition_1:
self.DeploymentsListByResourceGroup(ctx=self.ctx)()
self.post_operations()

@register_callback
Expand All @@ -76,7 +76,7 @@ def _output(self, *args, **kwargs):
next_link = self.deserialize_output(self.ctx.vars.instance.next_link)
return result, next_link

class DeploymentsListByResourceGroup(AAZHttpOperation):
class DeploymentsList(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
Expand All @@ -90,7 +90,7 @@ def __call__(self, *args, **kwargs):
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments",
"/subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments",
**self.url_parameters
)

Expand All @@ -105,10 +105,6 @@ def error_format(self):
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
Expand All @@ -120,7 +116,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"api-version", "2024-09-01-preview",
required=True,
),
}
Expand Down Expand Up @@ -165,7 +161,7 @@ def _build_schema_on_200(cls):
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.identity = AAZObjectType()
_element.identity = AAZIdentityObjectType()
_element.location = AAZStrType()
_element.name = AAZStrType(
flags={"read_only": True},
Expand Down Expand Up @@ -212,6 +208,10 @@ def _build_schema_on_200(cls):
properties.auto_upgrade_profile = AAZObjectType(
serialized_name="autoUpgradeProfile",
)
properties.dataplane_api_endpoint = AAZStrType(
serialized_name="dataplaneApiEndpoint",
flags={"read_only": True},
)
properties.enable_diagnostics_support = AAZBoolType(
serialized_name="enableDiagnosticsSupport",
)
Expand All @@ -220,9 +220,6 @@ def _build_schema_on_200(cls):
flags={"read_only": True},
)
properties.logging = AAZObjectType()
properties.managed_resource_group = AAZStrType(
serialized_name="managedResourceGroup",
)
properties.network_profile = AAZObjectType(
serialized_name="networkProfile",
)
Expand Down Expand Up @@ -416,7 +413,7 @@ def _build_schema_on_200(cls):

return cls._schema_on_200

class DeploymentsList(AAZHttpOperation):
class DeploymentsListByResourceGroup(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
Expand All @@ -430,7 +427,7 @@ def __call__(self, *args, **kwargs):
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments",
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments",
**self.url_parameters
)

Expand All @@ -445,6 +442,10 @@ def error_format(self):
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
Expand All @@ -456,7 +457,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"api-version", "2024-09-01-preview",
required=True,
),
}
Expand Down Expand Up @@ -501,7 +502,7 @@ def _build_schema_on_200(cls):
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.identity = AAZObjectType()
_element.identity = AAZIdentityObjectType()
_element.location = AAZStrType()
_element.name = AAZStrType(
flags={"read_only": True},
Expand Down Expand Up @@ -548,6 +549,10 @@ def _build_schema_on_200(cls):
properties.auto_upgrade_profile = AAZObjectType(
serialized_name="autoUpgradeProfile",
)
properties.dataplane_api_endpoint = AAZStrType(
serialized_name="dataplaneApiEndpoint",
flags={"read_only": True},
)
properties.enable_diagnostics_support = AAZBoolType(
serialized_name="enableDiagnosticsSupport",
)
Expand All @@ -556,9 +561,6 @@ def _build_schema_on_200(cls):
flags={"read_only": True},
)
properties.logging = AAZObjectType()
properties.managed_resource_group = AAZStrType(
serialized_name="managedResourceGroup",
)
properties.network_profile = AAZObjectType(
serialized_name="networkProfile",
)
Expand Down
Loading