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
3 changes: 3 additions & 0 deletions src/dnc/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Release History
===============
0.2.1
++++++
* Add optional "allocationBlockPrefixSize" parameter for subnet delegation

0.2.0
++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ class Create(AAZCommand):
"""Create delegated subnet resource.

:example: Create a subnet delegated to DNC
az dnc delegated-subnet-service create --location "West US" --id "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.DelegatedNetwork/controller/dnctestcontroller" --subnet-details-id "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet" --resource-group "TestRG" --resource-name "delegated1"
az dnc delegated-subnet-service create --location "West US" --id "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.DelegatedNetwork/controller/dnctestcontroller" --subnet-details-id "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet" --resource-group "TestRG" --resource-name "delegated1" --allocation-block-prefix-size 27
"""

_aaz_info = {
"version": "2023-05-18-preview",
"version": "2023-06-27-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.delegatednetwork/delegatedsubnets/{}", "2023-05-18-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.delegatednetwork/delegatedsubnets/{}", "2023-06-27-preview"],
]
}

Expand All @@ -47,7 +47,6 @@ def _build_arguments_schema(cls, *args, **kwargs):

_args_schema = cls._args_schema
_args_schema.resource_group = AAZResourceGroupNameArg(
help="Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.",
required=True,
)
_args_schema.resource_name = AAZStrArg(
Expand Down Expand Up @@ -89,6 +88,20 @@ def _build_arguments_schema(cls, *args, **kwargs):
tags = cls._args_schema.tags
tags.Element = AAZStrArg()

# define Arg Group "Properties"

_args_schema = cls._args_schema
_args_schema.allocation_block_prefix_size = AAZIntArg(
options=["-a", "--allocation-block-prefix-size"],
arg_group="Properties",
help={"short-summary": "Defines prefix size of CIDR blocks allocated to nodes in VnetBlock Mode.", "long-summary": "Defines prefix size of CIDR blocks allocated to nodes in VnetBlock Mode. This should be greater than Delegated subnet's prefix size by a minimum of 3."},
is_preview=True,
fmt=AAZIntArgFormat(
maximum=30,
minimum=24,
),
)

# define Arg Group "SubnetDetails"

_args_schema = cls._args_schema
Expand Down Expand Up @@ -180,7 +193,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-05-18-preview",
"api-version", "2023-06-27-preview",
required=True,
),
}
Expand Down Expand Up @@ -211,6 +224,7 @@ def content(self):

properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("allocationBlockPrefixSize", AAZIntType, ".allocation_block_prefix_size")
properties.set_prop("controllerDetails", AAZObjectType)
properties.set_prop("subnetDetails", AAZObjectType)

Expand Down Expand Up @@ -262,6 +276,9 @@ def _build_schema_on_200_201(cls):
)

properties = cls._schema_on_200_201.properties
properties.allocation_block_prefix_size = AAZIntType(
serialized_name="allocationBlockPrefixSize",
)
properties.controller_details = AAZObjectType(
serialized_name="controllerDetails",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class Delete(AAZCommand):
"""

_aaz_info = {
"version": "2023-05-18-preview",
"version": "2023-06-27-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.delegatednetwork/delegatedsubnets/{}", "2023-05-18-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.delegatednetwork/delegatedsubnets/{}", "2023-06-27-preview"],
]
}

Expand All @@ -48,7 +48,6 @@ def _build_arguments_schema(cls, *args, **kwargs):

_args_schema = cls._args_schema
_args_schema.resource_group = AAZResourceGroupNameArg(
help="Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.",
required=True,
)
_args_schema.resource_name = AAZStrArg(
Expand Down Expand Up @@ -157,7 +156,7 @@ def query_parameters(self):
"forceDelete", self.ctx.args.force_delete,
),
**self.serialize_query_param(
"api-version", "2023-05-18-preview",
"api-version", "2023-06-27-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class Show(AAZCommand):
"""

_aaz_info = {
"version": "2023-05-18-preview",
"version": "2023-06-27-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.delegatednetwork/delegatedsubnets/{}", "2023-05-18-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.delegatednetwork/delegatedsubnets/{}", "2023-06-27-preview"],
]
}

Expand All @@ -46,7 +46,6 @@ def _build_arguments_schema(cls, *args, **kwargs):

_args_schema = cls._args_schema
_args_schema.resource_group = AAZResourceGroupNameArg(
help="Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.",
required=True,
)
_args_schema.resource_name = AAZStrArg(
Expand Down Expand Up @@ -127,7 +126,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-05-18-preview",
"api-version", "2023-06-27-preview",
required=True,
),
}
Expand Down Expand Up @@ -176,6 +175,9 @@ def _build_schema_on_200(cls):
)

properties = cls._schema_on_200.properties
properties.allocation_block_prefix_size = AAZIntType(
serialized_name="allocationBlockPrefixSize",
)
properties.controller_details = AAZObjectType(
serialized_name="controllerDetails",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Wait(AAZWaitCommand):

_aaz_info = {
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.delegatednetwork/delegatedsubnets/{}", "2023-05-18-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.delegatednetwork/delegatedsubnets/{}", "2023-06-27-preview"],
]
}

Expand All @@ -41,7 +41,6 @@ def _build_arguments_schema(cls, *args, **kwargs):

_args_schema = cls._args_schema
_args_schema.resource_group = AAZResourceGroupNameArg(
help="Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.",
required=True,
)
_args_schema.resource_name = AAZStrArg(
Expand Down Expand Up @@ -122,7 +121,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-05-18-preview",
"api-version", "2023-06-27-preview",
required=True,
),
}
Expand Down Expand Up @@ -171,6 +170,9 @@ def _build_schema_on_200(cls):
)

properties = cls._schema_on_200.properties
properties.allocation_block_prefix_size = AAZIntType(
serialized_name="allocationBlockPrefixSize",
)
properties.controller_details = AAZObjectType(
serialized_name="controllerDetails",
)
Expand Down
2 changes: 1 addition & 1 deletion src/dnc/azext_dnc/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.49.0"
"azext.minCliCoreVersion": "2.51.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interactions:
ParameterSetName:
- --location --resource-name --resource-group
User-Agent:
- AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.11 (Windows-10-10.0.22621-SP0)
- AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.11 (Windows-10-10.0.22621-SP0)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dnc000001/providers/Microsoft.DelegatedNetwork/controller/clitestcontroller?api-version=2023-05-18-preview
response:
Expand All @@ -31,25 +31,23 @@ interactions:
content-type:
- application/json
date:
- Fri, 28 Jul 2023 20:49:02 GMT
- Tue, 22 Aug 2023 22:35:16 GMT
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:82487bea-6925-46b8-a5c9-0bcae97f8f27
server:
- Kestrel
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding
x-cache:
- CONFIG_NOCACHE
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-subscription-writes:
- '1198'
- '1199'
x-msedge-ref:
- 'Ref A: 2B685273271A4D7096DB7B0EADAE207D Ref B: CO6AA3150218035 Ref C: 2023-08-22T22:35:16Z'
status:
code: 200
message: OK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,37 @@ interactions:
ParameterSetName:
- --location --resource-name --resource-group --purpose
User-Agent:
- AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.11 (Windows-10-10.0.22621-SP0)
- AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.11 (Windows-10-10.0.22621-SP0)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dnc000001/providers/Microsoft.DelegatedNetwork/controller/clitestcontroller?api-version=2023-05-18-preview
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dnc000001/providers/Microsoft.DelegatedNetwork/controller/clitestcontroller","location":"centraluseuap","name":"clitestcontroller","type":"Microsoft.DelegatedNetwork/controller","properties":{"dncAppId":"a91b1853-4403-4f54-b5cb-d1ea19d90c37","dncEndpoint":"https://openai-centraluseuap.dnc.azure.com","controllerProperties":{"dncAppId":"a91b1853-4403-4f54-b5cb-d1ea19d90c37","dncEndpoint":"https://openai-centraluseuap.dnc.azure.com","dncTenantId":null},"resourceGuid":"33b2d4dd-1290-4810-8e16-8283177b4538","provisioningState":"Succeeded"}}'
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dnc000001/providers/Microsoft.DelegatedNetwork/controller/clitestcontroller","location":"centraluseuap","name":"clitestcontroller","type":"Microsoft.DelegatedNetwork/controller","properties":{"dncAppId":"a91b1853-4403-4f54-b5cb-d1ea19d90c37","dncEndpoint":"https://test.openai-centraluseuap.dnc.azure.com","controllerProperties":{"dncAppId":"a91b1853-4403-4f54-b5cb-d1ea19d90c37","dncEndpoint":"https://test.openai-centraluseuap.dnc.azure.com","dncTenantId":null},"resourceGuid":"33b2d4dd-1290-4810-8e16-8283177b4538","provisioningState":"Succeeded"}}'
headers:
cache-control:
- no-cache
content-length:
- '624'
- '634'
content-type:
- application/json
date:
- Fri, 28 Jul 2023 20:49:02 GMT
- Tue, 22 Aug 2023 22:35:17 GMT
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:82487bea-6925-46b8-a5c9-0bcae97f8f27
server:
- Kestrel
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding
x-cache:
- CONFIG_NOCACHE
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-subscription-writes:
- '1199'
x-msedge-ref:
- 'Ref A: E0A17B8C4F86499E94D3AE532F390D4C Ref B: CO6AA3150219031 Ref C: 2023-08-22T22:35:16Z'
status:
code: 200
message: OK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interactions:
ParameterSetName:
- --resource-name --resource-group --yes
User-Agent:
- AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.11 (Windows-10-10.0.22621-SP0)
- AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.11 (Windows-10-10.0.22621-SP0)
method: DELETE
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dnc000001/providers/Microsoft.DelegatedNetwork/controller/clitestcontroller?api-version=2023-05-18-preview
response:
Expand All @@ -25,17 +25,21 @@ interactions:
cache-control:
- no-cache
date:
- Fri, 28 Jul 2023 20:49:01 GMT
- Tue, 22 Aug 2023 22:35:15 GMT
expires:
- '-1'
pragma:
- no-cache
strict-transport-security:
- max-age=31536000; includeSubDomains
x-cache:
- CONFIG_NOCACHE
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-subscription-deletes:
- '14999'
x-msedge-ref:
- 'Ref A: 84FD5ACAA78C405E9191C01E818F043C Ref B: CO6AA3150217039 Ref C: 2023-08-22T22:35:16Z'
status:
code: 204
message: No Content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interactions:
ParameterSetName:
- --location --resource-name --resource-group
User-Agent:
- AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.11 (Windows-10-10.0.22621-SP0)
- AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.11 (Windows-10-10.0.22621-SP0)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dnc000001/providers/Microsoft.DelegatedNetwork/controller/clitestcontroller?api-version=2023-05-18-preview
response:
Expand All @@ -31,25 +31,23 @@ interactions:
content-type:
- application/json
date:
- Fri, 28 Jul 2023 20:49:02 GMT
- Tue, 22 Aug 2023 22:35:16 GMT
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:82487bea-6925-46b8-a5c9-0bcae97f8f27
server:
- Kestrel
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding
x-cache:
- CONFIG_NOCACHE
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-subscription-writes:
- '1199'
x-msedge-ref:
- 'Ref A: 58CBD570784B42759F5F242AE3FDA24C Ref B: CO6AA3150220031 Ref C: 2023-08-22T22:35:16Z'
status:
code: 200
message: OK
Expand All @@ -67,7 +65,7 @@ interactions:
ParameterSetName:
- --resource-name --resource-group
User-Agent:
- AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.11 (Windows-10-10.0.22621-SP0)
- AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.11 (Windows-10-10.0.22621-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dnc000001/providers/Microsoft.DelegatedNetwork/controller/clitestcontroller?api-version=2023-05-18-preview
response:
Expand All @@ -81,23 +79,21 @@ interactions:
content-type:
- application/json
date:
- Fri, 28 Jul 2023 20:49:03 GMT
- Tue, 22 Aug 2023 22:35:17 GMT
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:82487bea-6925-46b8-a5c9-0bcae97f8f27
server:
- Kestrel
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding
x-cache:
- CONFIG_NOCACHE
x-content-type-options:
- nosniff
x-msedge-ref:
- 'Ref A: A46A4AFF49DF42DA9FB3A5BCFDEE8DAD Ref B: CO6AA3150220039 Ref C: 2023-08-22T22:35:17Z'
status:
code: 200
message: OK
Expand Down
Loading